1
krauh
Adding Yahoo Ads to RSS Feeds via backend.php
  • 2005/12/16 16:40

  • krauh

  • Just popping in

  • Posts: 70

  • Since: 2005/2/25


Anyone know if its possible to make this code work with the backend.php and where or how you would add it into the XOOPS coding so it will attach the ads to feeds?


Heres The Yahoo Ads Code:
:lol:/() ?>/click/">rss/:lol:/() ?>/img/?url=echo urlencode(get_permalink
()) ?>&pid=" :-P " alt="Ads by Yahoo!" border="0"/>





Heres The backend.php:
// $Id: backend.php,v 1.13 2004/12/26 19:11:47 Onokazu Exp $
{gnu comment removed to make this shorter}

include 
'mainfile.php';
include_once 
XOOPS_ROOT_PATH.'/class/template.php';
include_once 
XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
if (
function_exists('mb_http_output')) {
    
mb_http_output('pass');
}
header ('Content-Type:text/xml; charset=utf-8');
$tpl = new XoopsTpl();
$tpl->xoops_setCaching(2);
$tpl->xoops_setCacheTime(3600);
if (!
$tpl->is_cached('db:system_rss.html')) {
    
$sarray NewsStory::getAllPublished(100);
    if (
is_array($sarray)) {
        
$tpl->assign('channel_title'xoops_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
        
$tpl->assign('channel_link'XOOPS_URL.'/');
        
$tpl->assign('channel_desc'xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
        
$tpl->assign('channel_lastbuild'formatTimestamp(time(), 'rss'));
        
$tpl->assign('channel_webmaster'$xoopsConfig['adminmail']);
        
$tpl->assign('channel_editor'$xoopsConfig['adminmail']);
        
$tpl->assign('channel_category''News');
        
$tpl->assign('channel_generator''XOOPS');
        
$tpl->assign('channel_language'_LANGCODE);
        
$tpl->assign('image_url'XOOPS_URL.'/images/logo.gif');
        
$dimention getimagesize(XOOPS_ROOT_PATH.'/images/logo.gif');
        if (empty(
$dimention[0])) {
            
$width 88;
        } else {
            
$width = ($dimention[0] > 144) ? 144 $dimention[0];
        }
        if (empty(
$dimention[1])) {
            
$height 31;
        } else {
            
$height = ($dimention[1] > 400) ? 400 $dimention[1];
        }
        
$tpl->assign('image_width'$width);
        
$tpl->assign('image_height'$height);
        
$count $sarray;
        foreach (
$sarray as $story) {
            
$tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($story->title(), ENT_QUOTES)), 'link' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'guid' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode(htmlspecialchars($story->hometext(), ENT_QUOTES))));
        }
    }
}
$tpl->display('db:system_rss.html');
?>




So where would you stick it? Or How could it be added to feeds?

Login

Who's Online

482 user(s) are online (409 user(s) are browsing Support Forums)


Members: 0


Guests: 482


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits