سلام عليكم
أخواني أتمنى تطبق هذا الكود على منتدانا المحبوب
أخواني أتمنى تطبق هذا الكود على منتدانا المحبوب
PHP:
editpost.php
Search:
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
Replace:
=========
post.*, post.username AS postusername, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
inlinemod.php
Search:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, showposts, ipaddress, personal, forumchoice, sortby, sortorder, searchtime, orderedids, announceids, dateline, displayterms, searchhash)
=========
Replace:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, showposts, personal, forumchoice, sortby, sortorder, searchtime, orderedids, announceids, dateline, displayterms, searchhash)
=========
Search:
=========
VALUES (" . $vbulletin->userinfo['userid'] . ", 0, '" . $db->escape_string(IPADDRESS) . "', 1, '', '', 'DESC', '', '" . $db->escape_string($threadids) . "', '', " . TIMENOW . ", '" . $db->escape_string(serialize($display)) . "', '')
=========
Replace:
=========
VALUES (" . $vbulletin->userinfo['userid'] . ", 0, 1, '', '', 'DESC', '', '" . $db->escape_string($threadids) . "', '', " . TIMENOW . ", '" . $db->escape_string(serialize($display)) . "', '')
=========
Search:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, showposts, ipaddress, personal, forumchoice, sortby, sortorder, searchtime, orderedids, announceids, dateline, displayterms, searchhash)
=========
Replace:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, showposts, personal, forumchoice, sortby, sortorder, searchtime, orderedids, announceids, dateline, displayterms, searchhash)
=========
Search:
=========
VALUES (" . $vbulletin->userinfo['userid'] . ", 1, '" . $db->escape_string(IPADDRESS) . "', 1, '', '', 'DESC', '', '" . $db->escape_string($postids) . "', '', " . TIMENOW . ", '" . $db->escape_string(serialize($display)) . "', '')
=========
Replace:
=========
VALUES (" . $vbulletin->userinfo['userid'] . ", 1, 1, '', '', 'DESC', '', '" . $db->escape_string($postids) . "', '', " . TIMENOW . ", '" . $db->escape_string(serialize($display)) . "', '')
=========
Search:
=========
SELECT threadrateid, threadid, userid, vote, ipaddress
=========
Replace:
=========
SELECT threadrateid, threadid, userid, vote
=========
Search:
=========
$id = (!empty($rating['userid'])) ? $rating['userid'] : $rating['ipaddress'];
=========
Replace:
=========
$id = $rating['userid'];
=========
Search and delete:
=========
$ipaddress = '';
=========
Search and delete:
=========
$ipaddress = $id;
=========
Search:
=========
$sql[] = "($destthread[threadid], $userid, $vote, '" . $db->escape_string($ipaddress) . "')";
=========
Replace:
=========
$sql[] = "($destthread[threadid], $userid, $vote)";
=========
Search:
=========
(threadid, userid, vote, ipaddress)
=========
Replace:
=========
(threadid, userid, vote)
=========
Search and delete:
=========
$new_ip = false;
=========
Search:
=========
post.userid, post.ipaddress,
=========
Replace:
=========
post.userid,
=========
Search and delete:
=========
if ($new_ip === false)
{
// update IP to one of the IPs used by the person who will own the new post
$new_ip = $post['ipaddress'];
}
=========
Search and delete:
=========
$new_ip = $destpost['ipaddress'];
=========
Search and delete:
=========
$postman->set('ipaddress', $new_ip);
=========
newreply.php
Search and delete:
=========
'postbit_ip',
=========
Search:
=========
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
Replace:
=========
post.*, post.username AS postusername, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
online.php
Search and delete:
=========
// pre-cache templates used by specific actions
$actiontemplates = array(
'resolveip' => array(
'whosonline_resolveip'
)
);
=========
Search and delete:
=========
// #######################################################################
// resolve an IP in Who's Online (this uses the WOL permissions)
if ($_REQUEST['do'] == 'resolveip')
{
$vbulletin->input->clean_array_gpc('r', array(
'ipaddress' => TYPE_NOHTML,
'ajax' => TYPE_BOOL
));
// can we actually resolve this?
if (!($permissions['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlineip']))
{
print_no_permission();
}
$resolved_host = htmlspecialchars_uni(@gethostbyaddr($vbulletin->GPC['ipaddress']));
$ipaddress =& $vbulletin->GPC['ipaddress']; // no html'd already
if ($vbulletin->GPC['ajax'])
{
if (empty($resolved_host))
{
$resolved_host = $ipaddress;
}
require_once(DIR . '/includes/class_xml.php');
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_tag('ipaddress', $resolved_host, array('original' => $ipaddress));
$xml->print_xml();
}
else
{
$navbits = construct_navbits(array(
'online.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['whos_online'],
'' => $vbphrase['resolve_ip_address']
));
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('whosonline_resolveip') . '");');
}
exit;
}
=========
Search and delete:
=========
case 'host':
$sqlsort = 'session.host';
=========
Search:
=========
SELECT user.username, session.useragent, session.location, session.lastactivity, user.userid, user.options, session.host, session.badlocation, session.incalendar, user.aim, user.icq, user.msn, user.yahoo, user.skype,
=========
Replace:
=========
SELECT user.username, session.useragent, session.location, session.lastactivity, user.userid, user.options, session.badlocation, session.incalendar, user.aim, user.icq, user.msn, user.yahoo, user.skype,
=========
Search and delete:
=========
if ($vbulletin->options['WOLresolve'] AND ($permissions['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlineip']))
{
$userinfo["$key"]['host'] = @gethostbyaddr($users['host']);
}
=========
Search:
=========
$ourip = ip2long($users['host']);
=========
Replace:
=========
$ourip = ip2long("127.0.0.1");
=========
Search and delete:
=========
if ($vbulletin->options['WOLresolve'] AND ($permissions['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlineip']))
{
$guests["$count"]['host'] = @gethostbyaddr($users['host']);
}
=========
Search and delete:
=========
$userinfo["{$vbulletin->userinfo['userid']}"]['host'] = IPADDRESS;
=========
Search and delete:
=========
if ($vbulletin->options['WOLresolve'] AND ($permissions['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlineip']))
{
$userinfo["{$vbulletin->userinfo['userid']}"]['host'] = @gethostbyaddr($userinfo["{$vbulletin->userinfo['userid']}"]['host']);
}
=========
Search and delete:
=========
$show['ip'] = iif($permissions['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlineip'], true, false);
$show['ajax_resolve'] = ($show['ip'] AND !$vbulletin->options['WOLresolve']);
$show['useragent'] = iif($vbulletin->GPC['ua'], true, false);
=========
Search and delete:
=========
if ($permissions['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlineip'])
{
$onlinecolspan++;
exec_switch_bg();
$ipclass = $bgclass;
}
=========
Search and delete:
=========
$colspan = iif($show['ip'], $colspan + 1, $colspan);
=========
postings.php
Search and delete:
=========
case 'getip':
break;
=========
Search and delete:
=========
// ############################### start retrieve ip ###############################
if ($_REQUEST['do'] == 'getip')
{
$vbulletin->input->clean_array_gpc('r', array(
'ip' => TYPE_NOHTML
));
// check moderator permissions for getting ip
if (!can_moderate($threadinfo['forumid'], 'canviewips'))
{
print_no_permission();
}
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
if (!empty($vbulletin->GPC['ip']) AND preg_match('#^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $vbulletin->GPC['ip']))
{
$postinfo['ipaddress'] =& $vbulletin->GPC['ip'];
}
else if (!$postinfo['postid'])
{
eval(standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink'])));
}
$postinfo['hostaddress'] = @gethostbyaddr($postinfo['ipaddress']);
($hook = vBulletinHook::fetch_hook('threadmanage_getip')) ? eval($hook) : false;
eval(standard_error(fetch_error('thread_displayip', $postinfo['ipaddress'], $postinfo['hostaddress']), '', 0));
}
=========
Search and delete:
=========
$show['ipaddress'] = can_moderate($threadinfo['forumid'], 'canviewips') ? true : false;
=========
Search:
=========
SELECT moderatorlog.dateline, moderatorlog.userid, moderatorlog.action, moderatorlog.type, moderatorlog.postid, moderatorlog.ipaddress,
=========
Replace:
=========
SELECT moderatorlog.dateline, moderatorlog.userid, moderatorlog.action, moderatorlog.type, moderatorlog.postid,
=========
Search and delete:
=========
$log['ipaddress'] = htmlspecialchars_uni($log['ipaddress']); // Sanity ;0
=========
Search:
=========
SELECT threadrateid, threadid, userid, vote, ipaddress
=========
Replace:
=========
SELECT threadrateid, threadid, userid, vote
=========
Search:
=========
$id = (!empty($rating['userid'])) ? $rating['userid'] : $rating['ipaddress'];
=========
Replace:
=========
$id = $rating['userid'];
=========
Search and delete:
=========
$ipaddress = '';
=========
Search and delete:
=========
$ipaddress = $id;
=========
Search:
=========
$sql[] = "($threadinfo[threadid], $userid, $vote, '" . $db->escape_string($ipaddress) . "')";
=========
Replace:
=========
$sql[] = "($threadinfo[threadid], $userid, $vote)";
=========
Search:
=========
(threadid, userid, vote, ipaddress)
=========
Replace:
=========
(threadid, userid, vote)
=========
register.php
Search and delete:
=========
// register IP address
$userdata->set('ipaddress', IPADDRESS);
=========
Search and delete:
=========
$ipaddress = IPADDRESS;
=========
report.php
Search and delete:
=========
if ($userinfo['userid'] != $vbulletin->userinfo['userid'])
{
// not posting as the current user, IP won't make sense
$threadman->set('ipaddress', '');
}
=========
Search and delete:
=========
if ($userinfo['userid'] != $vbulletin->userinfo['userid'])
{
// not posting as the current user, IP won't make sense
$postman->set('ipaddress', '');
}
=========
search.php
Search:
=========
WHERE " . iif(!$vbulletin->userinfo['userid'], "ipaddress ='" . $db->escape_string(IPADDRESS) . "'", "userid = " . $vbulletin->userinfo['userid']) . "
=========
Replace:
=========
WHERE userid = " . $vbulletin->userinfo['userid'] . "
=========
Search:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, titleonly, ipaddress, personal, query, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, searchterms, displayterms, searchhash, completed)
=========
Replace:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, titleonly, personal, query, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, searchterms, displayterms, searchhash, completed)
=========
Search:
=========
VALUES (" . $vbulletin->userinfo['userid'] . ", " . intval($vbulletin->GPC['titleonly']) . " ,'" . $db->escape_string(IPADDRESS) . "', " . ($vbulletin->options['searchsharing'] ? 0 : 1) . ", '" . $db->escape_string($search['query']) . "', '" . $db->escape_string($search['searchuser']) . "', '" . $db->escape_string($search['forumchoice']) . "', '" . $db->escape_string($search['sortby']) . "', '" . $db->escape_string($vbulletin->GPC['sortorder']) . "', $searchtime, " . intval($vbulletin->GPC['showposts']) . ", '" . implode(',', $search['orderedids']) . "', " . TIMENOW . ", '" . $db->escape_string($search['searchterms']) . "', '" . $db->escape_string($search['displayterms']) . "', '" . $db->escape_string($searchhash) . "', 1)
=========
Replace:
=========
VALUES (" . $vbulletin->userinfo['userid'] . ", " . intval($vbulletin->GPC['titleonly']) . " , " . ($vbulletin->options['searchsharing'] ? 0 : 1) . ", '" . $db->escape_string($search['query']) . "', '" . $db->escape_string($search['searchuser']) . "', '" . $db->escape_string($search['forumchoice']) . "', '" . $db->escape_string($search['sortby']) . "', '" . $db->escape_string($vbulletin->GPC['sortorder']) . "', $searchtime, " . intval($vbulletin->GPC['showposts']) . ", '" . implode(',', $search['orderedids']) . "', " . TIMENOW . ", '" . $db->escape_string($search['searchterms']) . "', '" . $db->escape_string($search['displayterms']) . "', '" . $db->escape_string($searchhash) . "', 1)
=========
Search:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, titleonly, ipaddress, personal, query, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, searchterms, displayterms, searchhash, completed)
=========
Replace:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, titleonly, personal, query, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, searchterms, displayterms, searchhash, completed)
=========
Search and delete:
=========
'" . $db->escape_string(IPADDRESS) . "',
=========
Search:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, titleonly, ipaddress, personal, query, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, searchterms, displayterms, searchhash, completed)
=========
Replace:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, titleonly, personal, query, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, searchterms, displayterms, searchhash, completed)
=========
Search and delete:
=========
'" . $db->escape_string(IPADDRESS) . "',
=========
Search:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, titleonly, ipaddress, personal, query, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, searchterms, displayterms, searchhash, completed)
=========
Replace:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, titleonly, personal, query, searchuser, forumchoice, sortby, sortorder, searchtime, showposts, orderedids, dateline, searchterms, displayterms, searchhash, completed)
=========
Search:
=========
VALUES (" . $vbulletin->userinfo['userid'] . ", " . intval($vbulletin->GPC['titleonly']) . " ,'" . $db->escape_string(IPADDRESS) . "', " . ($vbulletin->options['searchsharing'] ? 0 : 1) . ", '" . $db->escape_string($vbulletin->GPC['query']) . "', '" . $db->escape_string($vbulletin->GPC['searchuser']) . "', '" . $db->escape_string($forumchoice) . "', '" . $db->escape_string($vbulletin->GPC['sortby']) . "', '" . $db->escape_string($vbulletin->GPC['sortorder']) . "', $searchtime, " . intval($vbulletin->GPC['showposts']) . ", '" . implode(',', $orderedids) . "', " . time() . ", '" . $db->escape_string(serialize($searchterms)) . "', '" . $db->escape_string(serialize($display)) . "', '" . $db->escape_string($searchhash) . "', 1)
=========
Replace:
=========
VALUES (" . $vbulletin->userinfo['userid'] . ", " . intval($vbulletin->GPC['titleonly']) . " , " . ($vbulletin->options['searchsharing'] ? 0 : 1) . ", '" . $db->escape_string($vbulletin->GPC['query']) . "', '" . $db->escape_string($vbulletin->GPC['searchuser']) . "', '" . $db->escape_string($forumchoice) . "', '" . $db->escape_string($vbulletin->GPC['sortby']) . "', '" . $db->escape_string($vbulletin->GPC['sortorder']) . "', $searchtime, " . intval($vbulletin->GPC['showposts']) . ", '" . implode(',', $orderedids) . "', " . time() . ", '" . $db->escape_string(serialize($searchterms)) . "', '" . $db->escape_string(serialize($display)) . "', '" . $db->escape_string($searchhash) . "', 1)
=========
Search:
=========
// if search was by guest, do ip addresses match?
if ($search['userid'] == 0 AND $search['ipaddress'] == IPADDRESS)
=========
Replace:
=========
// if search was by guest
if ($search['userid'] == 0)
=========
Search:
=========
$searchhash = md5($vbulletin->userinfo['userid'] . IPADDRESS . $forumid . $vbulletin->GPC['days'] . $vbulletin->userinfo['lastvisit'] . $vbulletin->GPC['include'] . '|' . $vbulletin->GPC['exclude']);
=========
Replace:
=========
$searchhash = md5($vbulletin->userinfo['userid'] . $forumid . $vbulletin->GPC['days'] . $vbulletin->userinfo['lastvisit'] . $vbulletin->GPC['include'] . '|' . $vbulletin->GPC['exclude']);
=========
Search:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, showposts, ipaddress, personal, forumchoice, sortby, sortorder, searchtime, orderedids, announceids, dateline, displayterms, searchhash, completed)
=========
Replace:
=========
REPLACE INTO " . TABLE_PREFIX . "search (userid, showposts, personal, forumchoice, sortby, sortorder, searchtime, orderedids, announceids, dateline, displayterms, searchhash, completed)
=========
Search:
=========
VALUES (" . $vbulletin->userinfo['userid'] . ", " . intval($vbulletin->GPC['showposts']) . ", '" . $db->escape_string(IPADDRESS) . "', 1, '" . $db->escape_string($foruminfo['forumid']) . "', '" . $db->escape_string($vbulletin->GPC['sortby']) . "', 'DESC', $searchtime, '$sql_ids', '$sql_aids', " . TIMENOW . ", '" . $db->escape_string(serialize($display)) . "', '" . $db->escape_string($searchhash) . "', 1)
=========
Replace:
=========
VALUES (" . $vbulletin->userinfo['userid'] . ", " . intval($vbulletin->GPC['showposts']) . ", 1, '" . $db->escape_string($foruminfo['forumid']) . "', '" . $db->escape_string($vbulletin->GPC['sortby']) . "', 'DESC', $searchtime, '$sql_ids', '$sql_aids', " . TIMENOW . ", '" . $db->escape_string(serialize($display)) . "', '" . $db->escape_string($searchhash) . "', 1)
=========
Search:
=========
(userid, ipaddress, personal,
=========
Replace:
=========
(userid, personal,
=========
Search:
=========
(" . $vbulletin->userinfo['userid'] . ", '" . $db->escape_string(IPADDRESS) . "', 1,
=========
Replace:
=========
(" . $vbulletin->userinfo['userid'] . ", 1,
=========
sendmessage.php
Search and delete:
=========
if ($destemail == $vbulletin->options['webmasteremail'])
{
$ip = IPADDRESS;
}
else
{
$ip =& $vbphrase['n_a'];
}
=========
Search and delete:
=========
$ip = IPADDRESS;
=========
showpost.php
Search and delete:
=========
'postbit_ip',
=========
Search:
=========
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
Replace:
=========
post.*, post.username AS postusername, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
showthread.php
Search and delete:
=========
'postbit_ip',
=========
Search:
=========
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
Replace:
=========
post.*, post.username AS postusername, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
Search:
=========
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
Replace:
=========
post.*, post.username AS postusername, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
Search:
=========
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
Replace:
=========
post.*, post.username AS postusername, IF(post.visible = 2, 1, 0) AS isdeleted,
=========
threadrate.php
Search:
=========
// Check for entry in Database for this Ip Addr/Threadid
if ($rating = $db->query_first("
SELECT *
FROM " . TABLE_PREFIX . "threadrate
WHERE ipaddress = '" . $db->escape_string(IPADDRESS) . "'
AND threadid = $threadinfo[threadid]
"))
=========
Replace:
=========
// Check for entry in Database for this Threadid
if ($rating = $db->query_first("
SELECT *
FROM " . TABLE_PREFIX . "threadrate
WHERE threadid = $threadinfo[threadid]
"))
=========
Search and delete:
=========
$threadrate->set('ipaddress', IPADDRESS);
=========
modcp\index.php
Search:
=========
$guestsarry = $db->query_first("SELECT COUNT(host) AS sessions FROM " . TABLE_PREFIX . "session WHERE userid = 0 AND lastactivity > $datecut");
=========
Replace:
=========
$guestsarry = $db->query_first("SELECT COUNT(userid) AS sessions FROM " . TABLE_PREFIX . "session WHERE userid = 0 AND lastactivity > $datecut");
=========
Search and delete:
=========
if (can_moderate(0, 'canviewips'))
{
$canuser = true;
construct_nav_option($vbphrase['search_ip_addresses'], 'user.php?do=doips');
}
=========