<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="visitorslastx" active="1">
	<title>تعريب عمان الاصالة www.om-al.net - اخر الزوار خلال</title>
	<description>تعريب عمان الاصالة www.om-al.net - اخر الزوار خلال X ساعة</description>
	<version>2.4</version>
	<url>http://www.vbulletin.org/forum/showthread.php?t=177965</url>
	<versioncheckurl><![CDATA[http://www.vbulletin.org/forum/misc.php?do=checkversion&t=122999]]></versioncheckurl>
	<dependencies>
	</dependencies>
	<codes>
		<code version="2.4">
			<installcode><![CDATA[
		$db->hide_errors();
		$vbulletin->db->query_write(" 
			CREATE TABLE IF NOT EXISTS `". TABLE_PREFIX ."cybvilxh_guests` (
		    `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
		    `userip` VARCHAR(20) NOT NULL,
			`dateline` INT(10) NOT NULL)
	    ");
		$db->show_errors();]]></installcode>
			<uninstallcode><![CDATA[$db->hide_errors();
		$vbulletin->db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "cybvilxh_guests` ");
		$db->show_errors();]]></uninstallcode>
		</code>
	</codes>
	<templates>
		<template name="cyb_lastxhoursvisitors" templatetype="template" date="1193107910" username="Cybernetec" version="2.4"><![CDATA[
	<tbody>
		<tr>
			<td class="thead" colspan="2">
				<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('vilxh_switch')"><img id="collapseimg_vilxh_switch" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_vilxh_switch].gif" alt="" border="0" /></a>
				$vilxh_stats
			</td>
		</tr>
	</tbody>
	<tbody id="collapseobj_vilxh_switch" style="$vbcollapse[collapseobj_vilxh_switch]">
		<tr>
			<td class="alt2">
				<img src="$stylevar[imgdir_misc]/whos_online.gif" border="0" alt="$vilxh_stats" />
				<script language="JavaScript" type="text/javascript">
				<!--
					function Vilxh_getUsers()
					{
						document.getElementById("vilxh_users_more").style.display = "none";
						document.getElementById("vilxh_users_loading").style.display = "inline";
						vilxh_users = new vB_AJAX_Handler(true);
						vilxh_users.onreadystatechange(Vilxh_updateUsers);
						vilxh_users.send('misc.php?show=vilxh_users');
					}

					function Vilxh_updateUsers()
					{
						if (vilxh_users)
						{
							if (vilxh_users.handler.readyState == 4 && vilxh_users.handler.status == 200 && vilxh_users.handler.responseText)
							{
								vilxh_usersDiv = fetch_object('vilxh_users_area');
								vilxh_usersDiv.innerHTML = vilxh_users.handler.responseText;
							}
						}
					}
				-->
				</script>
			</td>
			<td class="alt1" width="100%">
				<div id="vilxh_users_area" class="smallfont">
					$vilxh_userlist_init
					<if condition="(($vboptions[cyb_visitorslastx_cutoff]>0) AND ($vilxh_total_members > $vboptions[cyb_visitorslastx_cutoff]))">
						<div id="vilxh_users_more" style="display:inline;float:$stylevar[right];">
							<phrase 1="$vboptions[cyb_visitorslastx_cutoff]" 2="$vilxh_total_members" 3="$vboptions[cyb_visitorslastx_xhours]">$vbphrase[cybvilxh_showing_x]</phrase> | <a href="javascript:void(0);" onclick="Vilxh_getUsers();" style="text-decoration:none;">$vbphrase[cybvilxh_show_all]</a>
						</div>
						<div id="vilxh_users_loading" style="display:none;float:$stylevar[right];">
							$vbphrase[cybvilxh_loading]
						</div>
					</if>
				</div>
			</td>
		</tr>
		<if condition="$vboptions['cyb_visitorslastx_showgroups'] AND $vilxh_legend">
			<tr>
				<td class="alt2" colspan="2" align="center">
					<span class="smallfont">$vilxh_legend</span>
				</td>
			</tr>
		</if>
	</tbody>]]></template>
	</templates>
	<plugins>
		<plugin active="1" executionorder="5">
			<title>Cyb - VILXH - TC</title>
			<hookname>cache_templates</hookname>
			<phpcode><![CDATA[
		if ($vbulletin->options['cyb_visitorslastx_enable'] AND (THIS_SCRIPT=='index'))
		{
			$globaltemplates = array_merge($globaltemplates, array('cyb_lastxhoursvisitors'));
		}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Cyb - VILXH - MN</title>
			<hookname>forumhome_complete</hookname>
			<phpcode><![CDATA[
		if ($vbulletin->options['cyb_visitorslastx_enable'] AND !is_member_of($vbulletin->userinfo, split(',', $vbulletin->options['cyb_visitorslastx_exclgroups'])))
		{
			$db->hide_errors();
			$vilxh_timecut = TIMENOW - ($vbulletin->options['cyb_visitorslastx_xhours'] * 3600); 

			$vilxh_getvisitors = $vbulletin->db->query_read("
				SELECT userid, username, usergroupid, displaygroupid, lastactivity, IF(user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ", 1, 0) AS invisible
				FROM " . TABLE_PREFIX . "user AS user
				WHERE lastactivity > $vilxh_timecut
				ORDER BY username ASC
			");
			$vilxh_total_members = $db->num_rows($vilxh_getvisitors);
			$vbulletin->options['yestoday'] = 1;
			while($vilxh_visitor = $db->fetch_array($vilxh_getvisitors))
			{
				if ($vbulletin->options['cyb_visitorslastx_cutoff']>0)
				{
					$vilxh_id += 1;
					if ($vilxh_id > $vbulletin->options['cyb_visitorslastx_cutoff'])
					{
						continue;
					}
				}

				$vilxh_markinv = '';
				$vilxh_visible = true;
				if ($vilxh_visitor[invisible])
				{
					$vilxh_visible = false;
					if (($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden']) OR $vilxh_visitor[userid] == $vbulletin->userinfo['userid'])
					{
						$vilxh_markinv = '*';
						$vilxh_visible = true;
					}
				}

				$vilxh_visitor[musername] = fetch_musername($vilxh_visitor);
				$vilxh_lastactivity = vbdate($vbulletin->options['dateformat'], $vilxh_visitor[lastactivity], 1).', '.vbdate('H:i', $vilxh_visitor[lastactivity]);

				if ($vilxh_visible)
				{
					$vilxh_userlist .= ', <a href="member.php?u='.$vilxh_visitor[userid].'" title="'.$vilxh_lastactivity.'">'.$vilxh_visitor[musername].'</a>'.$vilxh_markinv;
				}
				else
				{
					if ($vbulletin->options['cyb_visitorslastx_invisible']!='')
					{
						$vilxh_userlist .= ', '.$vbulletin->options['cyb_visitorslastx_invisible'];
					}
				}
			}
			$vilxh_userlist_init = substr($vilxh_userlist, 2);
			unset($vilxh_getvisitors, $vilxh_visitor);

			$vbulletin->options['yestoday'] = $vbulletin->options['yestoday'];

			if ($vbulletin->options['cyb_visitorslastx_showguests'])
			{
				$vilxh_getguests = $vbulletin->db->query_read("
					SELECT userip, dateline
					FROM " . TABLE_PREFIX . "cybvilxh_guests AS cybvilxh_guests
					WHERE dateline > $vilxh_timecut
				");
				$vilxh_total_guests = $db->num_rows($vilxh_getguests);
				unset($vilxh_getguests);

				if ($vbulletin->options['cyb_visitorslastx_fakeguests']!='')
				{
					$vilxh_total_guests += $vbulletin->options['cyb_visitorslastx_fakeguests'];
				}

				$vilxh_total = $vilxh_total_members + $vilxh_total_guests;
			}
			else
			{
				$vilxh_total = $vilxh_total_members;
			}

			foreach (explode(',',$vbulletin->options['cyb_visitorslastx_groups_legend']) AS $vilxh_getgroup)
			{
				$vilxh_group = $vbulletin->usergroupcache[$vilxh_getgroup];
				if ($vilxh_group[opentag])
				{
					$vilxh_legend .= ' - '.$vilxh_group[opentag].$vilxh_group[title].$vilxh_group[closetag];
				}
			}
			unset($vilxh_getgroup);
			$vilxh_legend = substr($vilxh_legend, 3);

			if ($vbulletin->options['cyb_visitorslastx_showguests'])
			{
				$vilxh_stats = construct_phrase($vbphrase['cybvilxh_visitsinfo'], $vbulletin->options['cyb_visitorslastx_xhours'], $vilxh_total, $vilxh_total_members, $vilxh_total_guests);
			}
			else
			{
				$vilxh_stats = construct_phrase($vbphrase['cybvilxh_visitsinfo_members'], $vbulletin->options['cyb_visitorslastx_xhours'], $vilxh_total);
			}

			eval('$cyb_vilxh = "' . fetch_template('cyb_lastxhoursvisitors') . '";');

			if ($vbulletin->options['cyb_visitorslastx_autoinsert'])
			{
				$vbulletin->templatecache['FORUMHOME'] = str_replace('<!-- end logged-in users -->','<!-- end logged-in users -->'.$vbulletin->templatecache['cyb_lastxhoursvisitors'],$vbulletin->templatecache['FORUMHOME']);
			}
			$db->show_errors();
		}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Cyb - VILXH - UU</title>
			<hookname>login_redirect</hookname>
			<phpcode><![CDATA[
		if ($vbulletin->options['cyb_visitorslastx_enable'] AND $vbulletin->options['cyb_visitorslastx_showguests'])
		{
			$GLOBALS['vbulletin']->db->query_write(" DELETE FROM " . TABLE_PREFIX . "cybvilxh_guests WHERE userip = '".$_SERVER['REMOTE_ADDR']."' ");
		}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Cyb - VILXH - SA</title>
			<hookname>misc_start</hookname>
			<phpcode><![CDATA[
		if (($_REQUEST['show']=='vilxh_users') AND $vbulletin->options['cyb_visitorslastx_enable'] AND ($vbulletin->options['cyb_visitorslastx_cutoff']>0) AND !is_member_of($vbulletin->userinfo, split(',', $vbulletin->options['cyb_visitorslastx_exclgroups'])))
		{
			$db->hide_errors();
			$vilxh_timecut = TIMENOW - ($vbulletin->options['cyb_visitorslastx_xhours'] * 3600); 
			$vilxh_getvisitors = $vbulletin->db->query_read("
				SELECT userid, username, usergroupid, displaygroupid, lastactivity, IF(user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ", 1, 0) AS invisible
				FROM " . TABLE_PREFIX . "user AS user
				WHERE lastactivity > $vilxh_timecut
				ORDER BY username ASC
			");
			$vilxh_total_members = $db->num_rows($vilxh_getvisitors);
			$vbulletin->options['yestoday'] = 1;
			while($vilxh_visitor = $db->fetch_array($vilxh_getvisitors))
			{
				$vilxh_markinv = '';
				$vilxh_visible = true;
				if ($vilxh_visitor[invisible])
				{
					$vilxh_visible = false;
					if (($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden']) OR $vilxh_visitor[userid] == $vbulletin->userinfo['userid'])
					{
						$vilxh_markinv = '*';
						$vilxh_visible = true;
					}
				}

				$vilxh_visitor[musername] = fetch_musername($vilxh_visitor);
				$vilxh_lastactivity = vbdate($vbulletin->options['dateformat'], $vilxh_visitor[lastactivity], 1).', '.vbdate('H:i', $vilxh_visitor[lastactivity]);

				if ($vilxh_visible)
				{
					$vilxh_userlist .= ', <a href="member.php?u='.$vilxh_visitor[userid].'" title="'.$vilxh_lastactivity.'">'.$vilxh_visitor[musername].'</a>'.$vilxh_markinv;
				}
				else
				{
					if ($vbulletin->options['cyb_visitorslastx_invisible']!='')
					{
						$vilxh_userlist .= ', '.$vbulletin->options['cyb_visitorslastx_invisible'];
					}
				}
			}
			$vilxh_userlist = substr($vilxh_userlist, 2);
			unset($vilxh_getvisitors, $vilxh_visitor);
			$db->show_errors();
			echo ($vilxh_userlist);
			exit;
		}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Cyb - VILXH - CG</title>
			<hookname>parse_templates</hookname>
			<phpcode><![CDATA[
		if ($vbulletin->options['cyb_visitorslastx_enable'] AND $vbulletin->options['cyb_visitorslastx_showguests'] AND !$vbulletin->userinfo['userid'])
		{
			$db->hide_errors();
			$vilxh_checkguest = $vbulletin->db->query_read("
				SELECT userip
				FROM " . TABLE_PREFIX . "cybvilxh_guests AS cybvilxh_guests
				WHERE userip = '".$_SERVER['REMOTE_ADDR']."'
			");
			if ($db->num_rows($vilxh_checkguest))
			{
				$vbulletin->db->query_write("
					UPDATE " . TABLE_PREFIX . "cybvilxh_guests
					SET dateline = '".TIMENOW."'
					WHERE userip = '".$_SERVER['REMOTE_ADDR']."'
				");
			}
			else
			{
				$vbulletin->db->query_write("
					INSERT INTO `". TABLE_PREFIX ."cybvilxh_guests`
					(userip, dateline)
					VALUES ('".$_SERVER['REMOTE_ADDR']."', '".TIMENOW."')
				");
			}
			unset($vilxh_checkguest);

			$vilxh_timecut = TIMENOW - ($vbulletin->options['cyb_visitorslastx_xhours'] * 3600);
			$vbulletin->db->query_write(" DELETE FROM " . TABLE_PREFIX . "cybvilxh_guests WHERE dateline < '".$vilxh_timecut."' ");
			$db->show_errors();
		}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title><![CDATA[Cybernetec's Hacks Template Group]]></title>
			<hookname>template_groups</hookname>
			<phpcode><![CDATA[$only['cyb_'] = 'Cybernetec';
		]]></phpcode>
		</plugin>
	</plugins>
	<phrases>
		<phrasetype name="GLOBAL" fieldname="global">
			<phrase name="cybvilxh_loading" date="0" username="" version=""><![CDATA[تحميل...]]></phrase>
			<phrase name="cybvilxh_show_all" date="0" username="" version=""><![CDATA[تظهر للجميع]]></phrase>
			<phrase name="cybvilxh_showing_x" date="0" username="" version=""><![CDATA[يظهر {1} من اجمالي {2} الأعضاء الذين زاروا المنتدى  {3} ساعة]]></phrase>
			<phrase name="cybvilxh_visitsinfo" date="0" username="" version=""><![CDATA[مجموع الاعضاء المتواجدون خلال {1} ساعة: {2} ({3} اعضاء و {4} زوار)]]></phrase>
			<phrase name="cybvilxh_visitsinfo_members" date="0" username="" version=""><![CDATA[مجموع الاعضاء المتواجدون خلال {1} ساعة: {2}]]></phrase>
		</phrasetype>
		<phrasetype name="vBulletin Settings" fieldname="vbsettings">
			<phrase name="setting_cyb_visitorslastx_autoinsert_desc" date="0" username="" version=""><![CDATA[عمل الهاك تلقائي "وقت المنتدي"]]></phrase>
			<phrase name="setting_cyb_visitorslastx_cutoff_desc" date="0" username="" version=""><![CDATA[النتائج تظهر عند بدء التشغيل (0 لعرض كل)<br />ملاحظة : يمكن الاطلاع على قائمة كاملة على طلب المستخدم عبر أجاكس]]></phrase>
			<phrase name="setting_cyb_visitorslastx_enable_desc" date="0" username="" version=""><![CDATA[تفعيل المنتج]]></phrase>
			<phrase name="setting_cyb_visitorslastx_enable_title" date="0" username="" version=""><![CDATA[الاعدادات الرئيسية]]></phrase>
			<phrase name="setting_cyb_visitorslastx_exclgroups_desc" date="0" username="" version=""><![CDATA[مجموعات المستخدمين لا يمكن أن تنظر إلى المربع (مفصولة بفواصل الهوية القائمة)]]></phrase>
			<phrase name="setting_cyb_visitorslastx_exclgroups_title" date="0" username="" version=""><![CDATA[خيارات اخري]]></phrase>
			<phrase name="setting_cyb_visitorslastx_fakeguests_desc" date="0" username="" version=""><![CDATA[(اتركة فارغ للتعطيل)اضافة عدد زوار وهمي ]]></phrase>
			<phrase name="setting_cyb_visitorslastx_groups_legend_desc" date="0" username="" version=""><![CDATA[مجموعات المستخدمين يمكنهم مشاهدة البوكس (مفصولة بفواصل الهوية القائمة)]]></phrase>
			<phrase name="setting_cyb_visitorslastx_invisible_desc" date="0" username="" version=""><![CDATA[وتظهر مرئية الأعضاء (وليس فارغا لاظهارهم على القائمة)]]></phrase>
			<phrase name="setting_cyb_visitorslastx_showgroups_desc" date="0" username="" version=""><![CDATA[تفعيل(مكن)]]></phrase>
			<phrase name="setting_cyb_visitorslastx_showgroups_title" date="0" username="" version=""><![CDATA[Usergroups Legend]]></phrase>
			<phrase name="setting_cyb_visitorslastx_showguests_desc" date="0" username="" version=""><![CDATA[ساعة X اظهار عدد الزوار للمنتدي خلال]]></phrase>
			<phrase name="setting_cyb_visitorslastx_xhours_desc" date="0" username="" version=""><![CDATA[ساعة (يفضل 24) X عرض عدد الساعات الماضية]]></phrase>
			<phrase name="settinggroup_VisitorsLastX" date="0" username="" version=""><![CDATA[تعريب عمان الاصالة www.om-al.net - اخر الزوار خلال X ساعة]]></phrase>
		</phrasetype>
	</phrases>
	<options>
		<settinggroup name="VisitorsLastX" displayorder="65535">
			<setting varname="cyb_visitorslastx_enable" displayorder="5">
				<datatype>number</datatype>
				<optioncode>yesno</optioncode>
				<defaultvalue>1</defaultvalue>
			</setting>
			<setting varname="cyb_visitorslastx_xhours" displayorder="10">
				<datatype>number</datatype>
				<defaultvalue>24</defaultvalue>
			</setting>
			<setting varname="cyb_visitorslastx_cutoff" displayorder="15">
				<datatype>number</datatype>
				<defaultvalue>300</defaultvalue>
			</setting>
			<setting varname="cyb_visitorslastx_invisible" displayorder="20">
				<datatype>free</datatype>
				<defaultvalue><![CDATA[<i>Invisible</i>]]></defaultvalue>
			</setting>
			<setting varname="cyb_visitorslastx_showguests" displayorder="25">
				<datatype>number</datatype>
				<optioncode>yesno</optioncode>
				<defaultvalue>1</defaultvalue>
			</setting>
			<setting varname="cyb_visitorslastx_fakeguests" displayorder="30">
				<datatype>free</datatype>
			</setting>
			<setting varname="cyb_visitorslastx_showgroups" displayorder="35">
				<datatype>number</datatype>
				<optioncode>yesno</optioncode>
				<defaultvalue>1</defaultvalue>
			</setting>
			<setting varname="cyb_visitorslastx_groups_legend" displayorder="40">
				<datatype>free</datatype>
				<defaultvalue>2,3,4,5,6,7,8</defaultvalue>
			</setting>
			<setting varname="cyb_visitorslastx_exclgroups" displayorder="45">
				<datatype>free</datatype>
			</setting>
			<setting varname="cyb_visitorslastx_autoinsert" displayorder="50">
				<datatype>number</datatype>
				<optioncode>yesno</optioncode>
				<defaultvalue>1</defaultvalue>
			</setting>
		</settinggroup>
	</options>
	<helptopics>
	</helptopics>
	<cronentries>
	</cronentries>
	<faqentries>
	</faqentries>
</product>
