vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Latest Blog Feed in Postbit using Carp RSS (https://vborg.vbsupport.ru/showthread.php?t=91781)

nevetS 07-06-2005 10:00 PM

Latest Blog Feed in Postbit using Carp RSS
 
I just posted this over at vbWebmaster Forums. I'm all excited because this is my first plugin and I know pretty much nothing about vbulletin. I got the idea from Shawn's forum at Digital Point

I just put this together for 3.5 using carp.

Step 1) Add a custom profile field for the RSS link. In my setup it was field5.
Step 2) Edit your postbit template as follows:
PHP Code:

<if condition="$post['field5']">
<
div class="smallfont">Recent Blog$blogentry</div>
        </if> 

Step 3) Create a new plugin. I named mine: Carp Configuration. Attach it to the "global_start" hook location.
Here is the code:
PHP Code:

require_once '/path/to/carp/carp.php';
CarpConf('cacheinterval',120);
/** You may want to set a cachepath specifically for your forum **/
CarpConf('cachepath','/where/you/want/your/cache/files/');
CarpConf('cacherelative',0);
/** You can omit the above two lines without a problem **/
CarpConf('cborder','');
CarpConf('poweredby','');
CarpConf('maxitems',1);
CarpConf('iorder','link'); 

Step 4) One more plugin. This one I called: Get Users Blog Entry
Attach this to hook location: postbit_display_start
PHP Code:

ob_start();
CarpCacheShow($post[field5]);
$blogentry ob_get_contents();
ob_end_clean(); 

That's it... away you go. If you don't have carp, you can check it out at: http://www.geckotribe.com/rss/carp/
I'm not sure if this will work with the free version, as I have the paid version.

I'm thinking about using grouper to set it up so I can parse atom files, but I don't know how important that will be.

Note: carp allows you to enter local paths and http paths for rss feeds. I've tried entering both in my user profile field successfully. You may want to disallow users from entering a local path just to be on the safe side. I don't have any code for that right now, but I'm sure there are some examples for field validation out there.

Carp has an option to store it's output in a variable ($carpoutput), but it didn't seem to work for me. That's why I used the ob_start and end_clean functions. If anybody has any feedback as to how this may be improved, I'm willing to listen.

Marco van Herwaarden 07-07-2005 12:30 PM

Thank you for sharing this with us.

Could you please be so kind to copy your instructions into a textfile and upload it to the modification. This is usefull so members can keep the instruction of installed modifications for later use when upgrading for example.

nevetS 07-07-2005 05:13 PM

Quote:

Originally Posted by MarcoH64
Thank you for sharing this with us.

Could you please be so kind to copy your instructions into a textfile and upload it to the modification. This is usefull so members can keep the instruction of installed modifications for later use when upgrading for example.

The attached zip file contains the instructions per request.

Allan 07-07-2005 05:33 PM

screen please :)

nevetS 07-07-2005 07:48 PM

screenies added.

Allan 07-07-2005 07:54 PM

Quote:

Originally Posted by nevetS
screenies added.

thank you :)

PS: I just meant that screen is important for those who are not English as me.

Marco van Herwaarden 07-07-2005 08:14 PM

Quote:

Originally Posted by nevetS
The attached zip file contains the instructions per request.

Thank you for your fast response.

nevetS 07-07-2005 08:30 PM

Quote:

Originally Posted by MarcoH64
Thank you for your fast response.

No problem. I'm very impressed at how easy it is to build plugins in 3.5. It took me several hours to put this together, but I'm very new to vbulletin and I didn't know the in's and out's of anything.

In the future for this script, I'd like to add an installer that creates everything for you, but I don't quite know the best way for doing this yet and I'm going to have to add a function to search for the carp files and accepts some user input for location. I'm also not sure if I should just insert the code into the template or if I should just have the users do that themselves.

Before I go that far, I'm going to wait for any feedback about better ways to go about this. If there's a more performance friendly method, I should use it.

Carp is an caching RSS script. Which basically means it will look for a locally cached version fo the rss feed to display first and if one does not exist it will go out and grab the latest version online. The configuration above expires caches every two hours, so if you update your blog it can be up to two hours before the latest blog entry appears. If 10 different people have blogs configured and post in a thread it can mean that 10 different http queries need to go out to display the thread if it has not been viewed in a long time.

Another way to go about this is to set up a cron job to regularly update the cache files, but that could mean that every time it runs 150 http queries go out if you have 150 members with blog entries configured, and it very well could be the case that 50 of those members are not active posters.

These are all reasons to post the plugin here, though. As I get feedback, I can improve the script and everyone can benefit.

gamebrink 08-01-2005 02:03 PM

Quote:

Originally Posted by nevetS
No problem. I'm very impressed at how easy it is to build plugins in 3.5. It took me several hours to put this together, but I'm very new to vbulletin and I didn't know the in's and out's of anything.

In the future for this script, I'd like to add an installer that creates everything for you, but I don't quite know the best way for doing this yet and I'm going to have to add a function to search for the carp files and accepts some user input for location. I'm also not sure if I should just insert the code into the template or if I should just have the users do that themselves.

Before I go that far, I'm going to wait for any feedback about better ways to go about this. If there's a more performance friendly method, I should use it.

Carp is an caching RSS script. Which basically means it will look for a locally cached version fo the rss feed to display first and if one does not exist it will go out and grab the latest version online. The configuration above expires caches every two hours, so if you update your blog it can be up to two hours before the latest blog entry appears. If 10 different people have blogs configured and post in a thread it can mean that 10 different http queries need to go out to display the thread if it has not been viewed in a long time.

Another way to go about this is to set up a cron job to regularly update the cache files, but that could mean that every time it runs 150 http queries go out if you have 150 members with blog entries configured, and it very well could be the case that 50 of those members are not active posters.

These are all reasons to post the plugin here, though. As I get feedback, I can improve the script and everyone can benefit.


Yes I would like to see some sort of change so that (If 10 different people have blogs configured and post in a thread it can mean that 10 different http queries need to go out to display the thread if it has not been viewed in a long time.) doesn't happen.

Thanks for the code!

EricaJoy 08-19-2005 07:01 PM

Could you kindly make the same sort of thing for vB 3.0.8? It would be very much appreciated. :)

nevetS 08-19-2005 08:22 PM

I have plans on making a single install file for vb 3.5 in the near future, but I don't have an installation of 3.08 up and running right now to play with.

Give me two weeks and I'll see if I can't put both a 3.0x and a 3.5 update together.

I'm also planning on making it compatible with both magpie and carp - since those seem to be the most common rss caching systems out there.

I appreciate the interest.

memdy 08-20-2005 03:58 AM

Everything seems to have installed properly, but it's not showing up in the postbit. Anywhere special we should put the code in the postbit template. I put it just under the title/rank section.

nevetS 08-20-2005 08:38 AM

Are you seeing the "Recent Blog" part of it? Or just nothing at all?

You can place it anywhere you want in the postbit, but I think the place that makes sense the most is right around where the username is.

One thing to keep in mind is the part that says
PHP Code:

 <if condition="$post['field5']"

field5 was in my own personal setup. It could be that your new field has a different number - field6, field7, etc.

EricaJoy 11-19-2005 03:19 AM

any updates?

irishblacknight 01-19-2006 10:25 PM

Nice hack :)

The only thing I found was that if I tried to set the cache to be anywhere other than the default carp cache it refused to work even with the directories set to 777
This is with the GPL version :)

Thanks!

nevetS 01-22-2006 01:32 AM

Quote:

The only thing I found was that if I tried to set the cache to be anywhere other than the default carp cache it refused to work even with the directories set to 777
This is with the GPL version
I will look into this this week. Last week I was able to make a few changes that allowed the last five blog entries to display into the member profile.

I had originally set a goal to have this all set up as an installable package. I'm not sure if that's an achievable goal, but I'll see what I can do.

pmkb 02-07-2006 06:28 PM

Thanks nevetS, I'm using it with the CaRP free edition. It works fine as it's not using any of the extra features in the commercial edition.

chabbs 04-15-2006 12:06 PM

Thanks for this mod, I installed it and it worked well.

How can I make the link open up in a new page when someone clicks on it? This way people don't leave the forum when reading someone elses blog.

rollo tamasi 07-21-2006 04:06 AM

would it be possible to modify this mod so that it is only availabe to a specific usergroup?

Brandon Sheley 08-02-2006 02:35 AM

could someone please post a link to download carp, that site is extremely hard to navigate, all I done is signed up for some newsletter :(

armstrong 08-08-2006 05:18 AM

Installed on http://noypi.org . Thanks!

Hey, would it be possible to have the blogs on a new window? Someone else requested this, but no solution was offered. Is this even possible with Carp?

EDIT: Answering my own question, yes it is possible using carp's linktarget config option -> http://carp.docs.geckotribe.com/conf.../item/link.php

pmkb 08-25-2006 01:23 PM

This works great with 3.6 too. :)

nevetS 08-25-2006 05:09 PM

Quote:

Originally Posted by Loco.M
could someone please post a link to download carp, that site is extremely hard to navigate, all I done is signed up for some newsletter :(

You are not kidding. I saw your post and headed over there.

http://carp.docs.geckotribe.com/download.php

It LOOKS like you have to hand off your e-mail to download, but I don't know what happens if you give it to them. When I put this together originally, it was easy to download, easy to install, easy easy easy.

And frankly, since I purchased, they've been great about e-mailing me updates directly and regularly (I don't have to download them).

I know another user has developed a magpie version, which may be easier to get a copy of - here's the plugin, and a link to magpie:

https://vborg.vbsupport.ru/showthrea...ghlight=magpie

http://magpierss.sourceforge.net/

and the magpie rss download page:
http://sourceforge.net/project/showf...group_id=55691

993ti 10-13-2006 08:32 PM

Working great on 3.6.2, thx for this awesome mod ;)

glenvw 10-22-2006 11:03 AM

Ok, I happen to find this at Digital Point as well. However, I cannot figure out in laymens terms, what it does for a forum owner?

Can someone lay it out for me in dummy language please?

Thanks!

nevetS 10-23-2006 04:56 PM

It puts the linked title of your most recent blog entry in the postbit. Take a gander at the screenshots.

imranbaig 10-26-2006 07:27 PM

this is really a nice hack.
Clicks INSTALL

ResaleBroker 10-27-2006 02:51 AM

This worked like a charm with our 3.5.x forums. What would it take to get this to work with 3.0.x versions? I can get RSS feeds to show up but I haven't found a way to get the custom user field into the feed URL. Any ideas?

nevetS 10-27-2006 09:26 AM

No idea. I don't have a 3.0x version to work with. I'll poke around a little bit this week and see if there isn't an easy fix.

ResaleBroker 10-27-2006 05:14 PM

Quote:

Originally Posted by nevetS
No idea. I don't have a 3.0x version to work with. I'll poke around a little bit this week and see if there isn't an easy fix.

Thank you! :)

roliver 11-05-2006 10:08 AM

Hi all, is this a full blog plug-in to VB or just an RSS reader to other blog sites?

mhdhallak 11-12-2006 02:21 PM

Thank you indeed. Just what I needed :)

imranbaig 11-15-2006 06:10 AM

cant process atom feeds, I tried with Gouper but Got confused can any one help pleaseeeeeeeeeeeeeeeeeeeeeeeeeee

nevetS 11-16-2006 06:47 PM

ResaleBroker - I'm sorry, I just haven't been able to find a way to get this working in 3.0.x.

roliver - this simply pulls in the latest blog entry title into the user postbit.

mhdhallak - you're welcome :)

imranbaig - grouper is definitely what you need for atom feeds. I'll take a few minutes to see if I can figure that out tonight.

ResaleBroker 11-17-2006 02:48 AM

Quote:

Originally Posted by nevetS (Post 1118825)
ResaleBroker - I'm sorry, I just haven't been able to find a way to get this working in 3.0.x.

Bummer. Thank you for checking it out. I appreciate your efforts. ;)

RustedBucket 11-27-2006 05:49 PM

Quick question. What's the easiest way to set this so a user has to either be a member of a specific group or have X number of posts before they can use this feature. Thanks

pcoskat 12-17-2006 01:55 PM

Quote:

Originally Posted by crazy4bass (Post 1126554)
Quick question. What's the easiest way to set this so a user has to either be a member of a specific group or have X number of posts before they can use this feature. Thanks

Good question!

forumrating 01-21-2007 07:39 PM

will this work for 3.6.4 version latest vbulletin ?

nevetS 03-16-2007 01:42 AM

I believe it will work with 3.6.4 - I'll try it out tonight (actually I'll be trying on 3.6.5)

I don't know about the # of posts thing, but I'll look into it. If my past history is any indication, don't hold your breath. I get easily distracted sometimes.

Adam Fletcher 03-17-2007 04:09 PM

I am pretty new to VBulletin. Can anyone help me by installing this for me.

I have no idea what to do :(


All times are GMT. The time now is 04:47 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01420 seconds
  • Memory Usage 1,839KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete