本文整理汇总了PHP中decode_ip函数的典型用法代码示例。如果您正苦于以下问题:PHP decode_ip函数的具体用法?PHP decode_ip怎么用?PHP decode_ip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了decode_ip函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysql2AssocArray
function mysql2AssocArray($mysqlPostRow)
{
global $db, $userPosition, $forumId, $usersForumId;
$postId = $mysqlPostRow['id'];
// Times
$htmlDatetime = date('c', $mysqlPostRow['post_time']);
$readableTime = date('D, d M Y H:i:s', $mysqlPostRow['post_time']);
$niceTime = nicetime($mysqlPostRow['post_time']);
// User and message
$forumUser = html_entity_decode($mysqlPostRow['sender']);
$forumUser = smilify($forumUser, $forumUser);
$forumMessage = URL2link(smilify(nl2br(html_entity_decode($mysqlPostRow['message'])), $forumUser));
// ip address, delete, edit button
$headerActions = $userPosition == 'Webmaster' ? decode_ip($mysqlPostRow['ipaddress']) . '
<a class="forum-post-delete" style="color:black;" title="Delete post" href="forum/delete/' . $postId . '">
<i class="fa fa-trash-o"></i> <span class="sr-only">Delete</span>
</a>' : '';
if ($mysqlPostRow['users_forum_id'] == $usersForumId || $userPosition == 'Webmaster') {
$headerActions .= '
<a class="forum-post-edit" style="color:black;" title="Edit post" href="forum/edit/' . $postId . '">
<i class="fa fa-pencil"></i> <span class="sr-only">Edit</span>
</a>';
}
// Likes
$likeCount = mysqli_query($db, "SELECT count(1) c FROM forum_plusone WHERE message = {$postId} LIMIT 1");
$likeCount = mysqli_fetch_array($likeCount)['c'];
if (mysqli_num_rows(mysqli_query($db, "SELECT 1 FROM forum_plusone WHERE message = {$postId} AND cookie = '{$usersForumId}' LIMIT 1"))) {
$likedClass = 'liked';
$likeTitle = 'Approved';
} else {
$likedClass = 'not-liked';
$likeTitle = 'Approve Post';
}
return array('id' => $mysqlPostRow['id'], 'parentPostId' => $mysqlPostRow['parent_id'], 'htmlDatetime' => $htmlDatetime, 'readableTime' => $readableTime, 'niceTime' => $niceTime, 'forumUser' => $forumUser, 'forumMessage' => $forumMessage, 'headerActions' => $headerActions, 'likeCount' => $likeCount, 'likedClass' => $likedClass, 'likeTitle' => $likeTitle);
}
示例2: validate
/**
* validate function
* Validate the response and challenge strings of a recaptcha captcha.
* @return bool
* @author Rich Martin
**/
public function validate($response, $challenge)
{
// validate captcha
$privatekey = "6Lc96AAAAAAAAM8m1ok23XZpJxWKD7iGagzckTab";
$resp = recaptcha_check_answer($privatekey, decode_ip(USER_IP), $challenge, $response);
// needless to say, blow up if it's wrong.
if ((bool) $resp->is_valid == FALSE && !empty($resp->error)) {
throw new CircuitValidationException("Please fill in the two words to submit your entry.");
}
return TRUE;
}
示例3: grab
function grab($url)
{
$html = scraperWiki::scrape($url);
$dom = new simple_html_dom();
$dom->load($html);
foreach ($dom->find("#tbl_proxy_list tr") as $data) {
$tds = $data->find("td");
if (count($tds) == 7) {
$input = decode_ip((string) $tds[0]);
$record = array('ip' => $input);
scraperwiki::save(array('ip'), $record);
}
}
}
示例4: while
$mailcontent = '';
while (list($key, $val) = each($_POST)) {
strip_tags(removecrlf("{$key} => {$val}"));
//if ($val != ''){
$mailcontent .= "{$key} = {$val} \n";
//}
}
require_once BASEDIR . 'includes/classes/phpmailer.php';
$CLASS['mail']->ClearAll();
$sender_name = removecrlf($sender_name);
$sender_email = removecrlf($sender_email);
$msg = $MAIN_CFG['global']['sitename'] . "\n\n";
$msg .= _SENDERNAME . ': ' . $sender_name . "\n";
$msg .= _SENDEREMAIL . ': ' . $sender_email . "\n";
$msg .= _MESSAGE . ": " . stripslashes($mailcontent) . "\n\n--\n";
$msg .= _POSTEDBY . " IP: " . decode_ip($userinfo['user_ip']) . " \n\n";
// ChinaBrit
$CLASS['mail']->SetLanguage();
if ($MAIN_CFG['email']['smtp_on']) {
$CLASS['mail']->IsSMTP();
// set mailer to use SMTP
$CLASS['mail']->Host = $MAIN_CFG['email']['smtphost'];
if ($MAIN_CFG['email']['smtp_auth']) {
$CLASS['mail']->SMTPAuth = true;
// turn on SMTP authentication
$CLASS['mail']->Username = $MAIN_CFG['email']['smtp_uname'];
// SMTP username
$CLASS['mail']->Password = $MAIN_CFG['email']['smtp_pass'];
// SMTP password
}
}
示例5: profile_url
$link_reg_ip .= profile_url($row) . ' ';
}
}
if (!empty($last_ip)) {
$link_last_ip .= $lang['OTHER_IP'] . ' ';
foreach ($last_ip as $row) {
$link_last_ip .= profile_url($row) . ' ';
}
}
if ($profiledata['user_level'] == ADMIN && !IS_ADMIN) {
$reg_ip = $last_ip = $lang['HIDDEN'];
} elseif ($profiledata['user_level'] == MOD && IS_MOD) {
$reg_ip = $last_ip = $lang['HIDDEN'];
} else {
$user_reg_ip = decode_ip($profiledata['user_reg_ip']);
$user_last_ip = decode_ip($profiledata['user_last_ip']);
$reg_ip = '<a href="' . $bb_cfg['whois_info'] . $user_reg_ip . '" class="gen" target="_blank">' . $user_reg_ip . '</a>';
$last_ip = '<a href="' . $bb_cfg['whois_info'] . $user_last_ip . '" class="gen" target="_blank">' . $user_last_ip . '</a>';
}
$this->response['ip_list_html'] = '
<br /><table class="mod_ip bCenter borderless" cellspacing="1">
<tr class="row5" >
<td>' . $lang['REG_IP'] . '</td>
<td class="tCenter">' . $reg_ip . '</td>
<td><div>' . $link_reg_ip . '</div></td>
</tr>
<tr class="row4">
<td>' . $lang['LAST_IP'] . '</td>
<td class="tCenter">' . $last_ip . '</td>
<td><div>' . $link_last_ip . '</div></td>
</tr>
示例6: emailer
$ini_val = @phpversion() >= '4.0.0' ? 'ini_get' : 'get_cfg_var';
// We are running on windows, force delivery to use our smtp functions
// since php's are broken by default
$board_config['smtp_delivery'] = 1;
$board_config['smtp_host'] = @$ini_val('SMTP');
}
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
for ($i = 0; $i < count($bcc_list); $i++) {
$emailer->bcc($bcc_list[$i]);
}
$email_headers = 'X-AntiAbuse: Board servername - ' . $board_config['server_name'] . "\n";
$email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n";
$email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n";
$email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\n";
$emailer->use_template('admin_send_email');
$emailer->email_address($board_config['board_email']);
$emailer->set_subject($subject);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array('SITENAME' => $board_config['sitename'], 'BOARD_EMAIL' => $board_config['board_email'], 'MESSAGE' => $message));
$emailer->send();
$emailer->reset();
message_die(GENERAL_MESSAGE, $lang['Email_sent'] . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.{$phpEx}?pane=right") . '">', '</a>'));
}
}
if ($error) {
$template->set_filenames(array('reg_header' => 'error_body.tpl'));
$template->assign_vars(array('ERROR_MESSAGE' => $error_msg));
$template->assign_var_from_handle('ERROR_BOX', 'reg_header');
}
示例7: convert_data
/**
* Load the contents of the old tables into the database
*/
function convert_data($mode, $sub)
{
global $db, $gallery_config, $template, $user, $phpbb_root_path, $phpEx;
function decode_ip($int_ip)
{
$hexipbang = explode('.', chunk_split($int_ip, 2, '.'));
$phpbb3_ip = hexdec($hexipbang[0]) . '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);
return $phpbb3_ip;
}
$this->page_title = $user->lang['STAGE_IN_PROGRESS'];
$convert_prefix = request_var('convert_prefix', '');
$step = request_var('step', 0);
$next_update_url = $body = '';
switch ($step) {
case 0:
$batch_ary = array();
$current_batch = 1;
$current_batch_size = 1;
$sql = 'SELECT *
FROM ' . $convert_prefix . 'album_rate
ORDER BY rate_pic_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$ary = array('rate_image_id' => $row['rate_pic_id'], 'rate_user_id' => $row['rate_user_id'] < 0 ? ANONYMOUS : $row['rate_user_id'], 'rate_user_ip' => decode_ip($row['rate_user_ip']), 'rate_point' => $row['rate_point']);
$batch_ary[$current_batch][] = $ary;
$current_batch_size++;
if ($current_batch_size = $this->batch_size) {
$current_batch_size = 1;
$current_batch++;
}
}
$db->sql_freeresult($result);
foreach ($batch_ary as $batch => $ary) {
$db->sql_multi_insert(GALLERY_RATES_TABLE, $ary);
}
$body = $user->lang['CONVERTED_RATES'];
$next_update_url = append_sid("{$phpbb_root_path}install/index.{$phpEx}", "mode={$mode}&sub=in_progress&convert_prefix={$convert_prefix}&step=1");
break;
case 1:
$batch_ary = array();
$current_batch = 1;
$current_batch_size = 1;
$sql = 'SELECT c.*, u.user_colour
FROM ' . $convert_prefix . 'album_comment c
LEFT JOIN ' . USERS_TABLE . ' u
ON c.comment_user_id = u.user_id
ORDER BY c.comment_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$row['comment_uid'] = $row['comment_options'] = $row['comment_bitfield'] = '';
$row['comment'] = $row['comment_text'];
$comment_text_data = generate_text_for_edit($row['comment'], $row['comment_uid'], $row['comment_options']);
$comment_data = array('comment_id' => $row['comment_id'], 'comment_image_id' => $row['comment_pic_id'], 'comment_user_id' => $row['comment_user_id'] < 0 ? ANONYMOUS : $row['comment_user_id'], 'comment_username' => $row['comment_username'], 'comment_user_colour' => isset($row['user_colour']) ? $row['user_colour'] : '', 'comment_user_ip' => decode_ip($row['comment_user_ip']), 'comment_time' => $row['comment_time'], 'comment' => $comment_text_data['text'], 'comment_uid' => '', 'comment_bitfield' => '', 'comment_options' => 7, 'comment_edit_time' => isset($row['comment_edit_time']) ? $row['comment_edit_time'] : 0, 'comment_edit_count' => isset($row['comment_edit_count']) ? $row['comment_edit_count'] : 0, 'comment_edit_user_id' => isset($row['comment_edit_user_id']) ? $row['comment_edit_user_id'] < 0 ? ANONYMOUS : $row['comment_edit_user_id'] : 0);
generate_text_for_storage($comment_data['comment'], $comment_data['comment_uid'], $comment_data['comment_bitfield'], $comment_data['comment_options'], 1, 1, 1);
unset($comment_data['comment_options']);
$batch_ary[$current_batch][] = $comment_data;
$current_batch_size++;
if ($current_batch_size = $this->batch_size) {
$current_batch_size = 1;
$current_batch++;
}
}
$db->sql_freeresult($result);
foreach ($batch_ary as $batch => $ary) {
$db->sql_multi_insert(GALLERY_COMMENTS_TABLE, $ary);
}
$body = $user->lang['CONVERTED_COMMENTS'];
$next_update_url = append_sid("{$phpbb_root_path}install/index.{$phpEx}", "mode={$mode}&sub=in_progress&convert_prefix={$convert_prefix}&step=2");
break;
case 2:
$personal_albums = '0';
$left_id = 1;
$batch_ary = array();
$current_batch = 1;
$current_batch_size = 1;
$sql = 'SELECT *
FROM ' . $convert_prefix . 'album_cat
ORDER BY cat_order';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$row['cat_user_id'] = isset($row['cat_user_id']) ? $row['cat_user_id'] : 0;
if ($row['cat_user_id'] != 0) {
$personal_albums .= '_' . $row['cat_id'];
} else {
$row['album_desc_uid'] = $row['album_desc_options'] = $row['album_desc_bitfield'] = '';
$row['album_desc'] = $row['cat_desc'];
$album_desc_data = generate_text_for_edit($row['album_desc'], $row['album_desc_uid'], $row['album_desc_options']);
$album_data = array('album_id' => $row['cat_id'], 'album_name' => $row['cat_title'], 'parent_id' => 0, 'left_id' => $left_id, 'right_id' => $left_id + 1, 'album_parents' => '', 'album_type' => ALBUM_CAT, 'album_status' => ITEM_UNLOCKED, 'album_desc' => $album_desc_data['text'], 'album_desc_uid' => '', 'album_desc_bitfield' => '', 'album_desc_options' => 7);
generate_text_for_storage($album_data['album_desc'], $album_data['album_desc_uid'], $album_data['album_desc_bitfield'], $album_data['album_desc_options'], true, true, true);
$left_id = $left_id + 2;
$batch_ary[$current_batch][] = $album_data;
$current_batch_size++;
if ($current_batch_size = $this->batch_size) {
$current_batch_size = 1;
$current_batch++;
}
}
//.........这里部分代码省略.........
示例8: myerror
0
)') or myerror("Unable to save post", __FILE__, __LINE__, $db->error());
break;
// 0: Read the message [ Inbox ]
// 3: Saved a message [ Savebox ]
// 0: Read the message [ Inbox ]
// 3: Saved a message [ Savebox ]
case 0:
case 3:
$ob['owner'] = $ob['privmsgs_to_userid'];
$ob['sender'] = $ob['privmsgs_from_userid'];
$ob['status'] = 0;
$ob['showed'] = 1;
break;
}
// Save to database
$db->query('INSERT INTO ' . $db->prefix . 'messages
(owner, subject, message, sender, sender_id, posted, sender_ip, smileys, status, showed) VALUES(
' . $ob['owner'] . ',
\'' . addslashes($ob['privmsgs_subject']) . '\',
\'' . addslashes($ob['privmsgs_text']) . '\',
\'' . addslashes($ob['username']) . '\',
' . $ob['sender'] . ',
' . $ob['privmsgs_date'] . ',
\'' . decode_ip($ob['privmsgs_ip']) . '\',
' . $ob['privmsgs_enable_smilies'] . ',
' . $ob['status'] . ',
' . $ob['showed'] . '
)') or myerror("Unable to save post", __FILE__, __LINE__, $db->error());
}
convredirect('privmsgs_id', $_SESSION['phpnuke'] . 'privmsgs', $last_id);
示例9: message_die
if ($select_userlist == '') {
$select_userlist = '<option value="-1">' . $lang['No_banned_users'] . '</option>';
}
$select_userlist = '<select name="unban_user[]" multiple="multiple" size="5">' . $select_userlist . '</select>';
$sql = "SELECT ban_id, ban_ip, ban_email\n\t\tFROM " . BANLIST_TABLE;
if (!($result = DB()->sql_query($sql))) {
message_die(GENERAL_ERROR, 'Could not select current ip ban list', '', __LINE__, __FILE__, $sql);
}
$banlist = DB()->sql_fetchrowset($result);
DB()->sql_freeresult($result);
$select_iplist = '';
$select_emaillist = '';
for ($i = 0; $i < count($banlist); $i++) {
$ban_id = $banlist[$i]['ban_id'];
if (!empty($banlist[$i]['ban_ip'])) {
$ban_ip = str_replace('255', '*', decode_ip($banlist[$i]['ban_ip']));
$select_iplist .= '<option value="' . $ban_id . '">' . $ban_ip . '</option>';
$ipban_count++;
} else {
if (!empty($banlist[$i]['ban_email'])) {
$ban_email = $banlist[$i]['ban_email'];
$select_emaillist .= '<option value="' . $ban_id . '">' . $ban_email . '</option>';
$emailban_count++;
}
}
}
if ($select_iplist == '') {
$select_iplist = '<option value="-1">' . $lang['No_banned_ip'] . '</option>';
}
if ($select_emaillist == '') {
$select_emaillist = '<option value="-1">' . $lang['No_banned_email'] . '</option>';
示例10: myerror
<?php
if ($start == 0 && $_SESSION['phpnuke'] != '') {
echo '<script type="text/javascript">window.location="index.php?page=' . ++$_GET['page'] . '"</script>';
exit;
}
$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'banlist WHERE ban_id>' . $start . ' ORDER BY ban_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
$last_id = $ob['ban_id'];
$username = '';
if ($ob['ban_userid'] != 0) {
$res = $db->query('SELECT username FROM ' . $_SESSION['pun'] . 'users WHERE id=' . $ob['ban_userid']) or myerror("Unable to get userinfo for ban", __FILE__, __LINE__, $db->error());
list($username) = $db->fetch_row($res);
}
$ob['ban_ip'] == '' ? $ip = 'null' : ($ip = decode_ip($ob['ban_ip']));
$ob['ban_email'] == '' ? $ob['ban_email'] = 'null' : null;
// Dataarray
$todb = array('username' => $username, 'ip' => $ip, 'email' => $ob['ban_email']);
// Save data
insertdata('bans', $todb, __FILE__, __LINE__);
}
convredirect('ban_id', 'banlist', $last_id);
示例11: show_error
function show_error($the_error, $bypass_error = FALSE, $no_connection = 0)
{
global $sitename, $adminmail, $cpgdebugger, $userinfo;
$this->_backtrace();
$the_error .= "\n\nIn: " . $this->file . " on line: " . $this->line;
$the_error = 'On ' . (function_exists('get_uri') ? get_uri() : $_SERVER['REQUEST_URI']) . "\n" . $the_error;
$show = $no_connection || defined('INSTALL') ? 1 : is_admin() || NEXOS_DEBUG;
if ($show) {
if (!defined('INSTALL') && is_object($cpgdebugger)) {
trigger_error($the_error, E_USER_WARNING);
} else {
$the_error = '<html><body><center><h1>ERROR</h1><form><textarea rows="8" cols="60">' . htmlspecialchars($the_error, ENT_QUOTES, 'UTF-8') . '</textarea></form></body></html>';
die($the_error);
}
} else {
if ($adminmail && $adminmail != '') {
$addr = decode_ip(Security::get_ip());
$host = isset($_SERVER['REMOTE_HOST']) && $_SERVER['REMOTE_HOST'] != '' ? $_SERVER['REMOTE_HOST'] : gethostbyaddr($addr);
$the_error .= "\r\n\r\nGuest information:\r\nUser id: " . $userinfo['user_id'] . "\r\nUsername: " . $userinfo['username'] . "\r\nAdmin: " . ($show ? 'Yes' : 'No') . "\r\nIP: {$addr}\r\nHost: {$host}";
if (!send_mail($mailer_message, $the_error, 1, 'SQL Error on ' . $sitename)) {
echo $mailer_message;
}
}
}
if (!$bypass_error) {
$errorpage = '<b>A database error has occurred<br /><br />';
if (NEXOS_DEBUG) {
$errorpage .= "</b><textarea cols='60' rows='6'>{$the_error}</textarea>";
} else {
$errorpage .= 'The webmaster has been notified of the error</b>';
}
//header("HTTP/1.0 500 Internal Server Error");
if (function_exists('cpg_error')) {
cpg_error($errorpage, 'Database Error');
} else {
require_once 'includes/nexos_page.php';
$errorpage = nexos_header('Database Error') . $errorpage . cpg_footer();
die($errorpage);
}
}
}
示例12: migrate_phpbb_topic
function migrate_phpbb_topic($pTopicId, &$pRootComment)
{
global $db;
$sql = "SELECT bbp.*, bbpt.* FROM " . POSTS_TABLE . " bbp\n\t\t\t\tINNER JOIN " . POSTS_TEXT_TABLE . " bbpt ON(bbpt.post_id=bbp.post_id) \n\t\t\t\tINNER JOIN " . TOPICS_TABLE . " bbt ON(bbt.topic_id=bbp.topic_id) \n\t\t\tWHERE bbp.topic_id={$pTopicId} AND bbp.post_id != bbt.topic_first_post_id\n\t\t\tORDER BY bbp.post_time ";
if (!($result = $db->sql_query($sql))) {
message_die(GENERAL_ERROR, "Could not obtain topic/post information.", '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result)) {
print "Migrating Post {$row['post_id']}<br/>\n";
$commentHash = array();
$commentHash['root_id'] = $pRootComment->getField('root_id');
$commentHash['parent_id'] = $pRootComment->getField('content_id');
$commentHash['anon_name'] = $row['post_username'];
$commentHash['title'] = $row['post_subject'];
$commentHash['edit'] = $row['post_text'];
$commentHash['format_guid'] = 'bbcode';
$commentHash['created'] = $row['post_time'];
$commentHash['last_modified'] = $row['post_edit_time'];
$commentHash['user_id'] = $row['poster_id'];
$commentHash['modifier_user_id'] = $row['poster_id'];
$commentHash['ip'] = decode_ip($row['poster_ip']);
$newComment = new LibertyComment();
if ($newComment->storeComment($commentHash)) {
$postHash['migrate_post_id'] = $row['post_id'];
$newPost = new BitBoardPost($newComment->mCommentId);
$newPost->store($postHash);
} else {
vd($row);
vd($commentHash);
vd($newComment->mErrors);
die;
}
}
}
示例13: while
$mods_rowset = $db->sql_fetchrowset($result_mods);
include $phpbb_root_path . 'includes/emailer.' . $phpEx;
while ($i < $total_mods) {
$script_name = preg_replace('/^\\/?(.*?)\\/?$/', '\\1', trim($board_config['script_path'])) . '/viewtopic.' . $phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
$server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->email_address($mods_rowset[$i]['user_email']);
$email_headers = "To: \"" . $mods_rowset[$i]['username'] . "\" <" . $mods_rowset[$i]['user_email'] . ">\r\n";
$email_headers .= "From: \"" . $board_config['sitename'] . "\" <" . $board_config['board_email'] . ">\r\n";
$email_headers .= "Return-Path: " . ($userdata['user_email'] && $userdata['user_viewemail'] ? $userdata['user_email'] . "\r\n" : "\r\n");
$email_headers .= "X-AntiAbuse: Board servername - " . $server_name . "\r\n";
$email_headers .= "X-AntiAbuse: User_id - " . $userdata['user_id'] . "\r\n";
$email_headers .= "X-AntiAbuse: Username - " . $userdata['username'] . "\r\n";
$email_headers .= "X-AntiAbuse: User IP - " . decode_ip($user_ip) . "\r\n";
$emailer->use_template("repport_post", file_exists($phpbb_root_path . "language/lang_" . $mods_rowset[$i]['user_lang'] . "/email/repport_post.tpl") ? $mods_rowset[$i]['user_lang'] : "");
$i++;
// $emailer->set_subject($lang['Post_repport']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array('POST_URL' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . "={$post_id}#{$post_id}", 'POST_SUBJECT' => $post_subject, 'FORUM_NAME' => $forum_name, 'USER' => '"' . $userdata['username'] . '"', 'NUMBER_OF_REPPORTS' => $blue_card, 'SITENAME' => $board_config['sitename'], 'BOARD_EMAIL' => $board_config['board_email']));
$emailer->send();
$emailer->reset();
}
}
message_die(GENERAL_MESSAGE, ($total_mods ? sprintf($lang['Post_repported'], $total_mods) : $lang['Post_repported_1']) . "<br /><br />" . ($board_config['report_forum'] ? sprintf($lang['Send_message'], "<a href=\"" . append_sid("posting.{$phpEx}?mode=" . ($allready_reported ? "reply&t=" . $allready_reported : "newtopic&f=" . $board_config['report_forum']) . "&postreport=" . $post_id) . "\">", "</a>") : "") . sprintf($lang['Click_return_viewtopic'], "<a href=\"" . append_sid("viewtopic.{$phpEx}?p=" . $post_id . "#" . $post_id) . "\">", "</a>"));
} else {
if ($mode == 'unban') {
$no_error_ban = FALSE;
if (!$is_auth['auth_greencard']) {
message_die(GENERAL_ERROR, $lang['Not_Authorised']);
示例14: isset
} else {
$cpgtpl->assign_var('DL_REVIEWS', false);
}
$db->sql_freeresult($result);
if (can_admin($module_name) || $row['submitter'] == $userinfo['user_id']) {
// pagination
$cur_page2 = isset($_GET['p_page']) && $_GET['p_page'] > 0 ? intval($_GET['p_page']) : 1;
$limit2 = ($cur_page2 - 1) * $perpage;
$result = $db->sql_query("SELECT r.id, r.uid, r.ip, r.title, r.comment, r.score, r.timestamp, u.username, COUNT(r.score) AS votes FROM " . $dl_prefix . "_ratings r\n\tLEFT JOIN " . $user_prefix . "_users u ON (u.user_id = r.uid)\n\tWHERE r.lid='{$global_id}' AND r.comment!='' AND active=0 \n\tGROUP BY r.id DESC, r.uid, r.ip, r.title, r.comment, r.score, r.timestamp, u.username \n\tLIMIT {$perpage} OFFSET {$limit2}");
list($pending) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $dl_prefix . "_ratings \n\tWHERE lid='{$global_id}' AND active=0");
if ($db->sql_numrows($result)) {
$cpgtpl->assign_vars(array('DL_P_REVIEW_PAGES' => ceil($pending / $perpage) > 1 ? gen_pagination($pending, $perpage, $cur_page2, '&file=details&id=' . $global_id, 'p_reviews', 'p_page') : false, 'DL_P_REVIEWS' => $pending));
$i = 0;
while (list($review_id, $review_uid, $review_ip, $review_title, $review_comment, $review_score, $review_timestamp, $review_uname, $review_votes) = $db->sql_fetchrow($result)) {
$rating_info = get_rating($review_score, $review_votes);
$cpgtpl->assign_block_vars('dl_p_review', array('ID' => $review_id, 'U_ID' => htmlprepare(URL::uri()) . '#r' . $review_id, 'RATING' => _DLP_REVIEW . ' #' . $review_id . ': ' . $rating_info['desc'], 'U_MEMBER' => URL::index('Your_Account&profile=' . $review_uid), 'MEMBERNAME' => $review_uname, 'DATE' => generate_date($review_timestamp), 'U_DEL' => can_admin($module_name) || $row['submitter'] == $userinfo['user_id'] ? '<a href="' . URL::index('&del_review=' . $review_id) . '">[' . strtolower(_DELETE) . ']</a>' : false, 'U_APPR' => can_admin($module_name) || $row['submitter'] == $userinfo['user_id'] ? '<a href="' . URL::index('&approve_review=' . $review_id) . '">[' . strtolower(_DLP_APPROVE) . ']</a>' : false, 'TITLE' => $review_title, 'COMMENT' => decode_bb_all($review_comment), 'IP' => decode_ip($review_ip), 'IMG_RATE' => dl_image('stars/' . $rating_info['rating'] . '.png'), 'SPACER' => $i > 0));
$i++;
}
} else {
$cpgtpl->assign_var('DL_P_REVIEWS', false);
}
$db->sql_freeresult($result);
} else {
$cpgtpl->assign_var('DL_P_REVIEWS', false);
}
}
if ($row['pick']) {
$cpgtpl->assign_block_vars('dl_image', array('SRC' => dl_image('pick.png'), 'TITLE' => _DLP_EDPICK));
}
// custom fields: images
$result = $db->sql_query("SELECT field, img_path, img_alt FROM " . $dl_prefix . "_fields \n\tWHERE type=3 AND visible > 0");
示例15: AND
$sql .= " AND (link_title LIKE '%{$search_keywords}%' OR link_desc LIKE '% {$search_keywords}%') ORDER BY link_id DESC LIMIT {$start}, {$linkspp}";
} else {
$sql .= " ORDER BY link_id DESC LIMIT {$start}, {$linkspp}";
}
if (!($result = $db->sql_query($sql))) {
message_die(GENERAL_ERROR, "Couldn not query links list.", '', __LINE__, __FILE__, $sql);
}
if ($row = $db->sql_fetchrow($result)) {
$i = 0;
do {
$row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
$link_id = $row['link_id'];
$link_id .= '&sid=' . $userdata['session_id'] . '';
$user_id = $row['user_id'];
$username = $row['username'];
$template->assign_block_vars("linkrow", array('ROW_CLASS' => $row_class, 'LINK_ID' => $link_id, 'LINK_TITLE' => $row['link_title'], 'LINK_URL' => $row['link_url'], 'LINK_CATEGORY' => $link_categories[$row['link_category']], 'U_LINK_USER' => $user_id != ANONYMOUS ? "<a href=\"../profile.{$phpEx}?mode=viewprofile&" . POST_USERS_URL . "={$user_id}\" target=\"_blank\">{$username}</a>" : $username, 'LINK_JOINED' => create_date($lang['DATE_FORMAT'], $row['link_joined'], $board_config['board_timezone']), 'LINK_USER_IP' => decode_ip($row['user_ip']), 'LINK_DESC' => $row['link_desc'], 'LINK_ACTIVE' => '<font color="' . ($row['link_active'] ? 'green">' . $lang['ON'] : 'red">' . $lang['OFF']) . '</font>', 'LINK_HITS' => $row['link_hits']));
$i++;
} while ($row = $db->sql_fetchrow($result));
}
//
// Pagination
//
$sql = "SELECT count(*) AS total\n\t\t\tFROM " . LINKS_TABLE;
if ($search_keywords) {
$sql .= " AND (link_title LIKE '%{$search_keywords}%' OR link_desc LIKE '%{$search_keywords} %')";
$link_search = $lang['Search_site'] . " » " . $search_keywords;
$template->assign_vars(array('L_SEARCH_SITE' => $link_search));
}
if (!($result = $db->sql_query($sql))) {
message_die(GENERAL_ERROR, 'Could not query links number', '', __LINE__, __FILE__, $sql);
}