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: [MOD/ADDON] Social bookmarking feature (converted by burtrito)  (Read 2169 times)


  • Guest

Untested here, but since I am doing 1.4 atm why not..

Thread here:

Quote from: Mika
Full article with modding explanation can be found on

EDIT: fixed bug (by iatbm)

1. You know the drill :D backup first!
2. Add this code into your snews.php file (I usually put all my mods near the code where is the action ;) ) but you can paste it anywhere you want
Code: [Select]
function soc_bookmark($link$title$icon 'Y') {
$link rawurlencode($link);
$title rawurlencode($title);
$icon_folder 'icons/';
$bookmark = array(
$bookmark as $key=>$value) {
$link_text $icon == 'Y' '<img src="'.$icon_folder.str_replace("."''$key).'.jpg" alt="'.l('soc_bookmark').' '.$key.'" />' $key;
'<a href="'.$value.'" title="'.l('soc_bookmark').' '.$key.'">'.$link_text.'</a> ';
3. Download the icon package and place the folder named icons inside your site root;
4. Add this code inside language variables into function l()
$l['soc_bookmark'] = 'Post to';
5. Add this code inside function center()

echo '<p>'.l('soc_bookmark').': ';
soc_bookmark(db('website').$category.'/'.$r['seftitle'].'/', $r['title'], 'Y');
echo '</p>';

file_include(str_replace('[break]', '', $text), $shorten);
Quote from: burtrito
I made some small changes to get this working on snews 1.4:

The 1.5 mod above uses the following code in the center function:

Code: [Select]
echo '<p>'.l('soc_bookmark').': ';
soc_bookmark(db('website').$category.'/'.$r['seftitle'].'/', $r['title'], 'Y');
echo '</p>';
If you have 1.4, use the below in the center function:

Code: [Select]
echo '<p>'.l('soc_bookmark').': ';
soc_bookmark($s .s('website').$category.'/'.$r['seftitle'].'/', $r['title'], 'Y');
echo '</p>';
I added mine below

Code: [Select]
if ($category <> s('home')) { $category = $category. "/"; }I also had to alter the filenames of the icons to include an Uppercase first letter. e.g: Digg.jpg instead of digg.jpg (MyWeb.jpg and BlogMarks.jpg require two case changes)

Use the rest of Mika's code as instructed.
« Last Edit: August 25, 2007, 03:28:04 am by Phil Martin (Philmoz) »