⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.php

📁 下在管理系统2.0
💻 PHP
字号:
<?php
class CModule extends CUserApp
{
  function execute()
  {
    $this->showForm();
  }

  function showForm()   
  {
      $aSoft = new CSoft;
	  $aSoft->open();
	  if($this->input[keyword] != "") $posList = $aSoft->search($this->input[keyword], $this->input[searchtype], $this->input[name], $this->input[brief]);
      else $posList = $aSoft->FilterByClass($this->input[categoryid], $this->input[classid], "1",  -1);

	  $num = count($posList);
	  $aSoft->close();
      $header = $this->Header("软件列表");
	  $hot = $this->showDownTop($this->input[categoryid], $this->input[classid]);
	  $new = $this->showNew($this->input[categoryid], $this->input[classid]);
	  $comment = $this->showComment($this->input[categoryid], $this->input[classid]);
	  $banner = $this->printBanner($this->input[categoryid], $this->input[classid], "index.php?modules=list");
	  $pages = $this->getPages($num, $this->input[setpage], $this->input[setid], "index.php?modules=list&categoryid={$this->input[categoryid]}&classid={$this->input[classid]}");
	  $objects = $this->showObjects();
	  eval("\$this->output(\"".$this->getTemplate("list")."\");");
  }

function showObjects()
{
  $aSoft = new CSoft;
  $aSoft->open();
  $aClass = new CClass;
  $aClass->open();
  $aCategory = new CCategory;
  $aCategory->open();

  if($this->input[keyword] != "") $posList = $aSoft->search($this->input[keyword], $this->input[searchtype], $this->input[name], $this->input[brief]);
  else $posList = $aSoft->FilterByClass($this->input[categoryid], $this->input[classid], "1",  -1);

  $num = count($posList);
  if ($num <= 0) $result = "<center>未找到任何记录<br><br>";

  $setid = $this->input[setid];
  if (empty($setid)) $setid = 0;

  $realnum = $num - $setid;
  for($i = 0; $i < min($realnum, $this->set[listnumPage]); $i++)
  {
    // 获取分类名称
    $aSoft->setAbsolutePosition($posList[$i + $setid]);
    $id = $posList[$i + $setid];
    $aClass->find($aSoft->class_id);
    $type2 = $aClass->class_name;
    $sort1id = $aClass->class_category_id;

    $aCategory->find($sort1id);
    $type1 = $aCategory->category_name;

    $date = date($this->set[dateformat],$aSoft->updatetime);

    // 判断简介字符数
    $brief_len = strlen($aSoft->brief);
    if ($brief_len <= $list_brief_num) $brief = $aSoft->brief;
    else $brief = substr($aSoft->brief,"0",$this->set[listnumBriefChar]); 
    $parity= 0;
    for($j=0;$j<$this->set[listnumBriefChar];$j++)
	{ 
      $temp_str=substr($brief,$j,1); 
      if(Ord($temp_str)>127) $parity+=1; 
    } 
    if($parity%2==1) $brief=substr($brief,0,($this->set[listnumBriefChar]-1))."..."; 
    else $brief=substr($brief,0,$this->set[listnumBriefChar])."..."; 
    eval ("\$result .= \"".$this->getTemplate("listObject")."\";");
  } // while
  return $result;
}

}//end class

php?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -