![]() |
|
|
|||||||
| Website Development Web development programming languanges, HTML, PHP, MySQL and design support. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Administrator
|
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.
__________________
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. |
|
|
|
|
|
#2 |
|
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.
|
|
|
|
|
|
#3 | |
|
Administrator
|
Quote:
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. |
|
|
|
|
|
|
#4 |
|
Administrator
|
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. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jun 2005
Posts: 1
|
Hi Noppid,
Thanks for the great info and template! One question for now...what does '&ei=UTF-8&fl=0&x=wrt' mean? is this specific (ok one+ questions!) to the yahaoo feed or should it be used for other feeds as well? Andy |
|
|
|
|
|
#6 |
|
Administrator
|
That is specific to yahoo.
__________________
Computers and Accessories Computer Manuals Riderinfo Connect for Bikers Ad Revenue - Sell link space on your website and profit. |
|
|
|
|
|
#7 |
|
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! |
|
|
|
|
|
#8 |
|
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. |
|
|
|
|
|
#9 | |
|
Administrator
|
Quote:
Shhhh, don't tell everyone.
__________________
Computers and Accessories Computer Manuals Riderinfo Connect for Bikers Ad Revenue - Sell link space on your website and profit. |
|
|
|
|
|
|
#10 |
|
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:
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] |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |