alois3
19/04/2008, 21h16
bonsoir ,
suite a une discution sur votre forum je suis tomber sur ce hack , mais la je ne comprend pas ou mettre ceci
then add this new function to the file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ###################### Start construct_forum_columns #######################
function construct_forum_columns($parentid, $columncount)
{
global $vboptions, $DB_site, $session, $bbuserinfo, $stylevar, $_FORUMOPTIONS, $vbphrase, $show;
global $iforumcache, $forumcache, $imodcache, $lastpostarray, $counters, $inforum;
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 (!isset($iforumcache["$parentid"]))
{
return;
}
$forumbits = '';
$counter = 0;
foreach ($iforumcache["$parentid"] AS $baa)
{
foreach ($baa AS $forumid)
{
// grab the appropriate forum from the $forumcache
$forum = $forumcache["$forumid"];
if (!$forum['displayorder'] OR !($forum['options'] & $_FORUMOPTIONS['active']))
{
continue;
}
$forumperms = $bbuserinfo['forumpermissions']["$forumid"];
if (!($forumperms & CANVIEW) AND $vboptions['hideprivateforums'])
{ // no permission to view current forum
continue;
}
$GLOBALS['forumshown'] = true; // say that we have shown at least one forum
if (!$vboptions['showforumdescription'])
{ // blank forum description if set to not show
$forum['description'] = '';
}
// dates & thread title
$lastpostinfo = $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 ($forumcache["$lastpostarray[$forumid]"]['lastpost'] > 0)
{
$lastpostinfo['lastpostdate'] = vbdate($vboptions['dateformat'], $lastpostinfo['lastpost'], 1);
$lastpostinfo['lastposttime'] = vbdate($vboptions['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'] = (!$forum['password'] OR verify_forum_password($forum['forumid'], $forum['password'], false));
eval('$forum[\'lastpostinfo\'] = "' . fetch_template('forumhome_lastpostby') . '";');
}
else if (!($forumperms & CANVIEW) AND $vboptions['hideprivateforums'] == 0)
{
$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 & CANPOSTNEW) OR !($forum['options'] & $_FORUMOPTIONS['allowposting'])) AND $vboptions['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'];
if ($forum['link'])
{
$forum['replycount'] = '-';
$forum['threadcount'] = '-';
$forum['lastpostinfo'] = '-';
}
else
{
$forum['replycount'] = vb_number_format($forum['replycount']);
$forum['threadcount'] = vb_number_format($forum['threadcount']);
}
$show['forumdescription'] = iif ($forum['description'] != '', 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;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
merci de l aide byby
suite a une discution sur votre forum je suis tomber sur ce hack , mais la je ne comprend pas ou mettre ceci
then add this new function to the file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ###################### Start construct_forum_columns #######################
function construct_forum_columns($parentid, $columncount)
{
global $vboptions, $DB_site, $session, $bbuserinfo, $stylevar, $_FORUMOPTIONS, $vbphrase, $show;
global $iforumcache, $forumcache, $imodcache, $lastpostarray, $counters, $inforum;
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 (!isset($iforumcache["$parentid"]))
{
return;
}
$forumbits = '';
$counter = 0;
foreach ($iforumcache["$parentid"] AS $baa)
{
foreach ($baa AS $forumid)
{
// grab the appropriate forum from the $forumcache
$forum = $forumcache["$forumid"];
if (!$forum['displayorder'] OR !($forum['options'] & $_FORUMOPTIONS['active']))
{
continue;
}
$forumperms = $bbuserinfo['forumpermissions']["$forumid"];
if (!($forumperms & CANVIEW) AND $vboptions['hideprivateforums'])
{ // no permission to view current forum
continue;
}
$GLOBALS['forumshown'] = true; // say that we have shown at least one forum
if (!$vboptions['showforumdescription'])
{ // blank forum description if set to not show
$forum['description'] = '';
}
// dates & thread title
$lastpostinfo = $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 ($forumcache["$lastpostarray[$forumid]"]['lastpost'] > 0)
{
$lastpostinfo['lastpostdate'] = vbdate($vboptions['dateformat'], $lastpostinfo['lastpost'], 1);
$lastpostinfo['lastposttime'] = vbdate($vboptions['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'] = (!$forum['password'] OR verify_forum_password($forum['forumid'], $forum['password'], false));
eval('$forum[\'lastpostinfo\'] = "' . fetch_template('forumhome_lastpostby') . '";');
}
else if (!($forumperms & CANVIEW) AND $vboptions['hideprivateforums'] == 0)
{
$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 & CANPOSTNEW) OR !($forum['options'] & $_FORUMOPTIONS['allowposting'])) AND $vboptions['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'];
if ($forum['link'])
{
$forum['replycount'] = '-';
$forum['threadcount'] = '-';
$forum['lastpostinfo'] = '-';
}
else
{
$forum['replycount'] = vb_number_format($forum['replycount']);
$forum['threadcount'] = vb_number_format($forum['threadcount']);
}
$show['forumdescription'] = iif ($forum['description'] != '', 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;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
merci de l aide byby