Web log to sparedirectory.com

December 5, 2006

Top hits mod

Filed under: Directory mods — links @ 1:24 pm

This is a mod i added to make the top hits and latest link pages more search engine friendly, there are 2 methods of doing this i have used, so i will explain them both.
In the top_bar.tpl file change the top links and top hits to what ever you want, php, html etc.
<a href="{$smarty.const.DOC_ROOT}/latest-links.php">Latest Links</a>
<a href="{$smarty.const.DOC_ROOT}/top-hits.php">Top Hits</a>

————————————-
The first method is used if your directory is installed at the top level domain, then simply add the following lines to your .htaccess file to re-write the new pages to the old pages.

RewriteRule latest-links.php index.php?p=d
RewriteRule top-hits.php index.php?p=h

————————————-
method 2, if your directory is stored in a directory or sub folder other than top level then create two PHP files, called top_hits or most-visited etc then add this to each page adjusting as needed.

<?
$dirloc=$_SERVER[’PHP_SELF’];
$dirloc = str_replace("/latest-links.php", "", $dirloc);
include("http://".$_SERVER[’HTTP_HOST’]."$dirloc/index.php?p=d");
?>

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.

Sparedirectory blog is Powered by WordPress. RSS feed