vaivar
02-02-2005, 08:11 AM
السلام عليكم ورحمــة الله وبركــاته ..
هذا الهاك يقوم بوضع عدد الاعضاء الذين قاموا بوضع مشاركات في اسفل المنتدى مع توضيح اسمائهم
مثال :
http://www.traidnt.net/up//traidnt/bpsttody.jpg
الشرح :
الخطوة الاولى :
افتح ملف :Index.php
ابحث عن الكود التالي :
// ### LOGGED IN USERS #################################################
ضع اعلى منه مباشرة الكود التالي :
// ############# Paul Marsden - Who has posted today v1.40 ###############
$now = TIMENOW ;
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now. false, false), vbdate('d', $now. false, false), vbdate('Y', $now. false, false));
//$cutoff = $now - 86400 ; // Uncomment this line if you want a rolling last 24 hours.
$todaysposters = $DB_site->query("SELECT userid, lastpost, options, username, opentag, closetag
FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE lastpost > " .$cutoff. " ORDER BY username" );
unset ($posttoday);
$posterstoday = 0;
while ($today = $DB_site->fetch_array($todaysposters))
{
$today[visible] = 1 ;
$posterstoday += 1;
if ($today[options] & $_USEROPTIONS[invisible])
{
$today[visible] = 0 ;
if (($permissions['genericpermissions'] & CANSEEHIDDEN) OR $today['userid'] == $bbuserinfo['userid'])
{
$today[visible] = 2 ;
}
}
if ($today[visible])
{
$wrdate = vbdate($vboptions['timeformat'], $today['lastpost']);
$posttoday .= "<a href='search.php?do=finduser&u=$today[userid]' title='$wrdate' >";
if ($today[visible] == 2)
{
$posttoday .= $today['opentag'].$today[username].$today['closetag']."</a>*, ";
}
else
{
$posttoday .= $today['opentag'].$today[username].$today['closetag']."</a>, ";
}
}
}
if ($posttoday)
{
$posttoday = substr($posttoday, 0, strlen($posttoday)-2);
}
// ############# End of Who has posted today ###############
ارفع ملف Index.php الى السيرفر .
الخطوة الثانية :
اذهب الى لوحة تحكم المنتدى ومن ثم اذهب الى تمبلت :FORUMHOME
ابحث عن الكود التالي :
<!-- end logged-in users -->
اضف اسفله مباشرة الكود التالي :
<!-- Todays posters -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_todayposters')"><img id="collapseimg_forumhome_todayposters" src="$stylevar/collapse_thead$vbcollapse[collapseimg_forumhome_todayposters].gif" alt="" border="0" /></a>
عدد الأعضاء الذين قاموا بوضع مشاركات اليوم: $posterstoday
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_todayposters" style="$vbcollapse[collapseobj_forumhome_todayposters]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="Users online today" border="0" /></td>
<td class="alt1" width="100%"><div class="smallfont">$posttoday</div></td>
</tr>
</tbody>
<!-- End Todays posters -->
الخطوة الثالثة :
نقوم بزرع الامر التالي في قاعدة البيانات ( SQL )
ALTER TABLE user ADD INDEX (lastpost) ;
واسهل طريقة لزرع الامر هي من خلال لوحة تحكم المنتدى نضغط كما موضح في الصورة التالية :
[img]http://www.traidnt.net/up//traidnt/ssssss.jpg
واذا خرجت اليك جملة ( ليس لديك صلاحيات .. الخ )
توجه الى config.php الموجود بمجلد includes
وابحث عن :
$canrunqueries = '1';
وضع مكان رقم ( 1 ) رقم عضويتك في المنتدى
وصلى اللـــه على سيدنــا محمــد عليـه الصلاة والســلام ..
وانتهى العمل والتطبيـــق
هذا الهاك يقوم بوضع عدد الاعضاء الذين قاموا بوضع مشاركات في اسفل المنتدى مع توضيح اسمائهم
مثال :
http://www.traidnt.net/up//traidnt/bpsttody.jpg
الشرح :
الخطوة الاولى :
افتح ملف :Index.php
ابحث عن الكود التالي :
// ### LOGGED IN USERS #################################################
ضع اعلى منه مباشرة الكود التالي :
// ############# Paul Marsden - Who has posted today v1.40 ###############
$now = TIMENOW ;
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now. false, false), vbdate('d', $now. false, false), vbdate('Y', $now. false, false));
//$cutoff = $now - 86400 ; // Uncomment this line if you want a rolling last 24 hours.
$todaysposters = $DB_site->query("SELECT userid, lastpost, options, username, opentag, closetag
FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE lastpost > " .$cutoff. " ORDER BY username" );
unset ($posttoday);
$posterstoday = 0;
while ($today = $DB_site->fetch_array($todaysposters))
{
$today[visible] = 1 ;
$posterstoday += 1;
if ($today[options] & $_USEROPTIONS[invisible])
{
$today[visible] = 0 ;
if (($permissions['genericpermissions'] & CANSEEHIDDEN) OR $today['userid'] == $bbuserinfo['userid'])
{
$today[visible] = 2 ;
}
}
if ($today[visible])
{
$wrdate = vbdate($vboptions['timeformat'], $today['lastpost']);
$posttoday .= "<a href='search.php?do=finduser&u=$today[userid]' title='$wrdate' >";
if ($today[visible] == 2)
{
$posttoday .= $today['opentag'].$today[username].$today['closetag']."</a>*, ";
}
else
{
$posttoday .= $today['opentag'].$today[username].$today['closetag']."</a>, ";
}
}
}
if ($posttoday)
{
$posttoday = substr($posttoday, 0, strlen($posttoday)-2);
}
// ############# End of Who has posted today ###############
ارفع ملف Index.php الى السيرفر .
الخطوة الثانية :
اذهب الى لوحة تحكم المنتدى ومن ثم اذهب الى تمبلت :FORUMHOME
ابحث عن الكود التالي :
<!-- end logged-in users -->
اضف اسفله مباشرة الكود التالي :
<!-- Todays posters -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_todayposters')"><img id="collapseimg_forumhome_todayposters" src="$stylevar/collapse_thead$vbcollapse[collapseimg_forumhome_todayposters].gif" alt="" border="0" /></a>
عدد الأعضاء الذين قاموا بوضع مشاركات اليوم: $posterstoday
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_todayposters" style="$vbcollapse[collapseobj_forumhome_todayposters]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="Users online today" border="0" /></td>
<td class="alt1" width="100%"><div class="smallfont">$posttoday</div></td>
</tr>
</tbody>
<!-- End Todays posters -->
الخطوة الثالثة :
نقوم بزرع الامر التالي في قاعدة البيانات ( SQL )
ALTER TABLE user ADD INDEX (lastpost) ;
واسهل طريقة لزرع الامر هي من خلال لوحة تحكم المنتدى نضغط كما موضح في الصورة التالية :
[img]http://www.traidnt.net/up//traidnt/ssssss.jpg
واذا خرجت اليك جملة ( ليس لديك صلاحيات .. الخ )
توجه الى config.php الموجود بمجلد includes
وابحث عن :
$canrunqueries = '1';
وضع مكان رقم ( 1 ) رقم عضويتك في المنتدى
وصلى اللـــه على سيدنــا محمــد عليـه الصلاة والســلام ..
وانتهى العمل والتطبيـــق