Exemplo n.º 1
0
function plus_spacenewart(&$atts, &$refObj, &$fields)
{
    global $dsql, $_vars;
    $attlist = "channel=1,titlelen=30,infolen=200,row=8,imgwidth=120,imgheight=90";
    FillAtts($atts, $attlist);
    FillFields($atts, $fields, $refObj);
    extract($atts, EXTR_OVERWRITE);
    $query = "Select arc.*,mt.mtypename,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,\r\n\t\ttp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\r\n\t\tfrom `#@__archives` arc\r\n\t\tleft join `#@__arctype` tp on arc.typeid=tp.id\r\n\t\tleft join `#@__mtypes` mt on mt.mtypeid=arc.mtype\r\n\t\twhere arc.mid='{$_vars['mid']}' and arc.channel={$channel}\r\n\t\torder by id desc limit 0,{$row}";
    $dsql->SetQuery($query);
    $dsql->Execute("al");
    $artlist = '';
    $rearr = array();
    while ($row = $dsql->GetArray("al")) {
        //处理一些特殊字段
        $row['infos'] = cn_substr($row['description'], $infolen);
        $row['id'] = $row['id'];
        $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], $row['ismake'], $row['arcrank'], $row['namerule'], $row['typedir'], $row['money'], $row['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
        $row['typeurl'] = GetTypeUrl($row['typeid'], $row['typedir'], $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['moresite'], $row['siteurl'], $row['sitepath']);
        if ($row['litpic'] == '') {
            $row['litpic'] = '/images/defaultpic.gif';
        }
        if (!eregi("^http://", $row['litpic'])) {
            $row['picname'] = $row['litpic'] = $GLOBALS['cfg_cmsurl'] . $row['litpic'];
        } else {
            $row['picname'] = $row['litpic'] = $row['litpic'];
        }
        $row['stime'] = GetDateMK($row['pubdate']);
        $row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
        $row['image'] = "<img src='" . $row['picname'] . "' border='0' width='{$imgwidth}' height='{$imgheight}' alt='" . ereg_replace("['><]", "", $row['title']) . "'>";
        $row['imglink'] = "<a href='" . $row['filename'] . "'>" . $row['image'] . "</a>";
        $row['fulltitle'] = $row['title'];
        $row['title'] = cn_substr($row['title'], $titlelen);
        if ($row['color'] != '') {
            $row['title'] = "<font color='" . $row['color'] . "'>" . $row['title'] . "</font>";
        }
        if (ereg('b', $row['flag'])) {
            $row['title'] = "<strong>" . $row['title'] . "</strong>";
        }
        //$row['title'] = "<b>".$row['title']."</b>";
        $row['textlink'] = "<a href='" . $row['filename'] . "'>" . $row['title'] . "</a>";
        $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
        $row['memberurl'] = $GLOBALS['cfg_memberurl'];
        $row['templeturl'] = $GLOBALS['cfg_templeturl'];
        $rearr[] = $row;
    }
    //loop line
    $dsql->FreeResult("al");
    return $rearr;
}
Exemplo n.º 2
0
function plus_ask(&$atts, &$refObj, &$fields)
{
    global $dsql, $_vars;
    $attlist = "titlelen=40,row=8,typeid=0,sort=";
    FillAtts($atts, $attlist);
    FillFields($atts, $fields, $refObj);
    extract($atts, EXTR_OVERWRITE);
    $wheresql = ' 1 ';
    if ($sort == '') {
        $orderby = 'order by id desc';
    } else {
        if ($sort == 'commend') {
            $wheresql .= ' And digest=1';
            $orderby = ' order by dateline desc';
        } else {
            if ($sort == 'ok') {
                $wheresql .= ' And status=1 ';
                $orderby = ' order by solvetime desc';
            } else {
                if ($sort == 'expiredtime') {
                    $wheresql .= ' And status=0 ';
                    $orderby = ' order by expiredtime asc, dateline desc';
                } else {
                    if ($sort == 'reward') {
                        $wheresql .= ' And status=0 ';
                        $orderby = ' order by reward desc';
                    } else {
                        $wheresql .= ' And status=0 ';
                        $orderby = ' order by disorder desc, dateline desc';
                    }
                }
            }
        }
    }
    $query = "select id, tid, tidname, tid2, tid2name, title from `#@__ask` where {$wheresql} {$orderby} limit {$row}";
    $dsql->SetQuery($query);
    $dsql->Execute('an');
    $rearr = array();
    while ($row = $dsql->GetArray('an')) {
        if ($row['tid2'] != 0) {
            $row['typelink'] = $row['typedata'] = " <a href='browser.php?tid2={$row['tid2']}'>{$row['tid2name']}</a>\r\n";
        } else {
            $row['typelink'] = $row['typedata'] = " <a href='browser.php?tid={$row['tid']}'>{$row['tidname']}</a>\r\n";
        }
        $row['title'] = cn_substr($row['title'], $titlelen);
        $rearr[] = $row;
    }
    return $rearr;
}
Exemplo n.º 3
0
/**
 * 动态模板memberlist标签
 *
 * @version        $Id: plus_newvisitor.php 1 13:58 2010年7月5日Z tianya $
 * @package        DedeCMS.Tpllib
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
function plus_newvisitor(&$atts, &$refObj, &$fields)
{
    global $dsql, $_vars, $cfg_memberurl;
    $attlist = "titlelen=30,infolen=200,row=6";
    FillAtts($atts, $attlist);
    FillFields($atts, $fields, $refObj);
    extract($atts, EXTR_OVERWRITE);
    $mid = $_vars['mid'];
    $query = "SELECT h.*,mb.face,mb.sex,mb.userid AS loginid,mb.uname,s.sign FROM `#@__member_vhistory` h\n             LEFT JOIN `#@__member` mb ON mb.mid = h.vid\n             LEFT JOIN `#@__member_space` s ON s.mid = h.vid\n             WHERE  h.mid='{$mid}' ORDER BY h.vtime DESC LIMIT 0,{$row}";
    $dsql->SetQuery($query);
    $dsql->Execute("al");
    $rearr = array();
    while ($row = $dsql->GetArray("al")) {
        $row['url'] = $cfg_memberurl . "/index.php?uid=" . $row['loginid'];
        if (empty($row['face'])) {
            $row['face'] = $row['sex'] == '?' ? $cfg_memberurl . '/templets/images/dfgirl.png' : $cfg_memberurl . '/templets/images/dfboy.png';
        }
        $rearr[] = $row;
    }
    $dsql->FreeResult("al");
    return $rearr;
}
Exemplo n.º 4
0
function plus_newvisitor(&$atts, &$refObj, &$fields)
{
    global $dsql, $_vars, $cfg_memberurl;
    $attlist = "titlelen=30,infolen=200,row=6";
    FillAtts($atts, $attlist);
    FillFields($atts, $fields, $refObj);
    extract($atts, EXTR_OVERWRITE);
    $mid = $_vars['mid'];
    $query = "Select h.*,mb.face,mb.userid as loginid,mb.uname,s.sign From `#@__member_vhistory` h\r\n\t         left join `#@__member` mb on mb.mid = h.vid\r\n\t         left join `#@__member_space` s on s.mid = h.vid\r\n\t         where  h.mid='{$mid}' order by h.vtime desc limit 0,{$row}";
    $dsql->SetQuery($query);
    $dsql->Execute("al");
    $rearr = array();
    while ($row = $dsql->GetArray("al")) {
        $row['url'] = $cfg_memberurl . "/index.php?uid=" . $row['loginid'];
        if (trim($row['face']) == '') {
            $row['face'] = $cfg_memberurl . '/images/nopic.gif';
        }
        $rearr[] = $row;
    }
    $dsql->FreeResult("al");
    return $rearr;
}
Exemplo n.º 5
0
/**
 * 动态模板memberlist标签
 *
 * @version        $Id: plus_memberlist.php 1 13:58 2010年7月5日Z tianya $
 * @package        DedeCMS.Tpllib
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
function plus_memberlist(&$atts, &$refObj, &$fields)
{
    global $dsql, $_vars;
    $attlist = "row=6,iscommend=0,orderby=logintime,signlen=50";
    FillAtts($atts, $attlist);
    FillFields($atts, $fields, $refObj);
    extract($atts, EXTR_OVERWRITE);
    $rearray = array();
    $wheresql = ' WHERE mb.spacesta > -1 AND mb.matt != 10';
    if ($iscommend > 0) {
        $wheresql .= " AND  mb.matt='{$iscommend}' ";
    }
    $sql = "SELECT mb.*,ms.spacename,ms.sign FROM `#@__member` mb\n    LEFT JOIN `#@__member_space` ms ON ms.mid = mb.mid {$wheresql} ORDER BY mb.{$orderby} DESC LIMIT 0,{$row} ";
    $dsql->Execute('mb', $sql);
    while ($row = $dsql->GetArray('mb')) {
        $row['spaceurl'] = $GLOBALS['cfg_basehost'] . '/member/index.php?uid=' . $row['userid'];
        if (empty($row['face'])) {
            $row['face'] = $row['sex'] == '?' ? $GLOBALS['cfg_memberurl'] . '/templets/images/dfgirl.png' : $GLOBALS['cfg_memberurl'] . '/templets/images/dfboy.png';
        }
        $rearray[] = $row;
    }
    return $rearray;
}
Exemplo n.º 6
0
function plus_memberlist(&$atts, &$refObj, &$fields)
{
    global $dsql, $_vars;
    $attlist = "row=6,iscommend=0,orderby=logintime,signlen=50";
    FillAtts($atts, $attlist);
    FillFields($atts, $fields, $refObj);
    extract($atts, EXTR_OVERWRITE);
    $rearray = array();
    $wheresql = ' where mb.spacesta > -1 AND mb.matt != 10';
    if ($iscommend > 0) {
        $wheresql .= " And  mb.matt='{$iscommend}' ";
    }
    $sql = "Select mb.*,ms.spacename,ms.sign From `#@__member` mb\r\n\t\tleft join `#@__member_space` ms on ms.mid = mb.mid {$wheresql} order by mb.{$orderby} desc limit 0,{$row} ";
    $dsql->Execute('mb', $sql);
    while ($row = $dsql->GetArray('mb')) {
        $row['spaceurl'] = $GLOBALS['cfg_basehost'] . '/member/index.php?uid=' . $row['userid'];
        if (empty($row['face'])) {
            $row['face'] = $GLOBALS['cfg_memberurl'] . '/images/nopic.gif';
        }
        $rearray[] = $row;
    }
    return $rearray;
}
Exemplo n.º 7
0
/**
 * 动态模板channel标签
 *
 * @version        $Id: plus_ask.php 1 13:58 2010年7月5日Z tianya $
 * @package        DedeCMS.Tpllib
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
function plus_channel(&$atts, &$refObj, &$fields)
{
    global $dsql, $_vars;
    $attlist = "typeid=0,reid=0,row=100,type=son,currentstyle=";
    FillAtts($atts, $attlist);
    FillFields($atts, $fields, $refObj);
    extract($atts, EXTR_OVERWRITE);
    $line = empty($row) ? 100 : $row;
    $reArray = array();
    $reid = 0;
    $topid = 0;
    //如果属性里没指定栏目id,从引用类里获取栏目信息
    if (empty($typeid)) {
        if (isset($refObj->TypeLink->TypeInfos['id'])) {
            $typeid = $refObj->TypeLink->TypeInfos['id'];
            $reid = $refObj->TypeLink->TypeInfos['reid'];
            $topid = $refObj->TypeLink->TypeInfos['topid'];
        } else {
            $typeid = 0;
        }
    } else {
        $row2 = $dsql->GetOne("SELECT * FROM `#@__arctype` WHERE id='{$typeid}' ");
        $typeid = $row2['id'];
        $reid = $row2['reid'];
        $topid = $row2['topid'];
        $issetInfos = true;
    }
    if ($type == '' || $type == 'sun') {
        $type = 'son';
    }
    if ($type == 'top') {
        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n          FROM `#@__arctype` WHERE reid=0 AND ishidden<>1 ORDER BY sortrank ASC LIMIT 0, {$line} ";
    } else {
        if ($type == 'son') {
            if ($typeid == 0) {
                return $reArray;
            }
            $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n          FROM `#@__arctype` WHERE reid='{$typeid}' AND ishidden<>1 ORDER BY sortrank ASC LIMIT 0, {$line} ";
        } else {
            if ($type == 'self') {
                if ($reid == 0) {
                    return $reArray;
                }
                $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n            FROM `#@__arctype` WHERE reid='{$reid}' AND ishidden<>1 ORDER BY sortrank ASC LIMIT 0, {$line} ";
            }
        }
    }
    //检查是否有子栏目,并返回rel提示(用于二级菜单)
    $needRel = true;
    if (empty($sql)) {
        return $reArray;
    }
    $dsql->Execute('me', $sql);
    $totalRow = $dsql->GetTotalRow('me');
    //如果用子栏目模式,当没有子栏目时显示同级栏目
    if ($type == 'son' && $reid != 0 && $totalRow == 0) {
        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n            FROM `#@__arctype` WHERE reid='{$reid}' AND ishidden<>1 ORDER BY sortrank ASC LIMIT 0, {$line} ";
        $dsql->Execute('me', $sql);
    }
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        $row['currentstyle'] = $row['sonids'] = $row['rel'] = '';
        if ($needRel) {
            $row['sonids'] = GetSonIds($row['id'], 0, false);
            if ($row['sonids'] == '') {
                $row['rel'] = '';
            } else {
                $row['rel'] = " rel='dropmenu{$row['id']}'";
            }
        }
        //处理同级栏目中,当前栏目的样式
        if (($row['id'] == $typeid || $topid == $row['id'] && $type == 'top') && $currentstyle != '') {
            $row['currentstyle'] = $currentstyle;
        }
        $row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);
        $reArray[] = $row;
        $GLOBALS['autoindex']++;
    }
    //Loop for $i
    $dsql->FreeResult();
    return $reArray;
}
 function GetArcList($atts, $refObj = '', $fields = array())
 {
     $attlist = "titlelen=30,infolen=200,imgwidth=120,imgheight=90";
     FillAtts($atts, $attlist);
     FillFields($atts, $fields, $refObj);
     extract($atts, EXTR_OVERWRITE);
     $rsArray = array();
     //global $_vars;
     //$t1 = Exectime();
     if (!$this->isQuery) {
         $this->dsql->Execute('mbdl', $this->sourceSql);
     }
     $i = 0;
     while ($row = $this->dsql->GetArray('mbdl')) {
         $i++;
         if (!isset($row['description'])) {
             $row['description'] = '';
         }
         if (!isset($row['color'])) {
             $row['color'] = '';
         }
         if (!isset($row['pubdate'])) {
             $row['pubdate'] = $row['senddate'];
         }
         //处理一些特殊字段
         $row['infos'] = cn_substr($row['description'], $infolen);
         $row['id'] = $row['id'];
         $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], $row['ismake'], $row['arcrank'], $row['namerule'], $row['typedir'], $row['money'], $row['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
         $row['typeurl'] = GetTypeUrl($row['typeid'], $row['typedir'], $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['moresite'], $row['siteurl'], $row['sitepath']);
         if ($row['litpic'] == '-' || $row['litpic'] == '') {
             $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
         }
         if (!eregi("^http://", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
             $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
         }
         $row['picname'] = $row['litpic'];
         $row['stime'] = GetDateMK($row['pubdate']);
         $row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
         $row['image'] = "<img src='" . $row['picname'] . "' border='0' width='{$imgwidth}' height='{$imgheight}' alt='" . ereg_replace("['><]", "", $row['title']) . "'>";
         $row['imglink'] = "<a href='" . $row['filename'] . "'>" . $row['image'] . "</a>";
         $row['fulltitle'] = $row['title'];
         $row['title'] = cn_substr($row['title'], $titlelen);
         if ($row['color'] != '') {
             $row['title'] = "<font color='" . $row['color'] . "'>" . $row['title'] . "</font>";
         }
         if (ereg('b', $row['flag'])) {
             $row['title'] = "<strong>" . $row['title'] . "</strong>";
         }
         //$row['title'] = "<b>".$row['title']."</b>";
         $row['textlink'] = "<a href='" . $row['filename'] . "'>" . $row['title'] . "</a>";
         $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
         $row['memberurl'] = $GLOBALS['cfg_memberurl'];
         $row['templeturl'] = $GLOBALS['cfg_templeturl'];
         $rsArray[$i] = $row;
         if ($i >= $this->pageSize) {
             break;
         }
     }
     $this->dsql->FreeResult();
     //echo "执行时间:".(Exectime() - $t1);
     return $rsArray;
 }