vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Forums arranged in columns on forumhome (https://vborg.vbsupport.ru/showthread.php?t=99829)

Cheertobi 12-18-2005 07:42 PM

Quote:

Originally Posted by teedizz
he wants to know the exact steps in centering the forum name & description next to the forum icon.

Ah, ok ;)

The white line is a css issue, you have to check yoir css for something like border-left 1px and set that to 0px! Sorry, I do not use the standardstyle, so I cannot say right now, what style to change in your css!

For the second "problem" try this code in forumhome_forumbit_columncell:

Code:

<td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]" width="$column_width">
        <table>
                <tr>
                        <td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
                        <td><a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
                                        <if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if></td>
                </tr>
        </table>
</td>

As said before, I use a different style, but this should work.

Tobi

MSheraz86 12-18-2005 07:59 PM

Hi, I've tried every possible answer from this thread and the 3.0 thread but I cannot seem to get anywhere NEAR this mod at all :(

https://vborg.vbsupport.ru/

That's how my forum looks like with this mod installed and pretty much without. What am i doing wrong????? :(

teedizz 12-18-2005 08:13 PM

Quote:

Originally Posted by Cheertobi
Ah, ok ;)

The white line is a css issue, you have to check yoir css for something like border-left 1px and set that to 0px! Sorry, I do not use the standardstyle, so I cannot say right now, what style to change in your css!

For the second "problem" try this code in forumhome_forumbit_columncell:

Code:

<td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]" width="$column_width">
        <table>
                <tr>
                        <td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
                        <td><a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
                                        <if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if></td>
                </tr>
        </table>
</td>

As said before, I use a different style, but this should work.

Tobi


Worked perfectly. Thank you

teedizz 12-18-2005 08:20 PM

Quote:

Originally Posted by MSheraz86
Hi, I've tried every possible answer from this thread and the 3.0 thread but I cannot seem to get anywhere NEAR this mod at all :(

http://img486.imageshack.us/img486/2222/forum3bi.th.jpg

That's how my forum looks like with this mod installed and pretty much without. What am i doing wrong????? :(


Are you changing how many columns you wanna display under forums manager?

MSheraz86 12-18-2005 09:03 PM

I go to Forum Manager > Edit forum > Show Subforums in # of columns: 2

That's what i've done for the top side of the forums and it isn't having any effect :(. I've also tried 3 and 4 but no use either.

Guest190829 12-19-2005 12:57 AM

If you want this to work with Chris M's Cust Forum Status Icons Modification just replace Xenon's function with the following:

PHP Code:

// ###################### Start construct_forum_columns #######################
function construct_forum_columns($parentid$columncount)
{
    global 
$vbulletin$stylevar$vbphrase$show;
    global 
$imodcache$lastpostarray$counters$inforum;

    
// this function takes the constant MAXFORUMDEPTH as its guide for how
    // deep to recurse down forum lists. if MAXFORUMDEPTH is not defined,
    // it will assume a depth of 2.

    
if ($columncount == 0)
    {
        
// 0 Columns means don't show subforums at all
        
return '';
    }

    
// call fetch_last_post_array() first to get last post info for forums
    
if (!is_array($lastpostarray))
    {
        
fetch_last_post_array();
    }

    if (empty(
$vbulletin->iforumcache["$parentid"]))
    {
        return;
    }

    if (!
defined(MAXFORUMDEPTH))
    {
        
define('MAXFORUMDEPTH'1);
    }

    
$forumbits '';

    
$counter 0;
    foreach (
$vbulletin->iforumcache["$parentid"] AS $forumid)
    {
        
// grab the appropriate forum from the $vbulletin->forumcache
        
$forum $vbulletin->forumcache["$forumid"];
        
$lastpostforum $vbulletin->forumcache["$lastpostarray[$forumid]"];
        if (!
$forum['displayorder'] OR !($forum['options'] & $vbulletin->bf_misc_forumoptions['active']))
        {
            continue;
        }

        
$forumperms $vbulletin->userinfo['forumpermissions']["$forumid"];
        
$lastpostforumperms $vbulletin->userinfo['forumpermissions']["$lastpostarray[$forumid]"];
        if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums'])
        { 
// no permission to view current forum
            
continue;
        }

        if (
$subsonly)
        {
            
$childforumbits construct_forum_bit($forum['forumid'], 1$subsonly);
        }
        else if (
$depth MAXFORUMDEPTH)
        {
            
$childforumbits construct_forum_bit($forum['forumid'], $depth$subsonly);
        }
        else
        {
            
$childforumbits '';
        }

        
// do stuff if we are not doing subscriptions only, or if we ARE doing subscriptions,
        // and the forum has a subscribedforumid
        
if (!$subsonly OR ($subsonly AND !empty($forum['subscribeforumid'])))
        {

            
$GLOBALS['forumshown'] = true// say that we have shown at least one forum

            
if (($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads']))
            { 
// get appropriate suffix for template name
                
$tempext '_post';
            }
            else

            {
                
$tempext '_nopost';
            }

            if (!
$vbulletin->options['showforumdescription'])
            { 
// blank forum description if set to not show
                
$forum['description'] = '';
            }

            
// dates & thread title
            
$lastpostinfo $vbulletin->forumcache["$lastpostarray[$forumid]"];

            
// compare last post time for this forum with the last post time specified by
            // the $lastpostarray, and if it's less, use the last post info from the forum
            // specified by $lastpostarray
            
if ($vbulletin->forumcache["$lastpostarray[$forumid]"]['lastpost'] > 0)
            {
                if (!(
$lastpostforumperms $vbulletin->bf_ugp_forumpermissions['canview']) OR (!($lastpostforumperms $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $lastpostinfo['lastposter'] != $vbulletin->userinfo['username']))
                {
                    
$forum['lastpostinfo'] = $vbphrase['private'];
                }
                else
                {
                    
$lastpostinfo['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $lastpostinfo['lastpost'], 1);
                    
$lastpostinfo['lastposttime'] = vbdate($vbulletin->options['timeformat'], $lastpostinfo['lastpost']);
                    
$lastpostinfo['trimthread'] = fetch_trimmed_title($lastpostinfo['lastthread']);

                    if (
$icon fetch_iconinfo($lastpostinfo['lasticonid']))
                    {
                        
$show['icon'] = true;
                    }
                    else
                    {
                        
$show['icon'] = false;
                    }

                    
$show['lastpostinfo'] = (!$lastpostforum['password'] OR verify_forum_password($lastpostforum['forumid'], $lastpostforum['password'], false));

                    eval(
'$forum[\'lastpostinfo\'] = "' fetch_template('forumhome_lastpostby') . '";');
                }
            }
            else if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canview']))
            {
                
$forum['lastpostinfo'] = $vbphrase['private'];
            }
            else
            {
                
$forum['lastpostinfo'] = $vbphrase['never'];
            }

            
// do light bulb
            
$forum['statusicon'] = fetch_forum_lightbulb($forumid$lastpostinfo$forum);
            
$show['customstatusicon'] = false;
if (
$forum['hasstatusicons'])
{
    
$show['customstatusicon'] = true;
    if (
$forum['statusicon'] == 'new')
    {
        
$forum['customicon'] = $forum['statusiconon'];
    }
    if (
$forum['statusicon'] == 'new_lock')
    {
        
$forum['customicon'] = $forum['statusiconlockon'];
    }
    if (
$forum['statusicon'] == 'old')
    {
        
$forum['customicon'] = $forum['statusiconoff'];
    }
    if (
$forum['statusicon'] == 'old_lock')
    {
        
$forum['customicon'] = $forum['statusiconlockoff'];
    }
    if (
$forum['statusicon'] == 'link')
    {
        
$forum['customicon'] = $forum['statusiconlink'];
    }
}

            
// add lock to lightbulb if necessary
            
if ((!($forumperms $vbulletin->bf_ugp_forumpermissions['canpostnew']) OR !($forum['options'] & $vbulletin->bf_misc_forumoptions['allowposting'])) AND $vbulletin->options['showlocks'] AND !$forum['link'])
            {
                
$forum['statusicon'] .= '_lock';
            }

            
// get counters from the counters cache ( prepared by fetch_last_post_array() )
            
$forum['threadcount'] = $counters["$forum[forumid]"]['threadcount'];
            
$forum['replycount'] = $counters["$forum[forumid]"]['replycount'];

            
// get moderators ( this is why we needed cache_moderators() )
            
if ($vbulletin->options['showmoderatorcolumn'])
            {
                
$showmods = array();
                
$listexploded explode(','$forum['parentlist']);
                foreach (
$listexploded AS $parentforumid)
                {
                    if (!isset(
$imodcache["$parentforumid"]))
                    {
                        continue;
                    }
                    foreach(
$imodcache["$parentforumid"] AS $moderator)
                    {
                        if (isset(
$showmods["$moderator[userid]"]))
                        {
                            continue;
                        }

                        (
$hook vBulletinHook::fetch_hook('forumbit_moderator')) ? eval($hook) : false;

                        
$showmods["$moderator[userid]"] = true;
                        if (!isset(
$forum['moderators']))
                        {
                            eval(
'$forum[\'moderators\'] = "' fetch_template('forumhome_moderator') . '";');
                        }
                        else
                        {
                            eval(
'$forum[\'moderators\'] .= ", ' fetch_template('forumhome_moderator') . '";');
                        }
                    }
                }
                if (!isset(
$forum['moderators']))
                {
                    
$forum['moderators'] = '';
                }
            }

            if (
$forum['link'])
            {
                
$forum['replycount'] = '-';
                
$forum['threadcount'] = '-';
                
$forum['lastpostinfo'] = '-';
            }
            else
            {
                
$forum['replycount'] = vb_number_format($forum['replycount']);
                
$forum['threadcount'] = vb_number_format($forum['threadcount']);
            }

            if ((
$subsonly OR $depth == MAXFORUMDEPTH) AND $vbulletin->options['subforumdepth'] > 0)
            {
                
$forum['subforums'] = construct_subforum_bit($forumid, ($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads'] ) );
            }
            else
            {
                
$forum['subforums'] = '';
            }

            
$children explode(','$forum['childlist']);
            foreach(
$children AS $childid)
            {
                
$forum['browsers'] += ($inforum["$childid"] ? $inforum["$childid"] : 0);
            }

            if (
$depth == AND $tempext == '_nopost')
            {
                global 
$vbcollapse;
                
$collapseobj_forumid =& $vbcollapse["collapseobj_forumbit_$forumid"];
                
$collapseimg_forumid =& $vbcollapse["collapseimg_forumbit_$forumid"];
                
$show['collapsebutton'] = true;
            }
            else
            {
                
$show['collapsebutton'] = false;
            }

            
$show['forumsubscription'] = ($subsonly true false);
            
$show['forumdescription'] = ($forum['description'] != '' true false);
            
$show['subforums'] = ($forum['subforums'] != '' true false);
            
$show['browsers'] = ($vbulletin->options['displayloggedin'] AND !$forum['link'] AND $forum['browsers'] ? true false);

            
// build the template for the current forum
            
$column_width intval(100 $columncount) . '%';
            eval(
'$column = "' fetch_template("forumhome_forumbit_columncell") . '";');
            
            
// do the columnstuff
            
if ($counter $columncount == 0)
            {
                
// Begin a new row
                
$forumbits .= "\t<tr>\n";
            }
            
$forumbits .= $column;
            if (
$counter $columncount == $columncount 1)
            {
                
// End row
                
$forumbits .= "\t</tr>\n";
            }
            
$counter++;
        }
    }

    
// prevent unclosed <tr> tags
    
if ($counter $columncount != 0)
    {
        
$forumbits .= "\t</tr>\n";
    }
    
    return 
$forumbits;


And follow this template change:

Quote:

Originally Posted by Chris M
Edit [high]forumhome_forumbit_columncell[/high]
Change:
Code:

<img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" />
to
Code:

<img src="<if condition="$show['customstatusicon']">$forum[customicon]<else />$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif</if>" alt="" border="0" />
That should change it for you :)

Chris

And it should know work correctly....

MSheraz86 12-19-2005 02:09 AM

This is the error I receive:

Fatal error: Cannot redeclare construct_forum_columns() (previously declared in /home/username/public_html/forum/includes/functions_forumlist.php:312) in /home/username/public_html/forum/includes/functions_forumlist.php on line 312


my functions_forumlist.php looks like this (As it does not state in the instructions properly where to insert it so i inserted it right after the first instruction that is in the txt file)

PHP Code:

        if ($vbulletin->userinfo['field7'] == 'yes' AND THIS_SCRIPT == 'index' AND $forum['subforumcolumns'] != AND ($subsonly OR $depth MAXFORUMDEPTH))
        {
            
$childforumbits construct_forum_columns($forum['forumid'], $forum['subforumcolumns']);
        }
        else if (
$subsonly)
        {
            
$childforumbits construct_forum_bit($forum['forumid'], 1$subsonly);
        }
        else if (
$depth MAXFORUMDEPTH)
        {
            
$childforumbits construct_forum_bit($forum['forumid'], $depth$subsonly);
        }
        else
        {
            
$childforumbits '';
        }

// ###################### Start construct_forum_columns #######################
function construct_forum_columns($parentid$columncount)
{
    global 
$vbulletin$stylevar$vbphrase$show;
    global 
$imodcache$lastpostarray$counters$inforum;

    
// this function takes the constant MAXFORUMDEPTH as its guide for how
    // deep to recurse down forum lists. if MAXFORUMDEPTH is not defined,
    // it will assume a depth of 2.

    
if ($columncount == 0)
    {
        
// 0 Columns means don't show subforums at all
        
return '';
    }

    
// call fetch_last_post_array() first to get last post info for forums
    
if (!is_array($lastpostarray))
    {
        
fetch_last_post_array();
    }

    if (empty(
$vbulletin->iforumcache["$parentid"]))
    {
        return;
    }

    if (!
defined(MAXFORUMDEPTH))
    {
        
define('MAXFORUMDEPTH'1);
    }

    
$forumbits '';

    
$counter 0;
    foreach (
$vbulletin->iforumcache["$parentid"] AS $forumid)
    {
        
// grab the appropriate forum from the $vbulletin->forumcache
        
$forum $vbulletin->forumcache["$forumid"];
        
$lastpostforum $vbulletin->forumcache["$lastpostarray[$forumid]"];
        if (!
$forum['displayorder'] OR !($forum['options'] & $vbulletin->bf_misc_forumoptions['active']))
        {
            continue;
        }

        
$forumperms $vbulletin->userinfo['forumpermissions']["$forumid"];
        
$lastpostforumperms $vbulletin->userinfo['forumpermissions']["$lastpostarray[$forumid]"];
        if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums'])
        { 
// no permission to view current forum
            
continue;
        }

        if (
$subsonly)
        {
            
$childforumbits construct_forum_bit($forum['forumid'], 1$subsonly);
        }
        else if (
$depth MAXFORUMDEPTH)
        {
            
$childforumbits construct_forum_bit($forum['forumid'], $depth$subsonly);
        }
        else
        {
            
$childforumbits '';
        }

        
// do stuff if we are not doing subscriptions only, or if we ARE doing subscriptions,
        // and the forum has a subscribedforumid
        
if (!$subsonly OR ($subsonly AND !empty($forum['subscribeforumid'])))
        {

            
$GLOBALS['forumshown'] = true// say that we have shown at least one forum

            
if (($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads']))
            { 
// get appropriate suffix for template name
                
$tempext '_post';
            }
            else

            {
                
$tempext '_nopost';
            }

            if (!
$vbulletin->options['showforumdescription'])
            { 
// blank forum description if set to not show
                
$forum['description'] = '';
            }

            
// dates & thread title
            
$lastpostinfo $vbulletin->forumcache["$lastpostarray[$forumid]"];

            
// compare last post time for this forum with the last post time specified by
            // the $lastpostarray, and if it's less, use the last post info from the forum
            // specified by $lastpostarray
            
if ($vbulletin->forumcache["$lastpostarray[$forumid]"]['lastpost'] > 0)
            {
                if (!(
$lastpostforumperms $vbulletin->bf_ugp_forumpermissions['canview']) OR (!($lastpostforumperms $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $lastpostinfo['lastposter'] != $vbulletin->userinfo['username']))
                {
                    
$forum['lastpostinfo'] = $vbphrase['private'];
                }
                else
                {
                    
$lastpostinfo['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $lastpostinfo['lastpost'], 1);
                    
$lastpostinfo['lastposttime'] = vbdate($vbulletin->options['timeformat'], $lastpostinfo['lastpost']);
                    
$lastpostinfo['trimthread'] = fetch_trimmed_title($lastpostinfo['lastthread']);

                    if (
$icon fetch_iconinfo($lastpostinfo['lasticonid']))
                    {
                        
$show['icon'] = true;
                    }
                    else
                    {
                        
$show['icon'] = false;
                    }

                    
$show['lastpostinfo'] = (!$lastpostforum['password'] OR verify_forum_password($lastpostforum['forumid'], $lastpostforum['password'], false));

                    eval(
'$forum[\'lastpostinfo\'] = "' fetch_template('forumhome_lastpostby') . '";');
                }
            }
            else if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canview']))
            {
                
$forum['lastpostinfo'] = $vbphrase['private'];
            }
            else
            {
                
$forum['lastpostinfo'] = $vbphrase['never'];
            }

            
// do light bulb
            
$forum['statusicon'] = fetch_forum_lightbulb($forumid$lastpostinfo$forum);
            
$show['customstatusicon'] = false;
if (
$forum['hasstatusicons'])
{
    
$show['customstatusicon'] = true;
    if (
$forum['statusicon'] == 'new')
    {
        
$forum['customicon'] = $forum['statusiconon'];
    }
    if (
$forum['statusicon'] == 'new_lock')
    {
        
$forum['customicon'] = $forum['statusiconlockon'];
    }
    if (
$forum['statusicon'] == 'old')
    {
        
$forum['customicon'] = $forum['statusiconoff'];
    }
    if (
$forum['statusicon'] == 'old_lock')
    {
        
$forum['customicon'] = $forum['statusiconlockoff'];
    }
    if (
$forum['statusicon'] == 'link')
    {
        
$forum['customicon'] = $forum['statusiconlink'];
    }
}

            
// add lock to lightbulb if necessary
            
if ((!($forumperms $vbulletin->bf_ugp_forumpermissions['canpostnew']) OR !($forum['options'] & $vbulletin->bf_misc_forumoptions['allowposting'])) AND $vbulletin->options['showlocks'] AND !$forum['link'])
            {
                
$forum['statusicon'] .= '_lock';
            }

            
// get counters from the counters cache ( prepared by fetch_last_post_array() )
            
$forum['threadcount'] = $counters["$forum[forumid]"]['threadcount'];
            
$forum['replycount'] = $counters["$forum[forumid]"]['replycount'];

            
// get moderators ( this is why we needed cache_moderators() )
            
if ($vbulletin->options['showmoderatorcolumn'])
            {
                
$showmods = array();
                
$listexploded explode(','$forum['parentlist']);
                foreach (
$listexploded AS $parentforumid)
                {
                    if (!isset(
$imodcache["$parentforumid"]))
                    {
                        continue;
                    }
                    foreach(
$imodcache["$parentforumid"] AS $moderator)
                    {
                        if (isset(
$showmods["$moderator[userid]"]))
                        {
                            continue;
                        }

                        (
$hook vBulletinHook::fetch_hook('forumbit_moderator')) ? eval($hook) : false;

                        
$showmods["$moderator[userid]"] = true;
                        if (!isset(
$forum['moderators']))
                        {
                            eval(
'$forum[\'moderators\'] = "' fetch_template('forumhome_moderator') . '";');
                        }
                        else
                        {
                            eval(
'$forum[\'moderators\'] .= ", ' fetch_template('forumhome_moderator') . '";');
                        }
                    }
                }
                if (!isset(
$forum['moderators']))
                {
                    
$forum['moderators'] = '';
                }
            }

            if (
$forum['link'])
            {
                
$forum['replycount'] = '-';
                
$forum['threadcount'] = '-';
                
$forum['lastpostinfo'] = '-';
            }
            else
            {
                
$forum['replycount'] = vb_number_format($forum['replycount']);
                
$forum['threadcount'] = vb_number_format($forum['threadcount']);
            }

            if ((
$subsonly OR $depth == MAXFORUMDEPTH) AND $vbulletin->options['subforumdepth'] > 0)
            {
                
$forum['subforums'] = construct_subforum_bit($forumid, ($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads'] ) );
            }
            else
            {
                
$forum['subforums'] = '';
            }

            
$children explode(','$forum['childlist']);
            foreach(
$children AS $childid)
            {
                
$forum['browsers'] += ($inforum["$childid"] ? $inforum["$childid"] : 0);
            }

            if (
$depth == AND $tempext == '_nopost')
            {
                global 
$vbcollapse;
                
$collapseobj_forumid =& $vbcollapse["collapseobj_forumbit_$forumid"];
                
$collapseimg_forumid =& $vbcollapse["collapseimg_forumbit_$forumid"];
                
$show['collapsebutton'] = true;
            }
            else
            {
                
$show['collapsebutton'] = false;
            }

            
$show['forumsubscription'] = ($subsonly true false);
            
$show['forumdescription'] = ($forum['description'] != '' true false);
            
$show['subforums'] = ($forum['subforums'] != '' true false);
            
$show['browsers'] = ($vbulletin->options['displayloggedin'] AND !$forum['link'] AND $forum['browsers'] ? true false);

            
// build the template for the current forum
            
$column_width intval(100 $columncount) . '%';
            eval(
'$column = "' fetch_template("forumhome_forumbit_columncell") . '";');
            
            
// do the columnstuff
            
if ($counter $columncount == 0)
            {
                
// Begin a new row
                
$forumbits .= "\t<tr>\n";
            }
            
$forumbits .= $column;
            if (
$counter $columncount == $columncount 1)
            {
                
// End row
                
$forumbits .= "\t</tr>\n";
            }
            
$counter++;
        }
    }

    
// prevent unclosed <tr> tags
    
if ($counter $columncount != 0)
    {
        
$forumbits .= "\t</tr>\n";
    }
    
    return 
$forumbits;


I'm ALWAYS encountering the above error just because of line 312 (function construct_forum_columns($parentid, $columncount))

:( How do I go about this and did i insert the new function in properly??

Cheertobi 12-19-2005 10:48 AM

@Danny.VBT

Does the hack the same like this tutorial explains?: http://www.vbulletin.com/forum/showp...22&postcount=3

Tobi

Guest190829 12-19-2005 04:54 PM

Quote:

Originally Posted by Cheertobi
@Danny.VBT

Does the hack the same like this tutorial explains?: http://www.vbulletin.com/forum/showp...22&postcount=3

Tobi

Yes, combining this hack with Chris's will allow this functionality with an even better way in managing it. Instead of hardcoding it in the template it's all done inside the forum manager.

Guest190829 12-19-2005 04:56 PM

Quote:

Originally Posted by MSheraz86
This is the error I receive:

Fatal error: Cannot redeclare construct_forum_columns() (previously declared in /home/username/public_html/forum/includes/functions_forumlist.php:312) in /home/username/public_html/forum/includes/functions_forumlist.php on line 312


my functions_forumlist.php looks like this (As it does not state in the instructions properly where to insert it so i inserted it right after the first instruction that is in the txt file)

PHP Code:

        if ($vbulletin->userinfo['field7'] == 'yes' AND THIS_SCRIPT == 'index' AND $forum['subforumcolumns'] != AND ($subsonly OR $depth MAXFORUMDEPTH))
        {
            
$childforumbits construct_forum_columns($forum['forumid'], $forum['subforumcolumns']);
        }
        else if (
$subsonly)
        {
            
$childforumbits construct_forum_bit($forum['forumid'], 1$subsonly);
        }
        else if (
$depth MAXFORUMDEPTH)
        {
            
$childforumbits construct_forum_bit($forum['forumid'], $depth$subsonly);
        }
        else
        {
            
$childforumbits '';
        }

// ###################### Start construct_forum_columns #######################
function construct_forum_columns($parentid$columncount)
{
    global 
$vbulletin$stylevar$vbphrase$show;
    global 
$imodcache$lastpostarray$counters$inforum;

    
// this function takes the constant MAXFORUMDEPTH as its guide for how
    // deep to recurse down forum lists. if MAXFORUMDEPTH is not defined,
    // it will assume a depth of 2.

    
if ($columncount == 0)
    {
        
// 0 Columns means don't show subforums at all
        
return '';
    }

    
// call fetch_last_post_array() first to get last post info for forums
    
if (!is_array($lastpostarray))
    {
        
fetch_last_post_array();
    }

    if (empty(
$vbulletin->iforumcache["$parentid"]))
    {
        return;
    }

    if (!
defined(MAXFORUMDEPTH))
    {
        
define('MAXFORUMDEPTH'1);
    }

    
$forumbits '';

    
$counter 0;
    foreach (
$vbulletin->iforumcache["$parentid"] AS $forumid)
    {
        
// grab the appropriate forum from the $vbulletin->forumcache
        
$forum $vbulletin->forumcache["$forumid"];
        
$lastpostforum $vbulletin->forumcache["$lastpostarray[$forumid]"];
        if (!
$forum['displayorder'] OR !($forum['options'] & $vbulletin->bf_misc_forumoptions['active']))
        {
            continue;
        }

        
$forumperms $vbulletin->userinfo['forumpermissions']["$forumid"];
        
$lastpostforumperms $vbulletin->userinfo['forumpermissions']["$lastpostarray[$forumid]"];
        if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums'])
        { 
// no permission to view current forum
            
continue;
        }

        if (
$subsonly)
        {
            
$childforumbits construct_forum_bit($forum['forumid'], 1$subsonly);
        }
        else if (
$depth MAXFORUMDEPTH)
        {
            
$childforumbits construct_forum_bit($forum['forumid'], $depth$subsonly);
        }
        else
        {
            
$childforumbits '';
        }

        
// do stuff if we are not doing subscriptions only, or if we ARE doing subscriptions,
        // and the forum has a subscribedforumid
        
if (!$subsonly OR ($subsonly AND !empty($forum['subscribeforumid'])))
        {

            
$GLOBALS['forumshown'] = true// say that we have shown at least one forum

            
if (($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads']))
            { 
// get appropriate suffix for template name
                
$tempext '_post';
            }
            else

            {
                
$tempext '_nopost';
            }

            if (!
$vbulletin->options['showforumdescription'])
            { 
// blank forum description if set to not show
                
$forum['description'] = '';
            }

            
// dates & thread title
            
$lastpostinfo $vbulletin->forumcache["$lastpostarray[$forumid]"];

            
// compare last post time for this forum with the last post time specified by
            // the $lastpostarray, and if it's less, use the last post info from the forum
            // specified by $lastpostarray
            
if ($vbulletin->forumcache["$lastpostarray[$forumid]"]['lastpost'] > 0)
            {
                if (!(
$lastpostforumperms $vbulletin->bf_ugp_forumpermissions['canview']) OR (!($lastpostforumperms $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $lastpostinfo['lastposter'] != $vbulletin->userinfo['username']))
                {
                    
$forum['lastpostinfo'] = $vbphrase['private'];
                }
                else
                {
                    
$lastpostinfo['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $lastpostinfo['lastpost'], 1);
                    
$lastpostinfo['lastposttime'] = vbdate($vbulletin->options['timeformat'], $lastpostinfo['lastpost']);
                    
$lastpostinfo['trimthread'] = fetch_trimmed_title($lastpostinfo['lastthread']);

                    if (
$icon fetch_iconinfo($lastpostinfo['lasticonid']))
                    {
                        
$show['icon'] = true;
                    }
                    else
                    {
                        
$show['icon'] = false;
                    }

                    
$show['lastpostinfo'] = (!$lastpostforum['password'] OR verify_forum_password($lastpostforum['forumid'], $lastpostforum['password'], false));

                    eval(
'$forum[\'lastpostinfo\'] = "' fetch_template('forumhome_lastpostby') . '";');
                }
            }
            else if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canview']))
            {
                
$forum['lastpostinfo'] = $vbphrase['private'];
            }
            else
            {
                
$forum['lastpostinfo'] = $vbphrase['never'];
            }

            
// do light bulb
            
$forum['statusicon'] = fetch_forum_lightbulb($forumid$lastpostinfo$forum);
            
$show['customstatusicon'] = false;
if (
$forum['hasstatusicons'])
{
    
$show['customstatusicon'] = true;
    if (
$forum['statusicon'] == 'new')
    {
        
$forum['customicon'] = $forum['statusiconon'];
    }
    if (
$forum['statusicon'] == 'new_lock')
    {
        
$forum['customicon'] = $forum['statusiconlockon'];
    }
    if (
$forum['statusicon'] == 'old')
    {
        
$forum['customicon'] = $forum['statusiconoff'];
    }
    if (
$forum['statusicon'] == 'old_lock')
    {
        
$forum['customicon'] = $forum['statusiconlockoff'];
    }
    if (
$forum['statusicon'] == 'link')
    {
        
$forum['customicon'] = $forum['statusiconlink'];
    }
}

            
// add lock to lightbulb if necessary
            
if ((!($forumperms $vbulletin->bf_ugp_forumpermissions['canpostnew']) OR !($forum['options'] & $vbulletin->bf_misc_forumoptions['allowposting'])) AND $vbulletin->options['showlocks'] AND !$forum['link'])
            {
                
$forum['statusicon'] .= '_lock';
            }

            
// get counters from the counters cache ( prepared by fetch_last_post_array() )
            
$forum['threadcount'] = $counters["$forum[forumid]"]['threadcount'];
            
$forum['replycount'] = $counters["$forum[forumid]"]['replycount'];

            
// get moderators ( this is why we needed cache_moderators() )
            
if ($vbulletin->options['showmoderatorcolumn'])
            {
                
$showmods = array();
                
$listexploded explode(','$forum['parentlist']);
                foreach (
$listexploded AS $parentforumid)
                {
                    if (!isset(
$imodcache["$parentforumid"]))
                    {
                        continue;
                    }
                    foreach(
$imodcache["$parentforumid"] AS $moderator)
                    {
                        if (isset(
$showmods["$moderator[userid]"]))
                        {
                            continue;
                        }

                        (
$hook vBulletinHook::fetch_hook('forumbit_moderator')) ? eval($hook) : false;

                        
$showmods["$moderator[userid]"] = true;
                        if (!isset(
$forum['moderators']))
                        {
                            eval(
'$forum[\'moderators\'] = "' fetch_template('forumhome_moderator') . '";');
                        }
                        else
                        {
                            eval(
'$forum[\'moderators\'] .= ", ' fetch_template('forumhome_moderator') . '";');
                        }
                    }
                }
                if (!isset(
$forum['moderators']))
                {
                    
$forum['moderators'] = '';
                }
            }

            if (
$forum['link'])
            {
                
$forum['replycount'] = '-';
                
$forum['threadcount'] = '-';
                
$forum['lastpostinfo'] = '-';
            }
            else
            {
                
$forum['replycount'] = vb_number_format($forum['replycount']);
                
$forum['threadcount'] = vb_number_format($forum['threadcount']);
            }

            if ((
$subsonly OR $depth == MAXFORUMDEPTH) AND $vbulletin->options['subforumdepth'] > 0)
            {
                
$forum['subforums'] = construct_subforum_bit($forumid, ($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads'] ) );
            }
            else
            {
                
$forum['subforums'] = '';
            }

            
$children explode(','$forum['childlist']);
            foreach(
$children AS $childid)
            {
                
$forum['browsers'] += ($inforum["$childid"] ? $inforum["$childid"] : 0);
            }

            if (
$depth == AND $tempext == '_nopost')
            {
                global 
$vbcollapse;
                
$collapseobj_forumid =& $vbcollapse["collapseobj_forumbit_$forumid"];
                
$collapseimg_forumid =& $vbcollapse["collapseimg_forumbit_$forumid"];
                
$show['collapsebutton'] = true;
            }
            else
            {
                
$show['collapsebutton'] = false;
            }

            
$show['forumsubscription'] = ($subsonly true false);
            
$show['forumdescription'] = ($forum['description'] != '' true false);
            
$show['subforums'] = ($forum['subforums'] != '' true false);
            
$show['browsers'] = ($vbulletin->options['displayloggedin'] AND !$forum['link'] AND $forum['browsers'] ? true false);

            
// build the template for the current forum
            
$column_width intval(100 $columncount) . '%';
            eval(
'$column = "' fetch_template("forumhome_forumbit_columncell") . '";');
            
            
// do the columnstuff
            
if ($counter $columncount == 0)
            {
                
// Begin a new row
                
$forumbits .= "\t<tr>\n";
            }
            
$forumbits .= $column;
            if (
$counter $columncount == $columncount 1)
            {
                
// End row
                
$forumbits .= "\t</tr>\n";
            }
            
$counter++;
        }
    }

    
// prevent unclosed <tr> tags
    
if ($counter $columncount != 0)
    {
        
$forumbits .= "\t</tr>\n";
    }
    
    return 
$forumbits;


I'm ALWAYS encountering the above error just because of line 312 (function construct_forum_columns($parentid, $columncount))

:( How do I go about this and did i insert the new function in properly??

Using a completely new function_forumlist.php file apply the edit and then add the function I mentioned above at the bottom of the file. Make sure you do it before the

PHP Code:

?> 

And before any comments in the footer...


All times are GMT. The time now is 09:32 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02270 seconds
  • Memory Usage 2,237KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (4)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete