Skip to content
WJunction - Webmaster Forum

How to change forums in column?? customized skin

Status
Not open for further replies.
hello,
look i have a trouble..
i have customized v1 skin.. i have installed it on my forum.. in it i have also found arrange forums in column plugin... i have also installed that but when i done template change in functions_forumslist.php.. it give me error
Code:
unexpected $end on line.....

i have got this type or error..
can anyone tell whats wrong with it.
or is this the problem that the skin is for vb 3.8.3 and i have installed it on 3.8.1
is it the solution that i need to upgrade to 3.8.3 then it works fine????
 

6 comments

this the code that was place in functions_forumlist.php
Code:
####################################################################################################
#######################################   File changes  ############################################
####################################################################################################


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++  editing file includes/functions_forumlist.php +++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


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

change it into:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        if (THIS_SCRIPT == 'index' AND $forum['subforumcolumns'] != 1 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 = '';
        }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


then add this new function to the file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ###################### 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);

            // 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 == 1 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;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
when i put this in the file
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);

            // 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 == 1 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;
}
then i get this error
Code:
[B]Fatal error[/B]: Cannot redeclare construct_forum_columns() (previously declared in /home/n1v7s3ed/public_html/enjoy/includes/functions_forumlist.php:210) in [B]/home/user/public_html/*********/includes/functions_forumlist.php[/B] on line [B]210[/B]
anyone got solutions ?
 
its not Skin Problem Nor Vb Problem just add the codes correctly because we have also this mod and skin on www.oriforums.com which is installed By Nano ( Before Only1_PO) take it so its the error in installation.

Edit: PM Me Or PM to DJGaurav,exel,CyberJ37,K3V,CyBerDevilZ might help u
 
Status
Not open for further replies.

About the author

B
Active Member · Joined
244
Messages
1
Reactions
18
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom