色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

zblogphp淘客店鋪導航站剖析 - 輸入信用值前臺轉為圖片

老白8年前1830瀏覽0評論

 昨天接一個zblogphp淘客店鋪導航站定制,其中用到了編輯文章頁面添加信用數字,前臺顯示信用圖片,今天來記錄分享出來:

zblogphp淘客店鋪導航站 信用圖片.png

以上就是信用圖片,淘寶的信用圖都對應相應的信用數字,如:

QQ圖片20170312135311.jpg

前臺要轉換為:

QQ圖片20170312135244.png

后臺編輯為:

QQ圖片20170312135346.png

其中用到了信用數字轉換為圖片,我是這么做的:

1、先為文章編輯中加入信用字段:

include.php掛載:

Add_Filter_Plugin('Filter_Plugin_Edit_Response5','ydtao_article_tao');

2、加入:

function ydtao_article_tao(){
global $zbp,$article;
echo '<p>掌柜: <input type="text" style="width:30%;" name="meta_zhanggui" value="'.$article->Metas->zhanggui.'"/></p>';
echo '<p>信用: <input type="text" style="width:30%;" name="meta_xinyong" value="'.$article->Metas->xinyong.'"/></p>';
echo '<p>行業: <input type="text" style="width:30%;" name="meta_hangye" value="'.$article->Metas->hangye.'"/></p>';
echo '<p>網址: <input type="text" style="width:80%;" name="meta_url" value="'.$article->Metas->url.'"/></p>';
}

3、為前臺模板中加入<img src='下方代碼單獨文件'>

4、建一個單獨的模板文件,放入下方這些判斷,用數值判斷范圍,顯示對應圖片:

<?php echo'404';die();?>{if $article.Metas.xinyong>4&&$article.Metas.xinyong<10 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_red_1.gif
{elseif $article.Metas.xinyong>11&&$article.Metas.xinyong<40 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_red_2.gif
{elseif $article.Metas.xinyong>41&&$article.Metas.xinyong<90 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_red_3.gif
{elseif $article.Metas.xinyong>91&&$article.Metas.xinyong<150 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_red_4.gif
{elseif $article.Metas.xinyong>151&&$article.Metas.xinyong<250 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_red_5.gif
{elseif $article.Metas.xinyong>251&&$article.Metas.xinyong<500 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_blue_1.gif
{elseif $article.Metas.xinyong>501&&$article.Metas.xinyong<1000 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_blue_2.gif
{elseif $article.Metas.xinyong>1001&&$article.Metas.xinyong<2000 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_blue_3.gif
{elseif $article.Metas.xinyong>2001&&$article.Metas.xinyong<5000 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_blue_4.gif
{elseif $article.Metas.xinyong>5001&&$article.Metas.xinyong<10000 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_blue_5.gif
{if $article.Metas.xinyong>10001&&$article.Metas.xinyong<20000 }
{$host}zb_users/theme/{$theme}/style/img/tao/s_cap_1.gif
{elseif $article.Metas.xinyong>20001&&$article.Metas.xinyong<50000}
{$host}zb_users/theme/{$theme}/style/img/tao/s_cap_2.gif
{elseif $article.Metas.xinyong>50001&&$article.Metas.xinyong<100000}
{$host}zb_users/theme/{$theme}/style/img/tao/s_cap_3.gif
{elseif $article.Metas.xinyong>100001&&$article.Metas.xinyong<200000}
{$host}zb_users/theme/{$theme}/style/img/tao/s_cap_4.gif
{elseif $article.Metas.xinyong>200001&&$article.Metas.xinyong<500000}
{$host}zb_users/theme/{$theme}/style/img/tao/s_cap_5.gif
{elseif $article.Metas.xinyong>500001&&$article.Metas.xinyong<1000000}
{$host}zb_users/theme/{$theme}/style/img/tao/s_crown_1.gif
{elseif $article.Metas.xinyong>1000001&&$article.Metas.xinyong<2000000}
{$host}zb_users/theme/{$theme}/style/img/tao/s_crown_2.gif
{elseif $article.Metas.xinyong>2000001&&$article.Metas.xinyong<5000000}
{$host}zb_users/theme/{$theme}/style/img/tao/s_crown_3.gif
{elseif $article.Metas.xinyong>5000001&&$article.Metas.xinyong<10000000}
{$host}zb_users/theme/{$theme}/style/img/tao/s_crown_4.gif
{elseif $article.Metas.xinyong>10000001}
{$host}zb_users/theme/{$theme}/style/img/tao/s_crown_5.gif
{else}{/if}