Please login or register.

Login with username, password and session length
Advanced search  


Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

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


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

This min-mod came about in answer to a private request to insert a Facebook "Like" Button plug-in under articles and pages in sNews 1.6. This should work in all versions of sNews 1.6 including my old MEMU versions. It has been tested and can be seen on an old 1.6 MEMU test install here - On Articles and On a Page.

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 = $link - within function center()
    and insert the following (excluding the PHP tags) under it:
Code: [Select]

# Facebook Mod, July 22.10
$social_url db('website').$category.'/'.$r['seftitle'].'/'// generates full URL to content - sNews 1.6


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]

/*---------- Facebook Mod, July 22.10 - generates the "Like" string --------------------*/
echo '<p><iframe src="'.$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.7 versions is located here.
« Last Edit: July 22, 2010, 08:47:42 pm by Keyrocks »
Do it now... later may not come.
sNews 1.6 MESU | sNews 1.6 MEMU


  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: [MINI-MOD] Facebook "Like" link - all sNews 1.6 versions
« Reply #1 on: August 30, 2010, 03:18:12 am »

nice method ... thanks mr.keyrocks Very nice job
“Fifty years of programming language research, and we end up with C++?”