Skip to content

Instantly share code, notes, and snippets.

@lizheming
Created February 17, 2011 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lizheming/831340 to your computer and use it in GitHub Desktop.
Save lizheming/831340 to your computer and use it in GitHub Desktop.
httprequest.php send reply修改
case 'sendreply':
if ($options['allow_comment'] == 'false')
{
Helper::PrintJavaScript("alert('对方评论功能已经关闭'); window.location = '" . BASE_URL . "?act=view&id=" . intval($_POST['entryid']) . "';");
}
if (intval($_POST['entryid']) > 0 AND trim($_POST['message']))
{
if ($is_guest)
{
require_once('lib/class_iplocation.php');
$iplocation = new IpLocation('database/QQWry.Dat');
$location = $iplocation->getlocation(Helper::FetchIP());
$geo = $location['country'];
}
else
{
$geo = 'owner';
$_POST['nickname'] = "公子"; //输入你自己的昵称
$_POST['email'] = "i@imnerd.org"; //输入你自己的邮箱
$_POST['url'] = "http://pagecookery.net"; //输入你的个人主页地址
}
$SQL->Insert('reply', array('entryid', 'message', 'geo', 'ip', 'time', 'userid', 'nickname', 'email', 'url'), array(intval($_POST['entryid']), Format::Safe($_POST['message'], true), $geo, Helper::FetchIP(), time(), $User['id'], Format::Safe($_POST['nickname'], true), Format::Safe($_POST['email'], true), Format::Safe(CKURL($_POST['url']), true)));
Helper::BakeCookie('nickname', $_POST['nickname'], time() + 3600 * 24 * 30);
if ($_POST['byquick'] == 'TRUE')
{
Helper::PrintJavaScript("window.location = '" . BASE_URL . "?act=view&id=" . intval($_POST['entryid']) . "';");
}
else if ($_POST['bymobile'] == 'TRUE')
{
header('Location: ' . BASE_URL . 'm/?act=view&id=' . intval($_POST['entryid']));
exit;
}
else
{
echo 'done';
}
}
else if ($_POST['bymobile'] == 'TRUE')
{
header('Location: ' . BASE_URL . 'm/?act=view&id=' . intval($_POST['entryid']));
exit;
}
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment