1

Topic: Installed mini portal getting error?

just installed the "mini portal" but recives error:

Notice: Undefined variable: output in /customers/zetterstrom.info/zetterstrom.info/httpd.www/lhs/index.php on line 29

website: http://www.zetterstrom.info/lhs/

and i also having trouble defining forum id, were do i get the forum id from my already created forums




/ Johan

It takes a big man to cry, but it takes a bigger man to laugh at that man.

2 (edited by scottywz 2005-06-20 00:56)

Re: Installed mini portal getting error?

Tell me what line 29 of index.php says.

And, for the forum ID, just look at the URL. Where it says ...viewforum.php?id=###, ### is the forum ID.

3

Re: Installed mini portal getting error?

row 29: if ( !$db->num_rows($result) ) return $output;


// Fetch $show topics
    $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, f.id AS fid, f.forum_name FROM '.$db_prefix.'topics AS t INNER JOIN '.$db_prefix.'forums AS f ON t.forum_id=f.id WHERE f.id='.$fid.' AND t.moved_to IS NULL ORDER BY '.$order_by.' DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
    $show_count = 0;
    if ( !$db->num_rows($result) ) return $output;
    while ( ($show_count < $show) && ($cur_topic = $db->fetch_assoc($result)) ) {
        $temp = '';
        if ($pun_config['o_censoring'] == '1')
            $cur_topic['subject'] = censor_words($cur_topic['subject']);
        if (pun_strlen($cur_topic['subject']) > $max_subject_length)
            $subject_truncated = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';
        else
            $subject_truncated = $cur_topic['subject'];
        $newsheading = '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.pun_htmlspecialchars($subject_truncated).'</a> - <em>Posted by '.$cur_topic['poster'].' at '.date('h:i A', $cur_topic['posted']).'</em><br>';
        // Group posts by date    
        $thisdate = date('l, d F Y', $cur_topic['posted']);
        if ($thisdate != $saveddate) 
        {
            if ($saveddate)
            {
                $temp .= "</div></div>";
It takes a big man to cry, but it takes a bigger man to laugh at that man.

Re: Installed mini portal getting error?

Do you find $output anywhere else in index.php?

5

Re: Installed mini portal getting error?

Make sure the forum_id is correct from which you want the news to be grabbed from.
You can get this forum_id by looking at either your db entry in phypmyadmin, or hover your mouse to the forum link and look for the link at the status bar i.e. viewforum.php?id=XX

Re: Installed mini portal getting error?

yeh the error is called by the forum id not existing

7

Re: Installed mini portal getting error?

/me learning from mistakes :-)

8 (edited by johan 2005-06-20 10:19)

Re: Installed mini portal getting error?

I have tryied every forum id in the forum all generates the same result

maybe i typed it in wrong?

i typed in the forum id on row 12 in index.php like this



function pun_news($fid='16', $show=5, $truncate=1)
{
    global $lang_common, $db, $pun_config, $db_prefix;
    $max_subject_length = 30;
    $show_max_topics = 50;
    $fid = intval($fid);
    $order_by = 't.posted';
    $forum_sql = '';
    // Was a forum ID supplied?
    if ( $fid ) $forum_sql = 'f.id='.$fid.' AND ';
    $show = intval($show);
    if ($show < 1 || $show > $show_max_topics)
    $show = 15;
    $saveddate="";

It takes a big man to cry, but it takes a bigger man to laugh at that man.

Re: Installed mini portal getting error?

no, you leave the function alone, you set the forum ID later on where it says pun_news(x,x,x) and also it should just be 16 not '16'

10

Re: Installed mini portal getting error?

Great! thats were i screwup. Thanx alot

now for another question. I wannt to seperate the topics from each other even if they are posted on the same date


       / Johan

It takes a big man to cry, but it takes a bigger man to laugh at that man.

Re: Installed mini portal getting error?

try replacing the pun_news function with

http://punbb.org/forums/viewtopic.php?pid=41647#p41647

its an alternative function it gives a comments button too

12

Re: Installed mini portal getting error?

Thanx. that was exactly what i wannted.



Thanx a bunch

It takes a big man to cry, but it takes a bigger man to laugh at that man.