Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [MINI-MOD] Facebook "Like" link - all sNews 1.7 versions  (Read 1936 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
[MINI-MOD] Facebook "Like" link - all sNews 1.7 versions
« on: July 22, 2010, 08:42:56 pm »

This min-mod came about in answer to a private request to insert a Facebook "Like" Button plug-in under articles in sNews 1.6.

This mini-mod should work for all versions of sNews 1.7.
It has been fully tested and can be seen working with a default demo installation of sNews 1.7 here

1. The first thing we need to do is generate the full URL to articles and pages by defining the value for a new variable - $social_url
    Search your snews.php or snewsMU.php file for - $edit_link.= ' '.l('divider').' '.$visiblity; - within function articles()
    and insert the following (excluding the PHP tags) under it:
Code: [Select]
<?php

# Facebook Mod, July 22.10
$social_url _SITE.$uri.'/'.$r['asef'].'/';  // generates full URL to content

?>


2. Search again for - if ($infoline == true) { two times and insert the following (again, with no PHP tags).
    The first location is just a few lines below the above location, and the second location is not far down from the first one.
    This uses the I-Frame script generated from Facebook's Plugins "Like Button" page,
    with our new $social_url variable replacing the static link to generate the links dynamically.
Code: [Select]
<?php

/*---------- Facebook Mod, July 22.10 - generates the "Like" string --------------------*/
echo '<p><iframe src="http://www.facebook.com/plugins/like.php?href='.$social_url.'&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe></p>';
 /* ----- end Facebook Mod ------------------*/

?>


NOTE: The same mod for sNews 1.6 versions is located here.
« Last Edit: July 26, 2010, 04:25:55 am by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: [MINI-MOD] Facebook "Like" link - all sNews 1.7 versions
« Reply #1 on: July 23, 2010, 05:16:28 am »

Kudos Doug, I know people will like this. oh. pardon the pun. :D
Logged

roie

  • Newbie
  • *
  • Karma: 1
  • Posts: 32
Re: [MINI-MOD] Facebook "Like" link - all sNews 1.7 versions
« Reply #2 on: July 25, 2010, 10:00:46 pm »

thanks, been looking for an update on this FB like issue...
Logged