Topic RSS
great.
i have another small question.
can I make it so this script only shows up on certain sections of the forum, similar to the way this is possible in wordpress.
You might find these template tags useful… Read the note at the top before using them…
thanks
what about a specific category section?
Like if I only want Android affiliate products to show up on the Android forums.
Look at the hooks. many of them pass in the id of the group, forum or topic so it easy to check. As in if($forumid = 2) or some such.
I have taken mikemacias great start here and extended it to use the new twitter tweet me button as well as added a facebook like me button.
you can see them both active here on this site. I have chosen to put them under the topic tags using the sf_hook_post_topic_top_tags() hooks… If you want them above the topic tags, just use the sf_hook_post_topic_top_pagelinks() hook.
Here is what I replaced the hook template with:
function sf_hook_post_topic_top_tags($forumid, $topicid)
{
$tweetme = '<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="SimpleForum">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>';
$url = urlencode(sf_permalink_from_forumid_and_topicid($forumid, $topicid));
$likeme = '<iframe src="http://www.facebook.com/plugins/like.php?href='.$url.'&layout=button_count&show_faces=false&width=450&action=like&font=tahoma&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:80px; height:20px;" allowTransparency="true"></iframe>';
$out = '<div class="sfalignright">';
$out.= $likeme;
$out.= $tweetme;
$out.= '</div>';
return $out;
}and thanks to mikemacias for getting us going! enjoy!
ooppsss… sorry, actually moved it back to the post pagelinks since the topic tags hooks arent fired if you arent using tags (like some of our forums).
or if you prefer to simply have the topic name itself (the above gives you page name and forum name too) for the tweet text, then use this:
function sf_hook_post_topic_top_pagelinks($forumid, $topicid)
{
$topicname = sf_get_topic_name_from_id($topicid);
$tweetme = '<a href="http://twitter.com/share" class="twitter-share-button" data-text="'.$topicname.'" data-count="horizontal" data-via="SimpleForum">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>';
$url = urlencode(sf_permalink_from_forumid_and_topicid($forumid, $topicid));
$likeme = '<iframe src="http://www.facebook.com/plugins/like.php?href='.$url.'&layout=button_count&show_faces=false&width=450&action=like&font=tahoma&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:80px; height:20px;" allowTransparency="true"></iframe>';
$out = '<div class="sfalignright">';
$out.= $likeme;
$out.= $tweetme;
$out.= '</div>';
return $out;
}7:50 am
You will need to change the Twitter ID in the Via spot to yours if you want it to have your account reflected in the Tweet.
via="WinObs" for instance or whatever your Twitter name is.
Most Users Ever Online: 444
Currently Online: wazina
65 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
-Radio-: 1251
Lee H: 606
Luffer: 535
Conrad_Farlow: 504
jim: 478
neon: 263
ovizii: 240
Tal: 240
Member Stats:
Guest Posters: 2626
Members: 7364
Moderators: 1
Admins: 2
Forum Stats:
Groups: 5
Forums: 16
Topics: 10905
Posts: 79605
Newest Members: Onuora Amobi, Rick Thomas, joelrob, ndc, MacBravO, irlandes1, triphop, betokan, Jonathan Yovani Muñoz, somosguatemala
Moderators: Brandon C (162)
Administrators: Yellow Swordfish (22240), Mr Papa (23698)
Log In
Register
Home
Add Reply
Add Topic
Offline


Quote


Visit 
Privacy Policy



