![]() |
![]() |
![]() |
|
|||||||
| 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 |
|
|
#1 |
|
Super Moderator
Join Date: Oct 2005
Location: Phoenix,Arizona (Valley of the Sun)
Posts: 5,358
![]() ![]() ![]() ![]() |
Mod by "Vincent Wright"
Here is a quick mod that displays new links on index page. But first, let me explain how it works. It uses the same mechanism to display a list of links that is used in any subcategory. But instead of subcategory links we substitute new links. Only slight changes are necessary to achieve the effect. Ok, let's jump straight to the gory details. 1. Open index.php in your directory script root folder. Go to the very bottom. Right before the last two lines of code: Code:
$gDirSmarty->display("index{$templ}.tpl");
?>
Code:
if (0 == $category['id'])
{
$new_links =& $gDirDb->getNewLinks(0, 5);
$gDirSmarty->assign_by_ref('links', $new_links);
$gDirSmarty->assign('show_as_new', true);
}
The next two lines assign Smarty variables. An important variable here is 'show_as_new' -- this is a flag to differentiate between regular and new links because the same template is used to display both. Well, it's use is described below. Read on.... ... but before, save changes to index.php and close the file. 2. The next step is to slightly adjust template file. Go to your template folder. By default it is templates/GreenLeaves. Open index.tpl file. Find the piece of code that displays links. In my distribution it is line 20 and starts like this: Code:
{if $links}
<div class="box">
<div class="box-caption-right">
<div class="box-caption-left">
<div class="box-caption">{$lang.links}</div>
</div>
</div>
<div class="box-content">
Code:
{if $links}
<div class="box">
<div class="box-caption-right">
<div class="box-caption-left">
<div class="box-caption">{if $show_as_new}{$lang.new_links}{else}{$lang.links}{/if}</div>
</div>
</div>
<div class="box-content">
Save changes, close the index.tpl file and give it a try! Is it what you wanted to see? Yes? Great! ![]() P.S. If you have trouble implementing this mod feel free to ask.
__________________
Please don't ask me about script questions or sales issues through "Private Messages". Thanks! |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Sep 2005
Posts: 9,291
![]() ![]() ![]() ![]() ![]() ![]() |
I have just sticked this thread. It seems to be useful
__________________
Subrion CMS - free open source php content management system Business Directory Script - powerful php business directory software, Yellow Pages Script - the most advanced yellow pages php software |
|
|
|
|
|
#3 |
|
Join Date: Feb 2006
Location: Canada
Posts: 8
![]() |
Excellent info,have just used this with version 2.0.01 and works great.........
http://linkerman.com
__________________
http://LinkerMan.com |
|
|
|
|
|
#4 | |
|
Join Date: May 2006
Posts: 172
![]() |
Having problem with this mod in my v.2 greenleaves template.
I have the following layout : {if $category.id == 0} my article {/if} <div>{if $links} {if $show_as_new}{$lang.new_links}{else}{$lang.links}{/if} </div> {if $category.id == 0} my 2nd article {/if} All worked fine til i added this mod. Now i'm getting the following error : Quote:
|
|
|
|
|
|
|
#5 |
|
Join Date: Jul 2006
Location: St. Petersburg
Posts: 2,567
![]() |
Hello Cris,
This modification made for version 2.0: http://www.esyndicat.com/forum/about7600.html Please try to check it. |
|
|
|
|
|
#6 |
|
Join Date: May 2006
Posts: 172
![]() |
Hi Dave - The mod you mention doesnt work for me since, as explained, the links should appear in the middle of the index (between 2 articles)...
David Marshall made it work... Anybody?? Last edited by Cris Santos; 12-05-2006 at 04:33 PM. |
|
|
|
|
|
#7 |
|
Join Date: Jul 2006
Location: St. Petersburg
Posts: 2,567
![]() |
It seems the code selected with red color is "unclosed tag"
Code:
{if $category.id == 0} my article {/if}
<div>{if $links}
{if $show_as_new}{$lang.new_links}{else}{$lang.links}{ /if}
</div>
{if $category.id == 0} my 2nd article {/if}
Code:
{if $category.id == 0} my article {/if}
<div>{if $links}
{if $show_as_new}{$lang.new_links}{else}{$lang.links}{ /if}
{/if}</div>
{if $category.id == 0} my 2nd article {/if}
|
|
|
|
|
|
#8 |
|
Join Date: Nov 2006
Posts: 10
![]() |
Very nice mod, thanks.
Joe |
|
|
|
|
|
#9 |
|
Join Date: Nov 2006
Posts: 45
![]() |
How can we have this feature in v2.1?
|
|
|
|
|
|
#10 |
|
Join Date: Jan 2007
Location: Sydney
Posts: 83
![]() |
Yes this is a feature I am looking for too can someone give the details for 2.1.01
|
|
|
|
![]() |
| 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 |