![]() |
![]() |
![]() |
|
|||||||
| Modifications Simple to complex modifications, made by users or by our team, applied to logic or presentation, all kinds of modifications are discussed and requested here. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#31 |
|
Join Date: Sep 2006
Posts: 384
![]() |
Hi kamy81,
In order to apply the mod "New Links on Home" please make the following changes: #1. Open index.php file and insert the highlighted code like this: Code:
// if unique template _not_ exists, then reset to default
if(!file_exists($gDirSmarty->template_dir.$render))
{
$render = "index.tpl";
}
//get latest links
$latest_links = $Link->getLatest($start, 10); // number of links = 10
$gDirSmarty->assign_by_ref('latest_links', $latest_links);
$gDirSmarty->display($render, $cache_id);
#3. Open index.tpl file and insert the following code where you want the latest links to be displayed: Code:
<!-- latest links box start -->
{if $latest_links}
{include file="box-header.tpl" caption="New Links" style="green"}
<div class="links">
<table cellspacing="0" cellpadding="0">
{foreach from=$latest_links item=link name=links}
{assign var="latest_links" value=0}
{include file="link-display.tpl"}
{/foreach}
</table>
</div>
{include file="box-footer.tpl"}
{/if}
<!-- latest links box end -->
#5. Open link-display.tpl and find the following code: Code:
{if $config.mod_rewrite}
<a href="{$config.base}{$config.dir}{$link.path}{convert_str string=$link.title}-l{$link.id}.html">{$lang.link_details}</a>
{else}
<a href="{$config.base}{$config.dir}view-link.php?id={$link.id}">{$lang.link_details}</a>
{/if}
Code:
{if $config.mod_rewrite}
{if $tab eq 'home'}
<a href="{$config.base}{$config.dir}{if $latest_links}{$link.path}{else}{$link.path|cat:"/"}{/if}{convert_str string=$link.title}-l{$link.id}.html">{$lang.link_details}</a>
{else}
<a href="{$config.base}{$config.dir}{$link.path}{convert_str string=$link.title}-l{$link.id}.html">{$lang.link_details}</a>
{/if}
{else}
<a href="{$config.base}{$config.dir}view-link.php?id={$link.id}">{$lang.link_details}</a>
{/if}
That's it! Please feel free to ask in case you have any questions. |
|
|
|
|
|
#32 |
|
Join Date: Feb 2007
Posts: 59
![]() |
Thanks David Evans.
New links showing on home page - its Working. But it is also showing in every category pages. Actually in category page I don't want to show this. New links will show only for home page . Another thing is - from category when I click on Link Details it open correctly as: domain.com/Business/Employment/South-Business-Employment-Corporation-l1.html But when I click on Link Details of any new list links from homepage it show error as "Error: Requested URL not found (404)" it miss / as: domain.com/Business/EmploymentSouth-Business-Employment-Corporation-l1.html 5 & 6 steps : Modification for (link-display.tpl ) is it a part of showing new links on homepage OR for showing only Main category in home page Last edited by kamy81; 03-20-2007 at 02:58 PM. |
|
|
|
|
|
#33 |
|
.
Join Date: Aug 2006
Posts: 349
![]() |
ok i followed the instructions to the letter and they work for me perfectly thanks!!!
|
|
|
|
|
|
#34 |
|
Join Date: Jan 2007
Posts: 36
![]() |
Hi Dave
How to make showing new links just on home page not on all categories pages
__________________
Free Directory - Submit Now! |
|
|
|
|
|
#35 |
|
Join Date: Jan 2007
Posts: 36
![]() |
Nermind I found solution
__________________
Free Directory - Submit Now! |
|
|
|
|
|
#36 |
|
Join Date: Sep 2006
Posts: 384
![]() |
Hi kamy81,
If you have some difficulties with implementing this mod you can provide me your FTP credentials via PM and I help you to apply it. Steps #5 and #6 help you to avoid the problem with wrong URLs to Link Details page. Maybe this is a reason of missing '/' in your site. Last edited by Tilek E.; 03-22-2007 at 02:13 PM. |
|
|
|
|
|
#37 |
|
Join Date: Sep 2006
Posts: 384
![]() |
Also I think it will be useful to have the latest links shown only on homepage:
Just change the step #3 and insert the highlighted code: Code:
<!-- latest links box start -->
{if $category.id eq '0'}
{if $latest_links}
{include file="box-header.tpl" caption="New Links" style="green"}
<div class="links">
<table cellspacing="0" cellpadding="0">
{foreach from=$latest_links item=link name=links}
{assign var="latest_links" value=0}
{include file="link-display.tpl"}
{/foreach}
</table>
</div>
{include file="box-footer.tpl"}
{/if}
{/if}
<!-- latest links box end -->
|
|
|
|
|
|
#38 |
|
Join Date: Feb 2007
Posts: 59
![]() |
Thanks David Evans. Excellent job
![]() Its very helpful for me |
|
|
|
|
|
#39 |
|
Join Date: Apr 2006
Location: UK
Posts: 1,095
![]() |
Whats the difference between these codes, New links in index and new links on home?
Is it just terminology? or is there a difference in how these two sets of codes work? And if someone would be so kind to help me and others out direct to an working example of these, being specific as to what area, as i don't know what i am looking for.. Cheers ![]() |
|
|
|
|
|
#40 |
|
Join Date: Feb 2007
Posts: 59
![]() |
Hi Loren,
Difference between these codes, New links in index: It shows new links on homepage, category page, new link page, top link page, popular link page, etc (where link shows as indexing) New links on homepage: It shows new links only on homepage |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How I can display "new links" at index page? | ultimate | Common Questions | 14 | 08-23-2006 08:18 AM |
| Adding New Links display on index page is it possible? | 90210 | Modifications | 10 | 05-30-2006 02:36 AM |
| Links on index page? | nunio | Common Questions | 9 | 05-29-2006 01:49 AM |
| modify design on the index page and category page | tadisaus2 | User interface | 2 | 05-19-2006 04:22 PM |
| How to don't redirect on index page if 404 error. | Satyapal | Common Questions | 3 | 01-01-1970 12:31 AM |