Computer Help Forum

Go Back   vBulletin and Computer Help Forum > Website Support and Management > Website Development

Website Development Web development programming languanges, HTML, PHP, MySQL and design support.

Reply
 
Thread Tools Display Modes
Old 06-06-2005   #1
Greg
Administrator
 
Greg's Avatar
 
Join Date: Feb 2003
Location: Florida
Posts: 5,173
Using Carp RSS for News Feed Content

This is not a tutorial on installing carp rss, the intent here is to show you how to use carp rss after it's setup. However, feel free to ask questions on setup and such. But we'll assume you have carp rss installed and working and want to tweak/configure it.

Let's walk through the basic settings we use. There are many, others may use more or less.

We have to deal with formatting descriptions and items. This is our example.

Channel Formatting Options
This is usually required to display. You show the provider as recognition for using the feed. How you have to display it may vary, some sites may not require it, most do. That's on you to be a fair player. So let's display a few of the available pieces of information.

You use the CarpConf() function to set the configuration. First argument is the setting, next are the settings.

CarpConf('cborder','image,title,link,desc');

This will display four parts of the channel info. Description, link to the feed, the feed image if available and the Title of the feed. This will be formatted pretty well on display. Image first, title, link, then description.

Let's set the length of the description for the channel with CarpConf() now.

CarpConf('maxcdesc',300);

That tells carp to display up to 300 characters of any description provided.

Now let's do the default image format from a carp example.

We will use the CarpConf() function to set what html code gets put before and after the image as well as what size to tell the html code to define in the img tag.

CarpConf('bcimage','<div style="float:left;margin-right:5px;">');
CarpConf('acimage','</div>');
CarpConf('maxcimagew',200);
CarpConf('maxcimageh',100);

The above puts the image in a div, left justified with a five pixel border on the right side. It tells carp to make the img tag size parameters 200x100 pixels.

Now we just need a space after the Channel info and we can move on to the news items. To put html breaks after the channel info for spacing we use the CarpConf() function again...

CarpConf('acb','<br /><br />');

That will tell carp to put two html breaks after the channel info for spacing.

Let's do the items now. It's the same proceedure with different CarpConf() settings.

Item Formatting Options
First we set what we will display with CarpConf()...

CarpConf('iorder','link,date,author,desc');

Again we have four pieces of data. Link, Date, author and description. Most feeds require you to display that much for them to make sense. This is up to you however.

Now lets do some display settings.

CarpConf('maxidesc',600);
CarpConf('maxititle',400);
CarpConf('maxitems',10);

The above set the Length of the description, the news feed article title and the number of items to display if that many are available.

The description is one you can play with. The more you show, the better the content.

The title we set long always. We use alot of yahoo! news feeds and the TOS says to display it all and we try to comply with that setting high to display all characters in the title.

Maxitems will tell carp how many of the available article items to display. I'll go out on a limb and say alot of feeds only supply 10 items at a time.

Item links can be controlled as to how they open. This setting will make the item links open in a new window.

CarpConf('linktarget',1);

This is usually a benefit as when they close the opened window, folks are back at your site.

Caching your Carp RSS News Feed
Caching your feed will make it so that your site only requests a news feed at a certain interval. Every specified time period, carp will make a call for the news and store a copy locally. This is a performance benefit for both us and the feed provider. You should always use this and the general rule is fetch at least 60 minutes apart.

CarpConf('cacheinterval',60);

That will tell carp to update the cache every 60 minutes and display the local copy any other time.

That's the basics. If you have any questions, post and we'll build on what we have.

Attached is a template in php to get you started with one single predefined feed from yahoo! news.

Here is the Carp RSS News Feed Template demo.

Regards.
Attached Files
File Type: php carptemplate.php (2.8 KB, 327 views)
__________________
Computers and Accessories Computer Manuals Riderinfo Connect for Bikers
Ad Revenue - Sell link space on your website and profit.

Last edited by Greg; 06-10-2005 at 05:26 PM.
Greg is offline   Reply With Quote
Old 06-06-2005   #2
Bazkaz
Junior Member
 
Join Date: Jun 2005
Posts: 3
Thanks for taking the time Noppid. I'll have to play with it when I get home tonight.
Bazkaz is offline   Reply With Quote
Old 06-06-2005   #3
Greg
Administrator
 
Greg's Avatar
 
Join Date: Feb 2003
Location: Florida
Posts: 5,173
Quote:
Originally Posted by Bazkaz
Thanks for taking the time Noppid. I'll have to play with it when I get home tonight.
I'll put together a working template folks can use to get started with and post it I guess.

That should be a big help.
__________________
Computers and Accessories Computer Manuals Riderinfo Connect for Bikers
Ad Revenue - Sell link space on your website and profit.
Greg is offline   Reply With Quote
Old 06-10-2005   #4
Greg
Administrator
 
Greg's Avatar
 
Join Date: Feb 2003
Location: Florida
Posts: 5,173
Ok, for those of you wanting to use this in FREEBS, I have created a variable conflict. One of the possible pitfalls of reusing code.

Anyhow, I've updated the Carp RSS Template to remove the conflict. If you need to do this, you can do a global search and replace of $keyword to perhaps $rss_keyword as I have.
__________________
Computers and Accessories Computer Manuals Riderinfo Connect for Bikers
Ad Revenue - Sell link space on your website and profit.
Greg is offline   Reply With Quote
Old 06-16-2005   #5
seeknulfind
Junior Member
 
Join Date: Jun 2005
Posts: 1
Hi Noppid,

Thanks for the great info and template!

One question for now...what does '&amp;ei=UTF-8&amp;fl=0&amp;x=wrt' mean? is this specific (ok one+ questions!) to the yahaoo feed or should it be used for other feeds as well?

Andy
seeknulfind is offline   Reply With Quote
Old 06-16-2005   #6
Greg
Administrator
 
Greg's Avatar
 
Join Date: Feb 2003
Location: Florida
Posts: 5,173
That is specific to yahoo.
__________________
Computers and Accessories Computer Manuals Riderinfo Connect for Bikers
Ad Revenue - Sell link space on your website and profit.
Greg is offline   Reply With Quote
Old 06-25-2005   #7
Evenrude
Junior Member
 
Join Date: Jun 2005
Posts: 1
great info!

I'll be sure to come back and check out the rest of your site.

Thanks!
Evenrude is offline   Reply With Quote
Old 12-14-2005   #8
Michael
Junior Member
 
Join Date: Jun 2005
Posts: 2
I found this very useful i must admit.
[URL=http://www.staff-lounge.com/vbulletin/]Here[/URL] is what i gathered together as a result.
Michael is offline   Reply With Quote
Old 12-14-2005   #9
Greg
Administrator
 
Greg's Avatar
 
Join Date: Feb 2003
Location: Florida
Posts: 5,173
Quote:
Originally Posted by Michael
I found this very useful i must admit.
Here is what i gathered together as a result.

Shhhh, don't tell everyone.
__________________
Computers and Accessories Computer Manuals Riderinfo Connect for Bikers
Ad Revenue - Sell link space on your website and profit.
Greg is offline   Reply With Quote
Old 03-16-2007   #10
dholt
Junior Member
 
Join Date: Mar 2007
Posts: 5
Hello, I'm sorry to be such a noob with this, and thanks for the template as I was not sure what to do or use.

I am using vbadvanced CMPS v2.2.1 and vBulletin® Version 3.6.5 on my site.

For one I am not understanding this template and how to add it. what I have done so far is:

1.installed carp and created a db for in in mysql, after I instaled it created a code for me that looks something like this but with the mysql info in it also.
PHP Code:
<?php
require_once '/YOUR/PATH/TO/carp/carp.php';
// Add any desired configuration settings before CarpCacheShow
// using "CarpConf" and other functions

CarpCacheShow('http://www.geckotribe.com/press/rss/pr.rss');
?>
2Created a new file with the code posted above and saved it to /forum/modules directory on server. Then added a new PHP file module, select that file as the file to include, and turn the "Clean File Output" setting on.

3Now I want to create the page, so I created a new "PHP File" page with the CMPS and entered the path to the template file you created as the for the "Path to File" setting. home/html/site/carp/template/Carp RSS News Feed Template.

This is what it is looking like and not like what you are talking about, I'm sure I'm doing a lot of things wrong here so if you can explain to me.

Thanks in advanced
[URL="http://www.delawarebulletin.com/index.php?page=yahoo"]Link to the page in Question [/URL]
dholt is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New AJAX Product for CARP RSS Greg Website Development 22 03-16-2007 08:03 AM
Carp RSS 3.5.6 Released Greg Website Administration 0 07-11-2005 01:09 PM
carp feed and freebs book store conflict? epitaph FREEBS PHP Amazon Book Store Support 3 06-11-2005 01:14 AM


All times are GMT -5. The time now is 01:42 PM.



vBulletin 3.8.7 Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright vB and Computer Help Forum

EZ software products copyright Greg Lynch 2006-2013