Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 12-23-2005, 04:18 AM
se.nsuo.us Offline
pixelpost guru
 
Join Date: Dec 2005
Location: Somewhere in India
Posts: 624
Categories tag in RSS feed

As many of you might be aware that RSS search engines use the <category> tag for the items in RSS feed to classify/tag the items making them easier to find in tags/categories that *you* have specified. PP does not add this tag - to remedy this I hacked the following code into index.php -

Add just below line - $body = strip_tags( $body );

PHP Code:
$query2 mysql_query("SELECT {$pixelpost_db_prefix}categories.name FROM {$pixelpost_db_prefix}catassoc , {$pixelpost_db_prefix}categories WHERE {$pixelpost_db_prefix}categories.id = {$pixelpost_db_prefix}catassoc.cat_id AND image_id = $id");
$categories "";
while(list(
$category) = mysql_fetch_row($query2)){
     
$categories .="<category>$category</category>";

Then just add $categories to the $output - just after </link> should be fine

However do note that it is not a good policy to hack index.php unless you realise all the risks and headaches involved (read you will have to redo all the changes in next upgrade) on second thoughts it would be good idea to add this code to the main distribution itself

Devs?
__________________
http://se.nsuo.us - A photoblog of sensual, abstract nudes [may not be work safe for some]
My Pixelpost Addons, Cheesecake-Photoblog Software
Reply With Quote
  #2  
Old 12-23-2005, 08:45 AM
tinyblob's Avatar
tinyblob Offline
team pixelpost
 
Join Date: Nov 2005
Location: scotland
Posts: 523
very good post, glad you put the warning in there

if you're interested in syndication/tags with reference to pixelpost i may get in touch with you, i'm working on something you might be interested in.
__________________
touchnothing.net
Reply With Quote
  #3  
Old 12-23-2005, 08:52 AM
se.nsuo.us Offline
pixelpost guru
 
Join Date: Dec 2005
Location: Somewhere in India
Posts: 624
@tinyblob - sure send me a message, I would be very interested to see what is being done...
__________________
http://se.nsuo.us - A photoblog of sensual, abstract nudes [may not be work safe for some]
My Pixelpost Addons, Cheesecake-Photoblog Software
Reply With Quote
  #4  
Old 12-23-2005, 12:41 PM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
it will be part of the next main release.

thanks!
Reply With Quote
  #5  
Old 12-23-2005, 01:27 PM
tinyblob's Avatar
tinyblob Offline
team pixelpost
 
Join Date: Nov 2005
Location: scotland
Posts: 523
Quote:
Originally Posted by Joe[y]
it will be part of the next main release.
surely you mean.. "we'll keep this in mind for the next main release"
__________________
touchnothing.net
Reply With Quote
  #6  
Old 12-23-2005, 02:51 PM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
yeah. what he said ^
Reply With Quote
  #7  
Old 09-17-2007, 10:20 AM
raztazor Offline
forum loafer
 
Join Date: Sep 2007
Location: London, United Kingdom
Posts: 18
Thumbs up 1.6 Pixel post and categories in RSS/ATOM Feed

Quote:
Originally Posted by se.nsuo.us View Post
As many of you might be aware that RSS search engines use the <category> tag for the items in RSS feed to classify/tag the items making them easier to find in tags/categories that *you* have specified. PP does not add this tag - to remedy this I hacked the following code into index.php -

Add just below line - $body = strip_tags( $body );

PHP Code:
$query2 mysql_query("SELECT {$pixelpost_db_prefix}categories.name FROM {$pixelpost_db_prefix}catassoc , {$pixelpost_db_prefix}categories WHERE {$pixelpost_db_prefix}categories.id = {$pixelpost_db_prefix}catassoc.cat_id AND image_id = $id");
$categories "";
while(list(
$category) = mysql_fetch_row($query2)){
     
$categories .="<category>$category</category>";

Then just add $categories to the $output - just after </link> should be fine

However do note that it is not a good policy to hack index.php unless you realise all the risks and headaches involved (read you will have to redo all the changes in next upgrade) on second thoughts it would be good idea to add this code to the main distribution itself

Devs?
Hi

I've just implemented PP1.6 and thought I'd share an update to this original posting as I found this code really useful.

If you use PP 1.6 the place to implement the modified code is in includes/function_feeds.php.

I use feedburner for my RSS feed http://feeds.feedburner.com/AndrewsPhotoblog which uses an ATOM feed as a source and then wraps it up as RSS with frills. As such I had to modify the ATOM feed to include categories. The code is very similar except for ATOM categories the $$categories variable should be built up like this.

Code:
$categories .="<category scheme='http://www.yoururl.com/atom/ns#' term='$category'/>";
Note: The URL in the code can be a dummy one as it's not needed. The categories still appear in my RSS feedburner feed and technorati.

Thanks for the original post and the code.

Andrew
http://www.andrewor.com
Reply With Quote
  #8  
Old 09-22-2007, 01:25 AM
Laprodo Offline
forum loafer
 
Join Date: Sep 2007
Posts: 10
How can I insert tags? I mean which XML-Tag I need? "tag"?
Reply With Quote
  #9  
Old 09-22-2007, 08:06 AM
Laprodo Offline
forum loafer
 
Join Date: Sep 2007
Posts: 10
According to http://www.rssboard.org/rss-2-0#hrelementsOfLtitemgt is there no tag for "tag"
Reply With Quote
  #10  
Old 09-23-2007, 08:51 AM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
Ill write in some time about tags in RSS feed as I got it
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 10:28 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs