douling8087 2016-01-03 14:35
浏览 38

来自Joomla数据库的RSS Generator

Something challenging....

I'm using a simple php code to generate RSS Feeds from my DB which is for my Joomla 3 website.

I managed to get the list of items from the database but now I'm struggling to get the correct link for each item.

Here is the code which populates the items with the links...

$results = $mysqli->query("SELECT * FROM bs_analiza ORDER by analiza_pk DESC");

if($results){ //we have records 
    while($row = $results->fetch_object()) //loop through each row
    {
        $item = $rss->addChild('item'); //add item node
        $title = $item->addChild('title', $row->h_team . " vs " . $row->a_team); //add title node under item
        $link = $item->addChild('link', 'http://dev.90mins.org/index.php?option=com_betting&view=pick&id='. $row->analiza_pk); //add link node under item
        $link->addAttribute('isPermaLink', 'false'); //add link node attribute

        $description = $item->addChild('description', '<![CDATA['. htmlentities($row->datum_ura) . ']]>'); //add description

        $date_rfc = gmdate(DATE_RFC2822, strtotime($row->published));
        $item = $item->addChild('pubDate', $date_rfc); //add pubDate node
    }
}

If I use simple link like www.my-site.com and add above will work but all items will point to the same page - www.my-site.com.

Any ideas how to attach unique links to items?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏