2 texasag90 Jan 02, 2008 17:59

I think I am abandoning feedflare for AddThis.com.
<!-- AddThis Bookmark Post Dropdown BEGIN -->
<div><script type='text/javascript'>addthis_url='<?php $Item->permanent_url(); ?> '; addthis_title='<?php $Item->title( '', '', false ); ?>'; addthis_pub='ttadddd0';</script><script src='http://s7.addthis.com/js/addthis_widget.php?v=12' type='text/javascript'></script></div>
<!-- AddThis Bookmark Post Dropdown END -->
OK -- I did not like Addthis for a couple of reasons, so I went back to FeedFlare. Problem there was multiple blogs -- each feed is blog specific in my case (and I only want to use one skin).
So, I wrote some simple php. Here are the instructions if you want to do the same.
http://www.masonworld.com/computer/b2evo/adding-feedflare-to-b2evolution
Is it my imagination, or did the code disappear?
Oh, bugger. I migrated this blog and it broke the code.
Let me see what I can dig up.
Mark
<p>
<h3 class="feedback_section">Social Bookmarks and Tags (tell people about this post)</h3>
</p>
<?php
// code to add FeedFlares to the end of the post
// works for multiple feeds (that is what the switch case is for)
// Find the blog ID
$items_blog = $Item->get_Blog();
$items_blog_ID = $items_blog->ID;
// Watch out for blogs without flares
$do_flare = 1;
switch ( $items_blog_ID ):
//Blog ID = 4
case 4:
$fb_src = "http://feeds.feedburner.com/~s/MasonWorldTestBlog";
break;
//Blog ID = 5
case 5:
$fb_src = "http://feeds.feedburner.com/~s/FightinTexasAggieGoodBullBlog";
break;
//Blog ID = 7
case 7:
$fb_src = "http://feeds.feedburner.com/~s/Masonworld";
break;
//Blog ID = 8
case 8:
$fb_src = "http://feeds.feedburner.com/~s/CochlearWorld";
break;
//Yikes, our blog is not set up for flares
default:
$do_flare =0;
endswitch;
if ($do_flare) {
echo '<script src="'.$fb_src.'?i='.$Item->get_permanent_url().'" type="text/javascript" charset="utf-8" ></script>';
};
// END code to add FeedFlares to the end of the post
?>
Not exactly sexy....
Is there any way to do this as a widget instead of a skin hack?
Well, it is certainly possible to write one, if that is what you are asking.
If you are asking if one exists, I think the answer is "no." However, I am not up to date on the latest developments.
If you want one badly enough, you could also hire it done cheaply. It would be a pretty simple plugin compared to some of the stuff out there.
Regards,
Mark
I tried plugging in your php code into a html widget. The feedflare ad appeared, but none of the other items like "edit this", "email the author", and so on.
Well, it may depend on how you display the page. The main question will be what $Item->get_permanent_url() returns. If you are viewing the index page, I am not sure what $Item->get_permanent_url() means. On a single post, you get the permalink.
Take a look at the page source that you generate and see what is happening. That will give you a clue.
If use
<script src="http://feeds.feedburner.com/~s/comiclistcomplete?i=<?php $Item->permanent_url() ?>" type="text/javascript" charset="utf-8"></script>
for an indivual post, I get the ad only. In the source I see:
<div class="PostBottom"><script src="http://feeds.feedburner.com/~s/comiclistcomplete?i=<?php $Item->permanent_url() ?>" type="text/javascript" charset="utf-8"></script></div>
If I put your PHP code into a widget for the end of the post, it appears to simply print the code at the end of the post.
The i=part needs to resolve to the actual permalink, and that is not happening. That is the problem. Not sure why -- maybe someone else on here can comment.
Sorry that I am not more help, but I have not worked in b2evo since Jan...
You've been very helpful! Feedflare works in 2.4.1 using your method, and I appreciate that a great deal. If it can be turned into a widget, even better. I will continue to experiment.
If blog #1 is the blog that aggregates the other blogs, what's the best way to make certain it does not have an ad or links? Create a separate skin and don't include the feedflare PHP? Or some other way, perhaps?
You can detect the blog ID and just not show feed flare.
If you want this in a widget then it'd need to be inside your post loop and you'd need to global $Blog,$Item to be able to get the bits that you want.
If the code that's added never changes ( per post ), which it looks like it doesn't then you'd probably be better to make it a renderer plugin instead ... although then it'd show on blog 1 ... but there's ways around taht as well ;)
¥
Strangely, feedflare no longer works as it should on my blog. It's showing google ads, but none of the links.
OK -- I think that I have figured out how to do this, but I need some help.
I want to modify the evocamp skin to place some js at the end of the posts. It needs to be blog specific.
So, I need to do something like this:
switch case (BLOG_ID)
case: BLOG ID = 1
some script
end case
case: BLOG ID = 2
some other script
end case
end switch.
I will need to querry the blog ID and the permalink. I am having trouble understanding where these functions are documented. Can some one point me in the right direction?
Also, where is the best (proper) place to locate the code?
Thanks.