Beispiel #1
0
    public static function filters($row, $inIds, $params)
    {
        global $modx;
        $pr = $modx->db->config['table_prefix'];
        $inparent = !empty($params['parent']) ? ' AND cont.parent IN(' . $params['parent'] . ')' : '';
        $intemplate = !empty($params['template']) ? ' AND cont.template=' . $params['template'] : '';
        $checkboxTpl = isset($params['checkboxTpl']) ? getTpl($params['checkboxTpl']) : self::$templates['checkboxTpl'];
        $checkboxOuterTpl = isset($params['checkboxOuterTpl']) ? getTpl($params['checkboxOuterTpl']) : self::$templates['checkboxOuterTpl'];
        $result = $modx->db->query('SELECT COUNT(*) as cnt,value,tmplvarid FROM ' . $pr . 'site_tmplvar_contentvalues as c
			LEFT join ' . $pr . 'site_content as cont ON (cont.id=c.contentid)
			WHERE tmplvarid="' . $row['id'] . '" ' . $inparent . ' ' . $intemplate . ' ' . $inIds . '
			GROUP BY value ORDER BY value ASC');
        while ($inrow = $modx->db->getRow($result)) {
            if (!empty($inrow['value'])) {
                $checked = '';
                if (isset($_GET[$inrow['name']])) {
                    foreach ($_GET[$inrow['name']] as $names) {
                        if ($inrow['value'] == $names) {
                            $checked = 'checked="checked"';
                        }
                    }
                }
                $items .= $modx->parseText($checkboxTpl, array('name' => $row['name'], 'value' => $inrow['value'], 'active' => $checked, 'count' => $inrow['cnt']));
            }
        }
        return $modx->parseText($checkboxOuterTpl, array('title' => $row['title'], 'wrapper' => $items));
    }
Beispiel #2
0
 function vhost($data)
 {
     $data = unserialize($data);
     if (!is_object($data) || !$data->name) {
         return false;
     }
     $dir = $data->root;
     if ($dir && !is_dir($dir)) {
         mkdir($dir, 0750, true);
         // Block other's access to here
         chgrp($dir, 'www');
         file_put_contents($dir . '/index.php', getTpl('userdefault', $data));
     }
     $cmd = "chown -R {$data->owner} {$dir}";
     return shell_exec($cmd);
 }
 public function webAdd()
 {
     $this->checkTrain();
     layout(false);
     $Ssid = D('ssid');
     $gw_id = I('get.gw_id', '');
     $ssid = $Ssid->getSsidByRid($gw_id);
     if (empty($ssid)) {
         $url = U('Ssid/ssidAdd', array('gw_id' => $gw_id));
         $this->error('请先添加热点', $url);
     }
     $tpl = getTpl();
     $this->assign('ssid', $ssid);
     $this->assign('tpl', $tpl);
     $this->display();
 }
Beispiel #4
0
    public static function filters($row, $inIds, $params)
    {
        global $modx;
        $pr = $modx->db->config['table_prefix'];
        $inparent = !empty($params['parent']) ? ' AND cont.parent IN(' . $params['parent'] . ')' : '';
        $intemplate = !empty($params['template']) ? ' AND cont.template=' . $params['template'] : '';
        $priceTpl = isset($params['priceTpl']) ? getTpl($params['priceTpl']) : self::$templates['priceTpl'];
        $priceOuterTpl = isset($params['priceOuterTpl']) ? getTpl($params['priceOuterTpl']) : self::$templates['priceOuterTpl'];
        $resm = $modx->db->query('SELECT min( cast(value as decimal) ) as value FROM ' . $pr . 'site_tmplvar_contentvalues as c
			LEFT join ' . $pr . 'site_content as cont ON (cont.id=c.contentid)
			WHERE tmplvarid="' . $row['id'] . '" ' . $inparent . ' ' . $intemplate . ' order by value ASC');
        $rowm = $modx->db->getRow($resm);
        $row['min'] = $rowm['value'];
        $resm = $modx->db->query('SELECT max( cast(value as decimal) ) as value FROM ' . $pr . 'site_tmplvar_contentvalues as c
			LEFT join ' . $pr . 'site_content as cont ON (cont.id=c.contentid)
			WHERE tmplvarid="' . $row['id'] . '" ' . $inparent . ' ' . $intemplate . ' order by value ASC');
        $rowm = $modx->db->getRow($resm);
        $row['max'] = $rowm['value'];
        $items .= $modx->parseText($priceTpl, array('name' => $row['name'], 'min' => $row['min'], 'max' => $row['max']));
        return $modx->parseText($priceOuterTpl, array('title' => $row['title'], 'wrapper' => $items));
    }
Beispiel #5
0
//不属于任何专题
require ROOT_PATH . "inc/label_module.php";
$showpage = getpage("", "", "bencandy.php?fid={$fid}&id={$id}", 1, $rsdb[pages]);
if ($rsdb[iframeurl]) {
    $head_tpl = $foot_tpl = "template/default/none.htm";
    $main_tpl = "template/default/bencandy_iframe.htm";
}
/**
*上一篇与下一篇,比较影响速度
**/
$nextdb = $db->get_one("SELECT title,id,fid FROM {$_pre}content WHERE id<'{$id}' AND fid='{$fid}' AND yz=1 ORDER BY id DESC LIMIT 1");
$nextdb[subject] = get_word($nextdb[title], 60);
$backdb = $db->get_one("SELECT title,id,fid FROM {$_pre}content WHERE id>'{$id}' AND fid='{$fid}' AND yz=1 ORDER BY id ASC LIMIT 1");
$backdb[subject] = get_word($backdb[title], 60);
require ROOT_PATH . "inc/head.php";
require getTpl("bencandy", $main_tpl);
require ROOT_PATH . "inc/foot.php";
/**
*文章检查
**/
function check_article($rsdb)
{
    global $fidDB, $web_admin, $groupdb, $timestamp, $lfjid, $lfjuid, $fid, $id, $buy, $lfjdb, $webdb, $pre, $_pre, $db;
    if ($lfjid && ($web_admin || $lfjid == $rsdb[uid] || in_array($lfjid, explode(",", $fidDB[admin])))) {
        $power = 1;
    }
    if (!$rsdb) {
        showerr("内容不存在");
    }
    if ($fidDB[allowviewcontent] && !$power && !in_array($groupdb[gid], explode(",", $fidDB[allowviewcontent]))) {
        showerr("本栏目设置,你所在用户组不允许浏览内容");
Beispiel #6
0
    $typedb[$type] = " checked ";
} else {
    $typedb[title] = " checked ";
}
$mid = intval($mid);
$module_select = "<select name='mid' onChange=\"window.location.href='?mid='+this.options[this.selectedIndex].value\"><option value='0'  style='color:#aaa;'>所有模型</option>";
foreach ($module_db as $key => $value) {
    $ckk = $mid == $key ? ' selected ' : ' ';
    $module_select .= "<option value='{$key}' {$ckk}>{$value}</option>";
}
$module_select .= "</select>";
if ($mid) {
    $SQL = " AND mid='{$mid}' ";
} else {
    $SQL = "";
}
$fid_select = "<select name='fid' onChange=\"if(this.options[this.selectedIndex].value=='-1'){alert('你不能选择大分类');}\"><option value='0' style='color:#aaa;'>所有栏目</option>";
foreach ($Fid_db[0] as $key => $value) {
    $fid_select .= "<option value='-1' style='color:red;'>{$value}</option>";
    foreach ($Fid_db[$key] as $key2 => $value2) {
        $ckk = $fid == $key2 ? ' selected ' : ' ';
        $fid_select .= "<option value='{$key2}' {$ckk}>&nbsp;&nbsp;|--{$value2}</option>";
    }
}
$fid_select .= "</select>";
if (!$mid) {
    showerr('MID不存在');
}
require ROOT_PATH . "inc/head.php";
require getTpl("search_" . intval($mid));
require ROOT_PATH . "inc/foot.php";
Beispiel #7
0
<?php

require_once dirname(__FILE__) . "/global.php";
@(include dirname(__FILE__) . "/data/guide_fid.php");
$forum_ups = "<A HREF='{$Murl}/'>Ê×Ò³</A>" . $GuideFid[$fid];
require_once getTpl("foot_nav");
Beispiel #8
0
    }
    if ($rs[icon]) {
        $rs[icon] = tempdir($rs[icon]);
    }
    $rs[posttime] = date("Y-m-d H:i:s", $rs[posttime]);
    $rs[full_content] = $rs[content];
    $rs[content] = kill_badword($rs[content]);
    $rs[username] = kill_badword($rs[username]);
    $rs[title] = preg_replace("/\\[quote\\](.*)\\[\\/quote\\]/", "", $rs[content]);
    $rs[title] = get_word($rs[title], 50);
    $rs[content] = get_word($rs[content], $leng);
    $rs[content] = preg_replace("/\\[quote\\](.*)\\[\\/quote\\]/", "<div class='quotecomment_div'>\\1</div>", $rs[content]);
    $rs[content] = str_replace("\n", "<br>", $rs[content]);
    if ($lfjuid) {
        if ($lfjuid === $rs[cuid] || $web_admin || $lfjuid === $rs[uid] || in_array($lfjid, explode(",", $rsdb[admin]))) {
            $rs[ifadmin] = 1;
        } else {
            $rs[ifadmin] = 0;
        }
    } else {
        $rs[ifadmin] = 0;
    }
    $listdb[] = $rs;
}
/**
*评论分页功能
**/
$showpage = getpage("`{$_pre}comments` A", " WHERE A.id='{$id}' {$SQL}", "?fid={$fid}&id={$id}", $rows);
$showpage = preg_replace("/\\?fid=([\\d]+)&id=([\\d]+)&page=([\\d]+)/is", "javascript:getcomment('comment_ajax.php?fid=\\1&id=\\2&page=\\3')", $showpage);
require_once getTpl('comment_ajax');
Beispiel #9
0
$ch_pagetype = 3;
//2,为list页,3,为bencandy页
$ch_module = $webdb[module_id] ? $webdb[module_id] : 99;
//系统特定ID参数,每个系统不能雷同
$ch = 0;
//不属于任何专题
require ROOT_PATH . "inc/label_module.php";
if ($rsdb[uid]) {
    $userdb = $db->get_one("SELECT * FROM {$pre}memberdata WHERE uid='{$rsdb['uid']}'");
    $userdb[username] = $rsdb[username];
    $userdb[regdate] = date("y-m-d H:i", $userdb[regdate]);
    $userdb[lastvist] = date("y-m-d H:i", $userdb[lastvist]);
    $userdb[icon] = tempdir($userdb[icon]);
    include_once ROOT_PATH . "data/level.php";
    $userdb[level] = $ltitle[$userdb[groupid]];
} else {
    $userdb[username] = preg_replace("/([\\d]+)\\.([\\d]+)\\.([\\d]+)\\.([\\d]+)/is", "\\1.\\2.*.*", $rsdb[ip]);
    $userdb[level] = "游客";
}
unset($picdb);
if ($rsdb[picnum] > 1) {
    $query = $db->query("SELECT * FROM {$_pre}pic WHERE id='{$id}'");
    while ($rs = $db->fetch_array($query)) {
        $rs[imgurl] = tempdir($imgurl = $rs[imgurl]);
        $rs[picurl] = eregi("^http:", $imgurl) ? $rs[imgurl] : "{$rs['imgurl']}.gif";
        $picdb[] = $rs;
    }
}
require ROOT_PATH . "inc/head.php";
require getTpl("bencandy_{$fidDB['mid']}", $main_tpl);
require ROOT_PATH . "inc/foot.php";
Beispiel #10
0
            if ($_SESSION['table'] == 'book') {
                newBook();
            }
            if ($_SESSION['table'] == 'category') {
                newCategory();
            }
            header("Location: http://" . $_SERVER['HTTP_HOST'] . "/");
            exit;
    }
}
if (!$_SESSION['user_id']) {
    $error['{ERROR}'] = isset($_SESSION['error_login']) ? "<font color='#a52a2a'>" . $_SESSION['error_login'] . "</font>" : "";
    $params['{LOGIN}'] = getTpl("login", $error);
    login();
} else {
    $userName = getUserName();
    $params['{LOGIN}'] = "<p id=\"logout\">You enter as: " . $userName . "<br><a href=\"?logout\"> logout</a></p>";
}
if (isset($_GET['category'])) {
    $_SESSION['table'] = 'category';
}
if (isset($_GET['book'])) {
    $_SESSION['table'] = 'book';
}
if (isset($_SESSION['table'])) {
    $params['{CONTENT}'] = $_SESSION['table'] == 'category' ? getCategory() : getBooks();
} else {
    $params['{CONTENT}'] = getBooks();
}
echo getTpl("main", $params);
Beispiel #11
0
$_erp = $Fid_db[tableid][$fid];
$rsdb = $db->get_one("SELECT A.* FROM `{$_pre}content{$_erp}` A WHERE A.id='{$id}'");
if (!$rsdb) {
    showerr("×ÊÁϲ»´æÔÚ");
}
$fid = $rsdb[fid];
$mid = $rsdb[mid];
unset($urldb, $titledb);
$query = $db->query("SELECT * FROM {$_pre}pic WHERE id='{$id}'");
while ($rs = $db->fetch_array($query)) {
    $urldb[] = "'" . tempdir($rs[imgurl]) . "'";
    $titledb[] = "'" . addslashes($rs[name]) . "'";
}
if (!$urldb) {
    if ($rsdb[picurl]) {
        header("location:" . tempdir($rsdb[picurl]));
        exit;
    }
    echo '<SCRIPT LANGUAGE="JavaScript">
	<!--
		alert("NO IMG");
	self.close();
	//-->
	</SCRIPT>';
    exit;
}
$urldb = implode(",", $urldb);
$titledb = implode(",", $titledb);
require ROOT_PATH . "inc/head.php";
require getTpl("show_img");
require ROOT_PATH . "inc/foot.php";
Beispiel #12
0
<?php

require_once dirname(__FILE__) . "/" . "global.php";
$rsdb = $db->get_one("SELECT A.*,S.* FROM {$_pre}content A LEFT JOIN {$_pre}sort S ON A.fid=S.fid WHERE A.id='{$id}'");
if (!$rsdb) {
    die("µØÖ·ÓÐÎó,Çë¼ì²éÖ®");
}
@(include dirname(__FILE__) . "/data/guide_fid.php");
require ROOT_PATH . "inc/head.php";
require getTpl("comment");
require ROOT_PATH . "inc/foot.php";
Beispiel #13
0
        foreach ($postdb as $key => $value) {
            if ($value && table_field("{$_pre}content_{$mid}", $key)) {
                $_sql .= " AND B.`{$key}`='{$value}' ";
                $rsdb[$key][$value] = " selected ";
            }
        }
        //分页功能
        //$showpage=getpage("{$_pre}content A LEFT JOIN {$_pre}content_$mid B ON A.id=B.id","WHERE A.mid='$mid' AND $field LIKE '%$keyword%' $_sql","?mid=$mid&keyword=$keyword&action=search&type=$type",$rows);
        $SQL = "SELECT A.*,B.* FROM {$_pre}content A LEFT JOIN {$_pre}content_{$mid} B ON A.id=B.id WHERE A.mid='{$mid}' AND {$field} LIKE '%{$keyword}%' {$_sql} LIMIT {$min},{$rows} ";
    }
    $query = $db->query("{$SQL}");
    while ($rs = $db->fetch_array($query)) {
        $rs[posttime] = date("Y-m-d", $rs[posttime]);
        $listdb[] = $rs;
    }
    if (!$listdb) {
        showerr("很抱歉,没有找到你要查询的内容");
    }
    $typedb[$type] = " checked ";
} else {
    $typedb[title] = " checked ";
}
$mid = intval($mid);
$colordb[$mid] = "red;";
require ROOT_PATH . "inc/head.php";
if ($mid) {
    require getTpl("search_{$mid}");
} else {
    require getTpl("search");
}
require ROOT_PATH . "inc/foot.php";
Beispiel #14
0
<?php

require dirname(__FILE__) . "/global.php";
/**
*为获取标签参数
**/
$chdb[main_tpl] = getTpl("city");
/**
*标签
**/
$ch_fid = 0;
//是否定义了栏目专用标签
$ch_pagetype = 4;
//2,为list页,3,为bencandy页
$ch_module = $webdb[module_id] ? $webdb[module_id] : 99;
//系统特定ID参数,每个系统不能雷同
$ch = 0;
//不属于任何专题
require ROOT_PATH . "inc/label_module.php";
require ROOT_PATH . "inc/head.php";
require getTpl("city");
require ROOT_PATH . "inc/foot.php";
Beispiel #15
0
<?php

require dirname(__FILE__) . "/" . "global.php";
if (!$web_admin) {
    showerr('你无权操作');
}
if ($step) {
    $array[content] = $content;
    //$array[content]=filtrate($content);
    $array[uid] = $lfjuid;
    $array[username] = $lfjid;
    $array[posttime] = $timestamp;
    $str = addslashes(serialize($array));
    $db->query("UPDATE {$_pre}content SET reply='{$str}' WHERE id='{$id}'");
    refreshto("./?fid={$fid}", "回复成功", 1);
} else {
    $rsdb = $db->get_one("SELECT * FROM {$_pre}content WHERE id='{$id}'");
    extract(unserialize($rsdb[reply]));
}
require ROOT_PATH . "inc/head.php";
require getTpl("replyguestbook");
require ROOT_PATH . "inc/foot.php";
Beispiel #16
0
<?php

require "global.php";
die;
$chdb[main_tpl] = getTpl("index");
$ch_fid = $ch_pagetype = 0;
$ch_module = $webdb[module_id] ? $webdb[module_id] : 7;
@(include ROOT_PATH . "inc/label_module.php");
require ROOT_PATH . "inc/head.php";
require getTpl("index");
require ROOT_PATH . "inc/foot.php";
Beispiel #17
0
}
$query = $db->query("SELECT SQL_CALC_FOUND_ROWS A.*,B.*,C.title AS companyname FROM {$_pre}content A LEFT JOIN {$_pre}content_1 B ON A.id=B.id  LEFT JOIN {$pre}hy_company C ON A.uid=C.uid {$SQL} ORDER BY A.{$ordertype} DESC LIMIT {$min},{$rows}");
$RS = $db->get_one("SELECT FOUND_ROWS()");
$totalNum = $RS['FOUND_ROWS()'];
while ($rs = $db->fetch_array($query)) {
    $rs[picurl] = tempdir($rs[picurl]);
    $rs[url] = get_info_url($rs[id], $rs[fid], $rs[city_id]);
    $rs[posttime] = date("Y-m-d H:i", $rs[posttime]);
    $Module_db->showfield($field_db, $rs, 'list');
    $listdb[] = $rs;
}
$showpage = getpage("", "", "?ordertype={$ordertype}", $rows, $totalNum);
/**
*为获取标签参数
**/
$chdb[main_tpl] = getTpl("alljob");
/**
*标签
**/
$ch_fid = 0;
//是否定义了栏目专用标签
$ch_pagetype = 4;
//2,为list页,3,为bencandy页
$ch_module = $webdb[module_id] ? $webdb[module_id] : 99;
//系统特定ID参数,每个系统不能雷同
$ch = 0;
//不属于任何专题
require ROOT_PATH . "inc/label_module.php";
require ROOT_PATH . "inc/head.php";
require getTpl("alljob");
require ROOT_PATH . "inc/foot.php";
Beispiel #18
0
        showerr("你无权修改");
    }
    //自定义字段的合法检查与数据处理
    $Module_db->checkpost($field_db, $postdb, $rsdb);
    /*更新主信息表内容*/
    //$db->query("UPDATE `{$_pre}join` SET title='$postdb[title]' WHERE id='$id'");
    /*检查判断辅信息表要插入哪些字段的内容*/
    unset($sqldb);
    foreach ($field_db as $key => $value) {
        $sqldb[] = "`{$key}`='{$postdb[$key]}'";
    }
    $sql = implode(",", $sqldb);
    /*更新辅信息表*/
    $db->query("UPDATE `{$_pre}content_{$mid}` SET {$sql} WHERE id='{$id}'");
    refreshto("bencandy.php?fid={$fid}&id={$cid}", "修改成功");
} else {
    /*模块设置时,有些字段有默认值*/
    foreach ($field_db as $key => $rs) {
        if ($rs[form_value]) {
            $rsdb[$key] = $rs[form_value];
        }
    }
    /*表单默认变量作处理*/
    $Module_db->formGetVale($field_db, $rsdb);
    $atc = "postnew";
    $rsdb[ask_title] = "我对您发布的“{$infodb[title]}”很感兴趣";
    $rsdb[hope_price] = $infodb[price];
    require ROOT_PATH . "inc/head.php";
    require getTpl("post_{$mid}");
    require ROOT_PATH . "inc/foot.php";
}
        {
            global $modx;
            if (strpos($tpl, '@CODE:') !== false) {
                $tpl = str_replace('@CODE:', '', $tpl);
            } else {
                $tpl = $modx->getChunk($tpl);
            }
            return $tpl;
        }
    }
}
//параметры по умолчанию
$filters = isset($filters) ? $filters : 'evoFilter';
$params['parent'] = isset($parent) ? $parent : $modx->documentIdentifier;
$type = isset($type) ? $type : 'filters';
$outerTpl = isset($outerTpl) ? getTpl($outerTpl) : '<form id="filter" class="pure-form velo-form filter-form" action="[~[*id*]~]"> [+wrapper+]	</form>';
if (isset($select)) {
    $select = '';
} else {
    $select = array();
}
//получаем значение ТВ-параметра с настройками фильтра и формируем масив для проверки get параметров
$filters = $modx->getTemplateVar($filters);
$filters = $filters['value'];
$filtersArr = json_decode($filters, true);
if (!$filtersArr['fieldValue']) {
    return;
}
$filters = array();
$filtersType = array();
foreach ($filtersArr['fieldValue'] as $value) {
Beispiel #20
0
 function tsv_display_success($cache)
 {
     global $modx, $session, $tsvshop, $shop_lang, $tables;
     //$session = session($cache);
     $output = getTpl($tsvshop['tplsuccess']);
     if ($tsvshop['debug']) {
         $output .= print_r($_SESSION['tsvshopfin']);
     }
     // тут ставим функцию оплаты
     if ($_SESSION['tsvshopfin']['result']['paytype'] == "none" || empty($_SESSION['tsvshopfin']['result']['paytype']) || empty($_SESSION['tsvshopfin']['result']['topay'])) {
         $output = str_replace("[+shop.paylink+]", "", $output);
     } else {
         if (!empty($tables['payments'])) {
             $res = $modx->db->query("SELECT * FROM " . $tables['payments'] . " WHERE `active` = 1");
             while ($payment = $modx->db->getRow($res)) {
                 if ($_SESSION['tsvshopfin']['result']['paytype'] == $payment['code']) {
                     include TSVSHOP_PATH . "addons/payments/payments/" . $payment['code'] . "/proc.inc.php";
                     $output = str_replace("[+shop.paylink+]", paylink($_SESSION['tsvshopfin']['result'], $tsvshop), $output);
                 }
             }
         } else {
             $output = str_replace("[+shop.paylink+]", "", $output);
         }
     }
     if (is_array($_SESSION['tsvshopfin']['result'])) {
         foreach ($_SESSION['tsvshopfin']['result'] as $key => $val) {
             $output = str_replace("[+shop." . $key . "+]", $val, $output);
         }
     }
     return $output;
 }
Beispiel #21
0
<?php

require "global.php";
$mid = 2;
$field_db = $module_DB[$mid]['field'];
$Lrows = 10;
$showpage = getpage("{$_pre}join A", "WHERE A.cid={$cid}", "?cid={$cid}", $Lrows);
unset($listdb);
if ($page < 1) {
    $page = 1;
}
$min = ($page - 1) * $Lrows;
$query = $db->query("SELECT A.*,B.*,C.* FROM {$_pre}join A LEFT JOIN {$_pre}content_{$mid} C ON A.id=C.id LEFT JOIN {$pre}memberdata B ON A.uid=B.uid WHERE A.cid='{$cid}' ORDER BY A.posttime DESC LIMIT {$min},{$Lrows}");
while ($rs = $db->fetch_array($query)) {
    $Module_db->showfield($field_db, $rs, 'list');
    $rs[username] || ($rs[username] = $rs[ip]);
    $rs[picurl] = tempdir($rs[icon]);
    $rs[posttime] = date("Y-m-d H:i:s", $rs[posttime]);
    $listdb[] = $rs;
}
$rs = $db->get_one("SELECT * FROM `{$_pre}content` WHERE id='{$cid}'");
if (!$lfjuid || $rs[uid] != $lfjuid) {
    showerr("ÄãÎÞȨ²é¿´");
}
require ROOT_PATH . "inc/head.php";
require getTpl("list_{$mid}");
require ROOT_PATH . "inc/foot.php";
 function display($templates = '', $path = '')
 {
     if ($this->tVar) {
         extract($this->tVar, EXTR_OVERWRITE);
     }
     if (!$this->isSetDefine) {
         define('TPL_PATH', APP_PATH . 'tpl/' . C('System', 'skin') . '/');
         define('PUBLIC_PATH', (G('main_path') ? SITE_PATH : WEB_PATH) . 'statics/' . C('System', 'skin') . '/');
         define('IMG_PATH', PUBLIC_PATH . 'images/');
         define('JS_PATH', PUBLIC_PATH . 'js/');
         define('CSS_PATH', PUBLIC_PATH . 'css/');
         define('LOCAL_PUBLIC_PATH', WEB_PATH . 'statics/' . C('System', 'skin') . '/');
         load('view.fun');
         $this->isSetDefine = true;
     }
     if (!$templates) {
         $templates = C('System', 'm');
     }
     if (!$path) {
         $path = C('System', 'c');
     }
     return include getTpl($templates, $path);
 }
Beispiel #23
0
    }
}
$listdb = '';
$query = $db->query("SELECT SQL_CALC_FOUND_ROWS B.*,A.posttime FROM {$_pre}person A LEFT JOIN {$_pre}content_{$fidDB[mid]} B ON A.id=B.id {$SQL} ORDER BY A.id DESC LIMIT {$min},{$rows}");
$RS = $db->get_one("SELECT FOUND_ROWS()");
$totalNum = $RS['FOUND_ROWS()'];
$showpage = getpage("", "", "listperson.php?cityid={$cityid}", $rows, $totalNum);
while ($rs = $db->fetch_array($query)) {
    $rs[posttime] = date("Y-m-d", $rs[full_time] = $rs[posttime]);
    $Module_db->showfield($field_db, $rs, 'list');
    $listdb[] = $rs;
}
/**
*为获取标签参数
**/
$chdb[main_tpl] = getTpl("list_{$fidDB['mid']}");
/**
*标签
**/
$ch_fid = intval($fidDB[config][label_list]);
//是否定义了栏目专用标签
$ch_pagetype = 4;
//2,为list页,3,为bencandy页
$ch_module = $webdb[module_id] ? $webdb[module_id] : 99;
//系统特定ID参数,每个系统不能雷同
$ch = 0;
//不属于任何专题
require ROOT_PATH . "inc/label_module.php";
require ROOT_PATH . "inc/head.php";
require getTpl("list_{$fidDB['mid']}", $FidTpl['list']);
require ROOT_PATH . "inc/foot.php";
Beispiel #24
0
}
$query = $db->query("SELECT SQL_CALC_FOUND_ROWS A.*,B.* FROM {$_pre}person A LEFT JOIN {$_pre}content_2 B ON A.id=B.id  {$SQL} ORDER BY A.{$ordertype} DESC LIMIT {$min},{$rows}");
$RS = $db->get_one("SELECT FOUND_ROWS()");
$totalNum = $RS['FOUND_ROWS()'];
while ($rs = $db->fetch_array($query)) {
    $rs[picurl] = tempdir($rs[picurl]);
    $rs[url] = get_info_url($rs[id], $rs[fid], $rs[city_id]);
    $rs[posttime] = date("Y-m-d H:i", $rs[posttime]);
    $Module_db->showfield($field_db, $rs, 'list');
    $listdb[] = $rs;
}
$showpage = getpage("", "", "?ordertype={$ordertype}", $rows, $totalNum);
/**
*为获取标签参数
**/
$chdb[main_tpl] = getTpl("allperson");
/**
*标签
**/
$ch_fid = 0;
//是否定义了栏目专用标签
$ch_pagetype = 4;
//2,为list页,3,为bencandy页
$ch_module = $webdb[module_id] ? $webdb[module_id] : 99;
//系统特定ID参数,每个系统不能雷同
$ch = 0;
//不属于任何专题
require ROOT_PATH . "inc/label_module.php";
require ROOT_PATH . "inc/head.php";
require getTpl("allperson");
require ROOT_PATH . "inc/foot.php";
Beispiel #25
0
function updateMail($newstatus, $idorder)
{
    global $modx, $tsvshop, $shop_lang;
    $body = getTpl($tsvshop['tplmailupdateorder']);
    $row = getOrderInfo($idorder);
    $i = 0;
    $body = str_replace("[+shop.order.status+]", $newstatus, $body);
    if (!empty($row)) {
        foreach ($row as $key => $val) {
            if (in_array($key, explode(",", $tsvshop['SecFields']))) {
                $val = DeCryptMessage($val, $tsvshop['SecPassword']);
            }
            if ($key == "dateorder") {
                $body = str_replace("[+shop.order." . $key . "+]", date("d.m.Y H:i:s", $val), $body);
            } else {
                $body = str_replace("[+shop.order." . $key . "+]", $val, $body);
            }
            $body = str_replace("[+shop.order.num+]", $i, $body);
            $i++;
        }
    }
    $body = str_replace("[+shop.order.sitename+]", $modx->config['site_name'], $body);
    if ($row['status'] != $newstatus) {
        if (sendMailUpdate(DeCryptMessage($row['email'], $tsvshop['SecPassword']), $tsvshop['SubjectUpdateStatus'], $body, 'true')) {
            return true;
        } else {
            return false;
        }
    }
}
Beispiel #26
0
        if ($rsdb['list'] > $timestamp) {
            $SQL = ",list='{$rsdb['posttime']}'";
        }
    }
    /*更新主信息表内容*/
    $db->query("UPDATE `{$_pre}content{$_erp}` SET title='{$postdb['title']}',keywords='{$postdb['keywords']}',picurl='{$postdb['picurl']}',ispic='{$postdb['ispic']}',picnum='{$num}',price='{$postdb['price']}' WHERE id='{$id}'");
    /*检查判断辅信息表要插入哪些字段的内容*/
    unset($sqldb);
    foreach ($field_db as $key => $value) {
        $sqldb[] = "`{$key}`='{$postdb[$key]}'";
    }
    $sql = implode(",", $sqldb);
    /*更新辅信息表*/
    $db->query("UPDATE `{$_pre}content_{$fidDB['mid']}` SET {$sql} WHERE id='{$id}'");
    refreshto($FROMURL, "<a href='{$FROMURL}'>继续修改</a> <a href='../bencandy.php?fid={$fid}&id={$id}' target='_blank'>查看效果</a>", 600);
} else {
    /*模块设置时,有些字段有默认值*/
    foreach ($field_db as $key => $rs) {
        if ($rs[form_value]) {
            $rsdb[$key] = $rs[form_value];
        }
    }
    /*表单默认变量作处理*/
    $Module_db->formGetVale($field_db, $rsdb);
    $atc = "postnew";
    $ifTop[0] = ' checked ';
    $listdb = array('');
    require ROOT_PATH . "member/head.php";
    require getTpl("post_{$fidDB['mid']}", $FidTpl['post']);
    require ROOT_PATH . "member/foot.php";
}
Beispiel #27
0
    $modx->setPlaceholder('manager_folder', MGR_DIR);
    $yesChunk = !empty($yesChunk) ? $yesChunk : '@FILE:assets/snippets/tsvoffice/tpl/tsvoffice.tpl';
    $noChunk = !empty($noChunk) ? $noChunk : '@FILE:assets/snippets/tsvoffice/tpl/login.tpl';
    tsv_logout($logouthomeid);
    if ($uid) {
        $act = 'listorders';
        $modx->setPlaceholder('listorders', $modx->runSnippet('TSVoffice', array('act' => 'listorders', 'orderpage' => $orderpage)));
        $modx->setPlaceholder('logoutlink', $modx->documentIdentifier . '?isLogOut=1');
        echo getTpl($yesChunk);
    } else {
        // если неавторизован
        $logintpl = !empty($logintpl) ? $logintpl : 'weblogin';
        $signuptpl = !empty($signuptpl) ? $signuptpl : 'formsignup';
        $modx->setPlaceholder('weblogin', $modx->runSnippet('WebLogin', array('loginhomeid' => $loginhomeid, 'logouthomeid' => $logouthomeid, 'pwdreqid' => $pwdreqid, 'pwdactid' => $pwdactid, 'logintext' => $logintext, 'logouttext' => $logouttext, 'tpl' => $logintpl)));
        $modx->setPlaceholder('websignup', $modx->runSnippet('WebSignup', array('groups' => $groups, 'useCaptchad' => $useCaptcha, 'tpl' => $signuptpl)));
        echo getTpl($noChunk);
    }
}
if ($act == 'listorders') {
    $modx->setPlaceholder('manager_folder', MGR_DIR);
    $uid = $modx->getLoginUserID();
    if ($uid) {
        $orderpage = !empty($orderpage) ? $orderpage : $modx->documentIdentifier;
        echo tsv_listorders($orderpage);
    } else {
        $act = 'office';
    }
}
// показ формы авторизации
if ($act == 'weblogin') {
    $modx->setPlaceholder('manager_folder', MGR_DIR);
Beispiel #28
0
// webeditprofile.php - to accompany weblogin and websignup
// provides a form for webusers to edit their profile
// sottwell sept. 2006
// version 1.2 - bug fixes, improved password changing handler
// version 1.3 - oct. 2006 - added redirect if user is not logged in
$uid = $_SESSION['webInternalKey'];
$username = $_SESSION['webShortname'];
$result = $modx->db->select("*", $modx->getFullTableName('web_user_attributes'), "internalKey = " . $uid);
$userdata = $modx->db->getRow($result);
// load tpl
if (is_numeric($tpl)) {
    $tpl = ($doc = $modx->getDocuments($tpl)) ? $doc['content'] : "Document '{$tpl}' not found.";
} else {
    if ($tpl) {
        $tpl = ($chunk = getTpl($tpl)) ? $chunk : "Chunk '{$tpl}' not found.";
    }
}
//if(!$tpl) { $tpl = getWebProfiletpl(); }
// extract declarations
$declare = webLoginExtractDeclarations($tpl);
$tpls = explode(isset($declare["separator"]) ? $declare["separator"] : "<!--tpl_separator-->", $tpl);
$tpl = $tpls[0];
$tpl = str_replace("[+action+]", $modx->makeURL($modx->documentIdentifier), $tpl);
$tpl = str_replace("[+username+]", $_SESSION['webShortname'], $tpl);
$tpl = str_replace("[+fullname+]", $userdata['fullname'], $tpl);
$tpl = str_replace("[+email+]", $userdata['email'], $tpl);
$tpl = str_replace("[+country+]", $userdata['country'], $tpl);
$tpl = str_replace("[+state+]", $userdata['state'], $tpl);
$tpl = str_replace("[+phone+]", $userdata['phone'], $tpl);
$tpl = str_replace("[+zip+]", $userdata['zip'], $tpl);
			  Msg.loading();
			  $.post('<?php 
echo U('servicelog/delete');
?>
',{"id":id},function(result){
				  Msg.hide();
				 if (result.status==1){
					$("#list_detail_"+id).fadeOut();  
			     }else{
					 Msg.error(result.info);
				}
			  },'json');
		  },
		  cancel: function() {
			  return false;
		  }
	  });
	  $("body").click();//取消弹出层对对话框的遮蔽
	  return false;
	})
  $('.btn-group').each(function(){
    var active = $(this).find('.dropdown-menu > .active');
    if(active.length > 0){
      $(this).find('.dropdown-label').children('span').text(active.find('a:first').text());
    }    
  });
});
</script>
<?php 
include getTpl('footer', 'public');
Beispiel #30
0
<?php

require "global.php";
//导航条
@(include Mpath . "data/guide_fid.php");
$mid = 2;
/**
*获取信息正文的内容
**/
$rsdb = $db->get_one("SELECT A.*,B.*,M.icon FROM `{$_pre}person` A LEFT JOIN `{$_pre}content_{$mid}` B ON A.id=B.id LEFT JOIN {$pre}memberdata M ON A.uid=M.uid WHERE A.id='{$id}'");
if (!$rsdb) {
    showerr("内容不存在");
} elseif (!$web_admin && $rsdb[uid] != $lfjuid && $rsdb[cuid] != $lfjuid) {
    showerr("你无权查看");
}
$rsdb[picurl] = tempdir($rsdb[icon]);
$rsdb[C] = $db->get_one("SELECT * FROM {$_pre}content WHERE id='{$rsdb['cid']}'");
$field_db = $module_DB[$mid]['field'];
/**
*对信息内容字段的处理
**/
$Module_db->hidefield = true;
$Module_db->classidShowAll = true;
$Module_db->showfield($field_db, $rsdb, 'show');
$rsdb[posttime] = date("Y-m-d H:i:s", $rsdb[posttime]);
require getTpl("print_member");