المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : لتركيب هاك المتواجدون طوال اليوم


ريح الجنان
10-11-2005, 01:33 AM
السلام عليكم

لتركيب هاك المتواجدون طوال اليوم نمشي في 3 خطوات :


1- الخطوة الأولى تعديل ملف index.php .

2- الخطوة الثانية إضافة قالب جديد .

3- الخطوة الثالثة تعديل على قالب forumhome .






ونبدأ بالخطوة الأولى :




1- نفتح ملف index.php الموجود بداخل مجلد vb .


2- بعد ما نفتح الملف نبحث عن الجملة بالأسفل عن طريق خاصية البحث .. اضغطوا CTRL+F وبيفتح لكم شريط البحث واكتبوا فيه الجملة التالية :


كود:
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###


3- بعد ما تحصلون الجملة أضيفوا فوقها الفقرة التالية :



كود:

// ### TODAY ONLINE USERS BY ANIMEWEBBY ###########################################
$todayactiveusers = '';
$todaystarttime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));

$todaynumbervisible = 0;
$todaynumberregistered = 0;

$todayforumusers = $DB_site->query("SELECT
user.userid, user.username, (user.options & $_USEROPTIONS[invisible]) AS invisible, user.usergroupid, user.lastactivity,
IF(displaygroupid=0, user.usergroupid, user.displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "user
WHERE user.lastactivity >= $todaystarttime
ORDER BY " . iif($permissions['genericpermissions'] & CANSEEHIDDEN, 'invisible ASC, ') . "username ASC, lastactivity DESC
");

if ($bbuserinfo['userid'])
{
// fakes the user being online for an initial page view of index.php
$bbuserinfo['joingroupid'] = iif($bbuserinfo['displaygroupid'], $bbuserinfo['displaygroupid'], $bbuserinfo['usergroupid']);
$todayuserinfos = array
(
$bbuserinfo['userid'] => array
(
'userid' => $bbuserinfo['userid'],
'username' => $bbuserinfo['username'],
'invisible' => $bbuserinfo['invisible'],
'lastactivity' => TIMENOW,
'musername' => fetch_musername($bbuserinfo, 'joingroupid')
)
);
$todaynumberregistered = 1;
$todaynumbervisible = 1;
fetch_online_status($todayuserinfos[$bbuserinfo['userid']]);
$todayloggedin = $todayuserinfos[$bbuserinfo['userid']];
eval('$todayactiveusers = ", ' . fetch_template('forumhome_todayloggedinuser') . '";');
}
else
{
$todayuserinfos = array();
}

while ($todayloggedin = $DB_site->fetch_array($todayforumusers))
{
$todayuserid = $todayloggedin[userid];
if (!$todayuserid)
{ // Guest
$todaynumberguest++;
}
else if (empty($todayuserinfos["$todayuserid"]['lastactivity']) OR ($todayuserinfos["$todayuserid"]['lastactivity'] < $todayloggedin['lastactivity']))
{
$todayuserinfos["$todayuserid"] = $todayloggedin;
$todaynumberregistered++;
$todayloggedin['musername'] = fetch_musername($todayloggedin);

if ($todayloggedin['invisible'])
{
if (($permissions['genericpermissions'] & CANSEEHIDDEN) OR $todayloggedin['userid'] == $bbuserinfo['userid'])
{
// user is online and invisible BUT bbuser can see them
$todayloggedin['invisiblemark'] = '*';
$todaynumbervisible++;
eval('$todayactiveusers .= ", ' . fetch_template('forumhome_todayloggedinuser') . '";');
}
}
else
{
// user is online and visible
$todaynumbervisible++;
eval('$todayactiveusers .= ", ' . fetch_template('forumhome_todayloggedinuser') . '";');
}

//if (fetch_online_status($todayloggedin))
//{
// $todaynumbervisible++;
// eval('$todayactiveusers .= ", ' . fetch_template('forumhome_todayloggedinuser') . '";');
//}
}
}

// memory saving
unset($todayuserinfos, $todayloggedin);

$todayactiveusers = substr($todayactiveusers , 2); // get rid of initial comma

$DB_site->free_result($todayloggedins);

$todaynumberinvisible = $todaynumberregistered - $todaynumbervisible;
$todaytotalonline = $todaynumberregistered - $todaynumberinvisible;

// ### MAX LOGGEDIN USERS ################################
$todaymaxusers = unserialize($datastore['todaymaxonline']);
if (intval($todaymaxusers['todaymaxonline']) <= $todaynumberregistered)
{
$todaymaxusers['todaymaxonline'] = $todaynumberregistered;
$todaymaxusers['todaymaxonlinedate'] = TIMENOW;
$DB_site->query("REPLACE INTO " . TABLE_PREFIX . "datastore (title, data) VALUES ('todaymaxonline', '" . addslashes(serialize($todaymaxusers)) . "')");
}

$todayrecordusers = $todaymaxusers['todaymaxonline'];
$todayrecorddate = vbdate($vboptions['dateformat'], $todaymaxusers['todaymaxonlinedate'], 1);




انتهينا من الخطوة الأولى .




------------------------------------------------------------------





الخطوة الثانية ( إضافة قالب جديد ) .


1- ندخل الى لوحة التحكم .

2- نذهب الى قائمة ( الاستايلات والقوالب ) ونختار الخيار الأول ( ضبط الاستايلات ) .

3- ستظهر أمامنا قائمة بجميع الاستايلات الموجودة في المنتدى وبجانب كل ستايل قائمة صغيرة .. نفتح القائمة ونختار منها ( إضافة قالب جديد ) .

4- ستظهر صفحة جديدة فيها فراغين .. الفراغ الأول ( عنوان الموضوع ) ونضع الاسم كالتالي :

forumhome_todayloggedinuser


الفراغ الثاني ( القالب ) ونضع فيه الكود التالي :



كود:

<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$userid">
<input style="font-size: 10px; vertical-align: middle; color: #3858AD; font-family: MS Sans Serif; letter-spacing: 0px; text-align: center; border-style: solid; border-width: 1px; padding-left: 0px; padding-right: 2px; padding-top: 0px; padding-bottom: 0px; background-color: #FFFFFF" size="15" value="$todayloggedin[musername]" name="oline"></a>$invisibleuser

5- نحفظ القالب .





انتهت الخطوة الثانية




---------------------------------------------------------------





الخطوة الثالثة وهي تعديل على قالب ( forumhome ) .


1- ندخل الى لوحة التحكم .

2- نذهب الى قائمة ( الاستايلات والقوالب ) ونختار منها ( البحث في القوالب ) .

3- في أعلى الصفحة سنجد قائمة صغيرة نختار منها نفس الاستايل الذي قمنا بإضافة القالب عليه ... ثم نضع في مربع البحث كلمة forumhome .. ثم نختار نعم عند خيار ( بحث في العناوين فقط ) .. ونضغط على ( ابحث ) لنبدأ البحث .

4- ستظهر نتيجة البحث .. نختار تمبلت FORUMHOME ونضغط عليه دبل كلك .

5- سيظهر الكود الخاص بالقالب هذا .. نضغط على CTRL+F ليظهر شريط البحث ونبحث عن الكود التالي :


كود:

<!-- end logged-in users -->
</if>


6- بعد أن نجد الكود في الخطوة السابقة نضع الكود التالي فوقه مباشرة :



كود:

<!-- today logged-in users -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_todayactiveusers')"><img id="collapseimg_forumhome_todayactiveusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_todayactiveusers].gif" alt="" border="0" /></a>
عدد الاعضاء الذي تواجدوا اليوم في المنتدى&nbsp; : $todaytotalonline
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_todayactiveusers" style="$vbcollapse[collapseobj_forumhome_todayactiveusers]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_link.gif" border="0" /></td>
<td class="alt1" width="100%">
<div class="smallfont">
<div>$todayactiveusers</div>
</div>
</td>
</tr>
</tbody>
<!-- end today logged-in users-->


الى هنا انتهينا من الخطوة الثالثة وصار الهاك جاهز ويمكنكم مشاهدته ان شاء الله بدون مشاكل ..





-----------------------------------------------------------





ملاحظة صغيرة .. سيعرض الهاك أسماء المتواجدين اليوم بداخل مربعات .. اذا أردنا تغيير الهاك لتظهر الأسماء بشكل عادي بدون مربعات نقوم بتغيير الكود الموجود بداخل قالب forumhome_todayloggedinuser
ونضع الكود التالي :




كود:

<a href="member.php?$session[sessionurl]u=$todayloggedin[userid]">$todayloggedin[musername]</a>$todayloggedin[invisiblemark]$todayloggedin[buddymark]

منقووووووووول