1 nelsonguirado Apr 22, 2007 06:08
3 edb Apr 22, 2007 18:55
Okay this was pretty easy. In your skins/yourskin/_main.php file find the bit that makes the stuff under your actual post and add a new line. Here I have a new line for a new "&bull" then the actual line tucked in between my categories list and my comments link.
$Item->categories();
echo ' • '; ?>
<a href="http://www.stumbleupon.com/submit?url="<?php $Item->permanent_url(); ?>" title="<?php $Item->title(); ?>"><img src="img/icon_su.gif" alt="<?php echo T_('Stumble upon this article') ?>" class="middle" width="16" height="16"> <?php echo T_('Stumble it!') ?></a>
<?php $Item->feedback_link( 'comments', ' • ' ) // Link to comments ?>
You also have to grab the image from stumbleupon and save it in your skins/yourskin/img folder. If your skin doesn't have one you can either make it or tweak the important line above to reflect your actual path.
4 nelsonguirado Apr 26, 2007 05:29
Thanks. I'll try it this weekend. You're great. I'd like to hire you to oversee my transition to 1.92.
Nelson
5 edb Apr 26, 2007 11:34
nelsonguirado wrote:
Thanks. I'll try it this weekend. You're great. I'd like to hire you to oversee my transition to 1.92.
Heh! No thanks friend. To me this is like checking out hot babes: something I do for fun - not profit. Talk to the guys at http://www.astonishme.co.uk/ instead. That'd be Yabba and stk and I think personman. I think. Anyway those guys know what they're doing with this stuff. I just look and say "wow that looks nice!" ;)
Besides upgrading isn't so hard. Make a second installation of the version you have, copy your database to it, upgrade that installation and see if your skin survives. If not tweak the second installation until your skin is groovy, then upgrade the real installation and throw in your freshly upgraded skin.
6 robert_t Apr 26, 2007 12:41
EdB wrote:
..
$Item->categories(); echo ' • '; ?> <a href="http://www.stumbleupon.com/submit?url="<?php $Item->permanent_url(); ?>" title="<?php $Item->title(); ?>"><img src="img/icon_su.gif" alt="<?php echo T_('Stumble upon this article') ?>" class="middle" width="16" height="16"> <?php echo T_('Stumble it!') ?></a> <?php $Item->feedback_link( 'comments', ' • ' ) // Link to comments ?>
..
Hi EdB,
Thanks also from me for the code tip. I tried adding this to my _main-php template though and have nothing in the link URL param. It looks like permanent_url() is not returning anything and the title tag is showing the subject of the post. I'm using rainforest, downloaded the little icon to img and pasted the code as you said. Am I missing something?
Thanks for any help you can offer,
Regards
Robert
7 edb Apr 26, 2007 13:14
Oh boof. Try getting rid of some of the double-quotes that don't belong there, and adding the & that should be in between the url and title.
$Item->categories();
echo ' • '; ?>
<a href="http://www.stumbleupon.com/submit?url=<?php $Item->permanent_url(); ?>&title=<?php $Item->title( '', '', false ); ?>"><img src="img/icon_su.gif" alt="<?php echo T_('Stumble upon this article') ?>" class="middle" width="16" height="16"> <?php echo T_('Stumble it!') ?></a>
<?php $Item->feedback_link( 'comments', ' • ' ) // Link to comments ?>
Also what version are you using?
* EDIT: fixed a bug in the code that affected any post with a link in the "link to URL" field.
8 robert_t Apr 26, 2007 13:24
EdB wrote:
Oh boof. Try getting rid of some of the double-quotes that don't belong there, and adding the & that should be in between the url and title.
$Item->categories(); echo ' • '; ?> <a href="http://www.stumbleupon.com/submit?url=<?php $Item->permanent_url(); ?>&title=<?php $Item->title(); ?>"><img src="img/icon_su.gif" alt="<?php echo T_('Stumble upon this article') ?>" class="middle" width="16" height="16"> <?php echo T_('Stumble it!') ?></a> <?php $Item->feedback_link( 'comments', ' • ' ) // Link to comments ?>
Also what version are you using?
Very nice indeed - works a treat! Thanks EdB!!!
I'm using rainforest - just downloaded and set it up last night.
Now must find the bits I need for technorati, etc... ;)
Robert
9 edb Apr 26, 2007 13:33
Stay tuned... I've been working on 4 of them. Problem is I don't know if they actually work or not is the thing, and can't find the website I was copying from that used the 4 biggies: delicious, digg, stumble, and technorati. I think I saw a blog that also included the "message me" envelope in the same batch. Kinda cute I guess, but the envelope is a different size image file. Anyway stick around. I'm busy bragging about my new computer, then I'll show you the code I've got so far and we can figure out if it works well or not.
10 robert_t Apr 26, 2007 13:40
OK EdB, sounds good to me. I'm bragging about my new blog (www.robertturrall.com/blogs), so why not! ;)
I've just found a page with LOADS of links and buttons for social bookmarking sites. See the post:
http://forums.b2evolution.net//viewtopic.php?t=11492
I don't know how much this will help but will try a few things here too... the links look simple - maybe too simple?
back later... Robert
11 robert_t Apr 26, 2007 15:19
OK, I've added Digg and de.licio.us using the following code:
<?php $Item->edit_link( ' • ' ) // Link to backoffice for editing ?>
<br /><br />
<a href="http://www.stumbleupon.com/submit?url=<?php $Item->permanent_url(); ?>&title=<?php $Item->title(); ?>" > <img src="img/icon_su.gif" alt="<?php echo T_('Stumble upon this article'); ?>" class="middle" width="16" height="16" /> <?php echo T_('Stumble it!'); ?></a>
<a href="http://del.icio.us/post?v=4&noui&jump=close&url=<?php $Item->permanent_url(); ?>&title=<?php $Item->title(); ?>" > <img src="img/6605delicious.png" alt="<?php echo T_('Add to de.licio.us'); ?>" class="middle" width="16" height="16" /> <?php echo T_('Add to de.licio.us'); ?></a>
<a href="http://digg.com/submit?phase=2&url=<?php $Item->permanent_url(); ?>&title=<?php $Item->title(); ?>" > <img src="img/16x16-digg-guy.gif" alt="<?php echo T_('Digg it!'); ?>" class="middle" width="16" height="16" /> <?php echo T_('Digg it!'); ?></a>
<?php $Item->trackback_rdf() // trackback autodiscovery information ?>
Everything between the <br /> tags and the <?php $Item->trackback...
Any use?
I found the new Digg logos here:
http://videos.revision3.com/diggnation/digg-badges.zip
Have fun,
Robert
12 edb Apr 26, 2007 16:25
I guess if they work then they work! I just posted http://wonderwinds.com/hackblog.php/2007/04/26/social_bookmarking_stuff that'll show delicious and digg and slashdot and stumbleupon and technorati, but I did delicious and digg differently. Wasn't sure what the "v=4&noui&jump=close" bit in delicious or the "phase=2" bit in digg were all about, so settled for copying what other blogs I could find were doing.
13 robert_t Apr 26, 2007 16:32
EdB wrote:
I guess if they work then they work! I just posted http://wonderwinds.com/hackblog.php/2007/04/26/social_bookmarking_stuff that'll show delicious and digg and slashdot and stumbleupon and technorati, but I did delicious and digg differently. Wasn't sure what the "v=4&noui&jump=close" bit in delicious or the "phase=2" bit in digg were all about, so settled for copying what other blogs I could find were doing.
Well, that's what I found on that other page with all of the links on. Having said that, the blasted things get broken when I look at the Links category - seems like the URL contains the link code aswell and something messes up the html that comes back.
I'll take a look at yours - thanks! :D
Regards
Robert
14 robert_t Apr 26, 2007 16:35
By the way: Do yours work OK on the links category? I can't see much difference in the way they're done so please check if you get this...
Robert
15 robert_t Apr 26, 2007 17:21
I've just taken out the title= bits on all of the links and they work fine for both normal categories and the links. Here's the funny bit: The urls they create still include "title="... go figure...
Robert
16 nelsonguirado Apr 27, 2007 03:13
The only thing holding me back is:
Notice: Undefined variable: disp_pingbacks in /home/nelsongu/public_html/test2/skins/_feedback.php on line 70
when I hit the permalinks.
http://nelsonguirado.com/test2/index.php?blog=2&title=first_post&more=1&c=1&tb=1&pb=1
This is a test site.
17 edb Apr 27, 2007 03:31
Kind of off-topic from stumbleupon, but check out http://forums.b2evolution.net/viewtopic.php?t=10657 and http://forums.b2evolution.net/viewtopic.php?t=10868 and see if they show you the next step or two. You might find something interesting on line 70 in your skins/_feedback.php file too, but then again you might not. It is possible that the error happens there because the variable is not defined previously. Anyway those two threads should give you some good traction.
18 edb Apr 27, 2007 06:11
Okay there's a bit of a problem here, but it's easily corrected. In any of these things that provides a title using something like
title=<?php $Item->title(); ?>
the "title" will be linked to whatever you have in the "link to URL" field in your post. Like your linkblog for example. Fortunately it's fixable by replacing the code above with this:
title=<?php $Item->title( '', '', false ); ?>
I will edit my posts above and my blog post to reflect this reality.
19 nelsonguirado Apr 29, 2007 03:37
The posts you mentioned fixed the problem. Thanks again
20 laibcoms Apr 29, 2007 09:19
I added StumbleUpon to the Social-Bookmarking Hack.
-> http://forums.b2evolution.net/viewtopic.php?p=54505
Thanks to nelson.
21 gcasanova Nov 12, 2007 00:51
To EdB:
Ive tried all your instructions changing just the icon and its path:
<a href="http://www.stumbleupon.com/submit?url=<?php $Item->permanent_url(); ?>&title=<?php $Item->title( '', '', false ); ?>"><img src="icons/su_micro.gif" alt="<?php echo T_('Stumble upon this article') ?>" class="middle" width="80" height="15"> <?php echo T_('Stumble it!') ?></a>
But there is no way I can make the Icon to show, any idea why?
I've tried path, full path, URL... and also the original 16x16 icon
22 gcasanova Nov 12, 2007 01:09
Also, the skin is Andreas01, the B2evo version is 1.10.02
A differente problem but that may have something related, the social bookmarkings hack doesn't show the icons either, just the ALT text.
23 afwas Nov 12, 2007 01:19
Where is / are the icons on the server. If you do a full URL to them they should show. Also ../icons/ or ../../icons may do the trick.
Good luck
24 gcasanova Nov 12, 2007 01:30
Afwas:
I've tried all possibly ways with no luck.
I'm beginning to believe it has something to do with skin, but what?
25 afwas Nov 12, 2007 01:41
Is it in your blog http://gameshogun.ws/? Where exactly is the code in the page (where do you like it to show up?)
edit: the icon is not at http://gameshogun.ws/icons/su_micro.gif
26 gcasanova Nov 12, 2007 01:52
I want it to show where EdB suggests, at the end of the main post.
27 afwas Nov 12, 2007 02:01
According to the blog you are now pointing to http://gameshogun.ws/skins/midnight/icons/su_micro.gif and that's not where the icon is. What is the url of the image?
28 gcasanova Nov 12, 2007 02:10
I'm sorry, I don't understand your mention to that blog. That is not my blog. I'm a bit confused.
29 afwas Nov 12, 2007 02:57
I'm sorry, it's Laibcoms blog. His post is right above yours.
You should know where the image is. Then you can point with a full URL to that image, like:
http://www.site.com/blog/skins/custom/icons/su_micro.gif
You can test the url because if you put it in the adressbar of your browser it should show the image.
The code goes under the post. In the main.php file of your blog, that's somewhere direct above, under or among the <div class="bSmallPrint">. This is a bit dependent of your b2evo version and skin.
If you provide us a link to your site, I can help you with more precise directions.
Good luck
30 gcasanova Nov 12, 2007 10:38
Thanks Afwas. The link is (TinyUrl): http://tinyurl.com/2tx39e
I've tried the whole link to the image but nothing. Right now I only have the StumbleUpon code without the image part, but that is not what I want.
31 afwas Nov 12, 2007 10:58
For testing purposes, try this:
<a href="http://www.stumbleupon.com/submit?url=<?php $Item->permanent_url(); ?>&title=<?php $Item->title( '', '', false ); ?>"><img src="www.fusiarski.com/images/stumbleupon.gif" alt="<?php echo T_('Stumble upon this article') ?>" class="middle" width="80" height="15"> <?php echo T_('Stumble it!') ?></a>
I can't find the gif on your site. It says it's at /media/icon_su.gif, but there it isn't. Nor is it in skins/andreas01/icons/su_micro.gif. I think adding the correct location solves your problem, but test this testcode first.
Good luck
32 knarfdotca Dec 23, 2007 22:36
I have a small problem with this, Stumbleupon uses the tag &title in their url for the title. If your url includes the &title for navigation(Like mine does) it links to the main page of the blog.
Example:
The link that the code generates is:
But when you get to stumbleupon it picks up the link as:
http://www.stumbleupon.com/submit?url=http://knarf.ca/index.php?blog=6
and does not pick up the post but directs to the main page of the blog.
Does anyone know how to fix this?
33 yabba Dec 24, 2007 15:30
You *might* get away with changing it to this :
<?php echo urlencode( $Item->get_permanent_url() ); ?>
¥
34 knarfdotca Dec 24, 2007 16:01
Thanks for your reply. When you transfer to the stumbleupon site it won't pick up anything past the &title (with that code or the old code)in the url because it thinks that it's the title. If I use my stumble "I like it" button from the tool bar it works and picks up the full url to record.
35 yabba Dec 24, 2007 16:08
Lets try a tad of rearranging then ;)
<a href="http://www.stumbleupon.com/submit?title=<?php $Item->title( '', '', false ); ?>
&url=<?php urlencode($Item->permanent_url() ); ?>">
<img src="www.fusiarski.com/images/stumbleupon.gif"
alt="<?php echo T_('Stumble upon this article') ?>" class="middle" width="80" height="15"> <?php echo T_('Stumble it!') ?></a>
¥
36 knarfdotca Dec 24, 2007 17:18
Thanks, I have it working now.
Feel like being the bleeding edge of hackage - again? It's probably doable, meaning it's totally doable. As far as I can tell though it hasn't been done yet.
200 hits in half an hour? Wow PJM people will click on anything ;)