📄 misc.php
字号:
<?php
/***********************************************
misc.php
Version : 1.2
Author : Tracemouse (tracemouse@msn.com)
Copyright: www.vitci.com
Writed : 2004/01/16
Modified : 2004/04/14
************************************************/
require "./include/base.php";
if($action == 'newp')
{
$condition="ORDER BY posttime DESC";
$nav .= SEPARATER.$language['product_new'];
}
elseif($action == 'hotp')
{
$condition="order by viewtimes desc";
$nav .= SEPARATER.$language['product_vts'];
}
elseif($action == 'recp')
{
$query=$db->query("select productid from $table_recommend",1);
if($dbq_rec = $db->fetch_array($query))
{
$condition="where productid in (".$dbq_rec['productid'];
while($dbq_rec = $db->fetch_array($query))
{
$condition.=",".$dbq_rec['productid'];
}
$condition.=") order by productid";
}
else
{
$condition="where productid = 0";
}
$nav .= SEPARATER.$language['recommend'];
}
elseif($action == 'allp')
{
$condition="";
$nav .= SEPARATER.$language['allproduct'];
}
$sqlstr="select count(*) from $table_products ".$condition;
$query=$db->query($sqlstr);
$count=$db->result($query,0);
if ($count <= $perpage)
$maxpage=1;
else
{
$maxpage=($count - ($count % $perpage))/$perpage;
$maxpage=$maxpage+1;
}
if(!empty($page))
{
$start_limit = ($page-1) * $perpage;
$startnum = ($page-1) * $perpage + 1;
$endnum = $page * $perpage;
}
else
{
$startnum = 1;
$endnum = $perpage;
$start_limit = 0;
$page = 1;
}
$multipage = multi($count, $perpage, $page, "misc.php?action=$action&hideimg=$hideimg");
$productlist = array();
$sqlstr="select * from $table_products ".$condition;
$sqlstr .= " limit $start_limit,$perpage";
$query = $db->query($sqlstr);
$productnum=0;
while($dbq_rec = $db->fetch_array($query))
{
$productnum=$productnum+1;
$dbq_rec['img']=empty($dbq_rec['smallimg'])?IMGDIR."/noimg.gif":$dbq_rec['smallimg'];
$dbq_rec['subject'] = substr($dbq_rec['notes'],0,101)."...";
$productlist[] = $dbq_rec;
}
include template('productlist');
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -