Search
  
Categories
 Last Articles
 Design
 Coding: PHP and Smarty
 Miscellaneous
 Admin Area
 Installation
[add new article]
Add Message when no links exist

Author: yktan and Marksman
Added: February 19, 2006

This code modification was created for phpLD version 2.


Open templates/main.tpl


Find:


{if $smarty.const.FTR_ENABLE==1 and count($feat_links) gt 0}


  <h3>{l}Featured Links{/l}</h3> 
{foreach from=$feat_links item=link name=links}
{include file="link.tpl" link=$link}
{/foreach}

{/if}



Replace with:


{if $smarty.const.FTR_ENABLE==1 and count($feat_links) gt 0}


  <h3>{l}Featured Links{/l}</h3> 
{foreach from=$feat_links item=link name=links}
{include file="link.tpl" link=$link}
{/foreach}

{/if}


{if count($links) eq 0} No links added in this category yet. <a href="{$smarty.const.DOC_ROOT}/submit.php">Sumbit link</a>! {/if}



You're done!



Note: As-is, that will display the submit link line on the top level if you don't have any top level links. If you don't want it to appear on the top level, then follow these instructions:


Find: {if count($links) eq 0}


Replace with: {if count($links) eq 0 and $category.ID gt 0}


Credits

Programming by: yktan and Marksman


Copywriting and testing by: Svenska Länkkatalogen (http://www.lankkatalogen)