Please login or register.

Login with username, password and session length
Advanced search  

News:

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

Author Topic: Social bookmarking code to suit snews variables  (Read 2470 times)

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Social bookmarking code to suit snews variables
« on: August 24, 2008, 11:39:58 am »

Hi all,
this old Social bookmarking features Mod seems to do the job but some codes aren't working such as Google's one:
Quote
'Google'=>'-http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk='.$link.'&title='.$title,
$link and $title doesn't provide the page's URL but the domain's URL,.
and the code for Blogger dosen't work of course:
Quote
-http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=
<$BlogItemPermalinkURL$>&title=<$BlogItemTitle$>

There's a page here
Does someone know the code to work with Google ?
And for Yahoo too?
Would be much appreciate.
Have a nice day
« Last Edit: August 24, 2008, 12:02:42 pm by Sven »
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Social bookmarking code to suit snews variables
« Reply #1 on: August 24, 2008, 03:23:08 pm »

Mr. Sven,

<$BLogItemPermalinkURL> is the SEF link to your article : domain.com/category/your-excellent-article/

then a description (here you can insert your meta description)
then the literal title of your article (<$BlogItemTitle$>)
« Last Edit: August 24, 2008, 03:26:21 pm by funlw65 »
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Social bookmarking code to suit snews variables
« Reply #2 on: August 24, 2008, 04:52:37 pm »

Mr. Sven,

<$BLogItemPermalinkURL> is the SEF link to your article : domain.com/category/your-excellent-article/

then a description (here you can insert your meta description)
then the literal title of your article (<$BlogItemTitle$>)
Nope. That's for the Google Blogging Machine.

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Social bookmarking code to suit snews variables
« Reply #3 on: August 24, 2008, 05:24:09 pm »

this is one of my google blogs :  pigeons-ro.blogspot.com :P

At first try, bookmarking on google:

Quote
http://www.google.com/bookmarks/mark?op=add&output=popup&bkmk=http://pigeons.morisca.net/ornament/porumbita-voltata-neagra/&title=Porumbita%20voltata%20neagra

So,
bkmk=your seflink to your article
title=your literal title...

I don't know yet  what are the aparameters for labels and description... I will see....     
Mr. Sven, you can click on link from quote for an working example ...

P.S. When I talked about  these tags <$...>, I tried to explain what they mean, so you can easly replace them with sNews equivalents...
« Last Edit: August 24, 2008, 05:32:29 pm by funlw65 »
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Social bookmarking code to suit snews variables
« Reply #4 on: August 24, 2008, 05:58:43 pm »

Quote
When I talked about  these tags <$...>, I tried to explain what they mean, so you can easly replace them with sNews equivalents...
$link and $title doesn't provide the page's URL but the domain's URL...
The sNews equivalent does nto work.

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Social bookmarking code to suit snews variables
« Reply #5 on: August 24, 2008, 06:01:01 pm »

Quote
When I talked about  these tags <$...>, I tried to explain what they mean, so you can easly replace them with sNews equivalents...
$link and $title doesn't provide the page's URL but the domain's URL...
The sNews equivalent does nto work.
Ok, I will make the code... you want the link after the tags? ...  To be visible only on article's page or also on blog page, on every article?
« Last Edit: August 24, 2008, 06:07:39 pm by funlw65 »
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Social bookmarking code to suit snews variables
« Reply #6 on: August 24, 2008, 06:20:42 pm »

Code: [Select]
<?php
//-- deleted code, see the one bellow


Insert that code in center() function, under EQ code about displaying tags....
Not tried ... I'm curious :) if is working


The sNews link equivalent is built from a few variables. We have db('website') for domain address, then we add category seftitle included in variable $category (inside center function), then we add '/' then seftitle of article included in $r['seftitle'] variable and finally, '/'...
Title of article is in $r['title'] . So:
db('website').$category.'/'.$r['seftitle'].'/'  == <$BlogItemPermalinkURL>

UPDATE:
Code repaired, forgot to add a dot after $r['title']

UPDATE2:

Code updated also for Yahoo MyWeb

UPDATE3:
A little better code, for easy working with it on other services.

Code: [Select]
<?php
  
//social bookmarks MOD(
  
$site_link db('website');
  
$article_link $site_link.$category.'/'.$r['seftitle'].'/';
  
$article_title $r['title'];
  
// -- start adding bookmarking services
  
echo '<p>Social Bookmarking: ';
  
// -- Google --
  
$starting_link 'http://www.google.com/bookmarks/mark?op=add&amp;output=popup&amp;bkmk=';
  echo 
'<a href="'.$starting_link.$article_link.'&amp;title='.$article_title.'">Googleize this article</a>';
  echo 
' | '// -- separator (you must insert it between "services")
  // -- Yahoo MyWeb --
  
$starting_link 'http://myweb.yahoo.com/myresults/bookmarklet?t=';
  echo 
' <a href="'.$starting_link.$article_title.'&amp;u='.$article_link.'">Add to MyWeb</a>';
  
// -- End adding bookmarking services 
  
echo '</p>';
  
//)



Of course, instead of text (e.g.: Googleize this article), you can insert an image. This code must be added in default case of center function, after EQ displaying keywords mod, or, in your case Mr.Sven, also in blog case.

« Last Edit: August 25, 2008, 12:59:46 am by funlw65 »
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Social bookmarking code to suit snews variables
« Reply #7 on: August 24, 2008, 06:35:33 pm »

I gonna tell you tomorrow Brother Fun. :D

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Social bookmarking code to suit snews variables
« Reply #8 on: August 25, 2008, 12:14:24 am »

Code updated and working (also valid, as Patric suggested)

You can test it here http://pigeons.morisca.net/blog/

Mr.Sven, look at last code update, is different and you saw it working.
« Last Edit: August 26, 2008, 02:57:57 pm by funlw65 »
Logged