View Full Version : Question about link sorting
kentuckyslone
06-17-2006, 08:00 PM
My links will not sort alphabetically. Does anyone have an idea of why or what needs to be done?
v 3.0.4
Thanks
hello mr. kentucky.
Can you tell me what you've modified in your directory, if anything at all?
Rob
kentuckyslone
06-17-2006, 08:12 PM
I have modified the main.tpl and several other files (header, footer and top_bar). I did try replacing the files with the original ones but that didnt make a difference.
Content visible to registered users only.
yea, sometimes things get a bit skewed and we don't realize it until it's not working. (i am guilty of this myself :D)
maybe posting up your tpl files would better help us all, so that others can take a peek around.
bobby9101
06-17-2006, 08:41 PM
it is an index.php prblem i am pretty sure
i can almost gaurantee it isnt a tpl problem
try using a new index.php
kentuckyslone
06-17-2006, 09:13 PM
I havent done anything to modify the index.php
MAIN TPL
{* Calculate title from path *}
{capture name="title"}
{if count($path) > 1} - {/if}
{foreach from=$path item=category name=path}
{if $smarty.foreach.path.iteration gt 2}
>
{/if}
{if not $smarty.foreach.path.first}
{$category.TITLE}
{/if}
{/foreach}
{/capture}
{strip}
{if $title_prefix}
{assign var="in_page_title" value=$title_prefix|cat:$category.TITLE}
{else}
{assign var="in_page_title" value=$category.TITLE}
{/if}
{assign var="description" value=$category.DESCRIPTION}
{include file="header.tpl"}
{include file="top_bar.tpl"}
{* Calculate the number of categories per row *}
{php}
$this->assign('cats_per_col', ceil(count($this->get_template_vars('categs')) / CATS_PER_ROW));
{/php}
{if $cats_per_col > 15}
{php}
$this->assign('cats_per_col', ceil(count($this->get_template_vars('categs')) / (CATS_PER_ROW + 1)));
{/php}
{/if}
{* Show category search results *}
{if $search_category}
{$search_category}
{/if}
{if isset($have_search_results) && $have_search_results == 0}
<div>
<p>{l}Sorry, no records found that match your keyword(s){/l}: "{$search|escape|wordwrap:200:"\n":true}"</p>
<p>{l}Suggestions{/l}:</p>
<p>
<ul>
<li>{l}Make sure all words are spelled correctly{/l}.</li>
<li>{l}Try different keywords{/l}.</li>
<li>{l}Try more general keywords{/l}.</li>
</ul>
</p>
</div>
{/if}
{if $category.ID gt 0 or $qu}
{include file="catlinks.tpl"}
{/if}
<p id="descr">{$description|escape|trim} </p>
{* Categories *}
{if !empty($categs)}
{if !empty($category.ID)}
<h3>{l}Categories{/l}</h3>
{/if}
<center>
<table width="95%" border="0" cellpadding="20" cellspacing="0">
<tr>
{foreach from=$categs item=cat name=categs}
{if ($smarty.foreach.categs.iteration mod $cats_per_col eq 1 and $cats_per_col gt 1) or $smarty.foreach.categs.first}<td width="33%" align="left">{/if}
<h2>
{if $category.ID eq 0}<img width="10" height="10" hspace="5" src="<A href="http://www.directoryfrog.com/images/bullet.gif">{/if">http://www.directoryfrog.com/images/bullet.gif">{/if}
<a href="{if $smarty.const.ENABLE_REWRITE}{$cat.TITLE_URL|escap e}/{else}index.php?c={$cat.ID}{/if}">{$cat.TITLE|escape}</a>{if $smarty.const.CATS_COUNT} <span class="count">({$cat.COUNT})</span>{/if}</h2>
{* Display subcategories *}
{if !empty($cat.SUBCATS)}
<p class="subcats">
{foreach from=$cat.SUBCATS item=scat name=scategs}
<a href="{if $smarty.const.ENABLE_REWRITE}{$cat.TITLE_URL|escap e}/{$scat.TITLE_URL|escape}/{else}index.php?c={$scat.ID}{/if}">
{$scat.TITLE|escape}</a> {/foreach}
</p>
{/if}
{if ($smarty.foreach.categs.iteration mod $cats_per_col eq 0 and $cats_per_col gt 1) or $smarty.foreach.categs.last}</td>{/if}
{/foreach}
</tr>
</table>
</center>
{/if}
{if $smarty.const.FTR_ENABLE == 1 && !empty($feat_links)}
<h3>{l}Featured Links{/l}</h3>
{foreach from=$feat_links item=link name=links}
{include file="link.tpl" link=$link}
{/foreach}
{/if}
{* Links heading and sorting*}
{if ($uid || $search || !empty($category.ID) || $list) && !empty($links)}
<h3>{l}Links{/l} {if not $list}<span class="small" style="margin-left:50px;">{l}Sort by{/l}:
{if $smarty.const.ENABLE_PAGERANK and $smarty.const.SHOW_PAGERANK}{if $sort eq 'P'}<span class="sort"> {l}PageRank{/l}</span>{else}<a href="?s=P{if not $smarty.const.ENABLE_REWRITE}&c={$category.ID}{/if}{if $search}&search={$search}{/if}{if $uid}&uid={$uid}{/if}"> {l}PageRank{/l}</a>{/if} |{/if}
{if $sort eq 'H'} <span class="sort">{l}Hits{/l}</span>{else} <a href="?s=H{if not $smarty.const.ENABLE_REWRITE}&c={$category.ID}{/if}{if $search}&search={$search}{/if}{if $uid}&uid={$uid}{/if}">{l}Hits{/l}</a>{/if}
{if $sort eq 'A'} | <span class="sort">{l}Alphabetical{/l}</span>{else} | <a href="?s=A{if not $smarty.const.ENABLE_REWRITE}&c={$category.ID}{/if}{if $search}&search={$search}{/if}{if $uid}&uid={$uid}{/if}">{l}Alphabetical{/l}</a>{/if}
</span>{/if}</h3>
{if $category.ID gt 0 or $qu}
{include file="rightlinks.tpl"}
{/if}
<div id="links">
{foreach from=$links item=link name=links}
{include file="link.tpl" link=$link}
{/foreach}
</div>
{/if}
{if $category.ID gt 0 or $qu}
{include file="googlead.tpl"}
{/if}
{* Javascript for tracking link clicks *}
{if $StopLinkHits eq 0}
<script language="javascript" type="text/javascript">
/* <![CDATA[ */
var root = '{$smarty.const.DOC_ROOT}';
{literal}
var a = document.getElementsByTagName("a");
for(i = 0; i< a.length; i++)
if(a[i].id != '')
a[i].onclick = count_link;
function count_link() {
i = new Image();
i.src= root+'/cl.php?id='+this.id;
return true;
}
{/literal}
/* ]]> */
</script>
{/if}
{include file="footer.tpl"}
{/strip}
HEADER
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{if empty($TITLE)}{$smarty.const.DIRECTORY_TITLE}{/if}{$smarty.capture.title|strip}</title>
<meta name="description" content="{$description}">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.DOC_ROOT}/main.css" />
<meta name="robots" content="index, follow" />
{* Please keep this line for a better tracking*}
<meta name="generator" content="PHP Link Directory {$smarty.const.CURRENT_VERSION}" />
{* Live Bookmarks *}
{if $smarty.const.ENABLE_RSS and (!empty($search) or $category.ID gt 0 or $list) && count($links) gt 0}
<link rel="alternate" type="application/rss+xml" title="{$in_page_title|escape|trim}" href="{$smarty.const.DOC_ROOT}/rss.php?{if !empty($search)}search={$search|@urlencode}{elseif $p}p={$p}{elseif $list}list={$list}{else}c={$category.ID}{/if}">
{/if}
<script language="javascript" type="text/javascript" src="files/libraries.js"></script>
</head>
<body leftMargin=10 topMargin=0 onload="" rightMargin=10 marginheight="0">
<table width="100%" cellpadding="15" border="0">
<tr>
<td width="320" align="left" valign="top">
<a href="http://www.directoryfrog.com/">
<img align="left" width="220" height="37" alt="Directory Frog Links and Website Listings logo" border="0" src="http://www.directoryfrog.com/images/dfbanner.jpg" /></a>
</td>
<td align="left" valign="top">
<!-- Search Google -->
<center>
<form method="get" action="http://www.google.com/custom" target="google_window">
<table bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
<a href="http://www.google.com/">
<img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a>
<input type="text" name="q" size="31" maxlength="255" value=""></input>
<input type="submit" name="sa" value="Search"></input>
<input type="hidden" name="client" value="pub-4706832482021024"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="6214377857"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center ;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000 000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
</center>
<!-- Search Google -->
</td>
</tr>
</table>
kentuckyslone
06-17-2006, 09:15 PM
TOP BAR
{strip}
<div id="path">
<div class="submit">
{* Right(!!) part of the top bar *}
<a href="<A href="http://www.directoryfrog.com/">Home</a">http://www.directoryfrog.com/">Home</a> |
<a href="<A href="http://www.directoryfrog.com/contact.php">Contact">http://www.directoryfrog.com/contact.php">Contact Us</a> |
{* Submit Link *}
<a href="{$smarty.const.DOC_ROOT}/submit.php" title="{l}Submit your link to the directory{/l}">{l}Submit Link{/l}</a>
|
{if $smarty.const.REQUIRE_REGISTERED_USER == 1 && !empty($regular_user_details)}
<a href="{$smarty.const.DOC_ROOT}/index.php?uid={$regular_user_details.ID}" title="{l}Browse personal links{/l}">{l}View my links{/l}</a>
|
{/if}
<a href="{$smarty.const.DOC_ROOT}/index.php?list=latest" title="{l}Browse latest submitted links{/l}">{l}Latest Links{/l}</a>
|
<a href="{$smarty.const.DOC_ROOT}/index.php?list=top" title="{l}Browse most popular links{/l}">{l}Top Hits{/l}</a>
{* RSS feed icon *}
{if $smarty.const.ENABLE_RSS and (!empty($search) or !empty($category.ID) or $p or $list)}
|
<a href="{$smarty.const.DOC_ROOT}/rss.php?{if !empty($search)}search={$search|@urlencode}{elseif $p}p={$p}{elseif $list}list={$list}{else}c={$category.ID}{/if}">
<img src="{$smarty.const.DOC_ROOT}/images/xml.gif" align="top" alt="RSS Feed" border="0" />
</a>
{/if}
{* Search form *}
<form action="{$smarty.const.DOC_ROOT}/index.php" method="get">
<input type="text" name="search" size="20" maxlength="250" class="text" value="{if !empty($search)}{$search|escape}{/if}" /> <input type="submit" value="{l}Search the Frog{/l}" class="btn" />
</form>
</div>
{* Left(!!) part of the top bar *}
{* Display current path *}
{assign var="current_path" value=""}
{foreach from=$path item=cat name=path}
{assign var="current_path" value="`$current_path``$cat.TITLE_URL`/"}
{if !$smarty.foreach.path.first} » {/if}
{if !$smarty.foreach.path.last}
<a href="{if $smarty.const.ENABLE_REWRITE}{$current_path}{else} index.php?c={$cat.ID}{/if}">{$cat.TITLE|escape}</a>
{else}
{$cat.TITLE|escape}
{/if}
{/foreach}
</div>
{if $smarty.const.REQUIRE_REGISTERED_USER == 1}
<div id="user-bar">
{if empty($regular_user_details)}
<a href="{$smarty.const.DOC_ROOT}/login.php" title="{l}Log In to your account{/l}">{l}Login{/l}</a>
|
<a href="{$smarty.const.DOC_ROOT}/profile.php?mode=register" title="{l}Register new user{/l}">{l}Register{/l}</a>
{else}
{l}Welcome:{/l} <strong>{$regular_user_details.NAME|escape}</strong> [<a href="{$smarty.const.DOC_ROOT}/logout.php" title="{l}Log out of this account{/l}">{l}Sign Out{/l}</a>, <a href="{$smarty.const.DOC_ROOT}/profile.php?mode=edit" title="{l}Edit your account settings{/l}">{l}My Account{/l}</a>]
{/if}
</div>
{/if}
{/strip}
sifting through the posted mail.tpl (rather quickly) i noticed something right off... what's this?
{if $category.ID gt 0 or $qu}
{include file="catlinks.tpl"}
{/if}
did you modify your links as well?
kentuckyslone
06-17-2006, 09:19 PM
That is the table that appears on the right hand side of my links listing. I used the same format for it as I did for the google ads
I might be able to lend a few moments to try and help out, but not until Monday. If you can hold out until then, then i can try and help you sort this out.
Rob
edit: i know it's not a major issue, but i do understand that you'd want it working properly.
if anyone thinks they can handle this, then they are more than welcome to join in.
kentuckyslone
06-17-2006, 09:27 PM
Thank you Rob. As a test I removed the
{if $category.ID gt 0 or $qu}
{include file="catlinks.tpl"}
{/if}
from the main.tpl but it did not correct the issue.
Content visible to registered users only.
I figured it wouldnt, because I think something may be affecting the assigning of the sort order type, mixed with mod rewrite. (and people know i hate dealing with mod rewrite)
bobby9101
06-17-2006, 10:25 PM
please try a new index.php, functions.php, and init.php
make sure you backup
even if you didnt edit the files please try it
oh and please post your .htaccess because it acyually could be a mod rewrite error
kentuckyslone
06-18-2006, 10:12 PM
I dont know how to explain it but today when I checked my directory the links were sorted alphabetically. I didnt make any changes at all. Strange gremlins in the machine I guess.
Thaks to everyone for your help
Magical gremlins ;)
It's a Love/Hate type of relationship :D
Rob
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.