Menu:

Recent Entries

About

Sirius

板工秀勇與阿吉管理中

Categories

FreeNX [1]
xoops [5]
Ubuntu相關 [1]
校務系統 [3]
MySQL [4]
TinyMCE [3]
系統修改 [4]
LightBox [1]
學用Blog [2]
有關模板 [4]
Windows相關 [5]
硬體相關 [2]
Lifetype系統更新 [10]
XPress [1]
IMageMagick [1]
CSS [1]
站務公告 [7]
Plugins套用修改 [3]
設備使用 [1]
Moodle [1]
電腦教室管理 [0]

Links

LiftType教學
- LifeType 線上教學(官網)
- 部落格教室(怡杰老師)
- 阿欣部落
- 阿杰老師部落格教室

Syndicate

RSS 0.90
RSS 1.0
RSS 2.0
Atom 0.3

Version:

andreas01 v1.3

1.2.x模板修改之前

sirius | 14 六月, 2007 07:04

每次LifeType升級,最令人痛苦的一件事就是修改模板。如果碰到升級時還有一些Plugin還來不及釋出升級版,那模版還得先槓掉那段程式碼。

還好李宗欣老師這篇檢查plog的plugin是否啟動的指令 ,與這篇文章下的迴響告訴我如何解決這個問題。如果再改版也不怕了!

以下引用自李宗欣老師上述兩篇文章:


檢查plog的plugin是否啟動的指令

{if !empty($recentcomments)} // 檢查 plugin 存不存在
{if $recentcomments->enabled()} // 檢查 plugin 有沒有啟動。
....
....
{/if}
{/if}

這樣就可以避免如果使用者沒裝 plugin 時會造成錯誤。


舉例來說這邊recentcomment的設定
{if $recentcomments->isEnabled()}
<h2>» 最近迴響</h2>
{assign var=comments value=$recentcomments->getRecentComments()}
<ul>
{foreach from=$comments item=comment}
{assign var=commentpostid value=$comment->getArticleId()}
{assign var=commentpost value=$recentcomments->getArticle($commentpostid)}
<li><a href="{$url->postPermalink($commentpost)}#{$comment->getId()}">{$ comment->getUsername()}:{$comment->getText()|truncate:80:".... "|strip_tags}</a></li>
{/foreach}
</ul>
{/if}

在 if 裡面就是要去判斷使用者是否已在管理後台裡啟動了這外掛,
有啟動的話,就會顯示底下的最近迴響的資料,若未啟動,則這一段程式碼就不會顯示

假如沒加上 if 的話,若在模版上加上了那些程式碼,但使用者卻未啟動外掛,則版面上就會出現錯誤訊息。
大概就是這樣。

 

Posted in 有關模板 . 迴響: (26770). 引用:(414). 靜態連結網址
«Next post | Previous post»

Comments

  1. 1. Trada Casino  |  09/21,2021 at 08:52

    Excellent blog here! Also your site loads up fast! What web host are you using?
    Can I get your affiliate link to your host? I wish my web site loaded
    up as quickly as yours lol

  2. 2. 비트코인 카지노  |  09/21,2021 at 08:51

    You ought to be a part of a contest for one of the most useful websites online.

    I will highly recommend this website!

  3. 3. דירות למכירה  |  09/21,2021 at 08:49

    thanks a lot a great deal this excellent website is formal plus casual

  4. 4. hey  |  09/21,2021 at 08:45

    Hey, I think your blog might be having browser compatibility issues.
    When I look at your blog site in Firefox, it looks fine
    but when opening in Internet Explorer, it has some overlapping.

    I just wanted to give you a quick heads up! Other then that, fantastic blog!

  5. 5. Bear Cat Studio  |  09/21,2021 at 08:45

    I'd like to thank you for tthe efforts yyou have put in penning this website.
    I am hoping to view the samne high-grade blog posts from you iin thhe
    future as well. In truth, your creative writinng abilities
    has inspired mee to get my own, personal site now ;)

  6. 6. rtyhftyt  |  09/21,2021 at 08:30

    I could not refrain from commenting. Exceptionally
    well written!

  7. 7. o terrorista filme  |  09/21,2021 at 08:10

    A person necessarily help to make critically articles
    I'd state. That is the very first time I frequented your web page and so far?
    I amazed with the research you made to make this particular
    post incredible. Great job!

  8. 8. keluaran Hk  |  09/21,2021 at 08:07

    You've made some really good points there. I looked on the web for more info about the issue and found most individuals will go along with your views on this website.

  9. 9. fghfghg  |  09/21,2021 at 07:58

    I was recommended this blog by my cousin. I'm not sure whether
    this post is written by him as no one else know such detailed about my difficulty.
    You are incredible! Thanks!

  10. 10. fghfghfgh  |  09/21,2021 at 07:50

    Hi there, after reading this amazing post i am as
    well cheerful to share my knowledge here with colleagues.

  11. 11. web site development  |  09/21,2021 at 07:45

    Thanks , I have recently been looking for information about this topic for a long time
    and yours is the best I've discovered so far.
    But, what concerning the bottom line? Are you certain about
    the source?

  12. 12. เเจกเครดิตฟรี  |  09/21,2021 at 07:32

    Wow that was strange. I just wrote an very long comment but after I clicked submit my comment didn't
    show up. Grrrr... well I'm not writing all that over
    again. Anyhow, just wanted to say wonderful blog!

  13. 13. Смотреть фильмы в высоком качестве  |  09/21,2021 at 07:30

    It's awesome in favor of me to have a web page, which
    is beneficial for my know-how. thanks admin

  14. 14. 샌즈카지노  |  09/21,2021 at 07:23

    Wow that was odd. I just wrote an extremely long comment but after I clicked submit my comment didn't
    show up. Grrrr... well I'm not writing all that over again. Regardless,
    just wanted to say great blog!

  15. 15. windsor electronic whistle  |  09/21,2021 at 07:23

    Greetings, I do think your site might be having internet browser compatibility
    problems. Whenever I look at your blog in Safari, it looks fine but
    when opening in IE, it has some overlapping issues. I merely wanted to give
    you a quick heads up! Aside from that, excellent website!

  16. 16. 3commas review. 3commas promo code. 3commas  |  09/21,2021 at 07:20

    I really like your blog.. very nice colors & theme.

    Did you make this website yourself or did you hire
    someone to do it for you? Plz reply as I'm looking to
    design my own blog and would like to know where u got this from.

    appreciate it

  17. 17. פרסום דירות למכירה  |  09/21,2021 at 07:11

    thanks a lot a whole lot this excellent website is actually proper and
    relaxed

  18. 18. write my essay  |  09/21,2021 at 07:09

    Why people still make use of to read news papers when in this technological world the whole thing is accessible on web?

  19. 19. guaranteed weight loss pills in india  |  09/21,2021 at 07:09

    Thanks on your marvelous posting! I truly enjoyed reading it, you may be a great author.

    I will be sure to bookmark your blog and definitely will come back later on. I want to encourage yourself
    to continue your great writing, have a nice evening!

  20. 20. диплом института  |  09/21,2021 at 06:56

    I really like your blog.. very nice colors & theme.
    Did you make this website yourself or did you hire someone to do it for you?
    Plz reply as I'm looking to design my own blog and would like
    to find out where u got this from. many thanks

Leave a Reply

發表迴響
 authimage