P/S:Style này làm theo 4rum mình, có chia cột, nếu để bình thường thì skin không có gì đặt biệt, còn đặc biệt thì xem demo nhé.
Demo: Để làm được giống thế này, các bạn làm theo các bước sau:
* Bạn Import file XML vào Products ( file XML các bạn Download ở http://sinhvienit.net/@forum/attachment.php?attachmentid=1404&stc=1&d=125613355 3 )
* Mở file functions_forumlist.php trong thư mục includes của diễn đàn : Tìm:
// ###################### 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; }
// 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']);
// 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; }
// 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++; } }
Nguồn bài viết: http://sinhvienit.net/@forum/showthread.php?t=12980 Sao mình làm theo hướng dẫn mà nó ko ra như vậy nhỉ!? (Như hình attach)
Có cách nào làm giống như demo ko!?? M thấy như vậy đẹp . . .
Mong các bạn giúp với . . .