讓織夢dedecms autoindex,itemindex 從0到1開始的辦法!
[field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global]
{dede:global name=itemindex runphp="yes"}@me=@me+1;{/dede:global}
autoindex itemindex 的使用心得區別
channelartlist 標簽下使用
{dede:global name='itemindex' runphp='yes'}@me;{/dede:global}
自增1
arclist 標簽下使用 [field:global.autoindex/] 默認從1開始
channel 標簽下使用 [field:global.autoindex/] 默認從0開
channelartlist 標簽下使用 {dede:global.itemindex/} 默認從1開始
arclist 從0開始 [field:global name=autoindex runphp="yes"]@me=@me-1;[/field:global]
channel 從1開始 [field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global][field:typename/]
channelartlist 從0開始 {dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global}
<div id="h_pd_lm_{dede:global.itemindex/}" {dede:global name='itemindex' runphp='yes'}@me=(@me==1)?'':'style="display:none;"';{/dede:global} class="pd2_lmc_l1">
<!---- eg---->
{dede:channelartlist notypeid='123,124,146,147'}
<a class="pd2_lmt{dede:global name=itemindex runphp='yes'}@me=(@me==1)?'1':'3';{/dede:global}" onmouseover="showitem2({dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global},'pd_lm','h_pd_lm_','pd2_lmt');" href='{dede:field name='typeurl'/}'>
{dede:php}if($refObj->Fields['ispart']){echo $refObj->Fields['typename'];}{/dede:php}
</a>
{/dede:channelartlist}
{dede:channelartlist typeid="1" row="8" }
<div class="combz01" {dede:global name=itemindex runphp='yes'}if(@me==2)@me='id="with"';if(@me==5)@me='id="with"';if(@me==7)@me='id="with"';{/dede:global}>
<div class="combz01title"><a href="{dede:field name='typeurl'/}" title="{dede:field name='typename'/}" target="_blank"><b>{dede:field name='typename'/}</b></a><u><a href="{dede:field name='typeurl'/}" title="{dede:field name='typename'/}" target="_blank">更多>></a></u></div>
<div class="comcon">
{dede:arclist titlelen='42' row='1' flag='c'}
<img src="[field:litpic/]" width="127" height="94"/>
<i>[field:description function="cn_substr(@me,100)"/]...<a href="[field:arcurl /]" title="[field:fulltitle/]" target="_blank">[詳情]</a></i>
{/dede:arclist}
</div>
<div class="comconlist">
<ul>
{dede:arclist titlelen="42" row="3"}
<li><a href="[field:arcurl /]">[field:title /]</a></li>
{/dede:arclist}
</ul>
</div>
</div>
{/dede:channelartlist}
channel 標簽下使用[field:global name=autoindex/]
<!---- eg---->
{dede:channel titlelen='32'}
<li [field:global name='autoindex' runphp='yes']if(@me%2==0){@me='class="rr"';}else{@me='';}[/field:global] ><h3><a href='[field:typelink/]'>[field:typename/]</a></h3></li>
{/dede:channel}
在arclist中使用autoindex runphp 時用這種方式:
{dede:arclist titlelen='22' row='4' flag='c' orderby='id'}
<a href="[field:arcurl /]" target="_blank">[field:title /]</a>
[field:global name='autoindex' runphp='yes']if(@me==2){@me="<br />";}else{@me=' ';}[/field:global]{/dede:arclist}
自增1
[field:global.autoindex/]
<!---- eg---->
{dede:arclist channelid=17 row=6 orderby=pubdate titlelen=40 addfields='docphoto,docjob,doctec' typeid='123,136,146,155,172,182,202'}
<div id="h_nrr_zj_[field:global.autoindex/]" class="nrr_zjl" [field:global name='autoindex' runphp='yes']if(@me==1){@me="";}else{@me='style="display:none;"';}[/field:global] >
<div><a href="[field:arcurl/]" title="[field:fulltitle/]" target="_blank"><img src="[field:litpic/]" alt="[field:fulltitle/]" /></a></div>
</div>
{/dede:arclist}
DedeCms在dede:arclist標簽如何調用附加表內容(其他標簽一樣適用)
{dede:arclist titlelen='26' row='20' orderby='id'}
[field:id runphp="yes"]
$dsql = new DedeSql(false);
$a="SELECT * FROM dede_addongame_tg where aid=@me";
$arcRow = $dsql->GetOne($a);
@me='url="'.$arcRow[sptype].'" leixing="'.$arcRow[model];
[/field:id]
{/dede:arclist}
[field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global]
{dede:global name=itemindex runphp="yes"}@me=@me+1;{/dede:global}
autoindex itemindex 的使用心得區別
channelartlist 標簽下使用
{dede:global name='itemindex' runphp='yes'}@me;{/dede:global}
自增1
arclist 標簽下使用 [field:global.autoindex/] 默認從1開始
channel 標簽下使用 [field:global.autoindex/] 默認從0開
channelartlist 標簽下使用 {dede:global.itemindex/} 默認從1開始
arclist 從0開始 [field:global name=autoindex runphp="yes"]@me=@me-1;[/field:global]
channel 從1開始 [field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global][field:typename/]
channelartlist 從0開始 {dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global}
<div id="h_pd_lm_{dede:global.itemindex/}" {dede:global name='itemindex' runphp='yes'}@me=(@me==1)?'':'style="display:none;"';{/dede:global} class="pd2_lmc_l1">
<!---- eg---->
{dede:channelartlist notypeid='123,124,146,147'}
<a class="pd2_lmt{dede:global name=itemindex runphp='yes'}@me=(@me==1)?'1':'3';{/dede:global}" onmouseover="showitem2({dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global},'pd_lm','h_pd_lm_','pd2_lmt');" href='{dede:field name='typeurl'/}'>
{dede:php}if($refObj->Fields['ispart']){echo $refObj->Fields['typename'];}{/dede:php}
</a>
{/dede:channelartlist}
{dede:channelartlist typeid="1" row="8" }
<div class="combz01" {dede:global name=itemindex runphp='yes'}if(@me==2)@me='id="with"';if(@me==5)@me='id="with"';if(@me==7)@me='id="with"';{/dede:global}>
<div class="combz01title"><a href="{dede:field name='typeurl'/}" title="{dede:field name='typename'/}" target="_blank"><b>{dede:field name='typename'/}</b></a><u><a href="{dede:field name='typeurl'/}" title="{dede:field name='typename'/}" target="_blank">更多>></a></u></div>
<div class="comcon">
{dede:arclist titlelen='42' row='1' flag='c'}
<img src="[field:litpic/]" width="127" height="94"/>
<i>[field:description function="cn_substr(@me,100)"/]...<a href="[field:arcurl /]" title="[field:fulltitle/]" target="_blank">[詳情]</a></i>
{/dede:arclist}
</div>
<div class="comconlist">
<ul>
{dede:arclist titlelen="42" row="3"}
<li><a href="[field:arcurl /]">[field:title /]</a></li>
{/dede:arclist}
</ul>
</div>
</div>
{/dede:channelartlist}
channel 標簽下使用[field:global name=autoindex/]
<!---- eg---->
{dede:channel titlelen='32'}
<li [field:global name='autoindex' runphp='yes']if(@me%2==0){@me='class="rr"';}else{@me='';}[/field:global] ><h3><a href='[field:typelink/]'>[field:typename/]</a></h3></li>
{/dede:channel}
在arclist中使用autoindex runphp 時用這種方式:
{dede:arclist titlelen='22' row='4' flag='c' orderby='id'}
<a href="[field:arcurl /]" target="_blank">[field:title /]</a>
[field:global name='autoindex' runphp='yes']if(@me==2){@me="<br />";}else{@me=' ';}[/field:global]{/dede:arclist}
自增1
[field:global.autoindex/]
<!---- eg---->
{dede:arclist channelid=17 row=6 orderby=pubdate titlelen=40 addfields='docphoto,docjob,doctec' typeid='123,136,146,155,172,182,202'}
<div id="h_nrr_zj_[field:global.autoindex/]" class="nrr_zjl" [field:global name='autoindex' runphp='yes']if(@me==1){@me="";}else{@me='style="display:none;"';}[/field:global] >
<div><a href="[field:arcurl/]" title="[field:fulltitle/]" target="_blank"><img src="[field:litpic/]" alt="[field:fulltitle/]" /></a></div>
</div>
{/dede:arclist}
DedeCms在dede:arclist標簽如何調用附加表內容(其他標簽一樣適用)
{dede:arclist titlelen='26' row='20' orderby='id'}
[field:id runphp="yes"]
$dsql = new DedeSql(false);
$a="SELECT * FROM dede_addongame_tg where aid=@me";
$arcRow = $dsql->GetOne($a);
@me='url="'.$arcRow[sptype].'" leixing="'.$arcRow[model];
[/field:id]
{/dede:arclist}