phpcms圖片頻道模板制作
關(guān)鍵字描述:制作 模板 頻道 圖片 " < > picture if current
phpcms圖片頻道的模板制作
前面我們已經(jīng)講過了文章、下載頻道的模板制作,今天講完圖片頻道之后,剩下的就是專題的制作,雖然每個頻道都有專題,但是制作方法都是一樣的,我們講集中講解。好,閑話不說,開始講課。
打開picture/index.html文件,我們就會發(fā)現(xiàn)都是我們前面講過很熟悉的標簽,圖片頻道與別的頻道最大的不同,就是在顯示的時候默認顯示的都是縮略圖,也就是我們看到的這一串標簽
{$picpicture(0,$channelid,$cat[catid],1,0,0,10,30,0,0,0,3,1,0,130,100,5)}
因此我們主要來講這個標簽的制作,別的頂級欄目。終極欄目的制作和文章頻道都是相同的
在picture文件夾下面以tag開頭的文件有4個
tag_picpicture.html 圖片縮略圖調(diào)用標簽
tag_picturelist.html 圖片標題列表調(diào)用標簽
tag_slidepicpicture.html 圖片幻燈片調(diào)用標簽
tag_slidepicpicture-js.html 圖片js效果標簽模板
打開tag_picpicture.html,我們會看到
{loop $pictures $i $picture}
$i是用來判斷幾列的
利用這個i來和系統(tǒng)設置的$cols 做比較
利用他們的余數(shù)來判斷是否分行
<img src='{$picture[thumb]}' alt='{$picture[alt]}' width='{$imgwidth}' height='{$imgheight}'> 這里面就是你在發(fā)布圖片時候選的 縮略圖的大小
<a href='{$picture[url]}' target='_blank' title='{$picture[alt]}'[/color]>{$picture[title]}</a>
這幾個分別是圖片的地址 圖片的提示 圖片的標題
{if $descriptionlen}
<tr>
<td>{$picture[content]} <a href='{$picture[url]}' target='_blank'>詳細>></a></td>
</tr>
{/if}
這一句是,如果允許顯示說明,則顯示具體的說明信息
在tag_picturelist.html中,顯示的東西則比縮略圖模板要多
{$picture[img]} 標題圖片
{$picture[catname]} 所屬欄目
<a href="{$picture[url]}" title="{$picture[alt]}" target="{$picture[target]}" class="tag_title_link{$picture[fonttype]}">{$picture[title]}</a> 圖片標題及路徑
{if $showhits}({$picture[hits]}){/if} 如果允許顯示點擊數(shù),則顯示點擊數(shù)
{if $showauthor}[作者:{$picture[author]}]{/if} 顯示作者
{if $datetype}[<span class="tag_date">{$picture[adddate]}</span>]{/if} 顯示添加時間
{if $descriptionlen}{$picture[content]}{/if} 顯示說明
圖片內(nèi)容頁content.html的制作
打開這個網(wǎng)頁
<script language=javascript type=text/javascript>
function fontZoom(size)
{
document.getElementById('{$addtime}l').style.fontSize=size 'px'
}
var pictureurl=new Array();
var picturename=new Array();
{loop $pictureurls $id $pic}
pictureurl[{$id}] = "{$pic[url]}";
picturename[{$id}] = "{$pic[name]}";
{/loop}
</script>
這個js函數(shù)是字體縮放函數(shù)
<!--圖片瀏覽JS開始-->
<script language=JavaScript>
<!-- Begin
var rotate_delay =4000; // delay in milliseconds (1000 = 1 secs)
current = 0;
function next() {
if(document.slideform.slide[current 1])
{
if(document.all){
document.images.show.style.filter="blendTrans(duration=2)"
關(guān)鍵字描述:制作 模板 頻道 圖片 " < > picture if current
document.images.show.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.show.filters.blendTrans.Apply()
}
document.images.show.src = pictureurl[current 1];
setidval('picname',picturename[current 1]);
if(document.all){
document.images.show.filters.blendTrans.play()
}
document.slideform.slide.selectedIndex = current;
}
else
first();
}
function previous()
{
if(current-1 >= 0)
{
if(document.all){
document.images.show.style.filter="blendTrans(duration=2)"
document.images.show.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.show.filters.blendTrans.Apply()
}
document.images.show.src = pictureurl[current-1];
setidval('picname',picturename[current-1]);
if(document.all){
document.images.show.filters.blendTrans.play()
}
document.slideform.slide.selectedIndex = --current;
}
else
last();
}
function first()
{
current = 0;
if(document.all){
document.images.show.style.filter="blendTrans(duration=2)"
document.images.show.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.show.filters.blendTrans.Apply()
}
document.images.show.src = pictureurl[0];
setidval('picname',picturename[0]);
if(document.all){
document.images.show.filters.blendTrans.play()
}
document.slideform.slide.selectedIndex = 0;
}
function last() {
current = document.slideform.slide.length-1;
if(document.all){
document.images.show.style.filter="blendTrans(duration=2)"
document.images.show.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.show.filters.blendTrans.Apply()
}
document.images.show.src = pictureurl[current];
setidval('picname',picturename[current]);
if(document.all){
document.images.show.filters.blendTrans.play()
}
document.slideform.slide.selectedIndex = current;
}
function ap(text) {
document.slideform.slidebutton.value = (text == "Stop") ? "Start" : "Stop";
rotate();
}
function change() {
current = document.slideform.slide.selectedIndex;
if(document.all){
document.images.show.style.filter="blendTrans(duration=2)"
document.images.show.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.show.filters.blendTrans.Apply()
}
document.images.show.src = pictureurl[current];
setidval('picname',picturename[current]);
if(document.all){
document.images.show.filters.blendTrans.play()
}
}
function rotate() {
if (document.slideform.slidebutton.value == "Stop") {
current = (current == document.slideform.slide.length-1) ? 0 : current 1;
if(document.all){
document.images.show.style.filter="blendTrans(duration=2)"
關(guān)鍵字描述:制作 模板 頻道 圖片 " < > picture if current
document.images.show.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.show.filters.blendTrans.Apply()
}
document.images.show.src = pictureurl[current];
setidval('picname',picturename[current]);
if(document.all){
document.images.show.filters.blendTrans.play()
}
document.slideform.slide.selectedIndex = current;
window.setTimeout("rotate()", rotate_delay);
}
}
function openpic()
{
window.open(pictureurl[current]);
}
// End -->
</script>
這個函數(shù)是控制js變換的函數(shù)
CODE: [Copy to clipboard] <!--主標題--><div id="title" align="center">{$title}</div>
<!--文件屬性--><div class="par" align="center">發(fā)布日期:{$adddate} 作者:<a href="{PHPCMS_PATH}member/member.php?username={$username}" class="member_url">{$author}</a> 來源:<a href="{$copyfromurl}" target="_blank">{$copyfromname}</a> 瀏覽次數(shù):<span id="hits">0</span> <a href="{PHPCMS_PATH}comment/index.php?item=pictureid&itemid={$pictureid}&itemurl={$itemurl}" class="commenturl">網(wǎng)友評論<span id="commentnumber1">0</span>條</a> 文字大?。骸?lt;a href="javascript :fontZoom(16)">大</a>】【<a href="javascript :fontZoom(14)">中</a>】【<a href="javascript :fontZoom(12)">小</a>】 評分等級:{$stars}</div>
<hr align="center" width="740" size="1" noshade style="color:#cccccc;" />
<div class="content_text" id="{$addtime}1"><a href="{$itemurl}">來源:{$_PHPCMS['sitename']}({$PHP_SITEURL})<br/>作者:{$username}<br/>原文:{$title}({$itemurl})</a></div>
<div class="content_text" id="{$addtime}l">{$content}</div>
{if $specialid}<div class="content_text" id="{$addtime}l">相關(guān)專題:<a href="{$special[specialurl]}" class="specialurl">{$special[specialname]}</a></div>{/if} 這一串和我們以前講文章頁面是一樣的,是一些相關(guān)的信息
從<form name=slideform >這個地方開始,就是圖片的顯示區(qū)
<span id="picname" style="font-weight:bold;font-size:14px;">{$pictureurls[0][name]}</span>
圖片名稱
<img src="{$pictureurls[0][url]}" align="center" name="show" id="picture{$id}" alt="{$pictureurls[0][name]}" border="0" style="cursor:hand;" on click="openpic()" on load="javascript :setpicWH(picture{$id},720,1000)">
圖片的具體內(nèi)容
<!--圖片名列表-->
關(guān)鍵字描述:制作 模板 頻道 圖片 " < > picture if current
<select on change="change();" name="slide">
{loop $pictureurls $id $pic}
<option value="{$id}">{$pic[name]}</option>
{/loop}
</select>
!--控制按鈕-->
<input title=Beginning on click=first(); type=button value=" |<< " class="btn">
<input title=Previous on click=previous(); type=button value=" << " class="btn">
<input title=AutoPlay on click=ap(this.value); type=button value=Start name=slidebutton class="btn">
<input title=Next on click=next(); type=button value=" >> " class="btn">
<input name="button" type=button title=End on Click=last(); value=" >>| " class="btn">
后面的東西就和文章頁面是一樣的,都是發(fā)布評論的內(nèi)容
您可能感興趣的文章
- 01-10phpcms常見問題解答
- 01-10phpcms語法規(guī)則
- 01-10PHPCMS網(wǎng)站轉(zhuǎn)移空間教程
- 01-10PHPCMS2008 SP4 心情排行指數(shù)不顯示的解決辦法
- 01-10phpcms頻道首頁調(diào)用所有一級欄目及二級欄目
- 01-10phpcms標簽模板及專題模板的制作
- 01-10PHPCMS系統(tǒng)自帶標簽說明
- 01-10為PHPCMS 2008 編輯器增加常用中文字體方法
- 01-10PHPcms 2008 注冊選擇模型關(guān)閉后,注冊不能自動登錄的問題
- 01-10phpcms模仿QQ和MSN消息提示的效果


閱讀排行
本欄相關(guān)
- 01-10phpcms常見問題解答
- 01-10phpcms語法規(guī)則
- 01-10PHPCMS2008 SP4 心情排行指數(shù)不顯示的解
- 01-10PHPCMS網(wǎng)站轉(zhuǎn)移空間教程
- 01-10PHPCMS系統(tǒng)自帶標簽說明
- 01-10phpcms標簽模板及專題模板的制作
- 01-10phpcms頻道首頁調(diào)用所有一級欄目及二
- 01-10PHPcms 2008 注冊選擇模型關(guān)閉后,注冊
- 01-10為PHPCMS 2008 編輯器增加常用中文字體
- 01-10phpcms模仿QQ和MSN消息提示的效果
隨機閱讀
- 08-05dedecms(織夢)副欄目數(shù)量限制代碼修改
- 01-11ajax實現(xiàn)頁面的局部加載
- 01-10SublimeText編譯C開發(fā)環(huán)境設置
- 01-10C#中split用法實例總結(jié)
- 08-05DEDE織夢data目錄下的sessions文件夾有什
- 08-05織夢dedecms什么時候用欄目交叉功能?
- 01-11Mac OSX 打開原生自帶讀寫NTFS功能(圖文
- 01-10delphi制作wav文件的方法
- 01-10使用C語言求解撲克牌的順子及n個骰子
- 04-02jquery與jsp,用jquery