Простоузер
Join Date: Jul 2008
Posts: 67
Reputation:
Novice 2
Репутация в разделе: 2
|
Как изменить модуль recentarticles.php
0
Привет! всем, подскажите что надо поменять в этом модуле чтобы он темы брал не из раздела со статьями а из того раздела который мне нужен,?
мне например 20 модулей таких надо чтобы каждый из разного раздела темы брал,
<?php
// ++=========================================================================++
// ||
// ++ ========================================================================++
if ($vbulletin->options['af_perpage'])
{
$forums = array();
$postforums = array();
$forumid = $vbulletin->options['af_forumids'];
$foruminfo = $vbulletin->forumcache["$forumid"];
$forums[] = $forumid;
$forumperms = $vbulletin->userinfo['forumpermissions']["$forumid"];
$foruminfo['options'] = intval($foruminfo['options']);
foreach($vbulletin->bf_misc_forumoptions AS $optionname => $optionval)
{
$foruminfo["$optionname"] = (($foruminfo['options'] & $optionval) ? 1 : 0);
}
if (($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']))
{
$foruminfo[childlist] = explode(",", $foruminfo[childlist]);
foreach ($foruminfo[childlist] as $cforumid)
{
$cforumperms = $vbulletin->userinfo['forumpermissions']["$cforumid"];
if ($cforumid > 0 && !in_array($cforumid, $forums) && ($cforumperms & $vbulletin->bf_ugp_forumpermissions['canview']) && $cforumid != $forumid)
{
$forums[] = $cforumid;
$cforuminfo = $vbulletin->forumcache["$cforumid"];
$cforuminfo['options'] = intval($cforuminfo['options']);
foreach($vbulletin->bf_misc_forumoptions AS $optionname => $optionval)
{
$cforuminfo["$optionname"] = (($cforuminfo['options'] & $optionval) ? 1 : 0);
}
if ($cforuminfo['allowposting'] && ($cforumperms & $vbulletin->bf_ugp_forumpermissions['canpostnew']))
{
$postforums["$cforumid"] = $cforuminfo['title_clean'];
}
}
}
}
$dyna_expand_width = 150;
if ($mod_options['portal_threads_showicon'])
{
$dyna_expand_width+= 30;
}
if ($mod_options['portal_threads_lastpost'])
{
$dyna_expand_width+= 140;
}
if ($mod_options['portal_threads_showforum'])
{
$dyna_expand_width += 80;
}
$recthread_tempname = ($mod_options['portal_threads_expanded'] == 1 OR ($mod_options['portal_threads_expanded'] == 2 AND $vba_colwidths[$vba_modcols[$modcol]] >= $dyna_expand_width)) ? 'exp' : 'lean';
if ($recthread_tempname == 'exp')
{
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_recthreads_exp_head') . '";');
$mods['colspan'] = 4;
if ($mod_options['portal_threads_lastpost'])
{
$mods['colspan']++;
}
if ($mod_options['portal_threads_showforum'])
{
$mods['colspan']++;
}
}
$vba_threads_condition = '';
// Threads & forums
if (!empty($mod_options['portal_threadids']) AND is_array($mod_options['portal_threadids']))
{
$vba_threads_condition = 'AND (thread.threadid IN(' . implode(',', array_keys($mod_options['portal_threadids'])) . ')';
}
// Add ) if we had forum or thread ids
if ($vba_threads_condition)
{
$vba_threads_condition .= ')';
}
if (!$mods['inforums'] AND !empty($adv_canviewforums) AND $mod_options['portal_applypermissions'])
{
$vba_threads_condition .= ' AND thread.forumid NOT IN(' . implode(',', $adv_canviewforums) . ')';
}
$show['lastpost'] = $mod_options['portal_threads_lastpost'];
if (!$mods['nodisplay'])
{
if ($mod_options['portal_threads_orderby'] == 'dateline')
{
$mod_options['portal_threads_orderby'] = 'thread.dateline';
}
if (!$mod_options['portal_threads_orderby'])
{
$mod_options['portal_threads_orderby'] = 'lastpost';
}
if (!$mod_options['portal_threads_direction'])
{
$mod_options['portal_threads_direction'] = 'DESC';
}
$markinglimit = (TIMENOW - ($vbulletin->options['markinglimit'] * 86400));
// Set the last visit date to the marking limit so new threads will not be based on individual cookie
if ($pages['name'] == 'home' AND !$vbulletin->userinfo['userid'] AND $vba_options['portal_guestcache'])
{
$vbulletin->userinfo['lastvisit'] = $markinglimit;
}
// Rating
$oldforumratings = $foruminfo['allowratings'];
$foruminfo['allowratings'] = $mod_options['portal_threads_showrating'];
$rtrating_fields = '';
if ($mod_options['portal_threads_showrating'] OR $mod_options['portal_threads_orderby'] == 'voteavg')
{
$rtrating_fields = 'IF(votenum >= ' . $vbulletin->options['showvotes'] . ', votenum, 0) AS votenum, IF(votenum >= ' . $vbulletin->options['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg, votetotal,';
}
$rthread_fields = '';
$rthread_join = '';
// Subscriptions
if ($mod_options['portal_threads_showsubscribed'] AND $vbulletin->userinfo['userid'])
{
$rthread_fields .= ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed';
$rthread_join .= ' LEFT JOIN ' . TABLE_PREFIX . 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = ' . $vbulletin->userinfo['userid'] . ')';
}
// Thread Icon
if ($mod_options['portal_threads_showicon'])
{
$rthread_fields .= ', thread.iconid AS threadiconid, iconpath AS threadiconpath';
$rthread_join .= ' LEFT JOIN ' . TABLE_PREFIX . 'icon AS icon ON (icon.iconid = thread.iconid)';
}
// Preview
if ($mod_options['portal_threads_showpreview'] AND $vbulletin->options['threadpreview'])
{
$rthread_fields .= ', post.pagetext AS preview';
$rthread_join .= ' LEFT JOIN ' . TABLE_PREFIX . 'post AS post ON (post.postid = thread.firstpostid)';
}
// Database read marking
if ($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
{
$rthread_fields .= ', threadread.readtime AS threadread, forumread.readtime AS forumread';
$rthread_join .= ' LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')
LEFT JOIN ' . TABLE_PREFIX . 'forumread AS forumread ON (thread.forumid = forumread.forumid AND forumread.userid = ' . $vbulletin->userinfo['userid'] . ')';
}
// Attach paperclip
if ($mod_options['portal_threads_showpaperclip'])
{
$rthread_fields .= ', thread.attach';
}
// Prefixes
if (IS_VB_37 AND $mod_options['portal_threads_prefix'])
{
$rthread_fields .= ', thread.prefixid';
}
if ($vbulletin->options['af_widththumb'])
{
$thumbdivstyle = "text-align: center; width: ".$vbulletin->options['attachthumbssize']."px;";
}
($hook = vBulletinHook::fetch_hook('vba_cmps_module_recthreads_start')) ? eval($hook) : false;
$forumids = implode(",", $forums);
$threads = $db->query_read("
SELECT thread.*,thread.title AS threadtitle, post.dateline AS postdateline, post.pagetext AS preview, attachment.thumbnail_filesize AS thumbsize, MIN(attachment.attachmentid) AS attachmentid
FROM " . TABLE_PREFIX . "thread as thread
LEFT JOIN " . TABLE_PREFIX . "post AS post
ON (post.postid = thread.firstpostid)
LEFT JOIN " . TABLE_PREFIX . "attachment AS attachment
ON (attachment.postid = thread.firstpostid AND attachment.extension IN('jpg', 'gif', 'png', 'jpeg', 'bmp'))
WHERE open != 10
AND thread.forumid IN( $forumids )
AND thread.visible = 1
GROUP BY thread.threadid
ORDER BY $mod_options[portal_threads_orderby] $mod_options[portal_threads_direction]
LIMIT $mod_options[portal_threads_maxthreads]
");
$mods['threadcount'] = $db->num_rows($threads);
if ($mods['threadcount'])
{
require_once(DIR . '/includes/functions_forumdisplay.php');
if ($mod_options['portal_threads_multipage'])
{
vba_template_alter('threadbit_pagelink',
'"$address"',
'"' . $vbulletin->options['bburl'] . '/$address"'
);
}
// Table cell classes
$bgclass = 'alt1';
if ($show['lastpost'])
{
// Don't need a variable since it's after a known class, just switch
exec_switch_bg();
}
if ($mod_options['portal_threads_replies'])
{
$class_reply = exec_switch_bg();
}
if ($mod_options['portal_threads_views'])
{
$class_view = exec_switch_bg();
}
if ($mod_options['portal_threads_showforum'])
{
$class_ftitle = exec_switch_bg();
}
$recthreads_comma = '';
if ($mod_options['portal_threads_views'] AND $mod_options['portal_threads_replies'])
{
$recthreads_comma = ', ';
}
}
while ($thread = $db->fetch_array($threads))
{
$bgclass = exec_switch_bg();
$thread['pagetext'] = $thread['preview'];
$thread['altimage'] = false;
$row++;
$post[date] = vbdate($vbulletin->options['dateformat'],$thread['postdateline'], 1) . " " . vbdate($vbulletin->options['timeformat'],$thread['postdateline'], 1);
if (!($thread['attachmentid'] AND $thread['thumbsize']) && $vbulletin->options['af_altthumb'] && !$vbulletin->options[af_parsebbcode])
{
$thread['images'] = preg_match_all('#\[img\]\s*(https?://([^*\r\n]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', $thread['preview'], $thread['matches']);
if ($thread['images'] !== false)
{
$thread['altimage'] = true;
}
$thread['image'] = $thread['matches'][1][0];
}
if (!$vbulletin->options[af_parsebbcode])
{
$thread['preview'] = preg_replace('#\[img\]\s*(https?://([^*\r\n]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', '', $thread['preview']);
$thread = process_thread_array($thread, $lastread, $foruminfo['allowicons']);
}
else
{
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list(), true);
$thread['preview'] = $bbcode_parser->do_parse($thread['pagetext'],false,true,true,true,true,false);
$thread['thumbsize'] = 0;
}
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('af_articlebit') . '";');
}
}
$home[$mods['modid']]['content'] = "<tr><td class=\"alt1\">".$home[$mods['modid']]['content']."</td></tr>";
$db->free_result($threads);
unset($thread);
$foruminfo['allowratings'] = $oldforumratings;
if (!$mods['threadcount'] OR $mods['nodisplay'])
{
$show['tablerow'] = true;
$home[$mods['modid']]['content'] = construct_phrase($vbphrase['no_x_to_display'], $vbphrase['articles']);
}
$home[$mods['modid']]['content'] = str_replace(array("\"showthread.php", "\"attachment.php"), array("\"{$vbulletin->options['bburl']}/showthread.php", "\"{$vbulletin->options['bburl']}/attachment.php",), $home[$mods['modid']]['content']);
}
?>
|