头部文件调用
<?php require_once('header.php'); ?>
底部文件
<?php require_once('footer.php'); ?>
关于我们 图片调用
<?php
$row = $dosql->GetOne("SELECT * FROM `#@__info` WHERE id='3' ");
<img src="<?php echo $row['picurl']; ?>" alt="<?php echo $row['pictitle']; ?>" />
?>
头部banner调用
<?php
$dosql->Execute("SELECT * FROM `#@__infoimg` WHERE classid=13 AND delstate='' AND checkinfo=true ORDER BY orderid DESC LIMIT 0,5");
while($row = $dosql->GetArray())
{
if($row['linkurl'] != '')$gourl = $row['linkurl'];
else $gourl = 'javascript:;';
?>
<li><img src="<?php echo $row['picurl']; ?>" width="1400" height="385" /></li>
<?php
}
?>
热门搜索调用$cfg_homermss
<b>热门搜索:</b><?php echo $cfg_homermss; ?>
<b>热门搜索:</b><strong>哈尔滨搬家哪家好</strong>|<strong>哈尔滨搬家公司哪家好</strong>|<strong>哈尔滨搬家公司电话</strong>|<strong>哈尔滨搬家公司哪家便宜</strong>
网站标题关键词 描述调用
<?php echo GetHeader(); ?>
index.php 头部关键词$cfg_hometitle;
<?php echo $cfg_homeif; ?>
<title><?php echo $cfg_hometitle; ?> - <?php echo $cfg_webname; ?><?php echo $cfg_weburl; ?></title>
<meta name="keywords" content="<?php echo $cfg_keyword; ?>" />
<meta name="description" content="<?php echo $cfg_description; ?>" />
底部信息调用
<?php echo $cfg_copyright ?>
网站公告
<?php echo Info(1); ?>
首页联系我们(注:联系我们用contact.php contact.html )
<?php
if($cfg_isreurl!='Y') $gourl = 'contact.php';
else $gourl = 'contact.html';
echo Info(10,214,$gourl);
?>
热门标签
<?php echo $cfg_keyword; ?>
服务热线
<?php echo $cfg_hotline; ?>
友情链接调用(注意ID ? classid=1 ?1是台栏目的id)
<?php
$dosql->Execute("SELECT * FROM `#@__weblink` WHERE classid=1 AND checkinfo=true ORDER BY orderid,id DESC");
while($row = $dosql->GetArray())
{
?><br><br>
首页图片滚动调用
<?php
$dosql->Execute("SELECT * FROM `#@__infoimg` WHERE classid=8 AND and delstate is NULL AND checkinfo=true ORDER BY orderid DESC LIMIT 0,30");
while($row = $dosql->GetArray())
{
if($row['linkurl']=='' and $cfg_isreurl!='Y') $gourl = 'product.php?cid='.$row['classid'].'&id='.$row['id'];
else if($cfg_isreurl=='Y') $gourl = 'product-'.$row['classid'].'-'.$row['id'].'-1.html';
else $gourl = $row['linkurl'];
?>
<li>
<a href="<?php echo $gourl; ?>" class="imga">
<img src="<?php echo $row['picurl']; ?>" alt="<?php echo $row['title']; ?>" />
</a>
<a href="<?php echo $gourl; ?>" class="titlea">
<?php echo $row['title']; ?>
</a>
</li>
<?php
}
?>
首页文章调用
<ul>
<?php $dosql->Execute("SELECT * FROM `#@__infolist` WHERE (classid=4 or parentid=4) AND delstate='' AND checkinfo=true ORDER BY orderid DESC LIMIT 0,6");
while($row = $dosql->GetArray())
{
//获取链接地址
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>
<a href="<?php echo $gourl; ?>" class="newsa">
<?php echo ReStrLen($row['title'],25); ?>
</a>
<span id="newsspan">【<?php echo MyDate('m-d', $row['posttime']); ?>】</span>
</li>
<?php
}
?>
</ul>
新闻头条
<?php $dosql->Execute("SELECT * FROM `#@__infolist` WHERE (classid=4 or parentid=4) AND delstate='' AND checkinfo=true And flag like 'h%' ORDER BY orderid DESC LIMIT 0,1");
$row1 = $dosql->GetArray()?>
<span id="_span"><a href="newsshow.php?cid=<?php echo $row1['classid'].'&id='.$row1['id'] ?>" title="<?=$row1['title']?>"><?php echo ReStrLen($row1['title'],11);?></a></span>
<div id="_spannr">
<?php echo ReStrLen($row1['description'],50);?>
</div>
头条后文章调用
<?php
$rid=$row1['id'];
$dosql->Execute("SELECT * FROM `#@__infolist` WHERE (classid=4 or parentid=4) AND delstate='' AND checkinfo=true And id != $rid ORDER BY orderid DESC LIMIT 0,3");
while($row = $dosql->GetArray())
{
//获取链接地址
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>
<a href="<?php echo $gourl; ?>" class="newslia">
<?php echo ReStrLen($row['title'],25); ?>
</a>
【<?php echo MyDate('m-d', $row['posttime']); ?>】
</li>
<?php
}
?>
子菜单的调用(二级栏目的调用)
parentid = ‘4’ 换成自己想要调取的id
<ul>
<?php
$dosql->Execute("SELECT * FROM `#@__infoclass` WHERE parentid = '4' AND checkinfo=true ORDER BY orderid aSC");
while($row = $dosql->GetArray()){
?>
<li>
<a href="<?php echo $row['linkurl']; ?>">
<?php echo $row['classname']; ?></a>
</li>
<?php } ?>
</ul>
列表信息的调用
<ul>
<?php
$dosql->Execute("SELECT * FROM `#@__infolist` WHERE (classid=14 or parentid=14) AND delstate='' AND checkinfo=true ORDER BY posttime DESC LIMIT 1,3");
while ($row = $dosql->GetArray()) {
if ($row['linkurl'] == '') $gourl = 'mediaDetail.php?cid=' . $row['classid'] . '&id=' . $row['id'];
else $gourl = $row['linkurl'];
?>
<li>
<a href="<?php echo $gourl; ?>">
<span><?php echo ReStrLen($row['title'], 25); ?>... </span>
<span><b>></b><?php echo GetDateMk($row['posttime']); ?></span>
</a>
</li>
<?php
}
?>
</ul>
单条记录的调用
$row = $dosql->GetOne("SELECT * FROM `#@__goods` WHERE id=$id");
分页显示内容:$dopage->GetList();
调用产品列表的所有产品信息,每页显示9条记录。
注意事项:
(1)使用$dopage->GetList() 分页时,必须与$dopage->GetPage 一起使用。
(2)$dopage->GetPage的格式:$dopage->GetPage(sql语句,单页显示的记录条数)
$dopage->GetPage("SELECT * FROM `#@__goods` WHERE (classid=$cid or parentid=$cid) AND delstate='' AND checkinfo=true ORDER BY posttime DESC", 9);
以下是完整的分页显示列表信息的调用:
<ul>
<?php
// 调用对应子栏目下的所有产品列表,按照最新更新时间排序
$dopage->GetPage("SELECT * FROM `#@__goods` WHERE (classid=$cid or parentid=$cid) AND delstate='' AND checkinfo=true ORDER BY posttime DESC", 9);
while ($row = $dosql->GetArray()) {
// 判断跳转连接是否为空
if ($row['linkurl'] == '') $gourl = 'productDetail.php?cid=' . $row['classid'] . '&id=' . $row['id'];
else $gourl = $row['linkurl'];
// 判断缩略图是否为空,若空,则给一张自定义的img
if ($row['picurl'] == '') $row['picurl'] = './style/image/chanpin.png'
?>
<li>
<span><img src="<?php echo $row["picurl"] ?>"></span>
<span><a href="<?php echo $gourl; ?>">了解详情 <b> >>> </b></a></span>
<span><?php echo $row['title']; ?></span>
</li>
<?php
}
?>
</ul>
</div>
## 分页标签的调用
<div class="pagelist">
<?php echo $dopage->GetList(); ?>
</div>
|