كود PHP:
if ($vbulletin->options['mwaextraadmin4_setting_active'])
{
if (THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'adv_index')
{
if($vbulletin->options['mwaonline'] == 1)
{
if($vbulletin->options['dr_login24'] == 1)
{
if (is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['mwaextraadmin4_mwastatus_last24_cansee'])))
{
$mwastcode = $vbulletin->options['mwastcode'];
$mwadefcolor = $vbulletin->options['mwadefcolor'];
$dr_background = $stylevar[imgdir_misc].'/'.$vbulletin->options['dr_background'];
$dr_ucolor = $vbulletin->options['mwadefcolor'];
$dr_fonts = $vbulletin->options['dr_fonts'];
$dr_fontsize = $vbulletin->options['dr_fontsize'];
$dr_fontface = $vbulletin->options['dr_fontface'];
$tnow = date('YmdHis',TIMENOW - $vbulletin->options['hourdiff']);
$cutoff = TIMENOW - (substr($tnow,8,2)*3600 + substr($tnow,10,2)*60 + substr($tnow,12,2));
$cutoff = TIMENOW - 86400 ; // ## Uncomment this line if you want a rolling 24 hours display ## //
$todaysusers = $vbulletin->db->query_read("
SELECT userid, lastactivity, options, username, user.usergroupid, displaygroupid,
groupa.opentag as opentaga, groupa.closetag as closetaga, groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " . TABLE_PREFIX . "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE lastactivity > " .$cutoff. " ORDER BY username
");
$totaltoday = 0;
unset ($whotoday);
while ($today = $vbulletin->db->fetch_array($todaysusers))
{
$totaltoday += 1;
$today['opentag'] = $today['opentaga'] ;
$today['closetag'] = $today['closetaga'] ;
if ($today['displaygroupid'])
{
$today['opentag'] = $today['opentagb'] ;
$today['closetag'] = $today['closetagb'] ;
}
$today[visible] = 1 ;
if ($today['options'] & $vbulletin->bf_misc_useroptions['invisible'])
{
$today['visible'] = 0 ;
if (($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden']) OR $today['userid'] == $vbulletin->userinfo['userid'])
{
$today['visible'] = 2 ;
}
}
if ($today['visible'])
{
$wrdate = vbdate($vbulletin->options['timeformat'], $today['lastactivity']);
if ($today['visible'] == 2)
{
$whotoday = $today['opentag'].$today['username'].$today['closetag']."*";
}
else
{
$whotoday = $today['opentag'].$today['username'].$today['closetag']."";
}
if($vbulletin->options['dr_nocode'] == 1)
{
if (preg_match("/color/i", "$whotoday")) {
$whotoday = preg_replace('/<font color="(.+?)">(.+?)<\\/font>/i', 'style="color: $1; background: transparent url('.$dr_background.'); border: 0px solid '.$dr_ucolor.'; font: '.$dr_fonts.' '.$dr_fontsize.' '.$dr_fontface.'; text-align: center; cursor: hand; width: 110px; height: 25px" value="$2" title="عرض بيانات $2"' , $whotoday);
} else {
$whotoday = 'style="color: '.$mwadefcolor.' ; background: transparent url('.$dr_background.'); border: 0px solid '.$dr_ucolor.'; font: '.$dr_fonts.' '.$dr_fontsize.' '.$dr_fontface.'; text-align: center; cursor: hand; width: 110px; height: 25px" value="' . $whotoday . '" title="عرض بيانات ' . $whotoday . '"';
}
}
else
{
if($vbulletin->options['dr_coma'])
{
$whotoday = "<a href='member.php?$session[sessionurl]u=$today[userid]' target=_blank>$whotoday</a> <img src='".$vbulletin->options['dr_coma']."' border='0'>";
}
else
{
$whotoday = "<a href='member.php?$session[sessionurl]u=$today[userid]' target=_blank>$whotoday</a> ";
}
}
eval('$mwawhotoday .= "' . fetch_template('mwaextraadmin4_whoonlinetoday_mwadah') . '";');
}
}
if ($mwawhotoday)
{
$mwawhotoday = substr($mwawhotoday, 0, strlen($mwawhotoday)-2);
}
else
{
$mwawhotoday = "لايوجد اعضاء تواجدو اليوم";
}
eval('$mwawhotodayrep .= "' . fetch_template('mwaextraadmin4_whoonlinetodaybit_mwadah') . '";');
$search_text = '<!-- end logged-in users -->';
$vbulletin->templatecache['FORUMHOME'] = str_replace($search_text,'$mwawhotodayrep <!-- end logged-in users -->',$vbulletin->templatecache['FORUMHOME']);
}
}
}
}
}
if ($vbulletin->options['mwaextraadmin4_setting_active'])
{
if (THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'adv_index')
{
if($vbulletin->options['mwaonline'] == 1)
{
if($vbulletin->options['dr_post24'] == 1)
{
if (is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['mwaextraadmin4_mwastatus_thread24_cansee'])))
{
$mwastcode = $vbulletin->options['mwastcode'];
$mwadefcolor = $vbulletin->options['mwadefcolor'];
$dr_background = $stylevar[imgdir_misc].'/'.$vbulletin->options['dr_background'];
$dr_ucolor = $vbulletin->options['mwadefcolor'];
$dr_fonts = $vbulletin->options['dr_fonts'];
$dr_fontsize = $vbulletin->options['dr_fontsize'];
$dr_fontface = $vbulletin->options['dr_fontface'];
$now = TIMENOW ;
require_once(DIR . '/includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, date('m', $now), date('d', $now), date('Y', $now));
$cutoff = $now - 86400 ; // ## Uncomment this line if you want a rolling 24 hours display ## //
$todaysposters= $vbulletin->db->query_read("
SELECT userid, lastpost, options, username, user.usergroupid, displaygroupid,
groupa.opentag as opentaga, groupa.closetag as closetaga, groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " . TABLE_PREFIX . "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE lastpost > " .$cutoff. " ORDER BY username
");
$posterstoday = 0;
unset ($posttoday);
while ($today = $vbulletin->db->fetch_array($todaysposters))
{
$posterstoday += 1;
$today['opentag'] = $today['opentaga'] ;
$today['closetag'] = $today['closetaga'] ;
if ($today['displaygroupid'])
{
$today['opentag'] = $today['opentagb'] ;
$today['closetag'] = $today['closetagb'] ;
}
$today[visible] = 1 ;
if ($today['options'] & $vbulletin->bf_misc_useroptions['invisible'])
{
$today['visible'] = 0 ;
if (($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden']) OR $today['userid'] == $vbulletin->userinfo['userid'])
{
$today['visible'] = 2 ;
}
}
if ($today['visible'])
{
$wrdate = vbdate($vboptions['timeformat'], $today['lastpost']);
if ($today['visible'] == 2)
{
$posttoday= $today['opentag'].$today['username'].$today['closetag']."*";
}
else
{
$posttoday= $today['opentag'].$today['username'].$today['closetag']."";
}
if($vbulletin->options['dr_nocode'] == 1)
{
if (preg_match("/color/i", "$posttoday")) {
$posttoday = preg_replace('/<font color="(.+?)">(.+?)<\\/font>/i', 'style="color: $1; background: transparent url('.$dr_background.'); border: 0px solid '.$dr_ucolor.'; font: '.$dr_fonts.' '.$dr_fontsize.' '.$dr_fontface.'; text-align: center; cursor: hand; width: 110px; height: 25px" value="$2" title="عرض بيانات $2"' , $posttoday);
} else {
$posttoday = 'style="color: '.$mwadefcolor.' ; background: transparent url('.$dr_background.'); border: 0px solid '.$dr_ucolor.'; font: '.$dr_fonts.' '.$dr_fontsize.' '.$dr_fontface.'; text-align: center; cursor: hand; width: 110px; height: 25px" value="' . $posttoday . '" title="عرض بيانات ' . $posttoday . '"';
}
}
else
{
if($vbulletin->options['dr_coma'])
{
$posttoday = "<a href='member.php?$session[sessionurl]u=$today[userid]' target=_blank>$posttoday</a> <img src='".$vbulletin->options['dr_coma']."' border='0'>";
}
else
{
$posttoday = "<a href='member.php?$session[sessionurl]u=$today[userid]' target=_blank>$posttoday</a> ";
}
}
eval('$mwawhoposttoday .= "' . fetch_template('mwaextraadmin4_whoposttoday_mwadah') . '";');
}
}
if ($mwawhoposttoday)
{
$mwawhoposttoday= substr($mwawhoposttoday, 0, strlen($mwawhoposttoday)-2);
}
else
{
$mwawhoposttoday = "لم يقم احد بوضع مشاركات اليوم";
}
eval('$mwawhoposttodayrep .= "' . fetch_template('mwaextraadmin4_whoposttodaybit_mwadah') . '";');
$search_text = '<!-- end logged-in users -->';
$vbulletin->templatecache['FORUMHOME'] = str_replace($search_text,'$mwawhoposttodayrep <!-- end logged-in users -->',$vbulletin->templatecache['FORUMHOME']);
}
}
}
}
}
if ($vbulletin->options['mwaextraadmin4_setting_active'])
{
if (THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'adv_index')
{
if($vbulletin->options['mwaonline'] == 1)
{
if($vbulletin->options['dr_reg24'] == 1)
{
if (is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['mwaextraadmin4_mwastatus_register24_cansee'])))
{
$mwastcode = $vbulletin->options['mwastcode'];
$mwadefcolor = $vbulletin->options['mwadefcolor'];
$dr_background = $stylevar[imgdir_misc].'/'.$vbulletin->options['dr_background'];
$dr_ucolor = $vbulletin->options['mwadefcolor'];
$dr_fonts = $vbulletin->options['dr_fonts'];
$dr_fontsize = $vbulletin->options['dr_fontsize'];
$dr_fontface = $vbulletin->options['dr_fontface'];
$now = TIMENOW - intval($vboptions['hourdif']);
$cutoff = mktime(0, 0, 0, date('m', $now), date('d', $now), date('Y', $now));
$cutoff = $now - 86400 ; // Uncomment this line if you want a rolling 24 hours display
$todaysregs = $db->query("SELECT userid, joindate, options, username, opentag, closetag, posts
FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE joindate > " .$cutoff. " ORDER BY username" );
unset ($regtoday);
$numregtoday = 0;
while ($today = $db->fetch_array($todaysregs))
{
$today[visible] = 1 ;
$numregtoday += 1;
//$useroptions = convert_bits_to_array($today['options'] , $vbulletin->bf_misc_useroptions);
if ($today[options] & $vbulletin->bf_misc_useroptions['invisible'])
{
$today[visible] = 0 ;
if (($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden']) OR $today['userid'] == $vbulletin->userinfo['userid'])
{
$today[visible] = 2 ;
}
}
if ($today[visible])
{
if ($today[visible] == 2)
{
$regtoday = "$today[opentag]$today[username]$today[closetag]*";
}
else
{
$regtoday = "$today[opentag]$today[username]$today[closetag]";
}
if($vbulletin->options['dr_nocode'] == 1)
{
if (preg_match("/color/i", "$regtoday")) {
$regtoday = preg_replace('/<font color="(.+?)">(.+?)<\\/font>/i', 'style="color: $1; background: transparent url('.$dr_background.'); border: 0px solid '.$dr_ucolor.'; font: '.$dr_fonts.' '.$dr_fontsize.' '.$dr_fontface.'; text-align: center; cursor: hand; width: 110px; height: 25px" value="$2" title="عرض بيانات $2"' , $regtoday);
} else {
$regtoday = 'style="color: '.$mwadefcolor.' ; background: transparent url('.$dr_background.'); border: 0px solid '.$dr_ucolor.'; font: '.$dr_fonts.' '.$dr_fontsize.' '.$dr_fontface.'; text-align: center; cursor: hand; width: 110px; height: 25px" value="' . $regtoday . '" title="عرض بيانات ' . $regtoday . '"';
}
}
else
{
if($vbulletin->options['dr_coma'])
{
$regtoday = "<a href='member.php?$session[sessionurl]u=$today[userid]' target=_blank>$regtoday</a> <img src='".$vbulletin->options['dr_coma']."' border='0'>";
}
else
{
$regtoday = "<a href='member.php?$session[sessionurl]u=$today[userid]' target=_blank>$regtoday</a> ";
}
}
eval('$mwawhoregistertoday .= "' . fetch_template('mwaextraadmin4_whoregistertoday_mwadah') . '";');
}
}
if ($mwawhoregistertoday)
{
$mwawhoregistertoday = substr($mwawhoregistertoday, 0, strlen($mwawhoregistertoday)-2);
}
else
{
$mwawhoregistertoday = "لم يقم أحد بالتسجيل اليوم";
}
eval('$mwawhoregistertodayrep .= "' . fetch_template('mwaextraadmin4_whoregistertodaybit_mwadah') . '";');
$search_text = '<!-- end logged-in users -->';
$vbulletin->templatecache['FORUMHOME'] = str_replace($search_text,'$mwawhoregistertodayrep <!-- end logged-in users -->',$vbulletin->templatecache['FORUMHOME']);
}
}
}
}
}
if ($vbulletin->options['mwaextraadmin4_setting_active'])
{
if($vbulletin->options['mwaonline'] == 1)
{
if($vbulletin->options['legend_dr'] == 1)
{
if (THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'adv_index')
{
if($vbulletin->options['legend_usergroups'])
{
$legendusergroups = explode(',', $vbulletin->options['legend_usergroups']);
foreach($vbulletin->usergroupcache as $usergroupid => $ug)
{
if(in_array($usergroupid, $legendusergroups))
{
eval('$uglegend .= "'.fetch_template('mwaextraadmin4__forumhome_usergroup_legend_bit').'";');
}
}
eval('$usergrouplegend .= "'.fetch_template('mwaextraadmin4_forumhome_usergroup_legend').'";');
$vbulletin->templatecache['FORUMHOME'] = str_replace(
array(
'<div>$activeusers</div>'
),
array(
'$usergrouplegend<div>$activeusers</div>'
),
$vbulletin->templatecache['FORUMHOME']
);
$vbulletin->templatecache['adv_portal_onlineusers'] = str_replace(
array(
'$activeusers'
),
array(
'$usergrouplegend $activeusers'
),
$vbulletin->templatecache['adv_portal_onlineusers']
);
}}}}}
مواقع النشر (المفضلة)