|
Posted by Meco on 12/30/06 16:41
Got an answer.
$rss->$items_limit = $row['rss_limit'];
should be
$rss->items_limit = $row['rss_limit'];
"Meco" <meco@ofir.dk> skrev i en meddelelse
news:45966bac$0$4153$ba624c82@nntp02.dk.telia.net...
>I got a message: "Fatal error: Cannot access empty property in
> /usr/home/web/*my username*/includes/portal_rss.php on line 22"
>
> This is the file, but I can΄t figure it out - Maybe you can help me ?
>
> Thanks.
>
> <?php
> if ( !defined('IN_PHPBB') )
> {
> die("Hacking attempt");
> }
>
>
> // Portal block #1
> $sql = "SELECT * FROM ".RSS_TABLE."
> WHERE rss_location = 3
> AND rss_enable = 1";
>
> if(!$result = $db->sql_query($sql))
> {
> message_die(GENERAL_ERROR, "Could not query RSS news information",
> "", __LINE__, __FILE__, $sql);
> }
>
> $rss_rows = array();
> $row = $db->sql_fetchrow($result);
>
> $rss = new rss();
> $rss->$items_limit = $row['rss_limit'];
> $rss_items = $rss->Get($row['rss_url']);
>
> if($rss_items['items_count'] != 0)
> {
> $template->assign_block_vars("rss_block1", array());
> }
>
> $max_rss = ($rss_items['items_count'] < $row['rss_limit']) ?
> $rss_items['items_count'] : $row['rss_limit'];
> for($i=0;$i<$max_rss;$i++)
> {
> $template->assign_block_vars("rss_block1.rss_portal", array(
> 'RSS_ARTC_TITLE' => "<a
> href=\"".$rss_items['items'][$i]['link']."\"
> target=\"_child\">".$rss_items['items'][$i]['title']."</a>",
> 'RSS_ARTC_TIME' =>
> $rss_items['items'][$i]['date'],
> )
> );
> }
>
>
> // Portal block #2
> $sql = "SELECT * FROM ".RSS_TABLE."
> WHERE rss_location = 4
> AND rss_enable = 1";
>
> if(!$result = $db->sql_query($sql))
> {
> message_die(GENERAL_ERROR, "Could not query RSS news information",
> "", __LINE__, __FILE__, $sql);
> }
>
> $row1 = $db->sql_fetchrow($result);
>
> $rss1 = new rss();
> $rss1->$items_limit = $row1['rss_limit'];
> $rss_items1 = $rss1->Get($row1['rss_url']);
>
> if($rss_items1['items_count'] != 0)
> {
> $template->assign_block_vars("rss_block2", array());
> }
>
> $max_rss1 = ($rss_items1['items_count'] < $row1['rss_limit']) ?
> $rss_items1['items_count'] : $row1['rss_limit'];
> for($i=0;$i<$max_rss1;$i++)
> {
> $template->assign_block_vars("rss_block2.rss_portal2", array(
> 'RSS_ARTC_TITLE' => "<a
> href=\"".$rss_items1['items'][$i]['link']."\"
> target=\"_child\">".$rss_items1['items'][$i]['title']."</a>",
> 'RSS_ARTC_TIME' =>
> $rss_items1['items'][$i]['date'],
> )
> );
> }
> ?>
>
>
Navigation:
[Reply to this message]
|