Beispiel #1
0
 function addTag($objname, $idname, $objid, $tags)
 {
     $objname = tsUrlCheck($objname);
     $idname = tsUrlCheck($idname);
     $objid = intval($objid);
     if ($objname != '' && $idname != '' && $objid != 0 && $tags != '') {
         $tags = str_replace(',', ',', $tags);
         $arrTag = explode(',', $tags);
         foreach ($arrTag as $item) {
             $tagname = t($item);
             if (strlen($tagname) < '32' && $tagname != '') {
                 $uptime = time();
                 $tagcount = $this->findCount('tag', array('tagname' => $tagname));
                 if ($tagcount == '0') {
                     $tagid = $this->create('tag', array('tagname' => $tagname, 'uptime' => $uptime));
                     $tagIndexCount = $this->findCount('tag_' . $objname . '_index', array($idname => $objid, 'tagid' => $tagid));
                     if ($tagIndexCount == '0') {
                         $this->create("tag_" . $objname . "_index", array($idname => $objid, 'tagid' => $tagid));
                     }
                     $tagIdCount = $this->findCount("tag_" . $objname . "_index", array('tagid' => $tagid));
                     $count_obj = "count_" . $objname;
                     $this->update('tag', array('tagid' => $tagid), array($count_obj => $tagIdCount));
                 } else {
                     $tagData = $this->find('tag', array('tagname' => $tagname));
                     $tagIndexCount = $this->findCount("tag_" . $objname . "_index", array($idname => $objid, 'tagid' => $tagData['tagid']));
                     if ($tagIndexCount == '0') {
                         $this->create("tag_" . $objname . "_index", array($idname => $objid, 'tagid' => $tagData['tagid']));
                     }
                     $tagIdCount = $this->findCount("tag_" . $objname . "_index", array('tagid' => $tagData['tagid']));
                     $count_obj = "count_" . $objname;
                     $this->update('tag', array('tagid' => $tagData['tagid']), array($count_obj => $tagIdCount, 'uptime' => $uptime));
                 }
             }
         }
     }
 }
Beispiel #2
0
        } else {
            reurlsubdomain();
        }
    }
} else {
    reurl();
}
//判断magic_quotes_gpc状态
if (get_magic_quotes_gpc() == 0) {
    $_GET = tsgpc($_GET);
    $_POST = tsgpc($_POST);
    $_COOKIE = tsgpc($_COOKIE);
    //$_FILES = tsgpc ( $_FILES );
}
//系统Url参数变量
$TS_URL = array('app' => isset($_GET['app']) ? tsUrlCheck($_GET['app']) : 'home', 'ac' => isset($_GET['ac']) ? tsUrlCheck($_GET['ac']) : 'index', 'ts' => isset($_GET['ts']) ? tsUrlCheck($_GET['ts']) : '', 'mg' => isset($_GET['mg']) ? tsUrlCheck($_GET['mg']) : 'index', 'my' => isset($_GET['my']) ? tsUrlCheck($_GET['my']) : 'index', 'api' => isset($_GET['api']) ? tsUrlCheck($_GET['api']) : 'index', 'plugin' => isset($_GET['plugin']) ? tsUrlCheck($_GET['plugin']) : '', 'in' => isset($_GET['in']) ? tsUrlCheck($_GET['in']) : '', 'tp' => isset($_GET['tp']) ? tsUrlCheck($_GET['tp']) : '1', 'page' => isset($_GET['page']) ? tsUrlCheck($_GET['page']) : '1');
//下面是过渡,直到把所有的参数都改完
$app = $TS_URL['app'];
$ac = $TS_URL['ac'];
$ts = $TS_URL['ts'];
$mg = $TS_URL['mg'];
$my = $TS_URL['my'];
$api = $TS_URL['api'];
$plugin = $TS_URL['plugin'];
$in = $TS_URL['in'];
$tp = $TS_URL['tp'];
$page = $TS_URL['page'];
//APP二级域名支持,同时继续支持url原生写法
if ($TS_CF['subdomain'] && $TS_URL['app'] == 'home') {
    //APP独立域名支持
    $TS_URL['app'] = array_search($_SERVER['HTTP_HOST'], $TS_CF['appdomain']);
Beispiel #3
0
<?php

defined('IN_TS') or die('Access Denied.');
$keys = tsUrlCheck($_GET['key']);
$strInfo = $new['home']->find('home_info', array('infokey' => $keys));
$strInfo['content'] = nl2br(tsDecode($strInfo['content']));
$arrInfo = $new['home']->findAll('home_info');
$title = $strInfo['title'];
include template('info');
Beispiel #4
0
<?php

defined('IN_TS') or die('Access Denied.');
switch ($ts) {
    case "":
        $objname = tsUrlCheck($_GET['objname']);
        $idname = tsUrlCheck($_GET['idname']);
        $objid = intval($_GET['objid']);
        include template("add_ajax");
        break;
    case "do":
        $objname = tsUrlCheck($_POST['objname']);
        $idname = tsUrlCheck($_POST['idname']);
        $objid = intval($_POST['objid']);
        $tags = t($_POST['tags']);
        $new['tag']->addTag($objname, $idname, $objid, $tags);
        echo "<script language=JavaScript>parent.window.location.reload();</script>";
        break;
}
Beispiel #5
0
            qiMsg("插件停用成功!");
        } elseif ($isused == '1') {
            array_push($app_plugins, $pname);
            if (file_exists('plugins/' . $apps . '/' . $pname . '/install.sql')) {
                $sql = file_get_contents('plugins/' . $apps . '/' . $pname . '/install.sql');
                $sql = str_replace('ts_', '' . dbprefix . '', $sql);
                $ret = $db->query($sql);
                if ($ret == '1') {
                    fileWrite($apps . '_plugins.php', 'data', $app_plugins);
                    $tsMySqlCache->set($apps . '_plugins', $app_plugins);
                    $msg = '插件启用成功!';
                } else {
                    $msg = $ret;
                }
            } else {
                fileWrite($apps . '_plugins.php', 'data', $app_plugins);
                $tsMySqlCache->set($apps . '_plugins', $app_plugins);
                $msg = '插件启用成功!';
            }
            qiMsg($msg);
        }
        break;
        //删除插件
    //删除插件
    case "delete":
        $apps = tsUrlCheck($_GET['apps']);
        $pname = tsUrlCheck($_GET['pname']);
        delDir('plugins/' . $apps . '/' . $pname);
        qiMsg('删除成功!');
        break;
}
Beispiel #6
0
<?php

defined('IN_TS') or die('Access Denied.');
//重设密码
switch ($ts) {
    case "":
        $email = trim($_GET['mail']);
        $resetpwd = tsUrlCheck($_GET['set']);
        if (valid_email($email) == false) {
            tsNotice('非法操作');
        }
        $userNum = $new['user']->findCount('user', array('email' => $email, 'resetpwd' => $resetpwd));
        if ($email == '' || $resetpwd == '') {
            tsNotice("你应该去火星生活啦!");
        } elseif ($userNum == 0) {
            tsNotice("你应该去火星生活啦!");
        } else {
            $title = '重设密码';
            include template("resetpwd");
        }
        break;
    case "do":
        $js = intval($_GET['js']);
        $email = trim($_POST['email']);
        $pwd = trim($_POST['pwd']);
        $repwd = trim($_POST['repwd']);
        $resetpwd = trim($_POST['resetpwd']);
        if ($email == '' || $pwd == '' || $repwd == '' || $resetpwd == '') {
            getJson("所有输入项都不能为空!", $js);
        }
        if (valid_email($email) == false) {