MOD Display new links on index page - Page 4 - eSyndiCat User Forums
eSyndiCat User Forums esyndicat directory software esyndicat support

Go Back   eSyndiCat User Forums > eSyndiCat Directory Software [FREE] > Modifications

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.

Reply
 
Thread Tools Display Modes
Old 03-19-2007   #31
Tilek E.
 
Join Date: Sep 2006
Posts: 384
Tilek E. is on a distinguished road
Default

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);
#2. Save changes and close the file.

#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 -->
#4. Save changes and close the file.

#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}
#6. Replace the code you found with the following code:

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}
#7. Save changes and close the file.

That's it!

Please feel free to ask in case you have any questions.
Tilek E. is offline   Reply With Quote
Old 03-20-2007   #32
kamy81
 
Join Date: Feb 2007
Posts: 59
kamy81 is on a distinguished road
Default

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.
kamy81 is offline   Reply With Quote
Old 03-21-2007   #33
ibs
.
 
ibs's Avatar
 
Join Date: Aug 2006
Posts: 349
ibs is on a distinguished road
Default

ok i followed the instructions to the letter and they work for me perfectly thanks!!!
ibs is offline   Reply With Quote
Old 03-22-2007   #34
ksgboy2
 
Join Date: Jan 2007
Posts: 36
ksgboy2 is on a distinguished road
Default

Hi Dave

How to make showing new links just on home page not on all categories pages
__________________
Free Directory - Submit Now!
ksgboy2 is offline   Reply With Quote
Old 03-22-2007   #35
ksgboy2
 
Join Date: Jan 2007
Posts: 36
ksgboy2 is on a distinguished road
Default

Nermind I found solution
__________________
Free Directory - Submit Now!
ksgboy2 is offline   Reply With Quote
Old 03-22-2007   #36
Tilek E.
 
Join Date: Sep 2006
Posts: 384
Tilek E. is on a distinguished road
Default

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.
Tilek E. is offline   Reply With Quote
Old 03-22-2007   #37
Tilek E.
 
Join Date: Sep 2006
Posts: 384
Tilek E. is on a distinguished road
Default

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 -->
Tilek E. is offline   Reply With Quote
Old 03-22-2007   #38
kamy81
 
Join Date: Feb 2007
Posts: 59
kamy81 is on a distinguished road
Default

Thanks David Evans. Excellent job
Its very helpful for me
kamy81 is offline   Reply With Quote
Old 03-22-2007   #39
Loren
 
Loren's Avatar
 
Join Date: Apr 2006
Location: UK
Posts: 1,095
Loren is an unknown quantity at this point
Default

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
__________________
Light and Peace
Spirit Mind Body UK ~ Holistic Directory

Loren is offline   Reply With Quote
Old 03-23-2007   #40
kamy81
 
Join Date: Feb 2007
Posts: 59
kamy81 is on a distinguished road
Default

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
kamy81 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT. The time now is 10:53 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Testimonials | Articles | Support | Documentation | Privacy Policy | License | Affiliates | Contact Us | SEO Resources