function verifyTiezi_send($uid, $tid, $pid, $water = 'StusGame Tieba Cloud Sign Plugin "verifyTiezi"', $device = 4) { if (empty($uid) || empty($tid) || empty($pid)) { return array('status' => '1', 'msg' => ''); } $ck = misc::GetCookie($pid); $xs = verifyTiezi_gettie($tid, $ck); $x = array('BDUSS' => $ck, '_client_id' => 'wappc_136' . rand_int(10) . '_' . rand_int(3), '_client_type' => $device, '_client_version' => '5.0.0', '_phone_imei' => md5(rand_int(16)), 'anonymous' => '0', 'content' => $water, 'fid' => $xs['fid'], 'kw' => $xs['word'], 'net_type' => '3', 'tbs' => $xs['tbs'], 'tid' => $tid, 'title' => ''); $y = ''; foreach ($x as $key => $value) { $y .= $key . '=' . $value; } $x['sign'] = strtoupper(md5($y . 'tiebaclient!!!')); $c = new wcurl('http://c.tieba.baidu.com/c/c/post/add', array('Content-Type: application/x-www-form-urlencoded')); /* //Note:普通的 $x = verifyTiezi_gettie($tid,$ck); $c = new wcurl('http://tieba.baidu.com'.$x['__formurl']); unset($x['__formurl']); $x['co'] = $water; */ $c->addcookie('BDUSS=' . $ck); $return = json_decode($c->post($x), true); $c->close(); if (!empty($return['error_code']) && $return['error_code'] != '1') { return array('status' => $return['error_code'], 'msg' => $return['error_msg']); } else { return array('status' => '1', 'msg' => ''); } }
function report($id, $name, $down, $up, $rank, $first, $last) { if ($down > 0) { $ratio = substr($up / $down, 0, 5); } else { $ratio = "∞"; } if ($down > $up) { $diff = "<b><font color='red'>↓ " . misc::makesize($down - $up) . "</font></b>"; } elseif ($up > $down) { $diff = "<b><font color='blue'>↑ " . misc::makesize($up - $down) . "</font></b>"; } else { $diff = "<b><font color='cyan'>0</font></b>"; } print "\n<tr>\n<td class='lista' align='center'><b><font color='blue'>" . $id . "</font></b></td>"; print "\n<td class='lista' align='center'><b><font color='lavender'><a href='userdetails.php?id=" . $id . "'>" . $name . "</a></font></b></td>"; print "\n<td class='lista' align='center'><b><font color='red'>↓ " . misc::makesize($down) . "</b></font></td>"; print "\n<td class='lista' align='center'><b><font color='green'>↑ " . misc::makesize($up) . "</b></font></td>"; print "\n<td class='lista' align='center'><b>" . $ratio . "</b></td>"; print "\n<td class='lista' align='center'><b>" . $rank . "</b></td>"; print "\n<td class='lista' align='center'><b>" . $diff . "</b></td>"; print "\n<td class='lista' align='center'><b>" . date("d/m/Y H:i:s", $first) . "</b></td>"; print "\n<td class='lista' align='center'><b>" . date("d/m/Y H:i:s", $last) . "</b></td>"; print "\n<td class='lista' align='center'><b><a href='account.php?act=mod&uid=" . $id . "&returnto=admincp.php?user="******"uid"] . "&code=" . user::$current["random"] . "&do=searchdiff'><img src='./style/base/edit.png' border='0' alt='Edit'/></b></td>"; print "\n<td class='lista' align='center'><b><a href='account.php?act=del&uid=" . $id . "&returnto=admincp.php?user="******"uid"] . "&code=" . user::$current["random"] . "&do=searchdiff'><img src='./style/base/delete.png' border='0' alt='Delete'/></b></td>"; print "\n<td class='lista' align='center'><input type='checkbox' name='uyedegis[]' value='" . $id . "' /></td>\n</tr>"; }
function FlashCounterViewDataSet($DATA) { global $blog, $service; requireComponent('Textcube.Function.misc'); $cfg = misc::fetchConfigVal($DATA); if (!isset($blog['blogLanguage'])) { $blog['blogLanguage'] = $service['language']; } // Locale language file support. switch ($blog['blogLanguage']) { case "zh-TW": $retval = 'Flash 計數器尺寸 "205x85" 僅適用於黑色底色設定。'; break; case "zh-CN": $retval = 'Flash 计数器尺寸 "205x85" 仅适用于黑色底色设定。'; break; default: $retval = "플래쉬카운터 '205x85' 크기는 검정색만 설정가능합니다."; } if ($cfg['flashsize'] == '205') { if ($cfg['flashcolor'] == 'white') { return $retval; } } return true; }
public function add() { global $db; $recipient = new user(); if ($recipient->get('name', $this->data['recipient']) == 'done') { $sender = new user(); if ($sender->get('name', $this->data['sender']) == 'done') { if (!$sender->isBlocked($recipient->data['id'])) { $this->data['id'] = misc::newId('messages'); $sent = strftime('%Y-%m-%d %H:%M:%S', time()); $db->query('insert into messages (id, sender, recipient, subject, body, sent, viewed) values ("' . $this->data['id'] . '", "' . $sender->data['id'] . '", "' . $recipient->data['id'] . '", "' . $this->data['subject'] . '", "' . $this->data['body'] . '", "' . $sent . '", "' . $this->data['viewed'] . '")'); if ($db->affected_rows() > -1) { $status = 'done'; } else { $status = 'error'; } } else { $status = 'blocked'; } } else { $status = 'noSender'; } } else { $status = 'noRecipient'; } return $status; }
function EntriesWithTags_DataSet($data) { requireComponent('Textcube.Function.misc'); $cfg = misc::fetchConfigVal($data); if (!$cfg['entries'] || empty($cfg['entries']) || intval($cfg['entries'] <= 0)) { $cfg['entries'] = 5; } return true; }
/** * 云签到内部计划任务 * [重新尝试签到出错的贴吧] */ function cron_system_sign_retry() { global $i; $today = date('Y-m-d'); $sign_again = unserialize(option::get('cron_sign_again')); if ($sign_again['lastdo'] != $today) { option::set('cron_sign_again', serialize(array('num' => 0, 'lastdo' => $today))); } foreach ($i['table'] as $value) { misc::DoSign_retry($value); } }
function cron_signtz_mail() { global $m; $today = date("Y-m-d"); $lastday = option::get('haotian_mail'); if ((time() - 1396281600) % 86400 < 21600) { return '未到发送邮件时间'; } if ($today != $lastday) { option::set('haotian_mail', $today); } else { return '今日任务已经执行完毕'; } $query = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users`"); while ($fetch = $m->fetch_array($query)) { $mail = $fetch['email']; $name = $fetch['name']; $id = $fetch['id']; if (option::uget('haotian_mail_enable', $id) == 1) { $title = "[" . date("Y-m-d") . "] " . SYSTEM_NAME . " - {$name} - 签到报告"; $query2 = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "tieba` WHERE `uid`={$id}"); $c = 0; $content = '<p class="sign_title">' . SYSTEM_NAME . ' - 签到报告</p><p>' . date("Y-m-d") . '<br>站点地址:<a href="' . SYSTEM_URL . '">' . SYSTEM_URL . '</a>' . '<br>若有大量贴吧签到失败,建议您重新设置 Cookie 相关信息</p><table class="result_table"><thead><tr><td style="width: 40px">#</td><td>贴吧</td><td style="width: 75px">状态</td><td style="width: 75px">经验</td></tr></thead><tbody>'; while ($ff = $m->fetch_array($query2)) { $c++; $tie8 = $ff['tieba']; $status = $ff['status']; $content .= "<tr><td>{$c}</td><td><a href=" . '"http://tieba.baidu.com/f?kw=' . urlencode($tie8) . '" target="_blank">' . $tie8 . '</a>' . "</td>"; if ($status == 0) { $content .= "<td>已签到</td><td>+8</td>"; } else { $content .= "<td>签到失败</td><td>-</td>"; } $content .= "</tr>"; } $content .= "</tbody></table>"; $content = '<style type="text/css">div.wrapper * { font: 12px "Microsoft YaHei", arial, helvetica, sans-serif; word-break: break-all; }div.wrapper a { color: #15c; text-decoration: none; }div.wrapper a:active { color: #d14836; }div.wrapper a:hover { text-decoration: underline; }div.wrapper p { line-height: 20px; margin: 0 0 .5em; text-align: center; }div.wrapper .sign_title { font-size: 20px; line-height: 24px; }div.wrapper .result_table { width: 85%; margin: 0 auto; border-spacing: 0; border-collapse: collapse; }div.wrapper .result_table td { padding: 10px 5px; text-align: center; border: 1px solid #dedede; }div.wrapper .result_table tr { background: #d5d5d5; }div.wrapper .result_table tbody tr { background: #efefef; }div.wrapper .result_table tbody tr:nth-child(odd) { background: #fafafa; }</style><div class="wrapper">' . $content . '</div><br><p style="font-size: 12px; color: #9f9f9f; text-align: right; border-top: 1px solid #dedede; padding: 20px 10px 0; margin-top: 25px;">此封邮件来自 百度贴吧云签到<br>Haotian Mail API v0.1, 2014 © <a href="http://ihaotian.me/">Haotian\'s Laboratory</a>.</p>'; if ($c == 0) { continue; } $x = misc::mail($mail, $title, $content); if ($x != true) { return '发送失败,错误日志:' . $x; } } } return '邮件发送成功!'; }
/** * Sets the template of the view. * * @param int The current step * @return void */ protected function setViewSubpart($step) { $this->finished = FALSE; if (intval($this->utilityFuncs->getSingle($this->settings, 'skipView')) === 1) { $this->finished = TRUE; } elseif (strstr($this->templateFile, '###TEMPLATE_FORM' . $step . $this->settings['templateSuffix'] . '###')) { // search for ###TEMPLATE_FORM[step][suffix]### $this->utilityFuncs->debugMessage('using_subpart', array('###TEMPLATE_FORM' . $step . $this->settings['templateSuffix'] . '###')); $this->view->setTemplate($this->templateFile, 'FORM' . $step . $this->settings['templateSuffix']); } elseif (!isset($this->settings['templateSuffix']) && strstr($this->templateFile, '###TEMPLATE_FORM' . $step . '###')) { //search for ###TEMPLATE_FORM[step]### $this->utilityFuncs->debugMessage('using_subpart', array('###TEMPLATE_FORM' . $step . '###')); $this->view->setTemplate($this->templateFile, 'FORM' . $step); } elseif (intval($step) === intval($this->globals->getSession()->get('lastStep')) + 1) { $this->finished = TRUE; } }
function cron_pch18_relist() { global $m; $query = $m->query("SELECT DISTINCT id,uid FROM `" . DB_PREFIX . "baiduid` "); while ($fetch = $m->fetch_array($query)) { $id = $fetch['id']; $uid = $fetch['uid']; $isqd_query = $m->query("SELECT * FROM `" . DB_PREFIX . "pch18_relist` where id=" . $id . " and lastdate='" . date("Y-m-d") . "'"); $isqd_fetch = $m->fetch_array($isqd_query); $setqd = option::uget('pch18_relist_enable', $uid); if (!empty($setqd)) { //user表里面开启签到功能 $r = misc::scanTiebaByPid($id); //更新列表函数 $m->query("REPLACE INTO `" . DB_NAME . "`.`" . DB_PREFIX . "pch18_relist` SET `lastdate` = '" . date("Y-m-d") . "', id = " . $id); } } }
/** * 变量名称 * @param $verifyKey 发送邮件中的key,用于验证用户身份是否与$verifyCode匹配 * @param $query SQL查询语句 * @param $url 验证链接地址 * @param $verifyCode 验证码 * @param $pluginName 插件名 */ function sendMail($userMail, $uid) { global $m; global $today; $pluginName = 'white_vmail'; // 获取8位数的随机验证码并加密 $verifyCode = rand_int(8); $verifyKey = sha1(md5($verifyCode)); $url = SYSTEM_URL . '?plugin=' . $pluginName . '&key=' . $verifyKey; $title = '邮箱验证 -- ' . SYSTEM_NAME; $text = '亲爱的用户:<br><br>您好!<br><br>这是来自学园百度贴吧云签到平台的验证邮件,用来验证您的用户邮箱。<br><br>请登录学园百度贴吧云签到平台后点击该链接,以便验证你的邮箱。<br><br>提示:必须登录后点击!必须登录后点击!必须登录后点击! 否则无法验证!谢谢合作!<br><br>系统将会自动清除注册一定时间后没验证邮箱的用户!<hr/>验证链接:' . $url . '<br>(如果您无法点击此链接,请将它复制到浏览器地址栏后访问)<br><br><br>' . SYSTEM_NAME . '<br><br>(本邮件为系统自动发送,请勿回复)'; $mailResult = misc::mail($userMail, $title, $text); if ($mailResult != TRUE) { msg("向" . $userMail . "发送邮件失败。"); } $m->query("UPDATE " . DB_PREFIX . "users SET white_vmail_send = 1, white_vmail_code = " . $verifyCode . " WHERE id = " . $uid); Redirect(SYSTEM_URL . "index.php?mod=admin:setplug&plug=white_vmail"); }
public function add($nodeId) { global $db, $game; $alliance = new alliance(); if ($alliance->get('name', $this->data['name']) == 'noAlliance') { $node = new node(); if ($node->get('id', $nodeId) == 'done') { $node->checkResources(time()); $addCost = $game['factions'][$node->data['faction']]['costs']['alliance']; $addCostData = $node->checkCost($addCost, 'alliance'); if ($addCostData['ok']) { $ok = 1; foreach ($addCost as $cost) { $node->resources[$cost['resource']]['value'] -= $cost['value'] * $game['users']['cost']['alliance']; $db->query('update resources set value="' . $node->resources[$cost['resource']]['value'] . '" where node="' . $node->data['id'] . '" and id="' . $cost['resource'] . '"'); if ($db->affected_rows() == -1) { $ok = 0; } } $this->data['id'] = misc::newId('alliances'); $db->query('insert into alliances (id, user, name) values ("' . $this->data['id'] . '", "' . $node->data['user'] . '", "' . $this->data['name'] . '")'); if ($db->affected_rows() == -1) { $ok = 0; } $db->query('update users set alliance="' . $this->data['id'] . '" where id="' . $this->data['user'] . '"'); if ($db->affected_rows() == -1) { $ok = 0; } if ($ok) { $status = 'done'; } else { $status = 'error'; } } else { $status = 'notEnoughResources'; } } else { $status = 'noNode'; } } else { $status = 'nameTaken'; } return $status; }
function display() { global $conn, $config, $lang; require_once $config['basepath'] . '/include/misc.inc.php'; $misc = new misc(); // Make Sure we passed the PageID $display = ''; if (!isset($_GET['PageID'])) { $display .= "ERROR. PageID not sent"; } $page_id = $misc->make_db_safe($_GET['PageID']); $display .= '<div class="page_display">'; $sql = "SELECT pagesmain_full,pagesmain_id FROM " . $config['table_prefix'] . "pagesmain WHERE pagesmain_id=" . $page_id; $recordSet = $conn->Execute($sql); if ($recordSet === false) { $misc->log_error($sql); } $full = html_entity_decode($misc->make_db_unsafe($recordSet->fields['pagesmain_full']), ENT_NOQUOTES, $config['charset']); //$full = $misc->make_db_unsafe($recordSet->fields['pagesmain_full']); $id = $recordSet->fields['pagesmain_id']; if ($config["wysiwyg_execute_php"] == 1) { ob_start(); $full = str_replace("<!--<?php", "<?php", $full); $full = str_replace("?>-->", "?>", $full); eval('?>' . "{$full}" . '<?php '); $display .= ob_get_contents(); ob_end_clean(); } else { $display .= $full; } // Allow Admin To Edit # if (isset($_SESSION['editpages']) && $_SESSION['admin_privs'] == 'yes' && $config["wysiwyg_show_edit"] == 1) { $display .= "<p> </p>"; $display .= "<a href=\"{$config['baseurl']}/admin/index.php?action=edit_page&id={$id}\">{$lang['edit_html_from_site']}</a>"; } $display .= '</div>'; // parse page for template varibales require_once $config['basepath'] . '/include/class/template/core.inc.php'; $template = new page_user(); $template->page = $display; $template->replace_tags(array('templated_search_form', 'featured_listings_horizontal', 'featured_listings_vertical', 'company_name', 'link_printer_friendly')); $display = $template->return_page(); return $display; }
function cron_wmzz_zan() { require_once SYSTEM_ROOT . '/plugins/Cloud_Click/zan.php'; $set = unserialize(option::get('plugin_Cloud_Click')); $today = date('Y-m-d'); global $m; //准备:扫描wmzz_zan表中lastdo不是今天的,然后更新wmzz_zan_data表的remain $sy = $m->query("SELECT * FROM `" . DB_PREFIX . "wmzz_zan` WHERE `lastdo` != '{$today}';"); while ($sx = $m->fetch_array($sy)) { $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan_data` SET `remain` = \'' . $sx['num'] . '\' WHERE `uid` = ' . $sx['uid']); $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan` SET `lastdo` = \'' . $today . '\' WHERE `uid` = ' . $sx['uid']); } //开始:计划任务 $count = $m->once_fetch_array("SELECT COUNT(*) AS `c` FROM `" . DB_PREFIX . "wmzz_zan_data` WHERE `remain` > '0' LIMIT {$set['rem']};"); if ($count['c'] == $set['rem']) { $y = rand_row(DB_PREFIX . 'wmzz_zan_data', 'id', $set['rem'], "`remain` > '0'"); } else { $y = rand_row(DB_PREFIX . 'wmzz_zan_data', 'id', $count['c'], "`remain` > '0'"); } //如果只有一条记录的兼容方案 if (isset($y['tieba'])) { $y = array(0 => $y); } //点赞 foreach ($y as $x) { if (!empty($x['pid'])) { $remain = $x['remain'] - $set['num']; $res = wmzz_zan_donow(misc::GetCookie($x['pid']), $x['tieba'], $set['num']); $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan_data` SET `remain` = \'' . $remain . '\' WHERE `tieba` = \'' . $x['tieba'] . '\' AND `uid` = ' . $x['uid']); sleep($set['sleep']); } } /* while ($v = $m->fetch_array($x)) { $u = $m->once_fetch_array("SELECT * FROM `".DB_NAME."`.`".DB_PREFIX."users` WHERE `id` = '{$v['uid']}' LIMIT 1"); $variable = unserialize($v['tieba']); foreach ($variable as $value) { wmzz_zan_get_list($u['ck_bduss'],$value['tieba'],$s['sleep'],$v['max'],$s['sp']); } $m->query("UPDATE `".DB_NAME."`.`".DB_PREFIX."wmzz_zan` SET `lastdo` = '".$today."' WHERE `id` = ".$v['id']); } */ }
public function add() { global $db, $game; $user = new user(); if ($user->get('name', $this->data['name']) == 'noUser') { if ($user->get('email', $this->data['email']) == 'noUser') { if (!blacklist::check('ip', $this->data['ip'])) { if (!blacklist::check('email', $this->data['email'])) { $ok = 1; $this->data['id'] = misc::newId('users'); $db->query('insert into users (id, name, password, email, level, joined, lastVisit, ip, template, locale) values ("' . $this->data['id'] . '", "' . $this->data['name'] . '", "' . $this->data['password'] . '", "' . $this->data['email'] . '", "' . $this->data['level'] . '", "' . $this->data['joined'] . '", "' . $this->data['lastVisit'] . '", "' . $this->data['ip'] . '", "' . $this->data['template'] . '", "' . $this->data['locale'] . '")'); if ($db->affected_rows() == -1) { $ok = 0; } $preferences = array(); foreach ($game['users']['preferences'] as $key => $preference) { $preferences[] = '("' . $this->data['id'] . '", "' . $key . '", "' . $preference . '")'; } $preferences = implode(', ', $preferences); $db->query('insert into preferences (user, name, value) values ' . $preferences); if ($db->affected_rows() == -1) { $ok = 0; } if ($ok) { $status = 'done'; } else { $status = 'error'; } } else { $status = 'emailBanned'; } } else { $status = 'ipBanned'; } } else { $status = 'emailInUse'; } } else { $status = 'nameTaken'; } return $status; }
function cron_wmzz_ban() { global $m; $s = unserialize(option::get('plugin_wmzz_ban')); $now = strtotime(date('Y-m-d')); $y = $m->query("SELECT * FROM `" . DB_PREFIX . "wmzz_ban` WHERE `nextdo` <= '{$now}' LIMIT {$s['limit']}"); while ($x = $m->fetch_array($y)) { $r = wmzz_ban_getTime($x['date']); if ($r != '-1') { $bduss = misc::getCookie($x['pid']); $c = new wcurl('http://tieba.baidu.com/pmc/blockid'); $c->addcookie('BDUSS=' . $bduss); $c->post(array('user_name[]' => $x['user'], 'day' => $r, 'fid' => misc::getFid($x['tieba']), 'tbs' => misc::getTbs($x['uid'], $bduss), 'ie' => 'utf-8', 'reason' => $s['msg'])); $next = $now + $r * 86400; $m->query("UPDATE `" . DB_PREFIX . "wmzz_ban` SET `nextdo` = '{$next}' WHERE `id` = '{$x['id']}'"); } else { $m->query("DELETE FROM `" . DB_PREFIX . "wmzz_ban` WHERE `id` = '{$x['id']}'"); } } }
public function editAction() { $id = intval($this->getRequest()->getQuery('id')); if ($this->getRequest()->isPost()) { $value = ['username' => core::safe_str($this->getRequest()->getPost('username')), 'name' => core::safe_str($this->getRequest()->getPost('name')), 'nickname' => core::safe_str($this->getRequest()->getPost('nickname')), 'gender' => intval($this->getRequest()->getPost('gender')), 'phone' => core::safe_str($this->getRequest()->getPost('phone')), 'email' => core::is_email($this->getRequest()->getPost('email')) ? $this->getRequest()->getPost('email') : NULL, 'status' => intval($this->getRequest()->getPost('status')), 'birthday' => misc::is_date($this->getRequest()->getPost('birthday'), '-') ? strtotime($this->getRequest()->getPost('birthday')) : NULL]; if ($this->member->update($value, ['id' => intval($this->getRequest()->getPost('id'))])) { Alert::success('更新成功!'); } else { Alert::success('没有任何变化!'); } $this->redirect($this->getRequest()->getPost('referer')); } else { if ($data = $this->member->getMemberByAttribute(['id' => $id])) { $data['referer'] = $_SERVER["HTTP_REFERER"]; $this->getView()->assign('data', $data); } else { Alert::success('没有此用户!'); $this->redirect('/admin/managemember/index'); } } }
function _torrenttable($res, $frame_caption, $speed = "false") { global $db; block_begin($frame_caption, 'center'); begin_table(); $num = 0; while ($a = $res->fetch_assoc()) { ++$num; if ($a["leechers"] > 0) { $r = (int) $a["seeds"] / (int) $a["leechers"]; $ratio = number_format($r, 2); } else { $ratio = INFINITE; } if (!isset($menu)) { $menu = ""; } if ($menu != "1") { echo "<tr>" . "<table width='100%' class='lista'>" . "<td class='header' align='center'>" . USER_LEVEL . "</td>" . "<td class='header'>" . FILE . "</td>"; if ($speed != "true") { echo "<td class='header' align='center'>" . FINISHED . "</td>" . "<td class='header' align='center'>" . SEEDERS . "</td>" . "<td class='header' align='center'>" . LEECHERS . "</td>" . "<td class='header' align='center'>" . PEERS . "</td>" . "<td class='header' align='center'>" . RATIO . "</td>"; } else { echo "<td class='header' align='right'>" . SPEED . "</td>"; } echo "</tr>"; $menu = 1; } print "<tr><td class='lista' align='center'>" . $num . "</td><td class='lista' align='left'>"; print "<a href='" . "details.php?id=" . $a['hash'] . "'>" . "<b>"; print security::html_safe($a["name"]) . "</b></a></td>"; if ($speed != "true") { print "<td class='lista' align='center' width='10%' ><a href='torrent_history.php?id=" . $a["hash"] . "'>" . number_format((int) $a["finished"]) . "</a></td><td class='lista' align='center' width='10%' ><a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["seeds"]) . "</a></td><td class='lista' align='center' width='10%' > <a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["leechers"]) . "</a></td><td class='lista' align='center' width='10%' > <a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["leechers"] + (int) $a["seeds"]) . "</a></td><td class='lista' align='center' width='10%'>" . $ratio . "</td>\n"; } else { print "<td class='lista' align='center'>" . misc::makesize((int) $a["speed"]) . "/s" . "\n"; } } end_table(); block_end(); }
function cron_wmzz_mailer() { global $m; $check = option::get('wmzz_mailer_check'); if ($check == '1') { $text = option::get('wmzz_mailer_text'); $title = option::get('wmzz_mailer_title'); $limit = option::get('wmzz_mailer_limit'); $last = option::get('wmzz_mailer_last'); $done = 0; $z = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` LIMIT {$last},{$limit}"); while ($v = $m->fetch_array($z)) { $done++; misc::mail($v['email'], $title, $text); } if ($done - $limit <= -1) { option::set('wmzz_mailer_check', '0'); option::set('wmzz_mailer_last', '0'); cron::set('wmzz_mailer', 'plugins/wmzz_mailer/wmzz_mailer_cron.php', 1); return '所有邮件群发任务于 ' . date('Y-m-d H:m:s') . ' 完成'; } option::set('wmzz_mailer_last', $done + $last); } }
$dump .= 'MySQL Server Version : ' . $m->getMysqlVersion() . PHP_EOL; $dump .= 'Date: ' . date('Y-m-d H:i:s') . PHP_EOL; $dump .= '*/' . PHP_EOL . PHP_EOL; $dump .= '-------------- Start --------------' . PHP_EOL . PHP_EOL; $dump .= 'SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";' . PHP_EOL; $dump .= 'SET FOREIGN_KEY_CHECKS=0;' . PHP_EOL; $dump .= 'SET time_zone = "+8:00";' . PHP_EOL . PHP_EOL; while ($v = $m->fetch_array($e)) { $list = $v; foreach ($list as $table) { $dump .= dataBak($table); } } $dump .= PHP_EOL . '-------------- End --------------'; $title = SYSTEM_NAME . " " . date('Y-m-d') . " 数据库备份"; $x = misc::mail($email, $title, "备份文件已附上,请查看附件", array('backup-' . date('Ymd') . '.sql' => $dump)); if ($x != true) { option::set('dl_backup_log', date('Y-m-d H:i:s') . ' 数据库备份邮件发送失败!'); ReDirect(SYSTEM_URL . 'index.php?mod=admin:setplug&plug=dl_backup&wrong'); } else { option::set('dl_backup_log', date('Y-m-d H:i:s') . ' 数据库备份邮件发送成功!'); ReDirect(SYSTEM_URL . 'index.php?mod=admin:setplug&plug=dl_backup&success'); } } } ?> <h3>自动数据库备份设置</h3><br/> <form action="index.php?mod=admin:setplug&plug=dl_backup&set" method="post"> <div class="input-group"> <span class="input-group-addon">接收备份邮箱</span> <input type="email" name="email" class="form-control" value="<?php
function display() { global $conn, $config, $lang; require_once $config['basepath'] . '/include/misc.inc.php'; $misc = new misc(); require_once $config['basepath'] . '/include/user.inc.php'; $userclass = new user(); require_once $config['basepath'] . '/include/class/template/core.inc.php'; $page = new page_user(); require_once $config['basepath'] . '/include/blog_functions.inc.php'; $blog_functions = new blog_functions(); // Make Sure we passed the PageID $display = ''; if (!isset($_GET['ArticleID']) && intval($_GET['ArticleID']) <= 0) { $display .= "ERROR. PageID not sent"; } else { $blog_id = intval($_GET['ArticleID']); //Check if we posted a comment. if (isset($_SESSION['userID']) && $_SESSION['userID'] > 0 && isset($_POST['comment_text']) && strlen($_POST['comment_text']) > 0) { require_once $config['basepath'] . '/include/blog_editor.inc.php'; $blog_comment = $misc->make_db_safe(blog_editor::htmlEncodeText($_POST['comment_text'])); if ($config['blog_requires_moderation'] == 1) { $moderated = 0; } else { $moderated = 1; } $sql = "INSERT INTO " . $config['table_prefix'] . "blogcomments (userdb_id,blogcomments_timestamp,blogcomments_text,blogmain_id,blogcomments_moderated) VALUES\n\t\t\t\t(" . intval($_SESSION['userID']) . "," . time() . ",{$blog_comment},{$blog_id},{$moderated});"; $recordSet = $conn->Execute($sql); if ($recordSet === false) { $misc->log_error($sql); } } //$display .= '<div class="page_display">'; $sql = "SELECT blogmain_full,blogmain_id FROM " . $config['table_prefix'] . "blogmain WHERE blogmain_id=" . $blog_id; $recordSet = $conn->Execute($sql); if ($recordSet === false) { $misc->log_error($sql); } $full = html_entity_decode($misc->make_db_unsafe($recordSet->fields['blogmain_full']), ENT_NOQUOTES, $config['charset']); //$full = $misc->make_db_unsafe($recordSet->fields['blogmain_full']); $full = preg_replace('/\\<hr.*?\\>/', '', $full, 1); $id = $recordSet->fields['blogmain_id']; if ($config["wysiwyg_execute_php"] == 1) { ob_start(); $full = str_replace("<!--<?php", "<?php", $full); $full = str_replace("?>-->", "?>", $full); eval('?>' . "{$full}" . '<?php '); $full = ob_get_contents(); ob_end_clean(); } //Load Template $page->load_page($config['template_path'] . '/blog_article.html'); //Start Replacing Tags $blog_title = $blog_functions->get_blog_title($id); $page->page = $page->parse_template_section($page->page, 'blog_title', $blog_title); $blog_author = $blog_functions->get_blog_author($id); $page->page = $page->parse_template_section($page->page, 'blog_author', $blog_author); $blog_comment_count = $blog_functions->get_blog_comment_count($id); $page->page = $page->parse_template_section($page->page, 'blog_comment_count', $blog_comment_count); $blog_date_posted = $blog_functions->get_blog_date($id); $page->page = $page->parse_template_section($page->page, 'blog_date_posted', $blog_date_posted); $page->page = $page->parse_template_section($page->page, 'blog_full_article', $full); // Allow Admin To Edit # if (isset($_SESSION['editblog']) && $_SESSION['admin_privs'] == 'yes' && $config["wysiwyg_show_edit"] == 1) { $admin_edit_link .= "{$config['baseurl']}/admin/index.php?action=edit_blog&id={$id}"; $page->page = $page->parse_template_section($page->page, 'admin_edit_link', $admin_edit_link); $page->page = $page->cleanup_template_block('admin_edit_link', $page->page); } else { $page->page = $page->remove_template_block('admin_edit_link', $page->page); } //Deal with COmments $sql = "SELECT blogcomments_id,userdb_id,blogcomments_timestamp,blogcomments_text FROM " . $config['table_prefix'] . "blogcomments WHERE blogmain_id = " . $id . " AND blogcomments_moderated = 1 ORDER BY blogcomments_timestamp ASC;"; $recordSet = $conn->Execute($sql); if ($recordSet === false) { $misc->log_error($sql); } $blog_comment_template = ''; while (!$recordSet->EOF) { //Load DB Values $comment_author_id = $misc->make_db_unsafe($recordSet->fields['userdb_id']); $blogcomments_id = $misc->make_db_unsafe($recordSet->fields['blogcomments_id']); $blogcomments_timestamp = $misc->make_db_unsafe($recordSet->fields['blogcomments_timestamp']); $blogcomments_text = html_entity_decode($misc->make_db_unsafe($recordSet->fields['blogcomments_text']), ENT_NOQUOTES, $config['charset']); //Load Template Block $blog_comment_template .= $page->get_template_section('blog_article_comment_item_block'); //Lookup Blog Author.. $author_type = $userclass->get_user_type($comment_author_id); if ($author_type == 'member') { $author_display = $userclass->get_user_name($comment_author_id); } else { $author_display = $userclass->get_user_last_name($comment_author_id) . ', ' . $userclass->get_user_first_name($comment_author_id); } $blog_comment_template = $page->parse_template_section($blog_comment_template, 'blog_comment_author', $author_display); if ($config['date_format'] == 1) { $format = "m/d/Y"; } elseif ($config['date_format'] == 2) { $format = "Y/d/m"; } elseif ($config['date_format'] == 3) { $format = "d/m/Y"; } $blog_comment_date_posted = date($format, "{$blogcomments_timestamp}"); $blog_comment_template = $page->parse_template_section($blog_comment_template, 'blog_comment_date_posted', $blog_comment_date_posted); $blog_comment_template = $page->parse_template_section($blog_comment_template, 'blog_comment_text', $blogcomments_text); $recordSet->MoveNext(); } $page->replace_template_section('blog_article_comment_item_block', $blog_comment_template); //Render Add New Comment if ($config['url_style'] == '1') { $article_url = 'index.php?action=blog_view_article&ArticleID=' . $id; } else { $url_title = str_replace("/", "", $blog_title); $url_title = strtolower(str_replace(" ", $config['seo_url_seperator'], $url_title)); $article_url = 'article-' . urlencode($url_title) . '-' . $id . '.html'; } $page->page = $page->parse_template_section($page->page, 'blog_comments_post_url', $article_url); //Render Page Out //$page->replace_tags(array('templated_search_form', 'featured_listings_horizontal', 'featured_listings_vertical', 'company_name', 'link_printer_friendly')); $page->replace_permission_tags(); $display .= $page->return_page(); } return $display; }
function getPlurkDataSet($data) { requireComponent('Textcube.Function.misc'); $cfg = misc::fetchConfigVal($data); if (!$cfg['plurknickname'] || empty($cfg['plurknickname']) || !$cfg['plurkpassword'] || empty($cfg['plurkpassword'])) { return "::Input error::\n\n Plurk's nickname and password must input certainly."; } return true; }
, 'user':'******'\\', "\", str_replace(' ', '%20', str_replace("'", "'", $row['user']))); ?> '} //]]> </script> <?php if ($got_permission !== false) { ob_flush(); flush(); } ++$ccount; } echo "<br /><br /><div id='paginator'>"; //Functionized the paginator... Let's see how well this works in practice. $misc = new misc(); print $misc->pagination($_GET['page'], $_GET['s'], $id, $limit, $page_limit, $count, $pid); echo '<script type="text/javascript"> //<![CDATA[ filterComments(\'' . $id . '\', \'' . $ccount . '\') //]]></script></div><a href="#" onclick="Javascript:showHide(\'comment_form\'); return false;">>>Respond</a> <form method="post" action="index.php?page=comment&id=' . $id . '&s=save" name="comment_form" id="comment_form" style="display:none"> <table><tr><td> <textarea name="comment" rows="0" cols="0"></textarea> </td></tr><tr><td>Post as anonymous?<br /> <input type="checkbox" name="post_anonymous"/> </td></tr><tr><td> <input type="submit" name="submit" value="Post comment"/> </td></tr><tr><td> <input type="hidden" name="conf" id="conf" value="0"/> </td></tr></table></form>
?> <?php global $m; if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'yz') { $mail = !empty($_POST['mail']) ? checkMail($_POST['mail']) ? $_POST['mail'] : ReDirect('index.php?pub_plugin=dl_zhmm&error_msg=' . urlencode('邮箱地址不合法,请重新输入')) : ReDirect('index.php?pub_plugin=dl_zhmm&error_msg=' . urlencode('邮箱地址为空,请重新输入')); $cx = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE email = '{$mail}' LIMIT 1"); $p = $m->fetch_array($cx); if ($p == "") { ReDirect(SYSTEM_URL . 'index.php?pub_plugin=dl_zhmm&error_msg=' . urlencode('错误:未能在本站找到持有该邮箱的用户!')); die; } $pw = sha1(md5(EncodePwd($p['pw'] . date('Ymd') . SYSTEM_NAME . SYSTEM_VER . SYSTEM_URL))); $title = strip_tags(SYSTEM_NAME) . " - 找回密码"; $text = "请点击以下链接重置密码:" . SYSTEM_URL . "index.php?pub_plugin=dl_zhmm" . '&page=yjqr' . '&email=' . base64_encode($mail) . '&key=' . $pw; $x = misc::mail($mail, $title, $text); if ($x != true) { ReDirect(SYSTEM_URL . 'index.php?pub_plugin=dl_zhmm&error_msg=' . urlencode('错误:找回密码邮件发送失败,请检查邮件相关设置!')); } else { ReDirect(SYSTEM_URL . 'index.php?pub_plugin=dl_zhmm&success_msg=' . urlencode('成功:邮件发送成功,请登录邮箱按照提示操作!')); } } if (isset($_GET['xg'])) { global $m; $emailcc = !empty($_REQUEST['email']) ? base64_decode($_REQUEST['email']) : msg('警告:邮件地址无效'); $email = checkMail($emailcc) ? sqladds($emailcc) : msg('警告:非法操作'); $key = $_REQUEST['key']; $newpw = EncodePwd($_POST['pw']); $cx = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE email = '{$email}' LIMIT 1"); $p = $m->fetch_array($cx); if ($p == "") {
case 'baiduid:getverify': global $m; if (option::get('bduss_num') == '-1' && ROLE != 'admin') { msg('本站禁止绑定新账号'); } if (option::get('bduss_num') != '0' && ISVIP == false) { $count = $m->once_fetch_array("SELECT COUNT(*) AS `c` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `uid` = " . UID); if ($count['c'] + 1 > option::get('bduss_num')) { msg('您当前绑定的账号数已达到管理员设置的上限<br/><br/>您当前已绑定 ' . $count['c'] . ' 个账号,最多只能绑定 ' . option::get('bduss_num') . ' 个账号'); } } $name = !empty($_POST['bd_name']) ? $_POST['bd_name'] : die; $pw = !empty($_POST['bd_pw']) ? $_POST['bd_pw'] : die; $vcode = !empty($_POST['vcode']) ? $_POST['vcode'] : ''; $vcodestr = !empty($_POST['vcodestr']) ? $_POST['vcodestr'] : ''; $loginResult = misc::loginBaidu($name, $pw, $vcode, $vcodestr); if ($loginResult[0] == -3) { echo '{"error":"-3","msg":"请输入验证码","vcodestr":"' . $loginResult[1] . '","img":"' . $loginResult[2] . '"}'; /* echo '<img onclick="addbdid_getcode();" src="'.$loginResult[2].'"style="float:left;"> 请在下面输入左图中的字符<br> 点击图片更换验证码'; echo '<br/><br/><div class="input-group"><span class="input-group-addon">验证码</span>'; echo '<input type="text" class="form-control" id="bd_v" name="bd_v" placeholder="请输入上图的字符" required></div><br/>'; echo '<input type="hidden" id="vcodeStr" name="vcodestr" value="'.$loginResult[1].'"/>'; */ } elseif ($loginResult[0] == 0) { if ((option::get('same_pid') == '1' || option::get('same_pid') == '2') && !ISADMIN) { $checkSame = $m->once_fetch_array("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `name` = '{$loginResult[2]}'"); if (!empty($checkSame)) { if (option::get('same_pid') == '2') { echo '{"error":"-11","msg":"你已经绑定了这个百度账号或者该账号已被其他人绑定,若要重新绑定,请先解绑"}'; } elseif (option::get('same_pid') == '1' && $checkSame['uid'] == UID) {
print "<td align='center' class='header'>" . PEER_CLIENT . "</td>\n"; print "<td align='center' class='header'>" . DOWNLOADED . "</td>\n"; print "<td align='center' class='header'>" . UPLOADED . "</td>\n"; print "<td align='center' class='header'>" . RATIO . "</td>\n"; print "<td align='center' class='header'>" . FINISHED . "</td></tr>\n"; while ($row = $res->fetch_array(MYSQLI_BOTH)) { print "<tr><td align='center' class='lista'>" . "<a href='userdetails.php?id=" . (int) $row["uid"] . "'>" . security::html_safe(unesc($row["username"])) . "</a></td>" . "<td align='center' class='lista'><a href='usercp.php?do=pm&action=edit&uid=" . user::$current['uid'] . "&what=new&to=" . urlencode(unesc($row["username"])) . "'>" . image_or_link($STYLEPATH . "/pm.png", "", "PM") . "</a></td>"; if ($row["flagpic"] != "") { print "<td align='center' class='lista'><img src='images/flag/" . $row["flagpic"] . "' alt='" . security::html_safe($row["country"]) . "' /></td>"; } else { print "<td align='center' class='lista'><img src='images/flag/unknown.gif' alt='" . UNKNOWN . "' /></td>"; } print "<td align='center' class='lista'>" . $row["active"] . "</td>"; print "<td align='center' class='lista'>" . security::html_safe($row["agent"]) . "</td>"; $dled = misc::makesize((int) $row["downloaded"]); $upld = misc::makesize((int) $row["uploaded"]); print "<td align='center' class='lista'>" . $dled . "</td>"; print "<td align='center' class='lista'>" . $upld . "</td>"; if (intval($row["downloaded"]) > 0) { $ratio = number_format((int) $row["uploaded"] / (int) $row["downloaded"], 2); } else { $ratio = "∞"; } print "<td align='center' class='lista'>" . $ratio . "</td>"; print "<td align='center' class='lista'>" . get_elapsed_time($row["date"]) . " ago</td></tr>"; } if ($res->num_rows == 0) { print "<tr><td align='center' colspan='9' class='lista'>No history to display</td></tr>"; } print "</table>"; print "</div><br /><br /><center><a href='javascript: history.go(-1);'>" . BACK . "</a>";
/** * 新闻批量添加 * @author yangguofeng */ public function batchAddAction() { $data = []; if ($_FILES['news']['name']) { $title = explode('.', $_FILES['news']['name']); $news = file_get_contents($_FILES['news']['tmp_name']); //新闻内容转编码 $content = strcmp(mb_detect_encoding($news, ['UTF-8', 'GBK']), 'UTF-8') === 0 ? $news : mb_convert_encoding($news, "UTF-8", "GBK"); //关键字(如果没写关键字,在标题中取。如果没取到,标题作为关键词) $keywords = empty($this->getRequest()->getPost('keywords', '')) ? implode(' ', misc::getKeywords($title[0])) : $this->getRequest()->getPost('keywords', ''); $keywords = empty($keywords) ? $title[0] : $keywords; $ret = $this->topic->add("topic_data", ['title' => $title[0], 'tid' => intval($this->getRequest()->getQuery('tid')), 'sid' => intval($this->getRequest()->getQuery('sid')), 'keywords' => $keywords, 'status' => 1, 'attribute' => 0, 'userid' => $this->_user['uid'], 'username' => $data['username'] = $this->_user['username'], 'description' => mb_substr(strip_tags($content), 0, 78, 'UTF-8'), 'inputtime' => $_SERVER['REQUEST_TIME'], 'content' => $content]); if ($ret) { exit($ret); } else { header("HTTP/1.1 500 Internal Server Error"); exit(0); } } $this->getView()->assign('tid', intval($this->getRequest()->getQuery('tid'))); $this->getView()->assign('sid', intval($this->getRequest()->getQuery('sid'))); }
$node->checkAll(time()); switch ($_GET['action']) { case 'add': if ($flags['combat']) { if (isset($_POST['name'], $_POST['attackerGroupUnitIds'], $_POST['attackerGroups'])) { foreach ($_POST as $key => $value) { if (!in_array($key, array('name', 'attackerGroupUnitIds', 'attackerGroups', 'attackerFocus'))) { $_POST[$key] = misc::clean($value, 'numeric'); } else { if (!in_array($key, array('name', 'attackerFocus'))) { $nr = count($_POST[$key]); for ($i = 0; $i < $nr; $i++) { $_POST[$key][$i] = misc::clean($_POST[$key][$i], 'numeric'); } } else { $_POST[$key] = misc::clean($value); } } } $target = new node(); if ($target->get('name', $_POST['name']) == 'done') { $targetUser = new user(); if ($targetUser->get('id', $target->data['user']) == 'done') { $alliance = new alliance(); $targetAlliance = new alliance(); if ($targetAlliance->get('id', $targetUser->data['alliance']) == 'done' && $alliance->get('id', $_SESSION[$shortTitle . 'User']['alliance']) == 'done') { $war = $alliance->getWar($targetAlliance->data['id']); if (isset($war['type'])) { $gotStatic = false; $data = array(); $data['input']['attacker']['focus'] = $_POST['attackerFocus'];
function replace_listing_field_tags($listing_id, $tempate_section = '', $utf8HTML = false) { global $lang; if (is_numeric($listing_id)) { global $config, $conn, $or_replace_listing_id, $or_replace_listing_owner; $or_replace_listing_id = $listing_id; require_once $config['basepath'] . '/include/listing.inc.php'; require_once $config['basepath'] . '/include/vtour.inc.php'; require_once $config['basepath'] . '/include/misc.inc.php'; $misc = new misc(); if ($tempate_section != '') { $tsection = true; } else { $tempate_section = $this->page; $tsection = false; } if ($utf8HTML) { //Deal with listing field blocks $lf_blocks = array(); preg_match_all('/{listing_field_([^{}]*?)_block}/', $tempate_section, $lf_blocks); require_once $config['basepath'] . '/include/user.inc.php'; global $or_replace_listing_owner; if (count($lf_blocks) > 1) { foreach ($lf_blocks[1] as $block) { require_once $config['basepath'] . '/include/listing.inc.php'; $value = listing_pages::renderSingleListingItem($or_replace_listing_id, $block, 'rawvalue'); if ($value == '') { $tempate_section = preg_replace('/{listing_field_' . $block . '_block}(.*?){\\/listing_field_' . $block . '_block}/is', '', $tempate_section); } else { $tempate_section = str_replace('{listing_field_' . $block . '_block}', '', $tempate_section); $tempate_section = str_replace('{/listing_field_' . $block . '_block}', '', $tempate_section); } } } // Handle Caption Only $tempate_section = preg_replace_callback('/{listing_field_([^{}]*?)_caption}/', create_function('$matches', 'global $config,$or_replace_listing_id,$lang;require_once($config[\'basepath\'].\'/include/listing.inc.php\'); return htmlentities(utf8_encode(listing_pages::renderSingleListingItem($or_replace_listing_id, $matches[1],\'caption\')), ENT_QUOTES, \'UTF-8\');'), $tempate_section); // Hanle Value Only $tempate_section = preg_replace_callback('/{listing_field_([^{}]*?)_value}/', create_function('$matches', 'global $config,$or_replace_listing_id,$lang;require_once($config[\'basepath\'].\'/include/listing.inc.php\'); return htmlentities(utf8_encode(listing_pages::renderSingleListingItem($or_replace_listing_id, $matches[1],\'value\')), ENT_QUOTES, \'UTF-8\');'), $tempate_section); // Handle Raw Value $tempate_section = preg_replace_callback('/{listing_field_([^{}]*?)_rawvalue}/', create_function('$matches', 'global $config,$or_replace_listing_id,$lang;require_once($config[\'basepath\'].\'/include/listing.inc.php\'); return htmlentities(utf8_encode(listing_pages::renderSingleListingItem($or_replace_listing_id, $matches[1],\'rawvalue\')), ENT_QUOTES, \'UTF-8\');'), $tempate_section); // Handle Both Caption and Value $tempate_section = preg_replace_callback('/{listing_field_([^{}]*?)}/', create_function('$matches', 'global $config,$or_replace_listing_id,$lang;require_once($config[\'basepath\'].\'/include/listing.inc.php\'); return htmlentities(utf8_encode(listing_pages::renderSingleListingItem($or_replace_listing_id, $matches[1])), ENT_QUOTES, \'UTF-8\');'), $tempate_section); $value = htmlentities(utf8_encode(listing_pages::get_title($listing_id)), ENT_QUOTES, 'UTF-8'); $tempate_section = str_replace('{listing_title}', $value, $tempate_section); $value = listing_pages::get_title($listing_id); if ($config["controlpanel_mbstring_enabled"] == 1) { if (mb_detect_encoding($value) != 'UTF-8') { $value = utf8_encode($value); } } $tempate_section = str_replace('{rss_listing_title}', $value, $tempate_section); $value = htmlentities(utf8_encode(listing_pages::getListingAgent($listing_id)), ENT_QUOTES, 'UTF-8'); $tempate_section = str_replace('{listing_agent_name}', $value, $tempate_section); $value = htmlentities(utf8_encode(listing_pages::getListingAgentFirstName($listing_id)), ENT_QUOTES, 'UTF-8'); $tempate_section = str_replace('{listing_agent_first_name}', $value, $tempate_section); $value = htmlentities(utf8_encode(listing_pages::getListingAgentLastName($listing_id)), ENT_QUOTES, 'UTF-8'); $tempate_section = str_replace('{listing_agent_last_name}', $value, $tempate_section); $value = htmlentities(utf8_encode(listing_pages::getListingAgentLink($listing_id)), ENT_QUOTES, 'UTF-8'); $tempate_section = str_replace('{listing_agent_link}', $value, $tempate_section); $value = htmlentities(utf8_encode(listing_pages::get_pclass($listing_id)), ENT_QUOTES, 'UTF-8'); $tempate_section = str_replace('{listing_pclass}', $value, $tempate_section); $value = htmlentities(utf8_encode(listing_pages::getAgentListingsLink($listing_id)), ENT_QUOTES, 'UTF-8'); $tempate_section = str_replace('{listing_agent_listings}', $value, $tempate_section); $value = htmlentities(utf8_encode(listing_pages::getListingAgentID($listing_id)), ENT_QUOTES, 'UTF-8'); $tempate_section = str_replace('{listing_agent_id}', $value, $tempate_section); // Get listing owner $owner_sql = 'SELECT userdb_id FROM ' . $config['table_prefix'] . 'listingsdb WHERE (listingsdb_id = ' . $or_replace_listing_id . ')'; $recordSet = $conn->execute($owner_sql); $or_replace_listing_owner = $recordSet->fields['userdb_id']; //New listing_agent_field_****_block tag handler for 2.4.1 $laf_blocks = array(); preg_match_all('/{listing_agent_field_([^{}]*?)_block}/', $tempate_section, $laf_blocks); require_once $config['basepath'] . '/include/user.inc.php'; global $or_replace_listing_owner; if (count($laf_blocks) > 1) { foreach ($laf_blocks[1] as $block) { $value = user::renderSingleListingItem($or_replace_listing_owner, $block, 'rawvalue'); if ($value == '') { $tempate_section = preg_replace('/{listing_agent_field_' . $block . '_block}(.*?){\\/listing_agent_field_' . $block . '_block}/is', '', $tempate_section); } else { $tempate_section = str_replace('{listing_agent_field_' . $block . '_block}', '', $tempate_section); $tempate_section = str_replace('{/listing_agent_field_' . $block . '_block}', '', $tempate_section); } } } // Replace listing_agent tags // Handle Caption Only $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)_caption}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return htmlentities(utf8_encode(user::renderSingleListingItem($or_replace_listing_owner, $matches[1],\'caption\')), ENT_QUOTES, \'UTF-8\');'), $tempate_section); // Hanle Value Only $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)_value}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return htmlentities(utf8_encode(user::renderSingleListingItem($or_replace_listing_owner, $matches[1],\'value\')), ENT_QUOTES, \'UTF-8\');'), $tempate_section); // Handle Raw Value $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)_rawvalue}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return htmlentities(utf8_encode(user::renderSingleListingItem($or_replace_listing_owner, $matches[1],\'rawvalue\')), ENT_QUOTES, \'UTF-8\');'), $tempate_section); // Handle Both Caption and Value $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return htmlentities(utf8_encode(user::renderSingleListingItem($or_replace_listing_owner, $matches[1])), ENT_QUOTES, \'UTF-8\');'), $tempate_section); } else { //Deal with listing field blocks $lf_blocks = array(); preg_match_all('/{listing_field_([^{}]*?)_block}/', $tempate_section, $lf_blocks); require_once $config['basepath'] . '/include/user.inc.php'; global $or_replace_listing_owner; if (count($lf_blocks) > 1) { foreach ($lf_blocks[1] as $block) { require_once $config['basepath'] . '/include/listing.inc.php'; $value = listing_pages::renderSingleListingItem($or_replace_listing_id, $block, 'rawvalue'); if ($value == '') { $tempate_section = preg_replace('/{listing_field_' . $block . '_block}(.*?){\\/listing_field_' . $block . '_block}/is', '', $tempate_section); } else { $tempate_section = str_replace('{listing_field_' . $block . '_block}', '', $tempate_section); $tempate_section = str_replace('{/listing_field_' . $block . '_block}', '', $tempate_section); } } } // Handle Caption Only $tempate_section = preg_replace_callback('/{listing_field_([^{}]*?)_caption}/', create_function('$matches', 'global $config,$or_replace_listing_id,$lang;require_once($config[\'basepath\'].\'/include/listing.inc.php\'); return listing_pages::renderSingleListingItem($or_replace_listing_id, $matches[1],\'caption\');'), $tempate_section); // Hanle Value Only $tempate_section = preg_replace_callback('/{listing_field_([^{}]*?)_value}/', create_function('$matches', 'global $config,$or_replace_listing_id,$lang;require_once($config[\'basepath\'].\'/include/listing.inc.php\'); return listing_pages::renderSingleListingItem($or_replace_listing_id, $matches[1],\'value\');'), $tempate_section); // Handle Raw Value $tempate_section = preg_replace_callback('/{listing_field_([^{}]*?)_rawvalue}/', create_function('$matches', 'global $config,$or_replace_listing_id,$lang;require_once($config[\'basepath\'].\'/include/listing.inc.php\'); return listing_pages::renderSingleListingItem($or_replace_listing_id, $matches[1],\'rawvalue\');'), $tempate_section); // Handle Both Caption and Value $tempate_section = preg_replace_callback('/{listing_field_([^{}]*?)}/', create_function('$matches', 'global $config,$or_replace_listing_id,$lang;require_once($config[\'basepath\'].\'/include/listing.inc.php\'); return listing_pages::renderSingleListingItem($or_replace_listing_id, $matches[1]);'), $tempate_section); $value = listing_pages::get_title($listing_id); $tempate_section = str_replace('{listing_title}', $value, $tempate_section); $value = listing_pages::getListingAgent($listing_id); $tempate_section = str_replace('{listing_agent_name}', $value, $tempate_section); $value = listing_pages::getListingAgentFirstName($listing_id); $tempate_section = str_replace('{listing_agent_first_name}', $value, $tempate_section); $value = listing_pages::getListingAgentLastName($listing_id); $tempate_section = str_replace('{listing_agent_last_name}', $value, $tempate_section); $value = listing_pages::getListingAgentLink($listing_id); $tempate_section = str_replace('{listing_agent_link}', $value, $tempate_section); $value = listing_pages::get_pclass($listing_id); $tempate_section = str_replace('{listing_pclass}', $value, $tempate_section); $value = listing_pages::getAgentListingsLink($listing_id); $tempate_section = str_replace('{listing_agent_listings}', $value, $tempate_section); $value = listing_pages::getListingAgentID($listing_id); $tempate_section = str_replace('{listing_agent_id}', $value, $tempate_section); // Get listing owner $owner_sql = 'SELECT userdb_id FROM ' . $config['table_prefix'] . 'listingsdb WHERE (listingsdb_id = ' . $or_replace_listing_id . ')'; $recordSet = $conn->execute($owner_sql); $or_replace_listing_owner = $recordSet->fields['userdb_id']; $laf_blocks = array(); preg_match_all('/{listing_agent_field_([^{}]*?)_block}/', $tempate_section, $laf_blocks); require_once $config['basepath'] . '/include/user.inc.php'; global $or_replace_listing_owner; if (count($laf_blocks) > 1) { foreach ($laf_blocks[1] as $block) { $value = user::renderSingleListingItem($or_replace_listing_owner, $block, 'rawvalue'); if ($value == '') { $tempate_section = preg_replace('/{listing_agent_field_' . $block . '_block}(.*?){\\/listing_agent_field_' . $block . '_block}/is', '', $tempate_section); } else { $tempate_section = str_replace('{listing_agent_field_' . $block . '_block}', '', $tempate_section); $tempate_section = str_replace('{/listing_agent_field_' . $block . '_block}', '', $tempate_section); } } } // Replace listing_agent tags // Handle Caption Only $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)_caption}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return user::renderSingleListingItem($or_replace_listing_owner, $matches[1],\'caption\');'), $tempate_section); // Hanle Value Only $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)_value}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return user::renderSingleListingItem($or_replace_listing_owner, $matches[1],\'value\');'), $tempate_section); // Handle Raw Value $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)_rawvalue}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return user::renderSingleListingItem($or_replace_listing_owner, $matches[1],\'rawvalue\');'), $tempate_section); // Handle Both Caption and Value $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return user::renderSingleListingItem($or_replace_listing_owner, $matches[1]);'), $tempate_section); } // Listing Images $sql2 = "SELECT listingsdb_title FROM " . $config['table_prefix'] . "listingsdb WHERE listingsdb_id = {$listing_id}"; $recordSet2 = $conn->Execute($sql2); if (!$recordSet2) { $misc->log_error($sql2); } $Title = $misc->make_db_unsafe($recordSet2->fields['listingsdb_title']); if ($config['url_style'] == '1') { $url = '<a href="index.php?action=listingview&listingID=' . $listing_id . '">'; $fullurl = '<a href="' . $config["baseurl"] . '/index.php?action=listingview&listingID=' . $listing_id . '">'; // Listing Link $tempate_section = str_replace('{link_to_listing}', 'index.php?action=listingview&listingID=' . $listing_id, $tempate_section); $tempate_section = str_replace('{fulllink_to_listing}', $config['baseurl'] . '/index.php?action=listingview&listingID=' . $listing_id, $tempate_section); } else { $url_title = str_replace("/", "", $Title); $url_title = strtolower(str_replace(" ", $config['seo_url_seperator'], $url_title)); $url = '<a href="listing-' . misc::urlencode_to_sef($url_title) . '-' . $listing_id . '.html">'; $fullurl = '<a href="' . $config["baseurl"] . '/listing-' . misc::urlencode_to_sef($url_title) . '-' . $listing_id . '.html">'; // Listing Link $tempate_section = str_replace('{link_to_listing}', 'listing-' . misc::urlencode_to_sef($url_title) . '-' . $listing_id . '.html', $tempate_section); $tempate_section = str_replace('{fulllink_to_listing}', '' . $config["baseurl"] . '/listing-' . misc::urlencode_to_sef($url_title) . '-' . $listing_id . '.html', $tempate_section); } // grab the listing's image $sql2 = "SELECT listingsimages_id, listingsimages_caption, listingsimages_thumb_file_name, listingsimages_file_name FROM " . $config['table_prefix'] . "listingsimages WHERE listingsdb_id = {$listing_id} ORDER BY listingsimages_rank"; $recordSet2 = $conn->Execute($sql2); if (!$recordSet2) { $misc->log_error($sql2); } $num_images = $recordSet2->RecordCount(); if ($num_images == 0) { if ($config['show_no_photo'] == 1) { $listing_image = $url . '<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" /></a>'; $listing_image_full = $fullurl . '<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" /></a>'; if ($_GET['action'] == 'listingview') { $listing_image = '<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" />'; $listing_image_full = '<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" />'; } $tempate_section = str_replace('{raw_image_thumb_1}', $config['baseurl'] . '/images/nophoto.gif', $tempate_section); } else { $listing_image = ''; $tempate_section = str_replace('{raw_image_thumb_1}', '', $tempate_section); } $tempate_section = str_replace('{image_thumb_1}', $listing_image, $tempate_section); $tempate_section = str_replace('{image_thumb_fullurl_1}', $listing_image, $tempate_section); } $x = 1; while (!$recordSet2->EOF) { //if we're already on the listing then make the urls goto the view image $listingsimages_id = $misc->make_db_unsafe($recordSet2->fields['listingsimages_id']); $image_caption = $misc->make_db_unsafe($recordSet2->fields['listingsimages_caption']); $thumb_file_name = $misc->make_db_unsafe($recordSet2->fields['listingsimages_thumb_file_name']); $full_file_name = $misc->make_db_unsafe($recordSet2->fields['listingsimages_file_name']); if ($_GET['action'] == 'listingview') { if ($config['url_style'] == '1') { $url = '<a href="index.php?action=view_listing_image&image_id=' . $listingsimages_id . '">'; $fullurl = '<a href="' . $config["baseurl"] . '/index.php?action=view_listing_image&image_id=' . $listingsimages_id . '">'; } else { $url = '<a href="listing_image_' . $listingsimages_id . '.html">'; $fullurl = '<a href="' . $config["baseurl"] . '/listing_image_' . $listingsimages_id . '.html">'; } } if ($thumb_file_name != "" && file_exists("{$config['listings_upload_path']}/{$thumb_file_name}")) { // Full Image Sizes $imagedata = GetImageSize("{$config['listings_upload_path']}/{$full_file_name}"); $imagewidth = $imagedata[0]; $imageheight = $imagedata[1]; $max_width = $config['main_image_width']; $max_height = $config['main_image_height']; $resize_by = $config['resize_by']; $shrinkage = 1; if ($max_width == $imagewidth || $max_height == $imageheight) { $display_width = $imagewidth; $display_height = $imageheight; } else { if ($resize_by == 'width') { $shrinkage = $imagewidth / $max_width; $display_width = $max_width; $display_height = round($imageheight / $shrinkage); } elseif ($resize_by == 'height') { $shrinkage = $imageheight / $max_height; $display_height = $max_height; $display_width = round($imagewidth / $shrinkage); } elseif ($resize_by == 'both') { $display_width = $max_width; $display_height = $max_height; } elseif ($resize_by == 'bestfit') { $shrinkage_width = $imagewidth / $max_width; $shrinkage_height = $imageheight / $max_height; $shrinkage = max($shrinkage_width, $shrinkage_height); $display_height = round($imageheight / $shrinkage); $display_width = round($imagewidth / $shrinkage); } } // Thumbnail Image Sizes $thumb_imagedata = GetImageSize("{$config['listings_upload_path']}/{$thumb_file_name}"); $thumb_imagewidth = $thumb_imagedata[0]; $thumb_imageheight = $thumb_imagedata[1]; $thumb_max_width = $config['thumbnail_width']; $thumb_max_height = $config['thumbnail_height']; $resize_thumb_by = $config['resize_thumb_by']; $shrinkage = 1; if ($thumb_max_width == $thumb_imagewidth || $thumb_max_height == $thumb_imageheight) { $thumb_displaywidth = $thumb_imagewidth; $thumb_displayheight = $thumb_imageheight; } else { if ($resize_thumb_by == 'width') { $shrinkage = $thumb_imagewidth / $thumb_max_width; $thumb_displaywidth = $thumb_max_width; $thumb_displayheight = round($thumb_imageheight / $shrinkage); } elseif ($resize_thumb_by == 'height') { $shrinkage = $thumb_imageheight / $thumb_max_height; $thumb_displayheight = $thumb_max_height; $thumb_displaywidth = round($thumb_imagewidth / $shrinkage); } elseif ($resize_thumb_by == 'both') { $thumb_displayheight = $thumb_max_height; $thumb_displaywidth = $thumb_max_width; } } $listing_image = $url . '<img src="' . $config['listings_view_images_path'] . '/' . $thumb_file_name . '" height="' . $thumb_displayheight . '" width="' . $thumb_displaywidth . '" alt="' . $image_caption . '" /></a>'; $listing_image_full = $url . '<img src="' . $config['listings_view_images_path'] . '/' . $full_file_name . '" height="' . $display_height . '" width="' . $display_width . '" alt="' . $image_caption . '" /></a>'; $listing_image_fullurl = $fullurl . '<img src="' . $config['listings_view_images_path'] . '/' . $thumb_file_name . '" height="' . $thumb_displayheight . '" width="' . $thumb_displaywidth . '" alt="' . $image_caption . '" /></a>'; $listing_image_full_fullurl = $fullurl . '<img src="' . $config['listings_view_images_path'] . '/' . $full_file_name . '" height="' . $display_height . '" width="' . $display_width . '" alt="' . $image_caption . '" /></a>'; $tempate_section = str_replace('{image_thumb_' . $x . '}', $listing_image, $tempate_section); $tempate_section = str_replace('{raw_image_thumb_' . $x . '}', $config['listings_view_images_path'] . '/' . $thumb_file_name, $tempate_section); $tempate_section = str_replace('{image_thumb_fullurl_' . $x . '}', $listing_image_fullurl, $tempate_section); //Full Image tags $tempate_section = str_replace('{image_full_' . $x . '}', $listing_image_full, $tempate_section); $tempate_section = str_replace('{raw_image_full_' . $x . '}', $config['listings_view_images_path'] . '/' . $full_file_name, $tempate_section); $tempate_section = str_replace('{image_full_fullurl_' . $x . '}', $listing_image_full_fullurl, $tempate_section); } else { if ($config['show_no_photo'] == 1) { $listing_image = $url . '<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" /></a>'; $listing_image_fullurl = $fullurl . '<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" /></a>'; $tempate_section = str_replace('{raw_image_thumb_' . $x . '}', $config['baseurl'] . '/images/nophoto.gif', $tempate_section); } else { $listing_image = ''; $tempate_section = str_replace('{raw_image_thumb_' . $x . '}', '', $tempate_section); } $tempate_section = str_replace('{image_thumb_' . $x . '}', $listing_image, $tempate_section); $tempate_section = str_replace('{image_thumb_fullurl_' . $x . '}', $listing_image_fullurl, $tempate_section); $tempate_section = str_replace('{image_full_' . $x . '}', '', $tempate_section); $tempate_section = str_replace('{raw_image_full_' . $x . '}', '', $tempate_section); $tempate_section = str_replace('{image_full_fullurl_' . $x . '}', '', $tempate_section); } // We have the image so insert it into the section. $x++; $recordSet2->MoveNext(); } // end while // End Listing Images $value = array(); $value = listing_pages::getListingAgentThumbnail($listing_id); $x = 0; foreach ($value as $y) { $tempate_section = str_replace('{listing_agent_thumbnail_' . $x . '}', $y, $tempate_section); $x++; } $tempate_section = preg_replace('/{listing_agent_thumbnail_([^{}]*?)}/', '', $tempate_section); // End of Listing Tag Replacement if ($tsection === true) { return $tempate_section; } else { $this->page = $tempate_section; } } }
} Redirect(SYSTEM_URL . 'index.php?mod=admin:setplug&plug=pch18_relist&isok=已刷新完所有状态为未开启用户贴吧列表'); die; case 'kong': //刷新空账户 $baid_ft = $m->query("SELECT id,uid FROM `" . DB_PREFIX . "baiduid`"); while ($baid = $m->fetch_array($baid_ft)) { $uxs = $m->once_fetch_array("SELECT * FROM `" . DB_PREFIX . "users` where id=" . $baid['uid']); if ($uxs['t'] == '') { continue; } $uxsm = $m->once_fetch_array("SELECT COUNT(*) AS `c` FROM `" . DB_PREFIX . $uxs['t'] . "` WHERE `pid` = " . $baid['id']); if ($uxsm['c'] == 0) { $r = misc::scanTiebaByPid($baid['id']); //更新列表函数 $m->query("REPLACE INTO `" . DB_NAME . "`.`" . DB_PREFIX . "pch18_relist` SET `lastdate` = '" . date("Y-m-d") . "', id = " . $baid['id']); } } Redirect(SYSTEM_URL . 'index.php?mod=admin:setplug&plug=pch18_relist&isok=已刷新完所有空账户'); die; default: if ($_GET['ref'] > 0) { $r = misc::scanTiebaByPid($_GET['ref']); $m->query("REPLACE INTO `" . DB_NAME . "`.`" . DB_PREFIX . "pch18_relist` SET `lastdate` = '" . date("Y-m-d") . "', id = " . $_GET['ref']); Redirect(SYSTEM_URL . 'index.php?mod=admin:setplug&plug=pch18_relist&isok=已刷新完PID=' . $_GET['ref'] . '的用户的贴吧列表'); } } } ?> </tbody> </table>
$row = $result->fetch_assoc(); $t_decode = urlencode(html_entity_decode($ttags, ENT_NOQUOTES, "UTF-8")); $c_decode = urlencode(html_entity_decode($current, ENT_NOQUOTES, "UTF-8")); echo '<li><a href="index.php?page=post&s=list&tags=' . $t_decode . "+" . $c_decode . '">+</a><a href="index.php?page=post&s=list&tags=' . $t_decode . "+-" . $c_decode . '">-</a> <span style="color: #a0a0a0;">? <a href="index.php?page=post&s=list&tags=' . $c_decode . '">' . str_replace('_', ' ', $current) . '</a> ' . $row['index_count'] . '</span></li>'; } //Print out image results and filter javascript echo '<li><br /><br /></li></ul></div></center></div></div><div class="content"><div>'; $images .= "</div><br /><br /><div id='paginator'>"; $images .= '<script type="text/javascript"> //<![CDATA[ filterPosts(posts) //]]> </script>'; echo $images; //Pagination function. This should work for the whole site... Maybe. $misc = new misc(); print $misc->pagination($_GET['page'], $_GET['s'], $id, $limit, $page_limit, $numrows, $_GET['pid'], $_GET['tags']); } //Cache doesn't exist for search, make one. if ($no_cache === true) { $data = ob_get_contents(); ob_end_clean(); if (isset($_GET['pid']) && is_numeric($_GET['pid']) && $_GET['pid'] > 0) { $page = $_GET['pid'] / $limit + 1; } else { $page = 0; } if ($new_tag_cache != "") { if (!is_dir("{$main_cache_dir}" . "" . "search_cache/" . $new_tag_cache)) { @mkdir("{$main_cache_dir}" . "" . "search_cache/" . $new_tag_cache); }