[ Video Sharing CMS v4 ] Category RSS feed

Started by korobert,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

korobertTopic starter

How can i generate category selected RSS Feed?

Thanks Robert
  •  

Marius P.


Hi, same code as for feed type, but query the category, example (feed.php):



if(_get("m") && (intval(_get("m")) > 0)) {
$vq = "select ".$options.", ".DB_PREFIX."users.name as owner FROM ".DB_PREFIX."videos LEFT JOIN ".DB_PREFIX."channels ON ".DB_PREFIX."videos.category =".DB_PREFIX."channels.cat_id  LEFT JOIN ".DB_PREFIX."users ON ".DB_PREFIX."videos.user_id = ".DB_PREFIX."users.id WHERE ".DB_PREFIX."videos.views >= 0 and ".DB_PREFIX."videos.pub > 0 and ".DB_PREFIX."videos.media ='".intval(_get("m"))."' ORDER BY ".DB_PREFIX."videos.id DESC ".this_limit();
} else {



turned to





if(_get("m") && (intval(_get("m")) > 0)) {
$vq = "select ".$options.", ".DB_PREFIX."users.name as owner FROM ".DB_PREFIX."videos LEFT JOIN ".DB_PREFIX."channels ON ".DB_PREFIX."videos.category =".DB_PREFIX."channels.cat_id  LEFT JOIN ".DB_PREFIX."users ON ".DB_PREFIX."videos.user_id = ".DB_PREFIX."users.id WHERE ".DB_PREFIX."videos.views >= 0 and ".DB_PREFIX."videos.pub > 0 and ".DB_PREFIX."videos.media ='".intval(_get("m"))."' ORDER BY ".DB_PREFIX."videos.id DESC ".this_limit();
} elseif(_get("c") && (intval(_get("c")) > 0)) {
$vq = "select ".$options.", ".DB_PREFIX."users.name as owner FROM ".DB_PREFIX."videos LEFT JOIN ".DB_PREFIX."channels ON ".DB_PREFIX."videos.category =".DB_PREFIX."channels.cat_id  LEFT JOIN ".DB_PREFIX."users ON ".DB_PREFIX."videos.user_id = ".DB_PREFIX."users.id WHERE ".DB_PREFIX."videos.views >= 0 and ".DB_PREFIX."videos.pub > 0 and ".DB_PREFIX."videos.category ='".intval(_get("c"))."' ORDER BY ".DB_PREFIX."videos.id DESC ".this_limit();
}else {



This way if you go to :


www.yoursite.com/feed?c=1



It will show the rss with the videos in the category with the id 1.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

korobertTopic starter

Thanks

how can i random feed generate from category?
  •  

Marius P.

ORDER BY ".DB_PREFIX."videos.id DESC


changed to


ORDER BY rand()
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

korobertTopic starter

  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

korobertTopic starter

I want on feed list only 10 feeds, or only 1.
  •  

Marius P.

Once again, based on what? The top 10 should be made with video select by which algorithm (views, likes, etc)?
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

Similar topics (7)