php基本語句
<?php echo $cfg_copyright ?>
<?php require_once(dirname(__FILE__).‘/include/config.inc.php‘); ?>
<!-- 獲取列表單項ID -->
<?php echo $gourl; ?>
<?php require_once(‘header.php‘); ?>
<!-- 網站標題 -->
<?php echo GetHeader(); ?>
<?php echo ReStrLen($row[‘title‘],30); ?>
<?php echo GetHeader(1,$cid); ?>
<?php echo info(2)?>
<!-- 獲取目前為止 -->
<?php echo GetPosStr($cid); ?>
<!-- 手機版 鏈接地址地址 -->
?m=cpzx&cid=19
<!--版權所有-->
<?php echo $cfg_copyright; ?>
<!--icp-->
<?php echo $cfg_icp; ?>
<td height="105" align="center" valign="middle" class="end">地址:<?php echo $cfg_adr; ?> 郵編:<?php echo $cfg_zipcode; ?> 版權所有:<?php echo $cfg_copyright; ?> <br />
<?php echo $cfg_icp; ?></td>
<?php echo ReStrLen($row[‘title‘],10); ?>
<?php echo $row[‘title‘]; ?>
<!-- 獲取年月日時間 -->
<?php echo GetDateMk($row[‘posttime‘]); ?>
<!-- 獲取年月日時間 -->
<?=MyDate("Y-m-d H:i:s",$row[‘posttime‘]);?>
(classid=$cid OR parentstr LIKE ‘%,$cid,%‘)
<!-- 獲取欄目標題 -->
<?php echo GetCatName($cid); ?>
<!-- 獲取分頁信息 -->
<?php echo $dopage->GetList(); ?>
<!-- 獲取合同號 -->
<?php echo microtime_format("YmdHisx",ExecTime())?>
<?php echo ReStrLen($row[‘description‘],34); ?><!--摘要-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"><!--手機版自動適應-->
<!-- 獲取碎片信息
@param $id int 碎片ID
@param $t int 調用的內容 0為內容 1為標識名稱 2為縮略圖 3為跳轉連接
-->
<?=GetFragment(2,2);?>
<!-- 獲取配置文件信息 -->
<?php echo $cfg_copyright ?>
if($(‘#checkbox‘).attr(‘checked‘) != ‘checked‘){...}
<!-- 自動攜帶ID-->
<?
$cid = empty($cid) ? 9 : intval($cid);
error_reporting(0);//屏蔽notice錯誤
?>
<!-- 導航欄 -->
<?php
$sql = "SELECT * FROM `#@__infoclass` WHERE parentid=5 AND checkinfo=true ORDER BY orderid ASC";
$dopage->GetPage($sql,9);
while($row = $dosql->GetArray())
{
?>
<li >
<h5><span></span><a href="product.php?cid=<?php echo $row[‘id‘]; ?>" title="<?php echo $row[‘classname‘]?>"><?php echo $row[‘classname‘]?></a></h5>
<div class="isClassTwo" >
<dl>
</dl>
</div>
</li>
<?php
}
?>
<!-- -->
//獲取縮略圖地址
if($row[‘picurl‘]!=‘‘)
$picurl = $row[‘picurl‘];
else
$picurl = ‘templates/default/images/nofoundpic.gif‘;
<!-- 列表頁查詢 -->
<?php
$dopage->GetPage("SELECT * FROM `#@__infolist` WHERE classid=$cid AND delstate=‘‘ AND checkinfo=true ORDER BY orderid DESC",15);
while($row = $dosql->GetArray())
{
if($row[‘linkurl‘]==‘‘ and $cfg_isreurl!=‘Y‘) $gourl = ‘newslistshow.php?cid=‘.$row[‘classid‘].‘&id=‘.$row[‘id‘];
else if($cfg_isreurl==‘Y‘) $gourl = ‘newslistshow-‘.$row[‘classid‘].‘-‘.$row[‘id‘].‘-1.html‘;
else $gourl = $row[‘linkurl‘];
$row2 = $dosql->GetOne("SELECT `classname` FROM `#@__infoclass` WHERE `id`=".$row[‘classid‘]);
if($cfg_isreurl!=‘Y‘) $gourl2 = ‘news.php?cid=‘.$row[‘classid‘];
else $gourl2 = ‘news-‘.$row[‘classid‘].‘-1.html‘;
?>
<li><a href="<?php echo $gourl; ?>" title="<?php echo $row[‘title‘]; ?> "><span class="floatleft"><?php echo ReStrLen($row[‘title‘],16); ?></span><span class="floatright"><?php echo GetDateMk($row[‘posttime‘]); ?></span></a></li>
<?php
}
?>
<?php
if(!empty($tid))
$sql = "SELECT * FROM `#@__goods` WHERE (classid=$cid OR parentstr LIKE ‘%,$cid,%‘) AND `typeid`=$tid AND delstate=‘‘ AND checkinfo=true ORDER BY orderid DESC";
else
$sql = "SELECT * FROM `#@__goods` WHERE (classid=$cid OR parentstr LIKE ‘%,$cid,%‘) AND delstate=‘‘ AND checkinfo=true ORDER BY orderid DESC";
$dopage->GetPage($sql,9);
while($row = $dosql->GetArray())
{
if($row[‘picurl‘] != ‘‘) $picurl = $row[‘picurl‘];
else $picurl = ‘templates/default/images/nofoundpic.gif‘;
if($row[‘linkurl‘]==‘‘ and $cfg_isreurl!=‘Y‘) $gourl = ‘goodsshow.php?cid=‘.$row[‘classid‘].‘&tid=‘.$row[‘typeid‘].‘&id=‘.$row[‘id‘];
else if($cfg_isreurl==‘Y‘) $gourl = ‘goodsshow-‘.$row[‘classid‘].‘-‘.$row[‘typeid‘].‘-‘.$row[‘id‘].‘-1.html‘;
else $gourl = $row[‘linkurl‘];
?>
<li> <a href="<?php echo $gourl; ?>" class="img"><img src="<?php echo $picurl; ?>" /></a>
<div class="info"><a href="<?php echo $gourl; ?>"><?php echo ReStrLen($row[‘title‘],20); ?></a>
<p><span class="fl">價格 <i class="lt"><?php echo $row[‘marketprice‘]; ?></i><i><?php echo $row[‘salesprice‘]; ?></i></span><span class="fr">瀏覽<i class="hits"><?php echo $row[‘hits‘]; ?></i></span></p>
</div>
</li>
<?php
}
?>
<?php
$dosql->Execute("SELECT * FROM `#@__infoimg` WHERE classid=13 AND delstate=‘‘ AND checkinfo=true ORDER BY orderid DESC LIMIT 0,4");
while($row = $dosql->GetArray())
{
if($row[‘linkurl‘] != ‘‘)$gourl = $row[‘linkurl‘];
else $gourl = ‘javascript:;‘;
?>
<li><a href="<?php echo $gourl; ?>"><img src="<?php echo $row[‘picurl‘]; ?>" alt="<?php echo $row[‘title‘]; ?>" /></a></li>
<?php
}
?>
<?php
$dosql->Execute("SELECT * FROM `#@__weblink` WHERE classid=1 AND checkinfo=true ORDER BY orderid,id DESC");
while($row = $dosql->GetArray())
{
?>
<a href="<?php echo $row[‘linkurl‘]; ?>" target="_blank"><?php echo $row[‘webname‘]; ?></a>
<?php
}
?>
/*分頁樣式*/
.page_info{text-align:center;margin-top:10px;color:#333;}
.page_info span{padding:0 2px;font-weight:bold;}
.page_list{height:24px;line-height:24px;text-align:center;letter-spacing:0;font-family:"Arial Black";font-size:10px;margin-top:20px;}
.page_list a{display:inline-block;color:#898989;border:1px solid #e8e8e8;background:#f8f8f8;text-align:center;padding:0 8px;margin:0 1px;}
.page_list a:hover{color:#fff;border:1px solid #898989;background:#898989;}
.page_list a.on{color:#333;border:1px solid #ccc;background:#E5EDF2;}
/*分頁樣式*/
.page_info{text-align:center;margin-top:10px;color:#333;}
.page_info span{padding:0 2px;font-weight:bold;}
.page_list{height:24px;line-height:24px;text-align:center;letter-spacing:0;font-family:"Arial Black";font-size:12px;margin-top:20px;}
.page_list a{display:inline-block;color:#898989;border:1px solid #e8e8e8;background:#f8f8f8;text-align:center;padding:0 8px;margin:0 1px;}
.page_list a:hover{color:#fff;border:1px solid #898989;background:#898989;}
.page_list a.on{color:#333;border:1px solid #ccc;background:#E5EDF2;}
<?php
$row = $dosql->GetOne("SELECT * FROM `#@__infoclass` WHERE id = $cid AND checkinfo = ‘true‘ ORDER BY orderid ASC");
if(!empty($row[‘id‘]))
{
?>
<?php if($row[‘infotype‘] == ‘0‘){?>
<!-- 裝飾器樣式開始 -->
<p><?php echo Info($cid);?></p>
<!-- 裝飾器樣式結束 -->
<?php }else if($row[‘infotype‘] == ‘1‘){?>
<!-- 裝飾器樣式開始 -->
<?php
$sql = "SELECT * FROM `#@__infolist` WHERE (classid=$cid OR parentstr LIKE ‘%,$cid,%‘) AND delstate=‘‘ AND checkinfo=true ORDER BY orderid DESC";
$dopage->GetPage($sql,20);
while($row = $dosql->GetArray())
{
if($row[‘picurl‘] != ‘‘) $picurl = $row[‘picurl‘];
else $picurl = ‘templates/default/images/nofoundpic.gif‘;
if($row[‘linkurl‘]==‘‘ and $cfg_isreurl!=‘Y‘) $gourl = ‘newsshow.php?cid=‘.$row[‘classid‘].‘&id=‘.$row[‘id‘];
else if($cfg_isreurl==‘Y‘) $gourl = ‘newsshow-‘.$row[‘classid‘].‘-‘.$row[‘id‘].‘-1.html‘;
else $gourl = $row[‘linkurl‘];
?>
<li class="content column-num1">
<div class="pic-module">
<div class="pic"> <a href="<?php echo $gourl; ?>" target="_blank"> <img src= "" id= "FrontProducts_list01-1443145223139_70" alt= "" onerror= "this.src=‘/images/common/noimage.jpg‘" /></a> </div>
<span class="lab"> </span> </div>
<div class="pro-module">
<ul class="basic">
<li class="code">
<h1> <span>名稱:</span>
<strong> <a href="<?php echo $gourl; ?>" target="_blank"> <?php echo ReStrLen($row[‘title‘],30); ?></a> </strong>
</h1>
</li>
</ul>
<p class="buttonP"> </p>
<div class="describe htmledit"> <span> 詳細介紹:</span> <?php echo ReStrLen(ClearHtml($row[‘content‘]),80); ?></div>
</div>
</li>
<li class="clearBoth"></li>
<?php }?>
<?php echo $dopage->GetList(); ?>
<!-- 裝飾器樣式結束 -->
<?php }else if($row[‘infotype‘] == ‘2‘){?>
<!-- 裝飾器樣式開始 -->
<?php
$sql = "SELECT * FROM `#@__infoimg` WHERE (classid=$cid OR parentstr LIKE ‘%,$cid,%‘) AND delstate=‘‘ AND checkinfo=true ORDER BY orderid DESC";
$dopage->GetPage($sql,12);
while($row = $dosql->GetArray())
{
if($row[‘picurl‘] != ‘‘) $picurl = $row[‘picurl‘];
else $picurl = ‘templates/default/images/nofoundpic.gif‘;
if($row[‘linkurl‘]==‘‘ and $cfg_isreurl!=‘Y‘) $gourl = ‘newsshow.php?cid=‘.$row[‘classid‘].‘&id=‘.$row[‘id‘];
else if($cfg_isreurl==‘Y‘) $gourl = ‘newsshow-‘.$row[‘classid‘].‘-‘.$row[‘id‘].‘-1.html‘;
else $gourl = $row[‘linkurl‘];
?>
<li class="content column-num3">
<div class="pic-module">
<div class="pic"> <a href="<?php echo $gourl; ?>" target="_blank"> <img src= "<?php echo $picurl; ?>" id= "FrontProducts_list01-1443142589760_31" alt= "" onerror= "this.src=‘/images/common/noimage.jpg‘" /></a> </div>
</div>
<div class="pro-module">
<ul class="basic">
<li class="code">
<h1> <span>名稱:</span>
<strong> <a href="<?php echo $gourl; ?>" target="_blank"> <?php echo ReStrLen($row[‘title‘],10); ?></a> </strong> </h1>
</li>
</ul>
<p class="buttonP"> </p>
</div>
</li>
<?php
}
?>
<?php echo $dopage->GetList(); ?>
<!-- 裝飾器樣式結束 -->
<?php }} ?>
<!-- 計數器 示例
-->
<?php
$sql = "SELECT * FROM `#@__infoimg` WHERE classid=47 AND checkinfo=true ORDER BY orderid desc";
$dopage->GetPage($sql,6);
$i=0;
while($row = $dosql->GetArray())
{
$i++;
//var_dump($row);
?>
<li index=<?php echo $i; ?> > <img width="385" height="260" src="<?php echo $row[‘picurl‘] ?>" />
<div class="txt1">
<h3><a href="article/detail/id/59.html"><img src="public/tu/tu5.png"></a></h3>
</div>
</li>
<?php } ?>
<script>
$(‘li‘).each(function(){
if($(this).attr(‘index‘)%3 == 0){
$(this).attr(‘style‘,‘margin-right:0px;‘);
}
});
</script>
<?php if(!defined(‘IN_PHPMYWIND‘)) exit(‘Request Error!‘);
/*
**************************
(C)2010-2014 lnasp.com
**************************
*/
//數據庫服務器
$db_host = ‘121.42.155.24‘;
//數據庫用戶名
$db_user = ‘demo1‘;
//數據庫密碼
$db_pwd = ‘gts7890‘;
//數據庫名
$db_name = ‘sqldemo1‘;
//數據表前綴
$db_tablepre = ‘pmw_‘;
//數據表編碼
$db_charset = ‘utf8‘;
?>
<?php echo ReStrLen($row[‘title‘],30); ?>
//組圖
<?php
$picarr = unserialize($row[‘picarr‘]);
foreach($picarr as $v)
{
$picarrSmall = explode(‘,‘,$v);
?>
<img style="width:350px;height:350px" src="<?php echo $picarrSmall[0]; ?>" class="img-responsive" /></a>
<?php } ?>
target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=<?=GetFragment(15,3);?>&site=qq&menu=yes"
<?php echo ReStrLen($row[‘title‘],20); ?>
<?php
if($rowc[‘infotype‘] == ‘1‘){
//獲取上一篇信息
$r = $dosql->GetOne("SELECT * FROM `#@__infolist` WHERE classid=".$row[‘classid‘]." AND orderid<".$row[‘orderid‘]." AND delstate=‘‘ AND checkinfo=true ORDER BY orderid DESC");
if($r < 1)
{
echo ‘<div>上一篇:已經沒有了</div>‘;
}
else
{
if($cfg_isreurl != ‘Y‘)
$gourl = ‘show.php?cid=‘.$row2[‘classid‘].‘&id=‘.$row2[‘id‘];
else
$gourl = ‘show-‘.$row2[‘classid‘].‘-‘.$row2[‘id‘].‘-1.html‘;
echo ‘<div>上一篇:<a href="‘.$gourl.‘">‘.$r[‘title‘].‘</a></div>‘;
}
//獲取下一篇信息
$r = $dosql->GetOne("SELECT * FROM `#@__infolist` WHERE classid=".$row[‘classid‘]." AND orderid>".$row[‘orderid‘]." AND delstate=‘‘ AND checkinfo=true ORDER BY orderid ASC");
if($r < 1)
{
echo ‘<div>下一篇:已經沒有了</div>‘;
}
else
{
if($cfg_isreurl != ‘Y‘)
$gourl = ‘show.php?cid=‘.$r[‘classid‘].‘&id=‘.$r[‘id‘];
else
$gourl = ‘show-‘.$r[‘classid‘].‘-‘.$r[‘id‘].‘-1.html‘;
echo ‘<div>下一篇:<a href="‘.$gourl.‘">‘.$r[‘title‘].‘</a></div>‘;
}
}else if($rowc[‘infotype‘] == ‘2‘){
//獲取上一篇信息
$r = $dosql->GetOne("SELECT * FROM `#@__infoimg` WHERE classid=".$row[‘classid‘]." AND orderid<".$row[‘orderid‘]." AND delstate=‘‘ AND checkinfo=true ORDER BY orderid DESC");
if($r < 1)
{
echo ‘<li>上一篇:已經沒有了</li>‘;
}
else
{
if($cfg_isreurl != ‘Y‘)
$gourl = ‘show.php?cid=‘.$r[‘classid‘].‘&id=‘.$r[‘id‘];
else
$gourl = ‘show-‘.$r[‘classid‘].‘-‘.$r[‘id‘].‘-1.html‘;
echo ‘<li>上一篇:<a href="‘.$gourl.‘">‘.$r[‘title‘].‘</a></li>‘;
}
//獲取下一篇信息
$r = $dosql->GetOne("SELECT * FROM `#@__infoimg` WHERE classid=".$row[‘classid‘]." AND orderid>".$row[‘orderid‘]." AND delstate=‘‘ AND checkinfo=true ORDER BY orderid ASC");
if($r < 1)
{
echo ‘<li>下一篇:已經沒有了</li>‘;
}
else
{
if($cfg_isreurl != ‘Y‘)
$gourl = ‘show.php?cid=‘.$r[‘classid‘].‘&id=‘.$r[‘id‘];
else
$gourl = ‘show-‘.$r[‘classid‘].‘-‘.$r[‘id‘].‘-1.html‘;
echo ‘<li>下一篇:<a href="‘.$gourl.‘">‘.$r[‘title‘].‘</a></li>‘;
}
}
?>
<?php
//判斷顯示縮略圖或組圖
if(!empty($row[‘picarr‘]))
{
$picarr = unserialize($row[‘picarr‘]);
$picarrBig = explode(‘,‘,$picarr[0]);
?>
<?php
$i=1;
foreach($picarr as $v)
{
$picarrSmall = explode(‘,‘,$v);
//var_dump($picarrSmall);
?>
<li <?php if($i==1){echo ‘style="filter: 100; opacity: 1;"‘;} ?>><img src="<?php echo $picarrSmall[0]; ?>"></li>
<?php $i++;}} ?>
/*
* 函數說明:欄目縮略圖調用
*
* @access public
* @param $classid int 類別ID
* @return string 返回單頁縮略圖地址
*/
function ClassPic($cid=0)
{
global $dosql;
$r = $dosql->GetOne("SELECT `picurl` FROM `#@__infoclass` WHERE `id`=$cid");
if(isset($r) && is_array($r))
{
return $r[‘picurl‘];
}
}
/*
* 函數說明:獲取當前文章名稱
*
* @access public
* @param $cid int 欄目id
* @return string 返回欄目名稱
*/
function GetListName($id=0)
{
global $dosql;
$r = $dosql->GetOne("SELECT `title` FROM `#@__infolist` WHERE `id`=$id");
if(isset($r[‘title‘]))
return $r[‘title‘];
else
return ‘‘;
}
/*
* 函數說明:獲取當前友情鏈接欄目名稱
*
* @access public
* @param $cid int 欄目id
* @return string 返回欄目名稱
*/
function GetWebName($cid=0)
{
global $dosql;
$r = $dosql->GetOne("SELECT `classname` FROM `#@__weblinktype` WHERE `id`=$cid");
if(isset($r[‘classname‘]))
return $r[‘classname‘];
else
return ‘‘;
}
php基本語句