• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP misc类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中misc的典型用法代码示例。如果您正苦于以下问题:PHP misc类的具体用法?PHP misc怎么用?PHP misc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了misc类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: report

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'>&#8595&nbsp;" . misc::makesize($down - $up) . "</font></b>";
    } elseif ($up > $down) {
        $diff = "<b><font color='blue'>&#8593&nbsp;" . 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'>&#8595&nbsp;" . misc::makesize($down) . "</b></font></td>";
    print "\n<td class='lista' align='center'><b><font color='green'>&#8593&nbsp;" . 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=" . user::$current["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=" . user::$current["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>";
}
开发者ID:HDVinnie,项目名称:BtiTracker-1.5.0,代码行数:27,代码来源:searchdiff.php


示例2: verifyTiezi_send

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' => '');
    }
}
开发者ID:noinlijin,项目名称:tiebaSign,代码行数:29,代码来源:verifyTiezi_cron.php


示例3: FlashCounterViewDataSet

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;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:26,代码来源:index.php


示例4: add

 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;
 }
开发者ID:yunsite,项目名称:devana-heroic,代码行数:27,代码来源:message.class.php


示例5: EntriesWithTags_DataSet

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;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:9,代码来源:index.php


示例6: cron_system_sign_retry

/**
 * 云签到内部计划任务
 * [重新尝试签到出错的贴吧]
 */
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);
    }
}
开发者ID:pixode,项目名称:Tieba-Cloud-Sign,代码行数:16,代码来源:cron_system_sign_retry.php


示例7: cron_signtz_mail

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 &copy; <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 '邮件发送成功!';
}
开发者ID:chajianku,项目名称:haotian_signtz,代码行数:48,代码来源:send.php


示例8: cron_pch18_relist

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);
        }
    }
}
开发者ID:chajianku,项目名称:pch18_relist,代码行数:18,代码来源:run.php


示例9: sendMail

/**
* 变量名称
* @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");
}
开发者ID:chajianku,项目名称:white_vmail,代码行数:26,代码来源:white_vmail_setting.php


示例10: add

 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;
 }
开发者ID:yunsite,项目名称:devana-heroic,代码行数:44,代码来源:alliance.class.php


示例11: display

 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>&nbsp;</p>";
         $display .= "<a href=\"{$config['baseurl']}/admin/index.php?action=edit_page&amp;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;
 }
开发者ID:schappaughc,项目名称:iitmapas,代码行数:44,代码来源:page_display.inc.php


示例12: cron_wmzz_zan

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']);
    }
    */
}
开发者ID:chajianku,项目名称:Cloud_Click,代码行数:43,代码来源:run.php


示例13: add

 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;
 }
开发者ID:yunsite,项目名称:devana-heroic,代码行数:42,代码来源:user.class.php


示例14: cron_wmzz_ban

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']}'");
        }
    }
}
开发者ID:chajianku,项目名称:wmzz_ban,代码行数:20,代码来源:wmzz_ban_cron.php


示例15: editAction

 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');
         }
     }
 }
开发者ID:290329416,项目名称:guahao,代码行数:21,代码来源:Managemember.php


示例16: _torrenttable

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();
}
开发者ID:HDVinnie,项目名称:BtiTracker-1.5.0,代码行数:39,代码来源:extra-stats.php


示例17: cron_wmzz_mailer

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);
    }
}
开发者ID:noinlijin,项目名称:tiebaSign,代码行数:24,代码来源:wmzz_mailer_cron.php


示例18: date

        $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 
开发者ID:MoeGakuen,项目名称:dl_backup,代码行数:31,代码来源:dl_backup_setting.php


示例19: display

 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&amp;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";
             }
// 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mnet_environment类代码示例发布时间:2022-05-23
下一篇:
PHP midgardmvc_core类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap