function GetOptionList($selid=0,$userCatalog=0,$channeltype=0)
{
    global $OptionArrayList,$channels,$dsql;
    
    if(!is_object($dsql)) $dsql = new DedeSql(false);
    
    $dsql->SetQuery("Select ID,typename From #@__channeltype ");
    $dsql->Execute();
    $channels = Array();
    while($row = $dsql->GetObject()) $channels[$row->ID] = $row->typename;
    
    $OptionArrayList = "";
    
    $query = "Select ID,typename,ispart,channeltype,issend From #@__arctype where ispart<>2 And reID=0 order by sortrank asc ";
      
    $dsql->SetQuery($query);
    $dsql->Execute();
    	
    while($row=$dsql->GetObject())
    {
        if($row->channeltype==$channeltype && $row->issend==1){
        	 if($row->ispart==0) $OptionArrayList .= "<option value='".$row->ID."' class='option3'>".$row->typename."</option>\r\n";
           else if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option2'>".$row->typename."</option>\r\n";
        }
        LogicGetOptionArray($row->ID,"─",$channeltype,$dsql);
    }
     
    return $OptionArrayList; 
}
function GetRankName($arcrank)
{
	global $arcArray,$dsql;
	if(!is_array($arcArray)){
		$dsql = new DedeSql(false);
		$dsql->SetQuery("Select * from #@__arcrank");
		$dsql->Execute('rn1');
		while($row = $dsql->GetObject('rn1')){ $arcArray[$row->rank]=$row->membername; }
	}
	if(isset($arcArray[$arcrank])) return $arcArray[$arcrank];
	else return "不限";
}
Exemplo n.º 3
0
require_once dirname(__FILE__) . "/include/common.inc.php";
header("Content-Type: text/html; charset=utf-8");
//header("Content-type:text/vnd.wap.wml");
require_once dirname(__FILE__) . "/include/wap.inc.php";
if (empty($action)) {
    $action = 'index';
}
$dsql = new DedeSql(false);
$cfg_templets_dir = $cfg_basedir . $cfg_templets_dir;
$channellist = '';
$newartlist = '';
$channellistnext = '';
//顶级导航列表
$dsql->SetQuery("Select id,typename From `#@__arctype` where reid=0 And channeltype=1 And ishidden=0 And ispart<>2 order by sortrank");
$dsql->Execute();
while ($row = $dsql->GetObject()) {
    $channellist .= "<a href='wap.php?action=list&amp;id={$row->id}'>{$row->typename}</a> ";
}
//当前时间
$curtime = strftime("%Y-%m-%d %H:%M:%S", time());
$cfg_webname = ConvertStr($cfg_webname);
//主页
/*------------
function __index();
------------*/
if ($action == 'index') {
    //最新文章
    $dsql->SetQuery("Select id,title,pubdate From `#@__archives` where channel=1 And arcrank = 0 order by id desc limit 0,10");
    $dsql->Execute();
    while ($row = $dsql->GetObject()) {
        $newartlist .= "<a href='wap.php?action=article&amp;id={$row->id}'>" . ConvertStr($row->title) . "</a> [" . date("m-d", $row->pubdate) . "]<br />";
Exemplo n.º 4
0
	function checkUser($username,$userpwd)
	{
		//只允许用户名和密码用0-9,a-z,A-Z,'@','_','.','-'这些字符
		$this->userName = ereg_replace("[^0-9a-zA-Z_@\!\.-]",'',$username);
		$this->userPwd = ereg_replace("[^0-9a-zA-Z_@\!\.-]",'',$userpwd);
		$pwd = substr(md5($this->userPwd),0,24);
		$dsql = new DedeSql(false);
		$dsql->SetQuery("Select * From #@__admin where userid='".$this->userName."' limit 0,1");
		$dsql->Execute();
		$row = $dsql->GetObject();
		if(!isset($row->pwd)){
			$dsql->Close();
			return -1;
		}
		else if($pwd!=$row->pwd){
			$dsql->Close();
			return -2;
		}
		else{
			$loginip = GetIP();
			$this->userID = $row->ID;
			$this->userType = $row->usertype;
			$this->userChannel = $row->typeid;
			$this->userName = $row->uname;
			$groupSet = $dsql->GetOne("Select * From #@__admintype where rank='".$row->usertype."'");
			$this->userPurview = $groupSet['purviews'];
			$dsql->SetQuery("update #@__admin set loginip='$loginip',logintime='".strftime("%Y-%m-%d %H:%M:%S",time())."' where ID='".$row->ID."'");
			$dsql->ExecuteNoneQuery();
			$dsql->Close();
			return 1;
		}
	}
Exemplo n.º 5
0
if($dopost=="edit")
{
   $msg = cn_substr($msg,1500);
   $adminmsg = trim($adminmsg);
   if($adminmsg!="")
   {
	  $adminmsg = cn_substr($adminmsg,1500);
	  $adminmsg = str_replace("<","&lt;",$adminmsg);
	  $adminmsg = str_replace(">","&gt;",$adminmsg);
	  $adminmsg = str_replace("  ","&nbsp;&nbsp;",$adminmsg);
	  $adminmsg = str_replace("\r\n","<br/>\n",$adminmsg);
	  $msg = $msg."<br/>\n"."<font color=red>管理员回复: $adminmsg</font>\n";
   }
   $query = "update #@__feedback set username='******',msg='$msg',ischeck=1 where ID=$ID";
   $dsql->SetQuery($query);
   $dsql->ExecuteNoneQuery();
   $dsql->Close();
   ShowMsg("成功回复一则留言!",$ENV_GOBACK_URL);
   exit();
}

$query = "select * from #@__feedback where ID=$ID";
$dsql->SetQuery($query);
$dsql->Execute();
$row = $dsql->GetObject();

require_once(dirname(__FILE__)."/templets/feedback_edit.htm");

ClearAllLink();
?>
Exemplo n.º 6
0
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
     left join #@__admin on #@__admin.ID=#@__log.adminid 
     where 1=1 $where order by #@__log.lid desc";
 
$adminlist = "";
$dsql = new DedeSql(false);
$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";
}
$dsql->Close();    

$dlist = new DataList();
$dlist->Init();
$dlist->pageSize = 20;
$dlist->SetParameter("adminid",$adminid);
$dlist->SetParameter("cip",$cip);
$dlist->SetParameter("dtime",$dtime);
$dlist->SetSource($sql);
include(dirname(__FILE__)."/templets/log_list.htm");
$dlist->Close();

ClearAllLink();
function GetOptionList($selid=0,$userCatalog=0,$channeltype=0)
{
    global $OptionArrayList,$channels,$adminCats,$adminCatstrs,$suserCatalog;
    $suserCatalog = $userCatalog;
    $dsql = new DedeSql(false);
    //读取频道模型信息
    $dsql->SetQuery("Select ID,typename From #@__channeltype ");
    $dsql->Execute();
    $channels = Array();
    while($row = $dsql->GetObject()) $channels[$row->ID] = $row->typename;
    
    $OptionArrayList = "";
    
    $adminCats = array();
    if(!empty($userCatalog) && $userCatalog!='-1')
    {
    	 $adminCats = explode(',',$userCatalog);
    	 $adminCatstrs = $userCatalog;
    }

    if($selid==0)
    {	
        $query = "Select ID,typename,ispart,channeltype From #@__arctype where ispart<2 And reID=0 order by sortrank asc ";
        $dsql->SetQuery($query);
        $dsql->Execute();
       while($row=$dsql->GetObject())
       {
          if(TestHasChannel($row->ID,$channeltype)==0) continue;
          if( TestAdmin() || $userCatalog==-1 )
          {
          	  if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option1'>".$row->typename."(封面频道)</option>\r\n";
              else if($row->ispart==2) $OptionArrayList .= "";
              else if($row->channeltype!=$channeltype) $OptionArrayList .= "<option value='".$row->ID."' class='option2'>".$row->typename."(".$channels[$row->channeltype].")</option>\r\n";
              else $OptionArrayList .= "<option value='".$row->ID."' class='option3'>".$row->typename."</option>\r\n";
          	  LogicGetOptionArray($row->ID,"─",$channeltype,$dsql);
          }else
          {
             if(in_array($row->ID,$adminCats))
             {
             	  if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option1'>".$row->typename."(封面频道)</option>\r\n";
                else if($row->ispart==2) $OptionArrayList .= "";
                else if($row->channeltype!=$channeltype) $OptionArrayList .= "<option value='".$row->ID."' class='option2'>".$row->typename."(".$channels[$row->channeltype].")</option>\r\n";
                else $OptionArrayList .= "<option value='".$row->ID."' class='option3'>".$row->typename."</option>\r\n";
                LogicGetOptionArray($row->ID,"─",$channeltype,$dsql,false);
             }else
             {
             	 $haspurcat = false;
             	 $query = "Select ID From #@__arctype where ispart<2 And reID={$row->ID} order by sortrank asc ";
               $dsql->Execute('sel'.$row->ID,$query);
               while($nrow = $dsql->GetObject('sel'.$row->ID)){
          	      if(in_array($nrow->ID,$adminCats)){ $haspurcat=true; break; }
               }
               if($haspurcat){
             	    $OptionArrayList .= "<option value='".$row->ID."' class='option1'>".$row->typename."(没权限)</option>\r\n";
             	    LogicGetOptionArray($row->ID,"─",$channeltype,$dsql);
             	 }
             }
          }
       }
    }else
    {
    	   $row = $dsql->GetOne("Select ID,typename,ispart,channeltype From #@__arctype where ID='$selid'");
    	   $channeltype = $row['channeltype'];
    	   if($row['ispart']==1) $OptionArrayList .= "<option value='$selid' class='option1' selected>".$row['typename']."(封面频道)</option>\r\n";
         else $OptionArrayList .= "<option value='$selid' class='option3' selected>".$row['typename']."</option>\r\n";
         LogicGetOptionArray($selid,"─",$channeltype,$dsql,false);
    }
    return $OptionArrayList; 
	}