Пример #1
0
<?php

include_once "include/common.inc.php";
$channelid = Char_Cv('channelid', 'get');
echo API_Logout('index.php?channelid=' . $channelid);
Пример #2
0
 function page($table, $key, $vars = "", $maxperpage = 20, $strs)
 {
     $tbl = $this->tbl;
     $table_ = $table;
     $vars_ = $vars;
     $pagename = $_SERVER['PHP_SELF'];
     $table = $tbl . $table;
     if ($vars) {
         $vars = "where {$vars}";
     }
     $thispage = Char_Cv("page", "get");
     if ($thispage == "" || !is_numeric($thispage)) {
         $thispage = 1;
     }
     $thispage = intval($thispage);
     if ($thispage < 1) {
         $thispage = 1;
     }
     $sql = "select {$key} from {$table} {$vars} limit " . ($thispage - 1) * $maxperpage . ",{$maxperpage}";
     $result = $this->query($sql);
     $totalput = $this->rows($table_, $vars_);
     if ($totalput % $maxperpage == 0) {
         $PageCount = intval($totalput / $maxperpage);
     } else {
         $PageCount = intval($totalput / $maxperpage + 1);
     }
     if ($PageCount < $thispage) {
         $thispage = $PageCount;
     }
     $record = array();
     while ($onez = $this->fetch_array($result)) {
         $record[] = $onez;
     }
     $ms = "";
     unset($A, $B);
     if ($thispage < 1) {
         $thispage = 1;
     }
     if ($PageCount < 1) {
         $PageCount = 1;
     }
     if ($strs && $PageCount > 1) {
         $page = '<div id="page">';
         if ($thispage > 1) {
             $page .= '<a href="' . str_replace('*', $thispage - 1, $strs) . '" class="step">��һҳ</a>';
         }
         if ($thispage > 5) {
             $page .= '<a href="' . str_replace('*', 1, $strs) . '">1</a>';
             $page .= '<span>��</span>';
             if ($thispage > $PageCount - 7) {
                 for ($i = $PageCount - 7; $i < $thispage - 3; $i++) {
                     $page .= '<a href="' . str_replace('*', $i, $strs) . '">' . $i . '</a>';
                 }
             }
             for ($i = $thispage - 3; $i < $thispage; $i++) {
                 $page .= '<a href="' . str_replace('*', $i, $strs) . '">' . $i . '</a>';
             }
         } else {
             for ($i = 1; $i < $thispage; $i++) {
                 $page .= '<a href="' . str_replace('*', $i, $strs) . '">' . $i . '</a>';
             }
         }
         $page .= '<a href="' . str_replace('*', $thispage, $strs) . '" class="sel">' . $thispage . '</a>';
         if ($PageCount - $thispage > 5) {
             if ($PageCount > 8) {
                 for ($i = $thispage + 1; $i <= ($thispage > 5 ? $thispage + 3 : 8); $i++) {
                     $page .= '<a href="' . str_replace('*', $i, $strs) . '">' . $i . '</a>';
                 }
                 $page .= '<span>��</span>';
                 $page .= '<a href="' . str_replace('*', $PageCount, $strs) . '">' . $PageCount . '</a>';
             } else {
                 for ($i = $thispage + 1; $i <= $PageCount; $i++) {
                     $page .= '<a href="' . str_replace('*', $i, $strs) . '">' . $i . '</a>';
                 }
             }
         } else {
             for ($i = $thispage + 1; $i <= $PageCount; $i++) {
                 $page .= '<a href="' . str_replace('*', $i, $strs) . '">' . $i . '</a>';
             }
         }
         if ($thispage < $PageCount) {
             $page .= '<a href="' . str_replace('*', $thispage + 1, $strs) . '" class="step">��һҳ</a>';
         }
         $page .= '</div>';
     }
     return array($record, $page);
 }
Пример #3
0
//header("Content-type: text/html; charset=utf-8");
foreach (API_Config() as $k => $v) {
    ${$k} = $v;
}
$type = Char_Cv('type', 'get');
Robot($type == 'onez' ? 1 : 0);
$channelid = Char_Cv('channelid', 'get');
Channel($channelid);
if ($Channel['allowguest'] == 1 || $username) {
    if ($Channel['ifonly'] == 1) {
        header("location:group.php?only=1&channel=" . $Channel['id']);
        exit;
    }
}
$botid = Char_Cv('botid', 'get');
$client = Char_Cv('client', 'get');
$onezdivcount = 28;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="themes/<?php 
echo $Channel['theme'] ? $Channel['theme'] : $setting['theme'];
?>
/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript">
var client="<?php 
echo $client;
Пример #4
0
<?php

include_once "include/common.inc.php";
$theskin = Char_Cv('theskin', 'get');
foreach (API_Config() as $k => $v) {
    ${$k} = $v;
}
function Check()
{
    global $userid;
    if (!$userid) {
        API_Logout();
        exit('<script>if(top!==self)top.location.reload();</script>');
    }
}
if (!$userid) {
    $userid = $_SESSION['onez_userid'];
    $username = 32;
    if (!$userid) {
        $userid = '_' . uniqid('');
        //$username=$guestname;
        $_SESSION['onez_userid'] = $userid;
        $_SESSION['onez_username'] = $username;
    }
}
if (file_exists('onezdata/limit/' . $userid . '.txt')) {
    $t = time() - @filemtime('onezdata/limit/' . $userid . '.txt');
    if ($t < 1800) {
        API_Logout();
        exit('<script>alert("您暂时不能进入本群,解封剩余时间:' . intval((1800 - $t) / 60) . '分钟");if(top!==self)top.location.reload();</script>');
    } else {
Пример #5
0
     $dh = opendir($tplpath);
     while ($file = readdir($dh)) {
         if ($file != "." && $file != "..") {
             if (!is_dir($tplpath . '/' . $file)) {
                 if (in_array(end(explode(".", $file)), array('gif', 'jpg', 'png'))) {
                     $Icon[] = $file;
                 }
             }
         }
     }
     closedir($dh);
     include "linksEdit.php";
     break;
 case 'editlinks':
     $cid = Char_Cv("cid", "get");
     $id = Char_Cv('id', 'get');
     if (!$id) {
         ero('参数不正确', '?action=links');
     }
     $links = $db->record("links", "adpos,icon,title,linkurl,endtime", "id={$id}");
     if (!$links) {
         ero('您要编辑的资料不存在', 'index.php?action=channels');
     }
     foreach ($links[0] as $k => $v) {
         ${$k} = $v;
     }
     $endtime = date('Y-m-d H:i:s', $endtime);
     $ti = $title;
     $title = '编辑链接';
     $btn = '保存修改';
     $tplpath = "../images/link";
Пример #6
0
<?php

include_once "check.php";
$action = Char_Cv('action', 'get');
if ($action == 'del') {
    $uid = Char_Cv('uid', 'get');
    API_DelFriend($uid);
}
include 'header.php';
$maxperpage = 10;
$thispage = Char_Cv("page", "get");
if ($thispage == "" || !is_numeric($thispage)) {
    $thispage = 1;
}
$thispage = intval($thispage);
$totalput = API_RowFriend();
if ($totalput % $maxperpage == 0) {
    $PageCount = intval($totalput / $maxperpage);
} else {
    $PageCount = intval($totalput / $maxperpage + 1);
}
if ($PageCount < $thispage) {
    $thispage = $PageCount;
}
$Table[0] = API_ListFriend($page, $maxperpage, $totalput);
if ($strs && substr($strs, 0, 1) != '&') {
    $strs = '&' . $strs;
}
for ($A = $k = $thispage > 3 && $PageCount > 5 ? $thispage - 2 : 1; $k <= ($A + 5 > $PageCount ? $PageCount : $A + 5); $k = $k + 1) {
    $ms = $ms . "[<a href='" . $pagename . "?page=" . $k . $strs . "'>" . ($k == $thispage ? '<b>' . $k . '</b>' : $k) . "</a>] " . "\r\n";
}
Пример #7
0
     $errormsg = 'database_errno_' . mysql_errno();
     $msg .= '<li>' . $lang[$errormsg] . '</li>';
     $quit = TRUE;
 } else {
     $curr_mysql_version = mysql_get_server_info();
     if ($curr_mysql_version < '3.23') {
         $msg .= '<li>' . $lang['mysql_version_323'] . '</li>';
         $quit = TRUE;
     }
 }
 if ($_POST['submit']) {
     $apitype = Char_Cv('apitype');
     $apiurl = Char_Cv('apiurl');
     $regurl = Char_Cv('RegUrl');
     $ViewUserUrl = Char_Cv('UserUrl');
     $mastername = Char_Cv('mastername');
     if (!$quit) {
         if (!$write_error) {
             $fp = fopen('./config.inc.php', 'r');
             $configfile = fread($fp, filesize('./config.inc.php'));
             fclose($fp);
             $homepage = preg_replace("/\\/([a-zA-Z\\.]{4,})\$/", "", "http://" . $_SERVER["SERVER_NAME"] . $_SERVER['PHP_SELF']);
             $configfile = preg_replace("/[\$]homepage\\s*\\=\\s*[\"'].*?[\"'];/is", "\$homepage = '{$homepage}';", $configfile);
             $configfile = preg_replace("/[\$]apitype\\s*\\=\\s*[\"'].*?[\"'];/is", "\$apitype = '{$apitype}';", $configfile);
             $configfile = preg_replace("/[\$]regurl\\s*\\=\\s*[\"'].*?[\"'];/is", "\$regurl = '{$regurl}';", $configfile);
             $configfile = preg_replace("/[\$]ViewUserUrl\\s*\\=\\s*[\"'].*?[\"'];/is", "\$ViewUserUrl = '{$ViewUserUrl}';", $configfile);
             $configfile = preg_replace("/[\$]mastername\\s*\\=\\s*[\"'].*?[\"'];/is", "\$mastername = '{$mastername}';", $configfile);
             $configfile = preg_replace("/[\$]apiurl\\s*\\=\\s*[\"'].*?[\"'];/is", "\$apiurl = '{$apiurl}';", $configfile);
             $configfile = preg_replace("/\\/\\/([\\*]+)UCenter Start([\\*]+)((.|\n)+?)\\/\\/([\\*]+)UCenter End([\\*]+)/i", "//\$1UCenter Start\$2\n" . $_POST['uc_config'] . "//\$5UCenter End\$6", $configfile);
             $fp = fopen('./config.inc.php', 'w');
             fwrite($fp, trim($configfile));
Пример #8
0
<?php

include_once "include/common.inc.php";
foreach (API_Config() as $k => $v) {
    ${$k} = $v;
}
switch ($action = Char_Cv('type', 'get')) {
    case 'islogin':
        print $userid ? 'Y' : 'N';
        break;
    case 'logout':
        echo API_Logout();
        break;
}
Пример #9
0
<?php

include_once "check.php";
$client = intval(Char_Cv('client', 'get'));
Links();
$from = Char_Cv('from', 'get');
$uid = Char_Cv('uid', 'get');
if (substr($userid, 0, 1) == '_') {
    $user = array('username' => $guestname, 'face' => 'images/guest.gif');
} else {
    $user = API_Info($userid);
}
if (substr($uid, 0, 1) == '_') {
    $touser = array('uid' => $uid, 'username' => $guestname, 'face' => 'images/guest.gif');
} else {
    $touser = API_Info($uid);
}
//print_r($touser);
if (!$touser) {
    exit('<script>alert("此用户不存在");window.parent.FrameClose("' . $_GET["onezid"] . '")</script>');
}
@(include_once 'plugins/toolbar.php');
if (is_array($ONLOAD)) {
    $ONLOAD = implode("\n", $ONLOAD);
}
if (is_array($SWFLOAD)) {
    $SWFLOAD = implode(";", $SWFLOAD);
}
if (is_array($closeobj)) {
    $closeobj = implode(";", $closeobj);
}
Пример #10
0
<?php

include_once "include/common.inc.php";
function _exit($msg)
{
    exit('<script>alert("' . $msg . '");if(top!==self)top.location.href="http://www.onez.cn";</script>');
}
$client = Char_Cv('client', 'get');
$from = Char_Cv('from', 'get');
$botid = Char_Cv('botid', 'get');
file_exists('plugins/robot/' . $botid . '/config.php') || _exit('此用户不存在');
include_once 'plugins/robot/' . $botid . '/config.php';
if ($Con['theme']) {
    $skin = $Con['theme'];
}
include 'header.php';
?>
<div id="hiddenBox" style="position:absolute;top:-99999px;"></div>
<div class="toolbarbk">
<?php 
if (is_array($links)) {
    foreach ($links as $rs) {
        if ($rs['adpos'] == '0' || $rs['adpos'] == '2') {
            ?>
<a href="<?php 
            echo $rs['linkurl'];
            ?>
" onfocus="this.blur()" target="_blank"><img src="<?php 
            echo $rs['icon'];
            ?>
" alt="<?php 
Пример #11
0
<?php

include_once "include/common.inc.php";
$channel = Char_Cv("channel", "get");
switch ($action = Char_Cv('action', 'get')) {
    case 'login':
        $usr = Char_Cv("usr");
        $pwd = Char_Cv("pwd");
        $api = API_Login($usr, $pwd);
        if ($api != 'Y') {
            ero($api);
        }
        exit('<script>top.location.href="index.php?channelid=' . $channel . '";</script>');
        break;
}
if (!$groupname) {
    $groupname = "»áÔ±µÇ½";
}
if (!($webtitle = $homename)) {
    $webtitle = $groupname;
}
$banner = $loginbannerurl == '' ? '<img src="' . $loginbanner . '">' : '<a href="' . $loginbannerurl . '" target="_blank"><img src="' . $loginbanner . '" border="0"></a>';
include 'header.php';
?>
<div class="loginBanner"><?php 
echo $banner;
?>
</div>
<form action="login.php?action=login&channel=<?php 
echo $channel;
?>
Пример #12
0
            exit('Channel Error!');
        }
        $uid = Char_Cv('uid');
        $user = API_Info($userid);
        if ($Channel['username'] != $username) {
            exit('-1');
        }
        if (!$db) {
            include_once ONEZ_ROOT . './include/db_mysql.class.php';
            db_local();
            $db = new onez_db();
            $masters = explode(',', $Channel['masters']);
            if (!in_array($username, $masters)) {
                $masters[] = $username;
                $masters = implode(',', $masters);
                $db->update("channel", array('masters' => $masters), "id='{$ChannelId}'");
                Channel($ChannelId, 1);
            }
        }
        AddMsg_Public("5\t{$uid}", $ChannelId);
        exit('1');
        break;
    case 'addfriend':
        $uid = Char_Cv('uid');
        $A = explode(',', API_LsFriend());
        if (in_array($uid, $A)) {
            exit('-1');
        }
        echo API_AddFriend($uid);
        break;
}
Пример #13
0
     ero("删除成功", "index.php?action=links&cid={$cid}");
     break;
 case "dellinks2":
     //批量删除链接
     $cid = Char_Cv("cid");
     $id = Char_Cv("id");
     if (!$id) {
         ero("您没有选择任何内容", 1);
     }
     $db->delete("links", "id in (" . @implode(",", $id) . ")");
     @unlink('../onezdata/cache/channel/' . $cid . '.php');
     ero("删除成功", "index.php?action=links&cid={$cid}");
     break;
 case "robot":
     $s = Char_Cv("s", "get");
     $botid = Char_Cv("botid", "get");
     if ($s == 'install') {
         if ($db->rows("robot", "botid='{$botid}'") == 0) {
             if (is_numeric($botid)) {
                 ero("此机器人标识有误(必须字母开头),安装失败!");
             }
             if (!file_exists('../plugins/robot/' . $botid . '/config.php')) {
                 ero('此机器人不存在');
             }
             $sqlData = @readover('../plugins/robot/' . $botid . '/sql.txt');
             if ($sqlData) {
                 runquery($sqlData);
             }
             include '../plugins/robot/' . $botid . '/config.php';
             $arr = array('botid' => $botid, 'botname' => $Con['name'], 'readme' => $Con['readme']);
             $db->insert("robot", $arr);
Пример #14
0
<?php

include_once "check.php";
$only = intval(Char_Cv('only', 'get'));
$client = intval(Char_Cv('client', 'get'));
$channelid = intval(Char_Cv('channel', 'get'));
Channel($channelid);
if ($Channel['allowguest'] == 0 && $userid == $guestname) {
    exit('<script>top.location.href="login.php?channel=' . $Channel['id'] . '";</script>');
}
if ($Channel['maxusr'] != -1 && Online($channelid) >= $Channel['maxusr']) {
    API_Logout();
    exit('<script>alert("本群人数已满");
  if(top!==self)top.location.reload();</script>');
}
$today = date('Ymd');
if ($Channel['forumid'] && $Channel['lastday'] != $today) {
    $api = API_Pub($bbsTitle, $bbsContent);
    list($tid, $url) = $api;
    $arr = array('lasttid' => $tid, 'lastday' => $today);
    if (!$db) {
        include_once ONEZ_ROOT . './include/db_mysql.class.php';
        db_local();
        $db = new onez_db();
    }
    $db->reset();
    $db->update("channel", $arr, "id='{$Channel['id']}'");
    if ($Conn) {
        $Conn->reset();
    }
    @unlink('onezdata/cache/channel/' . $Channel['id'] . '.php');
Пример #15
0
    $msg = oiconv('utf-8', 'gbk', $msg);
    //用户消息
    $A = array();
    foreach (explode("\n", $BadWords) as $v) {
        $v = Trim($v);
        if ($v) {
            $A[] = $v;
        }
    }
    if (str_replace($A, '', $msg) != $msg) {
        echo $jsCode;
    }
    exit;
}
$step = intval(Char_Cv('step'));
$msg = Char_Cv('msg');
if ($msg == '?' || $msg == '?') {
    //如果用户输入问号,重新初始化
    $step = '0';
}
$A = array();
switch ($step) {
    case '0':
        //第一次
        $A[] = '1';
        $A[] = '';
        $A[] = '您好,欢迎使用Onez智能聊天系统';
        break;
    case '1':
        //第二次
        $A[] = '1';