当前位置: 首页>>代码示例>>PHP>>正文


PHP SQLString函数代码示例

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


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

示例1: htmlspecialchars

/**
 * 迷你同学录 (http://mini_class.piscdong.com/)
 * (c)PiscDong studio (http://www.piscdong.com/)
 *
 * 程序完全免费,请保留这段代码。
 * 请勿出售本程序或其修改版,请勿利用本程序或其修改版进行任何商业活动。
 */
if ($c_log && $pa == 9) {
    $title .= '特殊功能';
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        if (isset($_POST['g_open'])) {
            $g_open = $_POST['g_open'] != 1 ? 0 : 1;
            $g_name = htmlspecialchars(trim($_POST['g_name']), ENT_QUOTES);
            $g_pwd = htmlspecialchars(trim($_POST['g_pwd']), ENT_QUOTES);
            $u_db = sprintf('update %s set g_open=%s, g_name=%s, g_pwd=%s', $dbprefix . 'main', SQLString($g_open, 'int'), SQLString($g_name, 'text'), SQLString($g_pwd, 'text'));
            $result = mysql_query($u_db) or die('');
            $e = 1;
        } elseif (isset($_POST['mgc']) && trim($_POST['mgc']) != '') {
            if (isset($a_mgc) && count($a_mgc) > 0) {
                foreach ($a_mgc as $v) {
                    if (trim($v) != '') {
                        $at_mgc[trim($v)] = trim($v);
                    }
                }
            }
            $nmgc = $g_name = htmlspecialchars(trim($_POST['mgc']), ENT_QUOTES);
            $at_mgc[trim($nmgc)] = trim($nmgc);
            $mgc_c = "<?php";
            foreach ($at_mgc as $v) {
                $mgc_c .= "\r\n\$a_mgc[]='" . $v . "';";
开发者ID:lyhiving,项目名称:mini_class,代码行数:30,代码来源:s_special.php

示例2: header

        }
    } else {
        header('Location:./');
        exit;
    }
    mysql_free_result($q_dbc);
} else {
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        if ($c_log) {
            $title = htmlspecialchars(trim($_POST['title']), ENT_QUOTES);
            $cont = htmlspecialchars(trim($_POST['rinfo']), ENT_QUOTES);
            $cdate = htmlspecialchars(trim($_POST['cdate']), ENT_QUOTES);
            $cloc = htmlspecialchars(trim($_POST['cloc']), ENT_QUOTES);
            $cpay = htmlspecialchars(trim($_POST['cpay']), ENT_QUOTES);
            if ($title != '') {
                $i_db = sprintf('insert into %s (title, content, cdate, cloc, cpay, aid, datetime) values (%s, %s, %s, %s, %s, %s, %s)', $dbprefix . 'camp', SQLString($title, 'text'), SQLString($cont, 'text'), SQLString($cdate, 'text'), SQLString($cloc, 'text'), SQLString($cpay, 'text'), $_SESSION[$config['u_hash']], time());
                $result = mysql_query($i_db) or die('');
                $nid = mysql_insert_id();
                setsinfo($pn . ' 发起新活动', $_SESSION[$config['u_hash']], $nid, 3);
            }
        }
        header('Location:./?m=camp');
        exit;
    } else {
        $title .= '班级活动';
        $s_a_dbc = sprintf('select a.*, b.name from %s as a, %s as b where a.aid=b.id and a.disp=0 order by a.closed, a.sticky desc, a.datetime desc', $dbprefix . 'camp', $dbprefix . 'member');
        $q_a_dbc = mysql_query($s_a_dbc) or die('');
        $c_dbc = mysql_num_rows($q_a_dbc);
        if ($c_dbc > 0) {
            $p_dbc = ceil($c_dbc / $config['pagesize']);
            if ($page > $p_dbc) {
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:camp.php

示例3: isset

 * (c)PiscDong studio (http://www.piscdong.com/)
 *
 * 程序完全免费,请保留这段代码。
 * 请勿出售本程序或其修改版,请勿利用本程序或其修改版进行任何商业活动。
 */
if ($c_log) {
    $title .= '短消息';
    $page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1;
    if (isset($_GET['id']) && intval($_GET['id']) > 0 && intval($_GET['id']) != $_SESSION[$config['u_hash']] && getainfo(intval($_GET['id']), 'id')) {
        $tid = intval($_GET['id']);
        $tn = getainfo($tid, 'name');
        $title .= ' - ' . $tn['name'];
        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
            $cont = htmlspecialchars(trim($_POST['rinfo']), ENT_QUOTES);
            if ($cont != '') {
                $i_db = sprintf('insert into %s (content, aid, tid, datetime, readed) values (%s, %s, %s, %s, 1)', $dbprefix . 'message', SQLString($cont, 'text'), $_SESSION[$config['u_hash']], $tid, time());
                $result = mysql_query($i_db) or die('');
            }
            header('Location:./?m=message&id=' . $tid);
            exit;
        } else {
            $content .= '<div class="title" id="send">发消息 - 收件人:' . $tn['name'] . '</div><div class="lcontent"><form method="post" action="" class="btform" id="lyform"><textarea name="rinfo" id="forminfor0" rows="4" style="width: 95%" class="bt_input" rel="内容"></textarea><br/><input type="submit" value="发消息" /></form></div>';
            $s_a_dbg = sprintf('select * from %s where (aid=%s and tid=%s) or (tid=%s and aid=%s) order by datetime desc', $dbprefix . 'message', $tid, $_SESSION[$config['u_hash']], $tid, $_SESSION[$config['u_hash']]);
            $q_a_dbg = mysql_query($s_a_dbg) or die('');
            $c_dbg = mysql_num_rows($q_a_dbg);
            if ($c_dbg > 0) {
                $content .= '<div class="title">聊天记录</div>';
                $p_dbg = ceil($c_dbg / $config['pagesize']);
                if ($page > $p_dbg) {
                    $page = $p_dbg;
                }
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:message.php

示例4: mysql_query

    $q_dbo = mysql_query($s_dbo) or die('');
    $r_dbo = mysql_fetch_assoc($q_dbo);
    if (mysql_num_rows($q_dbo) > 0) {
        if (time() - $r_dbo['datetime'] > 600) {
            $u_db = sprintf('update %s set visit=visit+1, visitdate=%s where id=%s', $dbprefix . 'member', time(), $_SESSION[$config['u_hash']]);
            $result = mysql_query($u_db) or die('');
        }
        $u_db = sprintf('update %s set datetime=%s, online=1, ip_i=inet_aton(%s) where aid=%s', $dbprefix . 'online', time(), SQLString(getIP(), 'text'), $_SESSION[$config['u_hash']]);
        $result = mysql_query($u_db) or die('');
    } else {
        $i_db = sprintf('insert into %s (aid, datetime, ip_i) values (%s, %s, inet_aton(%s))', $dbprefix . 'online', $_SESSION[$config['u_hash']], time(), SQLString(getIP(), 'text'));
        $result = mysql_query($i_db) or die('');
    }
    mysql_free_result($q_dbo);
} elseif (isset($_COOKIE[$config['u_hash'] . '_u']) && $_COOKIE[$config['u_hash'] . '_u'] != '' && isset($_COOKIE[$config['u_hash'] . '_p']) && $_COOKIE[$config['u_hash'] . '_p'] != '') {
    $s_dbu = sprintf('select id, name, status, power from %s where username=%s and password=%s limit 1', $dbprefix . 'member', SQLString($_COOKIE[$config['u_hash'] . '_u'], 'text'), SQLString($_COOKIE[$config['u_hash'] . '_p'], 'text'));
    $q_dbu = mysql_query($s_dbu) or die('');
    $r_dbu = mysql_fetch_assoc($q_dbu);
    if (mysql_num_rows($q_dbu) > 0) {
        if ($r_dbu['status'] == 0 || $config['veri'] > 0) {
            $u_db = sprintf('update %s set visit=visit+1, visitdate=%s where id=%s', $dbprefix . 'member', time(), $r_dbu['id']);
            $result = mysql_query($u_db) or die('');
            session_unset();
            session_start();
            $_SESSION[$config['u_hash']] = $r_dbu['id'];
            $pa = $r_dbu['power'];
            $pn = $r_dbu['name'];
            $c_log = true;
        }
    }
    mysql_free_result($q_dbu);
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:index.php

示例5: htmlspecialchars

     $cont = htmlspecialchars(trim($_POST['rinfo']), ENT_QUOTES);
     if ($cont != '') {
         $time = time();
         $rid = isset($_POST['rid']) && intval($_POST['rid']) > 0 ? intval($_POST['rid']) : 0;
         $i_db = sprintf('insert into %s (content, aid, datetime, lasttime, rid) values (%s, %s, %s, %s, %s)', $dbprefix . 'topic', SQLString($cont, 'text'), $_SESSION[$config['u_hash']], $time, $time, $rid);
         $result = mysql_query($i_db) or die('');
         if ($rid > 0) {
             $u_db = sprintf('update %s set lasttime=%s where id=%s', $dbprefix . 'topic', $time, $rid);
             $result = mysql_query($u_db) or die('');
             $jid = $rid;
         } else {
             $jid = mysql_insert_id();
         }
     }
 } elseif (isset($_POST['vote']) && intval($_POST['vote']) > 0) {
     $s_dbt = sprintf('select id, content, datetime from %s where id=%s and tid=0 and mid=1 limit 1', $dbprefix . 'topic', SQLString($_POST['vote'], 'int'));
     $q_dbt = mysql_query($s_dbt) or die('');
     $r_dbt = mysql_fetch_assoc($q_dbt);
     if (mysql_num_rows($q_dbt) > 0) {
         $cont = explode('[/]', $r_dbt['content']);
         if ($cont[1] == 0 || time() < $r_dbt['datetime'] + 86400 * $cont[1]) {
             if ($cont[2] > 0 && count($_POST['vote' . $r_dbt['id']]) > 0 || $_POST['vote' . $r_dbt['id']] != '') {
                 $s_dbv = sprintf('select id from %s where tid=%s and aid=%s limit 1', $dbprefix . 'vote', $r_dbt['id'], $_SESSION[$config['u_hash']]);
                 $q_dbv = mysql_query($s_dbv) or die('');
                 if (mysql_num_rows($q_dbv) == 0) {
                     $time = time();
                     if ($cont[2] > 0) {
                         foreach ($_POST['vote' . $r_dbt['id']] as $v) {
                             $i_db = sprintf('insert into %s (aid, tid, vid, datetime) values (%s, %s, %s, %s)', $dbprefix . 'vote', $_SESSION[$config['u_hash']], $r_dbt['id'], $v, $time);
                             $result = mysql_query($i_db) or die('');
                         }
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:list.php

示例6: explode

                $title .= '设置头像 - ' . $r_dbu['name'];
                $content .= '<div class="title">设置头像 - ' . $r_dbu['name'] . '</div><div class="lcontent">';
                if (trim($r_dbu['photo']) != '') {
                    $a_pho = explode('|', trim($r_dbu['photo']));
                    $js_c .= '
	$("img[name=\'del_img\']").click(function(){
		if(confirm(\'确认要删除?\'))location.href=\'?m=edituser&id=' . $id . '&t=avator&did=\'+$(this).data(\'id\');
	});';
                    foreach ($a_pho as $k => $v) {
                        if (isset($_GET['did']) && $_GET['did'] == $k) {
                            if (!strstr($a_pho[$k], '://') && file_exists($a_pho[$k])) {
                                unlink($a_pho[$k]);
                            }
                            unset($a_pho[$k]);
                            $u_pho = join('|', $a_pho);
                            $u_db = sprintf('update %s set photo=%s where id=%s', $dbprefix . 'member', SQLString($u_pho, 'text'), $r_dbu['id']);
                            $result = mysql_query($u_db) or die('');
                            header('Location:./?m=edituser&id=' . $id . '&t=avator');
                            exit;
                        }
                        $content .= '<div class="photo_list"><img src="' . $v . '" class="photo" alt="" width="55" height="55"/>&nbsp; <img src="images/o_2.gif" alt="" title="删除" name="del_img" data-id="' . $k . '" class="f_link"/></div>';
                    }
                } else {
                    $content .= '<img src="images/dphoto.jpg" class="photo" alt="" width="55" height="55"/>';
                }
                $content .= '<div class="extr"></div></div>';
            } else {
                $title .= '修改个人资料 - ' . $r_dbu['name'];
                $content .= '<div class="title">修改个人资料 - ' . $r_dbu['name'] . '</div><div class="lcontent"><form method="post" action="" class="btform" id="epform"><table><tr><td>姓名:</td><td><input name="name" size="32" value="' . $r_dbu['name'] . '" class="bt_input" rel="姓名" /></td></tr>';
                if (isset($g_c) && isset($g_a) && count($g_a) > 1) {
                    $content .= '<tr><td>身份:</td><td><select name="gid">';
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:edituser.php

示例7: isset

         $bir_m = $_POST['bir_m'];
         $bir_d = $_POST['bir_d'];
         $isnl = isset($_POST['isnl']) && $_POST['isnl'] == 1 ? 1 : 0;
         $url = htmlspecialchars(trim($_POST['url']), ENT_QUOTES);
         $email = htmlspecialchars(trim($_POST['email']), ENT_QUOTES);
         $phone = htmlspecialchars(trim($_POST['phone']), ENT_QUOTES);
         $work = htmlspecialchars(trim($_POST['work']), ENT_QUOTES);
         $tel = htmlspecialchars(trim($_POST['tel']), ENT_QUOTES);
         $qq = htmlspecialchars(trim($_POST['qq']), ENT_QUOTES);
         $msn = htmlspecialchars(trim($_POST['msn']), ENT_QUOTES);
         $gtalk = htmlspecialchars(trim($_POST['gtalk']), ENT_QUOTES);
         $address = htmlspecialchars(trim($_POST['address']), ENT_QUOTES);
         $location = htmlspecialchars(trim($_POST['location']), ENT_QUOTES);
         $rela = htmlspecialchars(trim($_POST['rela']), ENT_QUOTES);
         $sylorm = isset($_POST['sylorm']) && $_POST['sylorm'] == 1 ? 1 : 0;
         $u_db = sprintf('update %s set username=%s, name=%s, gender=%s, bir_y=%s, bir_m=%s, bir_d=%s, isnl=%s, url=%s, email=%s, phone=%s, work=%s, tel=%s, qq=%s, msn=%s, gtalk=%s, address=%s, location=%s, rela=%s, sylorm=%s where id=%s', $dbprefix . 'member', SQLString($username, 'text'), SQLString($name, 'text'), SQLString($gender, 'int'), SQLString($bir_y, 'int'), SQLString($bir_m, 'int'), SQLString($bir_d, 'int'), $isnl, SQLString($url, 'text'), SQLString($email, 'text'), SQLString($phone, 'text'), SQLString($work, 'text'), SQLString($tel, 'text'), SQLString($qq, 'text'), SQLString($msn, 'text'), SQLString($gtalk, 'text'), SQLString($address, 'text'), SQLString($location, 'text'), SQLString($rela, 'text'), $sylorm, $r_dbu['id']);
         $result = mysql_query($u_db) or die('');
         setsinfo($name . ' 更新了个人资料', $r_dbu['id']);
     }
     header('Location:./?m=profile' . (isset($e) ? '&e=' . $e : ''));
     exit;
 } else {
     $a_msg = array(1 => '个人资料已修改。', '请使用其他的用户名!');
     $content .= '<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>' . (isset($_GET['e']) && isset($a_msg[$_GET['e']]) ? '<div class="msg_v">' . $a_msg[$_GET['e']] . '</div>' : '') . '<div class="title">个人资料</div><div class="lcontent"><form method="post" action="" class="btform" id="pfform"><table><tr><td>用户名:</td><td><input name="username" size="32" value="' . htmlspecialchars($r_dbu['username'], ENT_QUOTES) . '" class="bt_input" rel="用户名" /></td></tr><tr><td>姓名:</td><td><input name="name" size="32" value="' . $r_dbu['name'] . '" class="bt_input" rel="姓名" /></td></tr><tr><td>介绍:</td><td><input name="rela" size="32" value="' . $r_dbu['rela'] . '" /></td></tr><tr><td>性别:</td><td><input type="radio" name="gender" value="0"' . ($r_dbu['gender'] == 0 ? ' checked="checked"' : '') . ' />保密 <input type="radio" name="gender" value="1"' . ($r_dbu['gender'] == 1 ? ' checked="checked"' : '') . ' />男 <input type="radio" name="gender" value="2"' . ($r_dbu['gender'] == 2 ? ' checked="checked"' : '') . ' />女</td></tr><tr><td>生日:</td><td><input name="bir_y" size="5" maxsize="4" value="' . ($r_dbu['bir_y'] > 0 ? $r_dbu['bir_y'] : '') . '" />-<select name="bir_m">';
     for ($i = 0; $i < 13; $i++) {
         $content .= '<option value="' . $i . '"' . ($r_dbu['bir_m'] == $i ? ' selected="selected"' : '') . '>' . ($i > 0 ? $i : '-') . '</option>';
     }
     $content .= '</select>-<select name="bir_d">';
     for ($i = 0; $i < 32; $i++) {
         $content .= '<option value="' . $i . '"' . ($r_dbu['bir_d'] == $i ? ' selected="selected"' : '') . '>' . ($i > 0 ? $i : '-') . '</option>';
     }
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:profile.php

示例8: googlePHP

        case 'google':
            if ($config['is_google'] > 0 && $config['google_key'] != '' && $config['google_se'] != '') {
                require_once 'lib/google.php';
                $o = new googlePHP($config['google_key'], $config['google_se']);
                $result = $o->access_token_refresh($r_dby['s_r']);
                if (isset($result['access_token']) && $result['access_token'] != '') {
                    $r_dby['s_t'] = $result['access_token'];
                    $r_dby['edate'] = time() + $result['expires_in'];
                }
            }
            break;
        case 'live':
            if ($config['is_live'] > 0 && $config['live_key'] != '' && $config['live_se'] != '') {
                require_once 'lib/live.php';
                $o = new livePHP($config['live_key'], $config['live_se']);
                $result = $o->access_token_refresh($r_dby['s_r']);
                if (isset($result['access_token']) && $result['access_token'] != '') {
                    $r_dby['s_t'] = $result['access_token'];
                    $r_dby['s_r'] = $result['refresh_token'];
                    $r_dby['edate'] = time() + $result['expires_in'];
                }
            }
            break;
        default:
            break;
    }
    $u_db = sprintf('update %s set s_t=%s, s_r=%s, edate=%s, mdate=%s where id=%s', $dbprefix . 'm_sync', SQLString($r_dby['s_t'], 'text'), SQLString($r_dby['s_r'], 'text'), SQLString($r_dby['edate'], 'int'), time(), $r_dby['id']);
    $result = mysql_query($u_db) or die('');
    echo '<script type="text/javascript">location.href=\'' . $f . '\';</script>';
}
mysql_free_result($q_dby);
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:sync_e.php

示例9: SohuOAuth

                require_once 'lib/SohuOAuth.php';
                $oauth = new SohuOAuth($config['tsohu_key'], $config['tsohu_se'], $r_dby['s_t'], $r_dby['s_s']);
                $url = 'http://api.t.sohu.com/statuses/update.json';
                $oauth->post($url, array('status' => urlencode($a[0][0])));
            }
            mysql_free_result($q_dby);
        }
        if ($config['is_tw'] > 0 && $config['tw_key'] != '' && $config['tw_se'] != '' && in_array('twitter', $am)) {
            $s_dby = sprintf('select s_t, s_s from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $aid, SQLString('twitter', 'text'));
            $q_dby = mysql_query($s_dby) or die('');
            $r_dby = mysql_fetch_assoc($q_dby);
            if (mysql_num_rows($q_dby) > 0) {
                require_once 'lib/twitterOAuth.php';
                $twitter = new TwitterOAuth($config['tw_key'], $config['tw_se'], $r_dby['s_t'], $r_dby['s_s']);
                $t_c = $twitter->OAuthRequest('https://twitter.com/statuses/update.xml', array('status' => $a[0][0]), 'POST');
            }
            mysql_free_result($q_dby);
        }
        if ($config['is_fb'] > 0 && $config['fb_se'] != '' && $config['fb_app_id'] != '' && in_array('facebook', $am)) {
            $s_dby = sprintf('select s_id from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $aid, SQLString('facebook', 'text'));
            $q_dby = mysql_query($s_dby) or die('');
            $r_dby = mysql_fetch_assoc($q_dby);
            if (mysql_num_rows($q_dby) > 0) {
                require_once 'lib/facebook.php';
                $fb = new facebookPHP($config['fb_app_id'], $config['fb_se'], $r_dby['s_t']);
                $fb->update($a[0][0]);
            }
            mysql_free_result($q_dby);
        }
    }
}
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:sync_p.php

示例10: mysql_query

                $result = mysql_query($d_db) or die('');
                if ($config['skin'] == $r_dbk['id']) {
                    $u_db = sprintf('update %s set skin=0', $dbprefix . 'main');
                    $result = mysql_query($u_db) or die('');
                }
                header('Location:./?m=setting&t=skin');
                exit;
            }
        } else {
            $lp[0] = '<li><img src="images/skin_b.jpg" width="120" height="90" rel="' . $k . '|' . $v[0] . '" class="skin_img"/><br/>青青校园</li>';
        }
    }
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        if (isset($_POST['path']) && file_exists('skin/' . $_POST['path'] . '/info.php') && !isset($lp[$_POST['path']])) {
            $path = $_POST['path'];
            require_once 'skin/' . $_POST['path'] . '/info.php';
            $stitle = isset($s_title) ? htmlspecialchars($s_title, ENT_QUOTES) : '';
            $sfile = isset($s_file) ? htmlspecialchars($s_file, ENT_QUOTES) : 'styles.css';
            $i_db = sprintf('insert into %s (path, title, sfile) values (%s, %s, %s)', $dbprefix . 'skin', SQLString($path, 'text'), SQLString($stitle, 'text'), SQLString($sfile, 'text'));
            $result = mysql_query($i_db) or die('');
            $e = 2;
        } else {
            $e = 1;
        }
        header('Location:./?m=setting&t=skin' . (isset($e) ? '&e=' . $e : ''));
        exit;
    } else {
        $a_msg = array(1 => '文件不存在或者样式已经安装过!', '新样式已添加。');
        $content .= '<div class="msg_v" id="skin_msg"' . (isset($_GET['e']) && isset($a_msg[$_GET['e']]) ? '>' . $a_msg[$_GET['e']] : ' style="display: none;">') . '</div>' . (isset($lp) ? '<div class="title">样式管理</div><div class="scontent"><ul id="skinlist">' . join('', $lp) . '</ul><div class="extr"></div></div><br/>' : '') . '<div class="title">添加样式</div><div class="lcontent"><form method="post" action="" class="btform" id="skinform"><div class="formline">skin/<input name="path" size="32" class="bt_input" rel="样式路径" />/info.php</div><div class="formline"><input type="submit" value="添加" class="button" /> <input type="reset" value="取消" class="button" /> <a href="http://www.piscdong.com/mini_class/?m=skin" rel="external">下载更多样式</a></div></form></div>';
    }
}
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:s_skin.php

示例11: getsync_c

function getsync_c($ar)
{
    global $config, $dbprefix;
    if ($config['is_sina'] > 0 && $config['sina_key'] != '' && $config['sina_se'] != '') {
        $s_dby = sprintf('select s_n from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('sina', 'text'));
        $q_dby = mysql_query($s_dby) or die('');
        $r_dby = mysql_fetch_assoc($q_dby);
        if (mysql_num_rows($q_dby) > 0) {
            $a_sync_c[] = '<input type="checkbox" name="u_sina" value="1"/><a href="' . $r_dby['s_n'] . '" rel="external"><img src="images/i-sina.gif" alt="" title="新浪微博"/></a>';
        } else {
            $a_sync_c[] = '<input type="checkbox" disabled="disabled" title="您还没有绑定新浪微博账号,点击图标设置"/><a href="?m=profile&amp;t=sync&amp;n=sina"><img src="images/i-sina.gif" alt="" title="新浪微博" title="您还没有绑定新浪微博账号,点击设置"/></a>';
        }
        mysql_free_result($q_dby);
    }
    if ($config['is_tqq'] > 0 && ($config['is_utqq'] > 0 || $config['tqq_key'] != '' && $config['tqq_se'] != '')) {
        $s_dby = sprintf('select s_n from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('tqq', 'text'));
        $q_dby = mysql_query($s_dby) or die('');
        $r_dby = mysql_fetch_assoc($q_dby);
        if (mysql_num_rows($q_dby) > 0) {
            $a_sync_c[] = '<input type="checkbox" name="u_tqq" value="1"/><a href="' . $r_dby['s_n'] . '" rel="external"><img src="images/i-tqq.gif" alt="" title="腾讯微博"/></a>';
        } else {
            $a_sync_c[] = '<input type="checkbox" disabled="disabled" title="您还没有绑定腾讯微博账号,点击图标设置"/><a href="?m=profile&amp;t=sync&amp;n=tqq"><img src="images/i-tqq.gif" alt="" title="腾讯微博" title="您还没有绑定腾讯微博账号,点击设置"/></a>';
        }
        mysql_free_result($q_dby);
    }
    if ($config['is_renren'] > 0 && $config['renren_key'] != '' && $config['renren_se'] != '') {
        $s_dby = sprintf('select s_n from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('renren', 'text'));
        $q_dby = mysql_query($s_dby) or die('');
        $r_dby = mysql_fetch_assoc($q_dby);
        if (mysql_num_rows($q_dby) > 0) {
            $a_sync_c[] = '<input type="checkbox" name="u_renren" value="1"/><a href="' . $r_dby['s_n'] . '" rel="external"><img src="images/i-renren.gif" alt="" title="人人网"/></a>';
        } else {
            $a_sync_c[] = '<input type="checkbox" disabled="disabled" title="您还没有绑定人人网账号,点击图标设置"/><a href="?m=profile&amp;t=sync&amp;n=renren"><img src="images/i-renren.gif" alt="" title="人人网" title="您还没有绑定人人网账号,点击设置"/></a>';
        }
        mysql_free_result($q_dby);
    }
    if ($config['is_kx001'] > 0 && $config['kx001_key'] != '' && $config['kx001_se'] != '') {
        $s_dby = sprintf('select s_n from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('kx001', 'text'));
        $q_dby = mysql_query($s_dby) or die('');
        $r_dby = mysql_fetch_assoc($q_dby);
        if (mysql_num_rows($q_dby) > 0) {
            $a_sync_c[] = '<input type="checkbox" name="u_kx001" value="1"/><a href="' . $r_dby['s_n'] . '" rel="external"><img src="images/i-kx001.gif" alt="" title="开心网"/></a>';
        } else {
            $a_sync_c[] = '<input type="checkbox" disabled="disabled" title="您还没有绑定开心网账号,点击图标设置"/><a href="?m=profile&amp;t=sync&amp;n=kx001"><img src="images/i-kx001.gif" alt="" title="开心网" title="您还没有绑定开心网账号,点击设置"/></a>';
        }
        mysql_free_result($q_dby);
    }
    if ($config['is_tsohu'] > 0 && ($config['is_utsohu'] > 0 || $config['tsohu_key'] != '' && $config['tsohu_se'] != '')) {
        $s_dby = sprintf('select s_n from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('tsohu', 'text'));
        $q_dby = mysql_query($s_dby) or die('');
        $r_dby = mysql_fetch_assoc($q_dby);
        if (mysql_num_rows($q_dby) > 0) {
            $a_sync_c[] = '<input type="checkbox" name="u_tsohu" value="1"/><a href="' . $r_dby['s_n'] . '" rel="external"><img src="images/i-tsohu.gif" alt="" title="搜狐微博"/></a>';
        } else {
            $a_sync_c[] = '<input type="checkbox" disabled="disabled" title="您还没有绑定搜狐微博账号,点击图标设置"/><a href="?m=profile&amp;t=sync&amp;n=tsohu"><img src="images/i-tsohu.gif" alt="" title="搜狐微博" title="您还没有绑定搜狐微博账号,点击设置"/></a>';
        }
        mysql_free_result($q_dby);
    }
    if ($config['is_t163'] > 0 && $config['t163_key'] != '' && $config['t163_se'] != '') {
        $s_dby = sprintf('select s_n from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('t163', 'text'));
        $q_dby = mysql_query($s_dby) or die('');
        $r_dby = mysql_fetch_assoc($q_dby);
        if (mysql_num_rows($q_dby) > 0) {
            $a_sync_c[] = '<input type="checkbox" name="u_t163" value="1"/><a href="' . $r_dby['s_n'] . '" rel="external"><img src="images/i-t163.gif" alt="" title="网易微博"/></a>';
        } else {
            $a_sync_c[] = '<input type="checkbox" disabled="disabled" title="您还没有绑定网易微博账号,点击图标设置"/><a href="?m=profile&amp;t=sync&amp;n=t163"><img src="images/i-t163.gif" alt="" title="网易微博" title="您还没有绑定网易微博账号,点击设置"/></a>';
        }
        mysql_free_result($q_dby);
    }
    if ($config['is_tw'] > 0 && $config['tw_key'] != '' && $config['tw_se'] != '') {
        $s_dby = sprintf('select s_n from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('twitter', 'text'));
        $q_dby = mysql_query($s_dby) or die('');
        $r_dby = mysql_fetch_assoc($q_dby);
        if (mysql_num_rows($q_dby) > 0) {
            $a_sync_c[] = '<input type="checkbox" name="u_twitter" value="1"/><a href="http://twitter.com/' . $r_dby['s_n'] . '" rel="external"><img src="images/i-twitter.gif" alt="" title="Twitter"/></a>';
        } else {
            $a_sync_c[] = '<input type="checkbox" disabled="disabled" title="您还没有绑定Twitter账号,点击图标设置"/><a href="?m=profile&amp;t=sync&amp;n=twitter"><img src="images/i-twitter.gif" alt="" title="Twitter" title="您还没有绑定Twitter账号,点击设置"/></a>';
        }
        mysql_free_result($q_dby);
    }
    if ($config['is_fb'] > 0 && $config['fb_se'] != '' && $config['fb_app_id'] != '') {
        $s_dby = sprintf('select s_id from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('facebook', 'text'));
        $q_dby = mysql_query($s_dby) or die('');
        $r_dby = mysql_fetch_assoc($q_dby);
        if (mysql_num_rows($q_dby) > 0) {
            $a_sync_c[] = '<input type="checkbox" name="u_facebook" value="1"/><a href="http://www.facebook.com/profile.php?id=' . $r_dby['s_id'] . '" rel="external"><img src="images/i-facebook.gif" alt="" title="Facebook"/></a>';
        } else {
            $a_sync_c[] = '<input type="checkbox" disabled="disabled" title="您还没有绑定Facebook账号,点击图标设置"/><a href="?m=profile&amp;t=sync&amp;n=facebook"><img src="images/i-facebook.gif" alt="" title="Facebook" title="您还没有绑定Facebook账号,点击设置"/></a>';
        }
        mysql_free_result($q_dby);
    }
    if (isset($a_sync_c)) {
        return '<br/>发布到:' . join(' ', $a_sync_c);
    }
}
开发者ID:lyhiving,项目名称:mini_class,代码行数:95,代码来源:function.php

示例12: mysql_query

             $q_dby = mysql_query($s_dby) or die('');
             $r_dby = mysql_fetch_assoc($q_dby);
             if (mysql_num_rows($q_dby) > 0) {
                 $io = new instagramPHP($config['instagram_key'], $config['instagram_se'], $r_dby['s_t']);
                 $ia = $io->user($r_dby['s_id']);
                 if (!isset($ia['meta']['error_type']) && isset($ia['data']['id']) && $ia['data']['id'] != '') {
                     $is_sync = 1;
                     $me_url = 'http://instagram.com/' . $ia['data']['username'] . '/';
                     if ($r_dby['s_n'] != $me_url || $r_dby['s_id'] != $ia['data']['id']) {
                         $u_db = sprintf('update %s set s_n=%s, s_id=%s where id=%s', $dbprefix . 'm_sync', SQLString($me_url, 'text'), SQLString($ia['data']['id'], 'text'), $r_dby['id']);
                         $result = mysql_query($u_db) or die('');
                     }
                     $content .= '当前已绑定Instagram账号<table width="200"><tr><td align="center"><img src="' . $ia['data']['profile_picture'] . '" alt=""/><br/><a href="' . $me_url . '" target="_blank">' . $ia['data']['username'] . '</a>(<a href="?m=profile&amp;t=sync&amp;n=' . $nct . '&amp;lt=1">取消绑定</a>)</td></tr></table>';
                     $content .= '<br/><br/><form method="post" action=""><input type="checkbox" name="is_show" value="1"' . ($r_dby['is_show'] > 0 ? ' checked="checked"' : '') . '/>隐藏已绑定Instagram账号相关信息<br/><input type="submit" value="更新" class="button"/><input type="hidden" name="isl_instagram_h" value="' . $r_dby['id'] . '"/></form>';
                 } else {
                     $d_db = sprintf('delete from %s where aid=%s and name=%s', $dbprefix . 'm_sync', $r_dbu['id'], SQLString($nct, 'text'));
                     $result = mysql_query($d_db) or die('');
                 }
             }
             mysql_free_result($q_dby);
             if ($is_sync == 0) {
                 $io = new instagramPHP($config['instagram_key'], $config['instagram_se']);
                 $aurl = $io->login_url($config['site_url'] . 'instagram_callback.php');
                 $content .= '<a href="' . $aurl . '">点击此处和您的Instagram账号建立连接</a>';
             }
             $content .= '<br/><br/>绑定Instagram账号后将实现以下功能:<ol><li>可以选取Instagram图片添加到照片视频</li><li>在<a href="?m=user&amp;id=' . $r_dbu['id'] . '">用户信息</a>页面显示最新的Instagram图片</li</ol>';
             break;
     }
     $content .= '</div>';
 } else {
     $content .= '<div class="formline">管理员还没有' . ($pa == 9 ? '<a href="?m=setting&amp;t=sync">' : '') . '开启绑定功能' . ($pa == 9 ? '</a>' : '') . '。</div>';
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:p_sync.php

示例13: sprintf

         $u_db = sprintf('update %s set sticky=%s where id=%s', $dbprefix . 'topic', SQLString($sticky, 'int'), $r_dbl['id']);
         $result = mysql_query($u_db) or die('');
         if ($r_dbl['mid'] > 0) {
             $coa = explode('[/]', $r_dbl['content']);
             $msg = $coa[0];
         } else {
             $msg = $r_dbl['content'];
         }
         $ac = $pn . ' ' . ($sticky > 0 ? '' : '取消') . "置顶留言\r\r" . $r_dbl['name'] . ':' . $msg;
         setoinfo($ac, $r_dbl['id']);
         header('Location:?page=' . $page);
         exit;
     }
     if (isset($_GET['lid']) && $_GET['lid'] == $r_dbl['id']) {
         $lock = $r_dbl['is_lock'] > 0 ? 0 : 1;
         $u_db = sprintf('update %s set is_lock=%s where id=%s', $dbprefix . 'topic', SQLString($lock, 'int'), $r_dbl['id']);
         $result = mysql_query($u_db) or die('');
         if ($r_dbl['mid'] > 0) {
             $coa = explode('[/]', $r_dbl['content']);
             $msg = $coa[0];
         } else {
             $msg = $r_dbl['content'];
         }
         $ac = $pn . ' ' . ($lock > 0 ? '' : '取消') . "锁定留言\r\r" . $r_dbl['name'] . ':' . $msg;
         setoinfo($ac, $r_dbl['id']);
         header('Location:?page=' . $page);
         exit;
     }
 }
 if ($pa == 9 && $r_dbl['disp'] > 0) {
     $cm[] = '&nbsp;<span class="del_n">已删除</span> <a href="?page=' . $page . '&amp;pid=' . $r_dbl['id'] . '"><img src="images/o_4.gif" alt="" title="恢复"/></a>';
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:list.php

示例14: unset

        unset($result);
        $title = htmlspecialchars(trim($_POST['title']), ENT_QUOTES);
        $query = sprintf('insert into %s (title) values (%s)', $dbprefix . 'main', SQLString($title, 'text'));
        $result = mysql_query($query);
        echo '<li>写入新数据 ' . $dbprefix . 'main:<span style="font-weight:bold;color:#' . ($result == true ? '036;">成功' : 'f00;">失败') . '</span></li>';
        unset($query);
        unset($result);
        $username = trim($_POST['username']);
        $password = enc_p(trim($_POST['password']));
        $name = htmlspecialchars(trim($_POST['name']), ENT_QUOTES);
        $query = sprintf('insert into %s (username, password, name, power, regdate) values (%s, %s, %s, 9, %s)', $dbprefix . 'member', SQLString($username, 'text'), SQLString($password, 'text'), SQLString($name, 'text'), time());
        $result = mysql_query($query);
        echo '<li>写入新数据 ' . $dbprefix . 'member:<span style="font-weight:bold;color:#' . ($result == true ? '036;">成功' : 'f00;">失败') . '</span></li>';
        unset($query);
        unset($result);
        $query = sprintf('insert into %s (path, title, sfile) values (%s, %s, %s)', $dbprefix . 'skin', SQLString('blue', 'text'), SQLString('蓝色梦想', 'text'), SQLString('styles.css', 'text'));
        $result = mysql_query($query);
        echo '<li>写入新数据 ' . $dbprefix . 'skin:<span style="font-weight:bold;color:#' . ($result == true ? '036;">成功' : 'f00;">失败') . '</span></li>';
        unset($query);
        unset($result);
        echo '</ul><input type="button" value="完成" class="button" onclick="location.href=\'../\';"/></div>';
        writeText($l_file, time());
    } else {
        ?>
	<div class="title">第2步:配置信息</div>
	<div class="lcontent">
		<form method="post" onsubmit="if(document.form1.title.value=='' || document.form1.username.value=='' || document.form1.password.value=='' || document.form1.name.value==''){alert('请输入配置信息。');return false;}else if(document.form1.password.value!='' && document.form1.password.value!=document.form1.password2.value){alert('请确认密码。');return false;}" name="form1">
			<table>
				<tr><td>标题:</td><td><input name="title" size="32"/></td></tr>
				<tr><td colspan="2">管理员信息</td></tr>
				<tr><td>用户名:</td><td><input name="username" size="32"/></td></tr>
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:mysql.php

示例15: kaixinPHP

    if (isset($_GET['code']) && trim($_GET['code']) != '') {
        require_once 'lib/kaixin.php';
        $db_o = new kaixinPHP($config['kx001_key'], $config['kx001_se']);
        $result = $db_o->access_token($config['site_url'] . 'kx001_callback.php', $_GET['code']);
    }
    if (isset($result['access_token']) && $result['access_token'] != '') {
        $s_t = $result['access_token'];
        $s_r = $result['refresh_token'];
        $edate = time() + $result['expires_in'];
        if ($c_log) {
            $ar = getainfo($_SESSION[$config['u_hash']], 'id, name');
            $s_dby = sprintf('select id from %s where aid=%s and name=%s limit 1', $dbprefix . 'm_sync', $ar['id'], SQLString('kx001', 'text'));
            $q_dby = mysql_query($s_dby) or die('');
            $r_dby = mysql_fetch_assoc($q_dby);
            if (mysql_num_rows($q_dby) > 0) {
                $u_db = sprintf('update %s set s_t=%s, s_r=%s, edate=%s where id=%s', $dbprefix . 'm_sync', SQLString($s_t, 'text'), SQLString($s_r, 'text'), SQLString($edate, 'int'), $r_dby['id']);
                $result = mysql_query($u_db) or die('');
            } else {
                $i_db = sprintf('insert into %s (aid, name, s_t, s_r, edate) values (%s, %s, %s, %s, %s)', $dbprefix . 'm_sync', $ar['id'], SQLString('kx001', 'text'), SQLString($s_t, 'text'), SQLString($s_r, 'text'), SQLString($edate, 'int'));
                $result = mysql_query($i_db) or die('');
            }
            mysql_free_result($q_dby);
            setsinfo($ar['name'] . ' 绑定了开心网', $ar['id']);
        } else {
            $_SESSION['kx001_login_u_t'] = $s_t;
            $_SESSION['kx001_login_u_r'] = $s_r;
            $_SESSION['kx001_login_u_edate'] = $edate;
        }
    }
}
header('Location:' . $u);
开发者ID:lyhiving,项目名称:mini_class,代码行数:31,代码来源:kx001_callback.php


注:本文中的SQLString函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。