Esempio n. 1
0
    $cip = "";
}
if (empty($dtime)) {
    $dtime = 0;
}
if ($adminid > 0) {
    $where .= " AND #@__log.adminid='{$adminid}' ";
}
if ($cip != "") {
    $where .= " AND #@__log.cip LIKE '%{$cip}%' ";
}
if ($dtime > 0) {
    $nowtime = time();
    $starttime = $nowtime - $dtime * 24 * 3600;
    $where .= " AND #@__log.dtime>'{$starttime}' ";
}
$sql = "SELECT #@__log.*,#@__admin.userid FROM #@__log\n     LEFT JOIN #@__admin ON #@__admin.id=#@__log.adminid\n     WHERE 1=1 {$where} ORDER BY #@__log.lid DESC";
$adminlist = "";
$dsql->SetQuery("SELECT id,uname FROM #@__admin");
$dsql->Execute('admin');
while ($myrow = $dsql->GetObject('admin')) {
    $adminlist .= "<option value='{$myrow->id}'>{$myrow->uname}</option>\r\n";
}
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("adminid", $adminid);
$dlist->SetParameter("cip", $cip);
$dlist->SetParameter("dtime", $dtime);
$dlist->SetTemplate(DEDEADMIN . "/templets/log_list.htm");
$dlist->SetSource($sql);
$dlist->Display();
Esempio n. 2
0
<?php

/**
 * @version        $Id: mygroup.php 1 12:11 2010年9月13日Z tianya $
 * @package        DedeCMS.Module.Group
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once dirname(__FILE__) . "/system/config.php";
require_once DEDEINC . "/datalistcp.class.php";
$menutype = 'mydede';
$sql = "SELECT * FROM #@__groups WHERE ishidden='0' AND uid='" . $cfg_ml->M_ID . "'  ORDER BY threads DESC,stime DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
//这两句的顺序不能更换
$dl->SetTemplate(_SYSTEM_ . "/mygroup.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
Esempio n. 3
0
                            $row3 = "INSERT INTO\r\n                `#@__member_pms` (`floginid`,`fromid`,`toid`,`tologinid`,`folder`,`subject`,`sendtime`,`writetime`,`hasview`,`isadmin`,`message`)\r\n                VALUES ('admin','{$row['id']}','{$cfg_ml->M_ID}','{$cfg_ml->M_LoginID}','inbox','{$row['subject']}','{$row['sendtime']}','{$row['writetime']}','{$row['hasview']}','{$row['isadmin']}','{$row['message']}')";
                            $dsql->ExecuteNoneQuery($row3);
                        }
                    }
                    if ($state == "1") {
                        $wsql = " toid='{$cfg_ml->M_ID}' AND folder='inbox' AND writetime!='' and hasview=1";
                        $tname = "收件箱";
                    } else {
                        if ($state == "-1") {
                            $wsql = "toid='{$cfg_ml->M_ID}' AND folder='inbox' AND writetime!='' and hasview=0";
                            $tname = "收件箱";
                        } else {
                            $wsql = " toid='{$cfg_ml->M_ID}' AND folder='inbox' AND writetime!=''";
                            $tname = "收件箱";
                        }
                    }
                } else {
                    $wsql = " `fromid` ='{$cfg_ml->M_ID}' AND folder LIKE 'outbox'";
                    $tname = "已发信息";
                }
                $query = "SELECT * FROM `#@__member_pms` WHERE {$wsql} ORDER BY sendtime DESC";
                $dlist = new DataListCP();
                $dlist->pageSize = 20;
                $dlist->SetParameter("dopost", $dopost);
                $dlist->SetTemplate(DEDEMEMBER . '/templets/pm-main.htm');
                $dlist->SetSource($query);
                $dlist->Display();
            }
        }
    }
}
Esempio n. 4
0
//获得是否审核的表述
function IsChecklog($ischeck)
{
    $s = '';
    $s = $ischeck == '1' ? "<font color=blue>已审核</font>" : "<font color=red>未审核</font>";
    return $s;
}
function JstrimJajxLog($str, $len)
{
    $str = cn_substr($str, $len);
    $str = str_replace('&#039;', '"', $str);
    $str = str_replace('&lt;', '<', $str);
    $str = str_replace('&gt;', '>', $str);
    return $str;
}
$row = $dsql->GetOne("SELECT COUNT({$id}) AS dd FROM {$table}");
$totalnum = $row['dd'];
$rows = $dsql->GetOne("SELECT COUNT({$id}) AS dd FROM {$table} WHERE ischeck=1");
$checknum = $rows['dd'];
$rowss = $dsql->GetOne("SELECT COUNT({$id}) AS dd FROM {$table} WHERE ischeck=0");
$ischecknum = $rowss['dd'];
$sql = "SELECT * FROM {$table} WHERE 1=1 {$where} ORDER BY dtime DESC";
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("type", $type);
$dlist->SetParameter("totalnum", $totalnum);
$dlist->SetParameter("checknum", $checknum);
$dlist->SetParameter("ischecknum", $ischecknum);
$dlist->SetTemplate($tpl);
$dlist->SetSource($sql);
$dlist->Display();
Esempio n. 5
0
     $dlist->SetTemplate(DEDEMEMBER . "/space/{$_vars['spacestyle']}/listalbum.htm");
     $dlist->SetSource($query);
     $dlist->Display();
     exit;
 } else {
     if ($action == 'guestbook') {
         if (empty($mtype)) {
             $mtype = 0;
         }
         include_once DEDEINC . '/datalistcp.class.php';
         $query = "SELECT mg.*,mb.face,mb.userid,mb.sex From `#@__member_guestbook` mg \n    left join `#@__member` mb on mb.userid=mg.gid \n    where mg.mid='{$_vars['mid']}' order by mg.aid desc";
         $dlist = new DataListCP();
         $dlist->pageSize = 10;
         $dlist->SetParameter("uid", $_vars['userid']);
         $dlist->SetParameter("action", $action);
         $dlist->SetTemplate(DEDEMEMBER . "/space/{$_vars['spacestyle']}/guestbook.htm");
         $dlist->SetSource($query);
         $dlist->Display();
         exit;
     } else {
         if ($action == 'friend') {
             if (empty($mtype)) {
                 $mtype = 0;
             }
             include_once DEDEINC . '/arc.memberlistview.class.php';
             include_once DEDEINC . '/channelunit.func.php';
             $query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n          from `#@__archives` arc\n          left join `#@__arctype` tp on arc.typeid=tp.id\n          where arc.mid='{$_vars['mid']}' {$addqSql} order by arc.id desc";
             $dlist = new MemberListview();
             $dlist->pageSize = 8;
             $dlist->SetParameter("mtype", $mtype);
             $dlist->SetParameter("uid", $_vars['userid']);
Esempio n. 6
0
    }
    $sql = "SELECT * FROM #@__moneycard_record {$addsql} ORDER BY aid DESC";
    $dlist = new DataListCP();
    $dlist->pageSize = 25;
    //设定每页显示记录数(默认25条)
    if (isset($isexp)) {
        $dlist->SetParameter("isexp", $isexp);
    }
    $dlist->dsql->SetQuery("SELECT * FROM #@__moneycard_type ");
    $dlist->dsql->Execute('ts');
    while ($rw = $dlist->dsql->GetArray('ts')) {
        $TypeNames[$rw['tid']] = $rw['pname'];
    }
    $tplfile = DEDEADMIN . "/templets/cards_manmage.htm";
    //这两句的顺序不能更换
    $dlist->SetTemplate($tplfile);
    //载入模板
    $dlist->SetSource($sql);
    //设定查询SQL
    $dlist->Display();
    //显示
}
function GetMemberID($mid)
{
    global $dsql;
    if ($mid == 0) {
        return '0';
    }
    $row = $dsql->GetOne("SELECT userid FROM #@__member WHERE mid='{$mid}' ");
    if (is_array($row)) {
        return "<a href='member_view.php?mid={$mid}'>" . $row['userid'] . "</a>";
Esempio n. 7
0
$keywords = preg_replace("#[\"\r\n\t\\*\\?\\(\\)\$%']#", " ", trim($keywords));
$keywords = addslashes($keywords);
$addsql = "WHERE gid='{$id}' AND closed='0' ";
if ($typeid > 0) {
    $addsql .= "AND smalltype='{$typeid}' ";
}
if (!empty($keywords)) {
    $addsql .= "AND subject like '%" . $keywords . "%' ";
}
function _get_smalltype($id, $_field = 'name')
{
    global $db;
    $row = $db->GetOne("SELECT `id`,`name` FROM `#@__group_smalltypes` WHERE id='{$id}'");
    if (isset($row[$_field])) {
        return '[' . $row[$_field] . ']';
    }
}
static $row_fields = false;
$sql = "SELECT tid,subject,digest,displayorder,replies,lastpost,lastposter,smalltype,author,views FROM #@__group_threads {$addsql} ORDER BY displayorder DESC, lastpost DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
$dl->SetParameter('id', $id);
$dl->SetParameter("keywords", $keywords);
$dl->SetParameter("typeid", $typeid);
//这两句的顺序不能更换
$dl->SetTemplate(GROUP_TPL . '/groupdisplay.html');
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
Esempio n. 8
0
}
$arcsta = $cInfos['arcsta'];
//禁止访问无权限的模型
if ($cInfos['usertype'] != '' && $cInfos['usertype'] != $cfg_ml->M_MbType) {
    ShowMsg('你无权限访问该部分', '-1');
    exit;
}
if ($cid == 0) {
    $positionname = $cInfos['typename'] . " &gt;&gt; ";
} else {
    $positionname = str_replace($cfg_list_symbol, " &gt;&gt; ", $tl->GetPositionName()) . " &gt;&gt; ";
}
$whereSql = " where arc.channel = '{$channelid}' And arc.mid='{$mid}' ";
if ($keyword != '') {
    $keyword = cn_substr(trim(ereg_replace("[><\\|\"\r\n\t%\\*\\.\\?\\(\\)\$ ;,'%-]", "", stripslashes($keyword))), 30);
    $keyword = addslashes($keyword);
    $whereSql .= " And (arc.title like '%{$keyword}%') ";
}
if ($cid != 0) {
    $whereSql .= " And arc.typeid in (" . GetSonIds($cid) . ")";
}
$query = "select arc.aid,arc.aid as id,arc.typeid,arc.senddate,arc.channel,arc.click,arc.title,arc.mid,tp.typename\r\n        from `{$cInfos['addtable']}` arc\r\n        left join `#@__arctype` tp on tp.id=arc.typeid\r\n        {$whereSql}\r\n        order by arc.aid desc ";
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("dopost", "listArchives");
$dlist->SetParameter("keyword", $keyword);
$dlist->SetParameter("cid", $cid);
$dlist->SetParameter("channelid", $channelid);
$dlist->SetTemplate(DEDEMEMBER . "/templets/content_sg_list.htm");
$dlist->SetSource($query);
$dlist->Display();
Esempio n. 9
0
$dsql->SetQuery("SELECT id,classname,pid,rank FROM #@__story_catalog ORDER BY rank asc");
$dsql->Execute();
$ranks = array();
$btypes = array();
$stypes = array();
while ($row = $dsql->GetArray()) {
    if ($row['pid'] == 0) {
        $btypes[$row['id']] = $row['classname'];
    } else {
        $stypes[$row['pid']][$row['id']] = $row['classname'];
    }
    $ranks[$row['id']] = $row['rank'];
}
$addquery = "";
$orderby = " order by b.bid desc ";
if ($catid != 0) {
    $addquery .= " And (b.bcatid='{$catid}' Or b.catid='{$catid}') ";
}
if ($keyword != "") {
    $addquery .= " And (b.bookname like '%{$keyword}%' Or b.author like '%{$keyword}%') ";
}
$query = "\r\n   SELECT b.bid,b.catid,b.bookname,b.booktype,b.litpic,b.postnum,b.senddate,b.ischeck, c.id AS cid,c.classname FROM #@__story_books b\r\n   LEFT JOIN #@__story_catalog c on c.id = b.catid WHERE mid={$cfg_ml->M_ID} AND b.bid>0 {$addquery} {$orderby}\r\n";
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("keyword", $keyword);
$dlist->SetParameter("catid", $cid);
$dlist->SetParameter("orderby", $orderby);
$dlist->SetTemplate(dirname(__FILE__) . "/templets/book/story_books.htm");
$dlist->SetSource($query);
$dlist->Display();
$dlist->Close();
Esempio n. 10
0
 if ($action == 'list') {
     if (empty($diy->public)) {
         showMsg('后台关闭前台浏览', 'javascript:;');
         exit;
     }
     include_once DEDEINC . '/datalistcp.class.php';
     if ($diy->public == 2) {
         $query = "SELECT * FROM `{$diy->table}` ORDER BY id DESC";
     } else {
         $query = "SELECT * FROM `{$diy->table}` WHERE ifcheck=1 ORDER BY id DESC";
     }
     $datalist = new DataListCP();
     $datalist->pageSize = 10;
     $datalist->SetParameter('action', 'list');
     $datalist->SetParameter('diyid', $diyid);
     $datalist->SetTemplate(DEDEINC . "/../templets/plus/{$diy->listTemplate}");
     $datalist->SetSource($query);
     $fieldlist = $diy->getFieldList();
     $datalist->Display();
 } else {
     if ($action == 'view') {
         if (empty($diy->public)) {
             showMsg('后台关闭前台浏览', 'javascript:;');
             exit;
         }
         if (empty($id)) {
             showMsg('非法操作!未指定id', 'javascript:;');
             exit;
         }
         if ($diy->public == 2) {
             $query = "SELECT * FROM {$diy->table} WHERE id='{$id}' ";
Esempio n. 11
0
        $query = "SELECT addon.*, arctype.* FROM {$addontable} addon \n        LEFT JOIN #@__arctype arctype ON arctype.id = addon.typeid\n        {$where} {$orderby}";
    } else {
        $query = "SELECT main.id AS aid,main.*,main.description AS description1, type.* \n    FROM {$maintable} main \n    LEFT JOIN #@__arctype type ON type.id = main.typeid \n    LEFT JOIN {$addontable} addon ON addon.aid = main.id \n    {$where}  {$orderby}";
    }
    $sql = $query;
} else {
    $sql = urldecode($sql);
    $query = $sql;
}
$sql = urlencode($sql);
//生成sql的唯一序列化字符串,并将sql语句记录到session中去
$sqlhash = md5($sql);
$_SESSION[$sqlhash] = $sql;
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("hash", $sqlhash);
$dlist->SetParameter("mid", $mid);
if (file_exists(DEDEROOT . "/templets/default/{$template}")) {
    $templatefile = DEDEROOT . "/templets/default/{$template}";
} else {
    $templatefile = DEDEROOT . "/templets/default/advancedsearch.htm";
}
$dlist->SetTemplate($templatefile);
$dlist->SetSource($query);
require_once DEDEINC . "/channelunit.class.php";
//获得一个指定档案的链接
function GetArcUrl($aid, $typeid, $timetag, $title, $ismake = 0, $rank = 0, $namerule = '', $artdir = '', $money = 0)
{
    return GetFileUrl($aid, $typeid, $timetag, $title, $ismake, $rank, $namerule, $artdir, $money);
}
$dlist->Display();
  </tr>
  <tr>
    <td height="90">&nbsp;</td>
    <td colspan="2"><textarea name="rule" style="width:300px;height:80px"><?php 
                echo $row['rule'];
                ?>
</textarea></td>
  </tr>
  <tr>
    <td height="32">&nbsp;</td>
    <td colspan="2"><input class="nbt" type="submit" name="Submit" value="保存规则" /> 
    <input type="reset" class="nbt" name="Submit2" value="重置" /></td>
  </tr>
</table>
</form>
<?php 
                exit;
            }
        }
    }
}
//loadedit
/*---------------
function _ShowLoad(){ }
-------------*/
$sql = "";
$sql = "Select id,url,title,lang,issource From `#@__co_onepage` order by id desc";
$dlist = new DataListCP();
$dlist->SetTemplate(DEDEADMIN . "/templets/article_coonepage_rule.htm");
$dlist->SetSource($sql);
$dlist->Display();
Esempio n. 13
0
            $db->ExecuteNoneQuery("UPDATE #@__group_guestbook SET message='" . $message . "',title='" . $title . "' WHERE bid='{$id}'");
        }
    } else {
        if ($action == "edit") {
            $row = $db->GetOne("SELECT * FROM #@__group_guestbook WHERE bid='{$id}'");
            $title = $row['title'];
            $message = $row['message'];
        }
    }
}
//列表加载模板
$wheresql = "WHERE gid='{$gid}'";
if (!empty($keyword)) {
    $wheresql .= " AND    (title like '%" . $keyword . "%' OR message like '%" . $keyword . "%')";
}
if (!empty($username)) {
    $wheresql .= " AND uname like '%" . $username . "%'";
}
$sql = "SELECT * FROM #@__group_guestbook {$wheresql} ORDER BY stime DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
$dl->SetParameter("keyword", $keyword);
$dl->SetParameter("username", $username);
$dl->SetParameter("gid", $gid);
//这两句的顺序不能更换
$dl->SetTemplate(DEDEADMIN . "/templets/group_guestbook.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
Esempio n. 14
0
        }
    }
}
//列表加载模板
$wheresql = "WHERE gid='{$gid}'";
if (!empty($username)) {
    $wheresql .= " AND username like '%" . $username . "%'";
}
$sql = "SELECT * FROM #@__group_user {$wheresql} ORDER BY jointime DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
$dl->SetParameter("username", $username);
$dl->SetParameter("id", $id);
$dl->SetParameter("gid", $gid);
//这两句的顺序不能更换
$dl->SetTemplate(DEDEADMIN . "/templets/group_user.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
function filter($var)
{
    return $var == '' ? false : true;
}
function GetMaster($user)
{
    global $ismaster;
    $master = explode(",", $ismaster);
    if (in_array($user, $master)) {
        return "<img src='img/adminuserico.gif'> 管理员";
Esempio n. 15
0
require_once dirname(__FILE__) . "/config.php";
require_once DEDEINC . "/datalistcp.class.php";
CheckPurview('shops_Operations');
if (!isset($oid)) {
    exit("<a href='javascript:window.close()'>无效操作!</a>");
}
$oid = preg_replace("#[^-0-9A-Z]#", "", $oid);
if (empty($oid)) {
    exit("<a href='javascript:window.close()'>无效订单号!</a>");
}
$row = $dsql->GetOne("SELECT * FROM #@__shops_userinfo WHERE oid='{$oid}'");
$sql = "SELECT o.*,p.title,p.price as uprice,d.dname FROM #@__shops_orders as o left join #@__shops_products as p on o.oid=p.oid left join #@__shops_delivery as d on d.pid=o.pid WHERE o.oid='{$oid}'";
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("oid", $oid);
$dlist->SetTemplate(DEDEADMIN . "/templets/shops_operations_cart.htm");
$dlist->SetSource($sql);
$dlist->Display();
$dlist->Close();
function GetSta($sta, $oid)
{
    global $dsql;
    $row = $dsql->GetOne("SELECT paytype FROM #@__shops_orders WHERE oid='{$oid}'");
    $payname = $dsql->GetOne("SELECT name,fee FROM #@__payment WHERE id='{$row['paytype']}'");
    if ($sta == 0) {
        return $payname['name'] . " 手续费:" . $payname['fee'] . "元";
    } else {
        if ($sta == 1) {
            return '<font color="red">已付款,等发货</font>';
        } else {
            if ($sta == 2) {
Esempio n. 16
0
File: uploads.php Progetto: cwcw/cms
$menutype = 'content';
$keyword = empty($keyword) ? '' : FilterSearch($keyword);
$addsql = " where mid='" . $cfg_ml->M_ID . "' AND title LIKE '%{$keyword}%' ";
if (empty($mediatype)) {
    $mediatype = 0;
}
$mediatype = intval($mediatype);
if ($mediatype > 0) {
    $addsql .= " AND mediatype='{$mediatype}' ";
}
$sql = "SELECT * FROM `#@__uploads` {$addsql} ORDER BY aid DESC";
$dlist = new DataListCP();
$dlist->pageSize = 5;
$dlist->SetParameter("mediatype", $mediatype);
$dlist->SetParameter("keyword", $keyword);
$dlist->SetTemplate(DEDEMEMBER . "/templets/uploads.htm");
$dlist->SetSource($sql);
$dlist->Display();
function MediaType($tid, $nurl)
{
    if ($tid == 1) {
        return "图片";
    } else {
        if ($tid == 2) {
            return "FLASH";
        } else {
            if ($tid == 3) {
                return "视频/音频";
            } else {
                return "附件/其它";
            }
Esempio n. 17
0
</tr>
</table>
</form>
<?php 
    exit;
} else {
    if ($action == 'editsave') {
        $db->ExecuteNoneQuery("UPDATE #@__store_groups SET storename='{$storename}',tops='{$tops}',orders='{$orders}' WHERE storeid='{$catid}'");
        $msg = "成功修改栏目:{$catid} = {$storename} !";
    } else {
        if ($action == 'uprank') {
            foreach ($_POST as $rk => $rv) {
                if (preg_match('#rank#i', $rk)) {
                    $catid = str_replace('rank_', '', $rk);
                    $db->ExecuteNoneQuery("UPDATE #@__store_groups SET orders='{$rv}' WHERE storeid='{$catid}'");
                }
            }
            $msg = "成功更改排序 !";
        }
    }
}
$sql = "SELECT storeid,storename,tops,orders FROM #@__store_groups WHERE tops=0 ORDER BY orders ASC";
$dl = new DataListCP();
$dl->pageSize = 20;
//这两句的顺序不能更换
$dl->SetTemplate(DEDEADMIN . "/templets/group_store.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
Esempio n. 18
0
}
if (!empty($username)) {
    $wheresql .= " AND (author like '%" . $username . "%' OR lastposter like '%" . $username . "%')";
}
if ($orders == "rep") {
    $sqlorders = "ORDER BY replies DESC,";
}
$sqlorders .= " dateline DESC";
$sql = "SELECT * FROM #@__group_threads {$wheresql} {$sqlorders}";
$dl = new DataListCP();
$dl->pageSize = 20;
$dl->SetParameter("username", $username);
$dl->SetParameter("orders", $orders);
$dl->SetParameter("keyword", $keyword);
//这两句的顺序不能更换
$dl->SetTemplate(DEDEADMIN . "/templets/group_threads.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
function GetGroupname($id)
{
    global $db;
    $rs = $db->GetOne("SELECT groupname FROM #@__groups WHERE groupid='" . $id . "'");
    if (is_array($rs)) {
        return $rs['groupname'];
    } else {
        return_nulls;
    }
}
Esempio n. 19
0
        } else {
            if ($ftype == 1) {
                $wsql = " F.mid='{$cfg_ml->M_ID}' AND F.ftype =  '1' ";
                $tname = "特别关注";
            } else {
                if ($ftype == -1) {
                    $wsql = " F.mid='{$cfg_ml->M_ID}' AND F.ftype =  '-1' ";
                    $tname = "黑名单";
                }
            }
        }
        $query = "SELECT F.*,G.groupname FROM `#@__member_group` AS G  LEFT JOIN #@__member_friends AS F ON F.groupid=G.id WHERE {$wsql} ORDER BY F.id DESC";
        $dlist = new DataListCP();
        $dlist->pageSize = 20;
        $dlist->SetParameter("ftype", $ftype);
        $dlist->SetTemplate(dirname(__FILE__) . '/templets/myfriend.htm');
        $dlist->SetSource($query);
        $dlist->Display();
    }
}
/**
 *  获取用户信息
 *
 * @param     int  $uid  用户UID
 * @param     string  $_field  用户字段
 * @return    string
 */
function getUserInfo($uid, $_field = 'uname')
{
    global $dsql;
    $row = $dsql->GetOne("SELECT M.*,YEAR(CURDATE())-YEAR(P.birthday) as age,DATE_FORMAT(P.birthday,'%e月%d日出生') as birthday,S.spacename,S.sign FROM #@__member AS M \n                           LEFT JOIN #@__member_person AS P ON P.mid=M.mid\n                           LEFT JOIN #@__member_space AS S ON M.mid=M.mid WHERE M.mid='{$uid}'");
Esempio n. 20
0
    $wheresql .= " AND creater like '%" . $username . "%'";
}
if (!isset($store)) {
    $store = -1;
}
if ($store > 0) {
    $wheresql .= " AND (storeid='" . $store . "' OR rootstoreid='" . $store . "')";
}
$sql = "SELECT * FROM #@__groups {$wheresql} ORDER BY stime DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
$dl->SetParameter("username", $username);
$dl->SetParameter("store", $store);
$dl->SetParameter("keyword", $keyword);
//这两句的顺序不能更换
$dl->SetTemplate(DEDEADMIN . "/templets/group_main.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
function GetGroupstore($id)
{
    global $db;
    $row = $db->GetOne("SELECT storename,tops FROM #@__store_groups WHERE storeid='{$id}'");
    if (is_array($row)) {
        $store = $row['storename'];
        if (!$row['tops']) {
            return $row['storename'];
        } else {
            $rs = $db->GetOne("SELECT storename FROM #@__store_groups WHERE storeid='" . $row['tops'] . "'");
Esempio n. 21
0
                $title = $row['title'];
            }
            if (empty($notice)) {
                $notice = $row['notice'];
            }
            $db->ExecuteNoneQuery("UPDATE #@__group_notice SET notice='" . $notice . "',title='" . $title . "' WHERE id='{$id}'");
        }
    }
}
unset($row);
//列表加载模板
$wheresql = "WHERE gid='{$gid}'";
if (!empty($keyword)) {
    $wheresql .= " AND    (title like '%" . $keyword . "%' OR notice like '%" . $keyword . "%')";
}
if (!empty($username)) {
    $wheresql .= " AND uname like '%" . $username . "%'";
}
$sql = "SELECT * FROM #@__group_notice {$wheresql} ORDER BY stime DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
$dl->SetParameter("keyword", $keyword);
$dl->SetParameter("username", $username);
$dl->SetParameter("gid", $gid);
//这两句的顺序不能更换
$dl->SetTemplate(DEDEADMIN . "/templets/group_notice.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
Esempio n. 22
0
if ($folder == "inbox" || $folder == '') {
    $postuser = "******";
}
if (!empty($keyword)) {
    $whereSql .= " AND (subject like '%" . $keyword . "%' OR message like '%" . $keyword . "%')";
}
if (!empty($username)) {
    $whereSql .= " AND floginid like '%" . $username . "%'";
}
$sql = "SELECT * FROM #@__member_pms {$whereSql} ORDER BY sendtime desc";
$dlist = new DataListCP();
$dlist->pagesize = 25;
$dlist->SetParameter("folder", $folder);
$dlist->SetParameter("username", $username);
$dlist->SetParameter("keyword", $keyword);
$dlist->SetTemplate(DEDEADMIN . "/templets/member_pm.htm");
$dlist->SetSource($sql);
$dlist->Display();
$dlist->Close();
function GetFolders($me)
{
    if ($me == "outbox") {
        return '发件箱';
    } else {
        if ($me == "inbox") {
            return '收件箱';
        }
    }
}
function IsReader($me)
{
Esempio n. 23
0
        if (is_array($row)) {
            ShowMsg("关键字已存在库中!", "-1");
            exit;
        }
        $inquery = "INSERT INTO `#@__keywords`(keyword,rank,sta,rpurl) VALUES ('{$keyword}','{$rank}','1','{$rpurl}');";
        $dsql->ExecuteNoneQuery($inquery);
        ShowMsg("成功增加一个关键字!", $ENV_GOBACK_URL);
        exit;
    }
}
if (empty($keyword)) {
    $keyword = '';
    $addquery = '';
} else {
    $addquery = " WHERE keyword LIKE '%{$keyword}%' ";
}
$sql = "SELECT * FROM `#@__keywords` {$addquery} ORDER BY rank DESC";
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("keyword", $keyword);
$dlist->SetTemplate(DEDEADMIN . "/templets/article_keywords_main.htm");
$dlist->SetSource($sql);
$dlist->Display();
function GetSta($sta)
{
    if ($sta == 1) {
        return '';
    } else {
        return ' checked="1" ';
    }
}
Esempio n. 24
0
    } else {
        if ($action = "join") {
            $row = $db->GetOne("SELECT isjoin FROM #@__group_user WHERE uid='{$uid}' AND gid='{$id}' AND isjoin='0'");
            if (is_array($row)) {
                $db->ExecuteNoneQuery("UPDATE #@__group_user SET isjoin='1' WHERE uid='{$uid}' AND gid='{$id}'");
            }
        }
    }
}
$sql = "SELECT * FROM #@__group_user WHERE gid='{$id}' ORDER BY jointime DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
$dl->SetParameter("id", $id);
$dl->SetParameter("gid", $gid);
//这两句的顺序不能更换
$dl->SetTemplate(_SYSTEM_ . "/mygroup_member.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
function filter($var)
{
    return $var == '' ? false : true;
}
function GetMaster($user)
{
    global $ismaster;
    $master = explode(",", $ismaster);
    if (in_array($user, $master)) {
        return "<img src='img/adminuserico.gif' title='管理员'>";
Esempio n. 25
0
        $row['uprice'] = $rs['price'] / $rs['cartcount'];
        $row['dprice'] = $rs['dprice'];
        $row['priceCount'] = $rs['priceCount'];
        $rs = $dsql->GetOne("SELECT `dname` FROM #@__shops_delivery WHERE pid='{$rs['pid']}' LIMIT 0,1");
        $row['dname'] = $rs['dname'];
        unset($rs);
        $addsql = " AND oid='" . $oid . "'";
    }
    $sql = "SELECT * FROM #@__shops_products WHERE userid='" . $cfg_ml->M_ID . "' {$addsql} ORDER BY aid ASC";
    $dl = new DataListCP();
    $dl->pageSize = 20;
    if (!empty($oid)) {
        $dl->SetParameter('oid', $oid);
    }
    //这两句的顺序不能更换
    $dl->SetTemplate(dirname(__FILE__) . "/templets/shops_products.htm");
    //载入模板
    $dl->SetSource($sql);
    //设定查询SQL
    $dl->Display();
} else {
    if ($dopost == 'del') {
        $ids = explode(',', $ids);
        if (isset($ids) && is_array($ids)) {
            foreach ($ids as $id) {
                $id = preg_replace("/^[a-z][0-9]\$/", "", $id);
                $query = "DELETE FROM `#@__shops_products` WHERE oid='{$id}' AND userid='{$cfg_ml->M_ID}'";
                $query2 = "DELETE FROM `#@__shops_orders` WHERE oid='{$id}' AND userid='{$cfg_ml->M_ID}'";
                $query3 = "DELETE FROM `#@__shops_userinfo` WHERE oid='{$id}' AND userid='{$cfg_ml->M_ID}'";
                $dsql->ExecuteNoneQuery($query);
                $dsql->ExecuteNoneQuery($query2);
Esempio n. 26
0
<?php

require_once dirname(__FILE__) . '/config.php';
CheckRank(0, 0);
require_once DEDEINC . '/datalistcp.class.php';
setcookie('ENV_GOBACK_URL', GetCurUrl(), time() + 3600, '/');
$query = "Select * From `#@__member_operation` where mid='" . $cfg_ml->M_ID . "' And product='archive' order by aid desc";
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetTemplate(DEDEMEMBER . '/templets/mypay.htm');
$dlist->SetSource($query);
$dlist->Display();
Esempio n. 27
0
                $goto = "diy_list.php?action=list&diyid={$diy->diyid}";
                showmsg('发布成功', $goto);
            } else {
                showmsg('对不起,发布不成功', '-1');
            }
        }
    }
} else {
    if ($action == 'list') {
        include_once DEDEINC . '/datalistcp.class.php';
        $query = "SELECT * FROM {$diy->table} ORDER BY id DESC";
        $datalist = new DataListCP();
        $datalist->pageSize = 10;
        $datalist->SetParameter('action', 'list');
        $datalist->SetParameter('diyid', $diyid);
        $datalist->SetTemplate(DEDEADMIN . '/templets/diy_list.htm');
        $datalist->SetSource($query);
        $fieldlist = $diy->getFieldList();
        $datalist->Display();
    } else {
        if ($action == 'edit') {
            if (empty($do)) {
                $id = isset($id) && is_numeric($id) ? $id : 0;
                if (empty($id)) {
                    showMsg('非法操作!未指定id', 'javascript:;');
                    exit;
                }
                $query = "SELECT * FROM {$diy->table} WHERE id={$id}";
                $row = $dsql->GetOne($query);
                if (!is_array($row)) {
                    showmsg("你访问的记录不存在或未经审核", '-1');
Esempio n. 28
0
        exit;
    } else {
        if ($job == 'check') {
            $query = "Update `#@__feedback` set ischeck=1 where id in({$ids}) ";
            $dsql->ExecuteNoneQuery($query);
            ShowMsg("成功审核指定评论!", $_COOKIE['ENV_GOBACK_URL'], 0, 500);
            exit;
        } else {
            $bgcolor = '';
            $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0;
            $aid = isset($aid) && is_numeric($aid) ? $aid : 0;
            $keyword = !isset($keyword) ? '' : $keyword;
            $ip = !isset($ip) ? '' : $ip;
            $tl = new TypeLink($typeid);
            $openarray = $tl->GetOptionArray($typeid, $admin_catalogs, 0);
            $addsql = $typeid != 0 ? " And typeid in (" . GetSonIds($typeid) . ")" : '';
            $addsql .= $aid != 0 ? " And aid={$aid} " : '';
            $addsql .= $ip != '' ? " And ip like '{$ip}' " : '';
            $querystring = "select * from `#@__feedback` where msg like '%{$keyword}%' {$addsql} order by dtime desc";
            $dlist = new DataListCP();
            $dlist->pageSize = 15;
            $dlist->SetParameter('aid', $aid);
            $dlist->SetParameter('ip', $ip);
            $dlist->SetParameter('typeid', $typeid);
            $dlist->SetParameter('keyword', $keyword);
            $dlist->SetTemplate(DEDEADMIN . '/templets/feedback_main.htm');
            $dlist->SetSource($querystring);
            $dlist->Display();
        }
    }
}
Esempio n. 29
0
                if (empty($price)) {
                    $price = $row['price'];
                }
                if (empty($des)) {
                    $des = addslashes($row['des']);
                } else {
                    $des = cn_substrR($des, 255);
                }
                $dsql->ExecuteNoneQuery("UPDATE #@__shops_delivery SET dname='{$dname}',price='{$price}',des='{$des}' WHERE pid='{$id}'");
            }
            ShowMsg("成功修改配送方式!", "shops_delivery.php");
            exit;
        }
    }
}
$deliveryarr = array();
$dsql->SetQuery("SELECT pid,dname,price,des FROM #@__shops_delivery ORDER BY orders ASC");
$dsql->Execute();
while ($row = $dsql->GetArray()) {
    $deliveryarr[] = $row;
}
$dlist = new DataListCP();
$dlist->pageSize = 25;
//设定每页显示记录数(默认25条)
//这两句的顺序不能更换
$dlist->SetTemplate(DEDEADMIN . "/templets/shops_delivery.htm");
//载入模板
$dlist->SetSource("SELECT `pid`,`dname`,`price`,`des` FROM #@__shops_delivery ORDER BY `orders` ASC");
//设定查询SQL
$dlist->Display();
//显示
Esempio n. 30
0
include_once DEDEINC . '/datalistcp.class.php';
$bid = isset($bid) && is_numeric($bid) ? $bid : 0;
$do = isset($do) ? trim($do) : '';
if ($id < 1) {
    ShowMsg("错误,未定义的操作!", "-1");
    exit;
}
if ($do == "del" && $ismaster) {
    $row = $db->GetOne("SELECT bid FROM #@__group_guestbook WHERE bid='{$bid}'");
    if (!is_array($row)) {
        ShowMsg("记录不存在!", "-1");
        exit;
    }
    $db->ExecuteNoneQuery("DELETE FROM #@__group_guestbook WHERE bid='{$bid}'");
}
$pagesize = 5;
$nowpage = isset($pageno) && is_numeric($pageno) ? max($pageno, 1) : 1;
$topic = ($nowpage - 1) * $pagesize;
$sql = "SELECT G.stime,G.bid,G.message,G.title,M.uname,M.userid,M.face FROM #@__group_guestbook G LEFT JOIN #@__member M ON G.userid=M.mid WHERE G.gid='{$id}' ORDER BY G.stime ASC";
$dl = new DataListCP();
$dl->pageSize = $pagesize;
//设定每页显示记录数(默认5条)
$dl->SetParameter('id', $id);
//设定get字符串的变量
//这两句的顺序不能更换
$dl->SetTemplate(GROUP_TPL . '/guestbook.html');
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示