PDA

View Full Version : Customize List of links page


imagis
01-07-2007, 01:52 PM
Hello,

I want to customize lis of links page (sample: http://www.zftutorials.com/zend-config/)

I would like to remove: Report broken link, Link details.

I would move link to detail to link name.

There is a setting somewhere at least for some of this things or i need to customize template (already did for an other links site, so np).

John Turner
01-10-2007, 08:09 AM
Hi imagis,

I am glad you got it.
There isn't necessary to change any files.

imagis
01-10-2007, 08:19 AM
Actually, for putting link to link details on link title i had do do changes into templates.

Also, to put link to some custom fields....

Any other way ?

John Turner
01-10-2007, 11:08 AM
Please describe your modification in full.
I think it'll be helpful for somebody else.

Dave Baker
01-11-2007, 01:43 AM
Hello imagis,
You need changes in templates/youTemplate/link-display.tpl file
***Open templates/youTemplate/link-display.tpl and find code***

{if $config.broken_links_report}
| <a href="javascript:void(0)" onclick="reportBrokenLink({$link.id})">{$lang.report_broken_link}</a>
{/if}

***Remove it***
***In this file find code***

{if $config.mod_rewrite}
{if 'search' eq $tab}
{assign var="link_title" value=$link.title2}
{else}
{assign var="link_title" value=$link.title}
{/if}
<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}

***Replace with the following***

{if $config.mod_rewrite}
{if 'search' eq $tab}
{assign var="link_title" value=$link.title2}
{else}
{assign var="link_title" value=$link.title}
{/if}
{/if}

***In this file find code***

<div class="title">{if $link.crossed}@{/if} <a href="{$link.url}" class="title" id="l{$link.id}" {if $config.new_window}target="_blank"{/if}>{if $config.html_tags}{$link.title}{else}{text_html aText=$link.title}{/if}</a>

***Replace with the following code***

<div class="title">{if $link.crossed}@{/if} <a href="{if $config.mod_rewrite}{$config.base}{$config.dir}{$l ink.path}/{convert_str string=$link_title}-l{$link.id}.html{else}{$config.base}{$config.dir}v iew-link.php?id={$link.id}
{/if}" class="title" id="l{$link.id}" {if $config.new_window}target="_blank"{/if}>{if $config.html_tags}{$link.title}{else}{text_html aText=$link.title}{/if}</a>

***Save file***

Mominur Rahman
02-24-2007, 09:26 PM
I this (remove link details and move link to detail to link name) in v2.0.01 Aqua. But I got this message

Fatal error: Smarty error: [in link-display.tpl line 28]: syntax error: unexpected {else} (Smarty_Compiler.class.php, line 471) in /home/iwl/public_html/smarty/Smarty.class.php on line 1095

This may be because I also apply "Getting Rid of Full Path in Link Details URL MOD" http://www.esyndicat.com/forum/about6921.html

So how do I remove link details and move link to detail to link name?

Dave Baker
02-25-2007, 04:16 PM
Hello Mominur Rahman,
Please attach your link-display.tpl file to a post, we will try to check it.

Mominur Rahman
02-25-2007, 06:02 PM
My link-display.tpl

<tr>
<td colspan="2" class="link {$link.status}"{if $link.featured AND $config.featured_highlight AND $config.featured_links} style="background-color: {$config.featured_highlight}"{/if}{if $link.partner AND $config.partner_highlight AND $config.partner_links} style="background-color: {$config.partner_highlight}"{/if}{if $link.sponsored AND $config.sponsored_highlight AND $config.sponsored_links} style="background-color: {$config.sponsored_highlight}"{/if}>

<div class="title">{if $link.crossed}@{/if} <a href="{$link.url}" class="title" id="l{$link.id}" {if $config.new_window}target="_blank"{/if}>{if $config.html_tags}{$link.title}{else}{text_html aText=$link.title}{/if}</a>
{section name=star loop=$link.rank}<img src="{$img}star.png" alt="" />{/section}
</div>

<div class="description">{if $config.html_tags}{$link.description}{else}{text_h tml aText=$link.description}{/if}</div>
<div class="url">{$link.url}</div>
<div class="stat">

{if $config.mod_rewrite}

{if 'search' eq $tab}
{assign var="link_title" value=$link.title2}
{else}
{assign var="link_title" value=$link.title}
{/if}

<a href="{$config.base}{$config.dir}link-details-{$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}

{if ($editor.id eq $link.id_editor) || ($link.id_editor_edit eq '1')}
| <a href="{$config.base}{$config.dir}edit-link.php?id={$link.id}">{$lang.edit_link}</a>
{/if}

{if (($editor.id eq $link.id_editor) || ($link.id_editor_edit eq '1')) AND $config.sponsored_links}
| <a href="{$config.base}{$config.dir}upgrade-link.php?id={$link.id}">{$lang.upgrade_listing}</a>
{/if}

{if $config.amazon_link}
| <a href="http://partner.alexa.com/amzn/redirect_to_detail?amzn_id=esyndicatfree-20&amp;url={$link.url}">{$lang.view_amazon}</a>
{/if}

{if $config.broken_links_report}
| <a href="javascript:void(0)" onclick="reportBrokenLink({$link.id})">{$lang.report_broken_link}</a>
{/if}

{if $config.pagerank}
<br />{$lang.pagerank}: {if $link.pagerank eq '-1'}{$lang.not_available}{else}{$link.pagerank}{/if}<br />{print_pagerank pr=$link.pagerank}
{/if}
</div>

</td>
</tr>

Dave Baker
02-25-2007, 08:24 PM
I checked your code of link-display.tpl and was not finding any problems with {else}, but you have code "text_h tml" with blank in this code:

<div class="description">{if $config.html_tags}{$link.description}{else}{text_h tml aText=$link.description}{/if}</div>
<div class="url">{$link.url}</div>
<div class="stat">

Please check it and inform about results.

Mominur Rahman
02-27-2007, 09:36 AM
I apply this, now I there is no error code but the MOD that I previously made not working.

I applyed "Getting Rid of Full Path in Link Details URL MOD" http://www.esyndicat.com/forum/about6921.html . when I click on a link it shows "The requested URL /arts-and-entertainment/-l6.html was not found on this server."

Dave Baker
02-27-2007, 05:52 PM
Hello Mominur Rahman,
I've tested your directory and it seems that your directory has not this modification now. Please try to reimplement it.

Mominur Rahman
02-28-2007, 09:50 AM
This is my link-display.tpl file without modication -

<tr>
<td colspan="2" class="link {$link.status}"{if $link.featured AND $config.featured_highlight AND $config.featured_links} style="background-color: {$config.featured_highlight}"{/if}{if $link.partner AND $config.partner_highlight AND $config.partner_links} style="background-color: {$config.partner_highlight}"{/if}{if $link.sponsored AND $config.sponsored_highlight AND $config.sponsored_links} style="background-color: {$config.sponsored_highlight}"{/if}>

<div class="title">{if $link.crossed}@{/if} <a href="{$link.url}" class="title" id="l{$link.id}" {if $config.new_window}target="_blank"{/if}>{if $config.html_tags}{$link.title}{else}{text_html aText=$link.title}{/if}</a>
{section name=star loop=$link.rank}<img src="{$img}star.png" alt="" />{/section}
</div>

<div class="description">{if $config.html_tags}{$link.description}{else}{text_h tml aText=$link.description}{/if}</div>
<div class="url">{$link.url}</div>
<div class="stat">({$lang.clicks}: {$link.clicks};
{if $config.link_comments}
{$lang.comments}: {$link.comments};
{/if}

{$lang.link_added}: {$link.date|date_format:$config.date_format}) ::

{if $config.mod_rewrite}
{if 'search' eq $tab}
{assign var="link_title" value=$link.title2}
{else}
{assign var="link_title" value=$link.title}
{/if}
<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}

{if ($editor.id eq $link.id_editor) || ($link.id_editor_edit eq '1')}
| <a href="{$config.base}{$config.dir}edit-link.php?id={$link.id}">{$lang.edit_link}</a>
{/if}

{if (($editor.id eq $link.id_editor) || ($link.id_editor_edit eq '1')) AND $config.sponsored_links}
| <a href="{$config.base}{$config.dir}upgrade-link.php?id={$link.id}">{$lang.upgrade_listing}</a>
{/if}

{if $config.amazon_link}
| <a href="http://partner.alexa.com/amzn/redirect_to_detail?amzn_id=esyndicatfree-20&amp;url={$link.url}">{$lang.view_amazon}</a>
{/if}

{if $config.broken_links_report}
| <a href="javascript:void(0)" onclick="reportBrokenLink({$link.id})">{$lang.report_broken_link}</a>
{/if}

{if $config.pagerank}
<br />{$lang.pagerank}: {if $link.pagerank eq '-1'}{$lang.not_available}{else}{$link.pagerank}{/if}<br />{print_pagerank pr=$link.pagerank}
{/if}
</div>

</td>
</tr>


When I Modify it to Get Rid of Full Path in "Link Details" URL (http://www.esyndicat.com/forum/about6921.html) it becomes this -

<tr>
<td colspan="2" class="link {$link.status}"{if $link.featured AND $config.featured_highlight AND $config.featured_links} style="background-color: {$config.featured_highlight}"{/if}{if $link.partner AND $config.partner_highlight AND $config.partner_links} style="background-color: {$config.partner_highlight}"{/if}{if $link.sponsored AND $config.sponsored_highlight AND $config.sponsored_links} style="background-color: {$config.sponsored_highlight}"{/if}>

<div class="title">{if $link.crossed}@{/if} <a href="{$link.url}" class="title" id="l{$link.id}" {if $config.new_window}target="_blank"{/if}>{if $config.html_tags}{$link.title}{else}{text_html aText=$link.title}{/if}</a>
{section name=star loop=$link.rank}<img src="{$img}star.png" alt="" />{/section}
</div>

<div class="description">{if $config.html_tags}{$link.description}{else}{text_h tml aText=$link.description}{/if}</div>
<div class="url">{$link.url}</div>
<div class="stat">({$lang.clicks}: {$link.clicks};
{if $config.link_comments}
{$lang.comments}: {$link.comments};
{/if}

{$lang.link_added}: {$link.date|date_format:$config.date_format}) ::

{if $config.mod_rewrite}
{if 'search' eq $tab}
{assign var="link_title" value=$link.title2}
{else}
{assign var="link_title" value=$link.title}

<a href="{$config.base}{$config.dir}link-details-{$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}

{if ($editor.id eq $link.id_editor) || ($link.id_editor_edit eq '1')}
| <a href="{$config.base}{$config.dir}edit-link.php?id={$link.id}">{$lang.edit_link}</a>
{/if}

{if (($editor.id eq $link.id_editor) || ($link.id_editor_edit eq '1')) AND $config.sponsored_links}
| <a href="{$config.base}{$config.dir}upgrade-link.php?id={$link.id}">{$lang.upgrade_listing}</a>
{/if}

{if $config.amazon_link}
| <a href="http://partner.alexa.com/amzn/redirect_to_detail?amzn_id=esyndicatfree-20&amp;url={$link.url}">{$lang.view_amazon}</a>
{/if}

{if $config.broken_links_report}
| <a href="javascript:void(0)" onclick="reportBrokenLink({$link.id})">{$lang.report_broken_link}</a>
{/if}

{if $config.pagerank}
<br />{$lang.pagerank}: {if $link.pagerank eq '-1'}{$lang.not_available}{else}{$link.pagerank}{/if}<br />{print_pagerank pr=$link.pagerank}
{/if}
</div>

</td>
</tr>


Now what I do to remove link details and move link to detail to link name? Like this site http://www.zftutorials.com/zend-config/ but when click on a link it leads to http://www.zftutorials.com/link-detail-ID.html

Mominur Rahman
03-01-2007, 04:24 PM
So is there any way to do it?

Mominur Rahman
03-01-2007, 07:26 PM
It done. I fixed it by a simple change.

<div class="title">{if $link.crossed}@{/if} <a href="{if $config.mod_rewrite}{$config.base}{$config.dir}lin k-details-{$link.id}.html{else}{$config.base}{$config.dir}vi ew-link.php?id={$link.id}
{/if}" class="title" id="l{$link.id}" {if $config.new_window}target="_blank"{/if}>{if $config.html_tags}{$link.title}{else}{text_html aText=$link.title}{/if}</a>

Dave Baker
03-01-2007, 11:54 PM
Hello Mominur Rahman,
There's problem with mod rewrite in view-link.php:
***Open view-link.php and find code(around line # 204):***

if (empty($link) || ($config->get("mod_rewrite") && !$Category->exists("`id`='".$link['id_category']."' AND `status`='active' AND `path`='".$_GET['cat']."'")))
{
$_GET['error'] = "404";
include(HOME."error.php");
exit;
}

***Replace with***

if (empty($link) || (0 && !$Category->exists("`id`='".$link['id_category']."' AND `status`='active' AND `path`='".$_GET['cat']."'")))
{
$_GET['error'] = "404";
include(HOME."error.php");
exit;
}

***Save file***