Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 5

Author Topic: [MOD/ADDON] Social bookmarking feature (sNews 1.5)  (Read 58517 times)

Mika

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 9
  • Posts: 1408
    • http://www.ni5ni6.com/
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« on: October 25, 2006, 06:22:44 PM »

Full article with modding explanation can be found on http://www.ni5ni6.com/snews-mods/allround-social-bookmarking-script/

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]
<?php
// MOD - SOCIAL BOOKMARKING
function soc_bookmark($link$title$icon 'Y') {
    
$link rawurlencode($link);
    
$title rawurlencode($title);
    
$icon_folder 'icons/';
    
$bookmark = array(
        
'BlinkBits'=>'http://www.blinkbits.com/bookmarklets/save.php?v=1&source_url='.$link.'&title='.$title,
        
'BlogMarks'=>'http://blogmarks.net/my/new.php?mini=1&simple=1&url='.$link.'&title='.$title,
        
'Del.icio.us'=>'http://del.icio.us/post?v=2&url='.$link.'&title='.$title,
        
'Digg'=>'http://digg.com/submit?phase=2&url='.$link.'&title='.$title,
        
'Fark'=>'http://cgi.fark.com/cgi/fark/edit.pl?new_url='.$link.'&title='.$title,
        
'Furl'=>'http://www.furl.net/storeIt.jsp?t='.$title.'&u='.$link,
        
'Google'=>'http://www.google.com/bookmarks/mark?op=add&bkmk='.$link.'&title='.$title,
        
'Ma.gnolia'=>'http://ma.gnolia.com/bookmarklet/add?url='.$link.'&title='.$title,
        
'MyWeb'=>'http://myweb2.search.yahoo.com/myresults/bookmarklet?t='.$title.'&u='.$link,
        
'Netscape'=>'http://www.netscape.com/submit/?U='.$link.'&T='.$title,
        
'NetVouz'=>'http://netvouz.com/action/submitBookmark?url='.$link.'&title='.$title,
        
'Newsvine'=>'http://www.newsvine.com/_tools/seed&save?u='.$link.'&h='.$title,
        
'RawSugar'=>'http://www.rawsugar.com/pages/tagger.faces?turl='.$link.'&tttl='.$title,
        
'Reddit'=>'http://reddit.com/submit?url='.$link.'&title='.$title,
        
'Scuttle'=>'http://www.scuttle.org/bookmarks.php/maxpower?action=add&address='.$link.'&description='.$title,
        
'Shadows'=>'http://www.shadows.com/features/tcr.htm?url='.$link.'&title='.$title,
        
'Simpy'=>'http://simpy.com/simpy/LinkAdd.do?title='.$title.'&href='.$link,
        
'Slashdot'=>'http://slashdot.org/bookmark.pl?url='.$link.'&title='.$title,
        
'Spurl'=>'http://www.spurl.net/spurl.php?url='.$link.'&title='.$title,
        
'Technorati'=>'http://technorati.com/faves?add='.$link.'&title='.$title,
        
'Wists'=>'http://wists.com/r.php?c=&r='.$link.'&title='.$title,
    );
    foreach(
$bookmark as $key=>$value) {
        
$link_text $icon == 'Y' '<img src="'.$icon_folder.str_replace("."''$key).'.jpg" alt="'.l('soc_bookmark').' '.$key.'" />' $key;
        echo 
'<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()
Quote
$l['soc_bookmark'] = 'Post to';
5. Add this code inside function center()
Quote

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

file_include(str_replace('[break]', '', $text), $shorten);
...
« Last Edit: August 25, 2007, 03:24:40 AM by Phil Martin (Philmoz) »
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

iatbm

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 256
    • Public domain photos
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #1 on: October 25, 2006, 08:20:01 PM »

this is great ... I will definetely use this one ... thank you mika ... hey what is with that other mod we talked the other day :D

Mika

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 9
  • Posts: 1408
    • http://www.ni5ni6.com/
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #2 on: October 25, 2006, 09:07:50 PM »

View counter? Well, I still have to fix some issues before I publish it...
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

iatbm

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 256
    • Public domain photos
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #3 on: October 25, 2006, 09:10:58 PM »

no no ... most readed or most popular articles :D

Mika

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 9
  • Posts: 1408
    • http://www.ni5ni6.com/
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #4 on: October 25, 2006, 09:14:23 PM »

:) yes I know, I just call it differently
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

iatbm

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 256
    • Public domain photos
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #5 on: October 25, 2006, 09:29:25 PM »

haha great so it is in the work .... this is good ... thanks

Fred K

  • sNews Dude
  • ULTIMATE member
  • *****
  • Karma: 134
  • Posts: 2806
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #6 on: October 26, 2006, 12:46:25 AM »

Way cool, man.

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #7 on: October 26, 2006, 07:58:32 AM »

Yay, this will be most useful... So great Kreso... Nice work as always. I will definitivly use this one...
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

adi

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #8 on: October 26, 2006, 10:07:25 PM »

Great mod, thanks.  I'd ideally like the bookmark links to go after each article, between the post date and the comment area, but I can't seem to find out how to achieve this via the center() function.  Where should I place the

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

in the center() function to get it in this location?
« Last Edit: August 25, 2007, 03:25:46 AM by Phil Martin (Philmoz) »
Logged

Mika

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 9
  • Posts: 1408
    • http://www.ni5ni6.com/
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #9 on: October 27, 2006, 04:46:01 PM »

find this inside function center():
Quote
file_include(str_replace('[break]', '', $text), $shorten);"
and above that line add this:
Quote
echo '<p>'.l('soc_bookmark').': ';
soc_bookmark(db('website').$category.'/'.$r['seftitle'].'/', $title, 'Y');
echo '</p>';
« Last Edit: August 25, 2007, 03:26:06 AM by Phil Martin (Philmoz) »
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

adi

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #10 on: October 27, 2006, 06:31:20 PM »

Quote from: Mika
find this inside function center():
Quote
file_include(str_replace('[break]', '', $text), $shorten);"
and above that line add this:
Quote
echo '<p>'.l('soc_bookmark').': ';
soc_bookmark(db('website').$category.'/'.$r['seftitle'].'/', $title, 'Y');
echo '</p>';
Thanks for the reply, but this was where I had it already and the 'post to...' links are located underneath the title of each article.  I'd like them at the end of the article ideally, between the date and comment fields.
« Last Edit: August 28, 2007, 04:18:59 AM by Phil Martin (Philmoz) »
Logged

iatbm

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 256
    • Public domain photos
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #11 on: October 27, 2006, 06:53:02 PM »

Hmm this is not working for me :( ... even when I call images directly there is

Code: [Select]
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/minimal/public_html/snews.php on line 445

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/minimal/public_html/snews.php on line 456

Mika

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 9
  • Posts: 1408
    • http://www.ni5ni6.com/
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #12 on: October 27, 2006, 09:35:22 PM »

ouch, sorry for that bug! I've edited my original post accordingly

the correct modification should be as follows:
Quote
echo '

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

';
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

iatbm

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 256
    • Public domain photos
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #13 on: October 27, 2006, 09:37:44 PM »

will try this right away :D

iatbm

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 256
    • Public domain photos
[MOD/ADDON] Social bookmarking feature (sNews 1.5)
« Reply #14 on: October 27, 2006, 09:42:17 PM »

I am still seeing the same thing ... just text with image border :(  and I cannot even access image file directly grr ,,,...
Pages: [1] 2 3 ... 5