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

📄 show.php

📁 下在管理系统2.0
💻 PHP
字号:
<?
class CModule extends CUserApp
{
  function execute()
  {
    if($this->input[action] == "sendMail") $this->sendEmail();
	elseif($this->input[action] == "showEmail") $this->showEmail();
	elseif($this->input[down]) $this->downObject();
	else $this->showObject();
  }

  function showEmail()
  {
    eval("\$this->output(\"".$this->getTemplate("sendEmail")."\");");
  }

  function sendEmail()
  {
    if(empty($this->input[to_email]) || empty($this->input[subject]) || empty($this->input[content])) $this->showMsg("[收信人Email][Email主题][Email内容]不可为空!!", "");
    if(!eregi(".*\@.*\..*",$this->input[to_email]) && $this->input[to_email] != "") $this->showMsg("您的Email格式错误!", "");
    @mail($this->input[to_email], $this->input[subject], $this->input[content], "From:{$this->input[from_name]}({$this->input[from_email]})");
	$this->showMsg("恭喜,您的Email已成功发送!", "");
  }

  function showObject()
  {
    $aObject = new CSoft;
	$aObject->open();
	if(!$aObject->find($this->input[id])) $this->showMsg("出错:您要查看的目标ID非法!", "");
	$id = $aObject->getAbsolutePosition();
	//查看次数加一
	$this->plugNum("VIEW", $aObject);
    // 获取分类名称
    $aClass = new CClass;
    $aClass->open();
    if(!$aClass->find($aObject->class_id)) errorview("小类ID非法!");
    $type2 = $aClass->class_name;
    $sort1id = $aClass->class_category_id;

    $aCategory = new CCategory;
    $aCategory->open();
    if(!$aCategory->find($sort1id)) errorview("大类ID非法!");
    $type1 = $aCategory->category_name;
    $aClass->close();
    $aCategory->close();
	//图片处理
    $img = $aObject->img;
	if(!Empty($img)) $img = "<a href={$aObject->img} target=_blank><img src={$this->tplPath}/images/img.gif title=点击查看图片 border=0></a>";
    //日期处理
	$date = date($this->set[dateformat], $aObject->updatetime);
	//简介处理
    if (empty($aObject->brief)) $brief = "无";
    else $brief = $aObject->brief;
    $brief = str_replace("\n", "\n<br>\n", $brief);
    $brief = str_replace("  ", "\n &nbsp;\n", $brief);
     //下载处理
     if (!empty($aObject->down1)) $downs .= "<a href='index.php?modules=show&id=".$id."&down=1'>下载1</a>\n";
     if (!empty($aObject->down2)) $downs .= "<a href='index.php?modules=show&id=".$id."&down=2'>下载2</a>\n";
     if (!empty($aObject->down3)) $downs .= "<a href='index.php?modules=show&id=".$id."&down=3''>下载3</a>\n";
     if (!empty($aObject->down4)) $downs .= "<a href='index.php?modules=show&id=".$id."&down=4'>下载4</a>\n";
     if (!empty($aObject->down5)) $downs .= "<a href='index.php?modules=show&id=".$id."&down=5'>下载5</a>\n";
	 //送给朋友/错误报告处理
	 $errmsg = "您好,这是一封来自pkyDown的错误报告:";
     $errmsg.= "{$aObject->name}的下载连接有问题,现无法下载!";
     $errmsg.="请您速由:{$this->set[sysPath]}/index.php?modules=show查看。";

     $tellmsg = "您好,这是一封来自pkyDown的推荐Email:";
     $tellmsg.= "您的朋友为向您推荐一款为{$aObject->name}的软件,非常棒!";
     $tellmsg.="请您速到:{$this->set[sysPath]}/index.php?modules=show中下载。";

     $errorurl = "[<a href='javascript:;'onClick='javascript:window.open(\"index.php?modules=show&action=showEmail&to_email={$this->set[mgrEmail]}&subject=pkyDown下载出错报告&content=$errmsg\", \"错误报告\",\"width=418,height=450,resizable=1,scrollbars=yes,menubar=no,status=no\")'>出错报告</a>]</a>";
    
	 $tellurl = "&nbsp;&nbsp;[<a href='javascript:;'onClick='javascript:window.open(\"index.php?modules=show&action=showEmail&subject=pkyDown软件推荐&content=$tellmsg\", \"送给朋友\",\"width=418,height=450,resizable=1,scrollbars=yes,menubar=no,status=no\")'>送给朋友</a>]\n";
    
	  $reviewurl =  "&nbsp;&nbsp;[<a href='javascript:;'onClick='javascript:window.open(\"index.php?modules=review&id=$id\", \"送给朋友\",\"width=418,height=450,resizable=1,scrollbars=yes,menubar=no,status=no\")'>相关评论</a>]\n";

     $header = $this->Header("查看软件");
     $banner = $this->printBanner($aObject->category_id, "", "index.php?modules=list");
	 $hot = $this->showDownTop($aObject->category_id, $aObject->class_id);
	 $relatives = $this->getRelatives($aObject->keywords);
     eval("\$this->output(\"".$this->getTemplate("show")."\");");
   }

  function getRelatives($keywords)
  {
	  $aSoft = new CSoft;
      $aSoft->open();
      $posList = $aSoft->RelativeSoft($keywords);
	  $box_title = "相关软件";

      for($i = 0; $i< count($posList); $i ++)
      {
         $serial = $i + 1;
         $aSoft->setAbsolutePosition($posList[$i]);   
         $box_content .= "$serial.<a href=index.php?modules=show&id=$posList[$i] target = _blank>$aSoft->name</a>(<font color = red>$aSoft->downnum</font>)<br>";
      }
      $aSoft->close();
	  eval ("\$result .= \"".$this->getTemplate("box")."\";");
	  return $result;
	}

	function plugNum($mod, &$aObject)
	{
	  if($mod == "VIEW") $aObject->viewnum++;
	  elseif($mod == "DOWN") 
	  {
	    //下载总数加一
		$aObject->downnum++;
         $now_time=date("m").date("d");
         if ($now_time == $aObject->lastdowntime) $aObject->daydowntimes++;
		 //当天第一次
        else 
        {
          $aObject->lastdowntime = $now_time;
          $aObject->daydowntimes = "1";
        }
	  }
	  $aObject->update();
	}

  function downObject()
  {
    $aObject = new CSoft;
	$aObject->open();
	if(!$aObject->find($this->input[id])) showMsg("出错:您要查看的目标ID非法!", "");
	//下载次数加一
	$this->plugNum("DOWN", $aObject);
    $downid = "down".$this->input[down];
	$downurl = $aObject->$downid;
    header ("Location:".$downurl);
  }

}//end class

?>

⌨️ 快捷键说明

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