This is a simple php mod i have made in order to block certain websites from submitting to my directory after i started getting a few spam submissions.
Open submit.php and Find
$data['URL'] = "http://".$data['URL'];
Add below
require_once 'spamlist.php';
—————————-
Create a file called “spamlist.php” and insert the following
<?
$bansite[0] = 'aceroot.info';
$bansite[1] = 'orgfree.com';
$bansite[2] = 'ase3dj.info';
// add more above if needed
$count = count($bansite);
for($i = 0; $i <= $count-1; $i++)
{
if (strpos($data['URL'], $bansite[$i]) == True)
{
echo "<h1>The domain $bansite[$i] is banned for spamming</h1>";
exit;
}
}
//if [/URL] or http:// is found in description then stop and exit.
if (strpos($data['DESCRIPTION'], "[/URL]") == True){exit;}
if (strpos($data['DESCRIPTION'], "[/url]") == True){exit;}
if (strpos($data['DESCRIPTION'], "http://") == True){exit;}
?>
——— Upload both files
Origionally the directory had links to each pages xml feed but after installing the new Internet Explorer v7 i realised that the feed button wasnt lighting up.
After doing some research i found out the correct meta tag was missing, here is the code i have used to get the rss buttonĀ
to light up
{if $category.ID eq not 0 and not $p}
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="{$smarty.const.DOC_ROOT}/rss.php?{if $qu ne ''}q={$qu}{elseif $p}p={$p}{else}c={$category.ID}{/if}" />
{/if}
Today i changed the amount of links on each page and limited them to 20 per page, instead of having a question mark in the page name for page 2 and 3 etc (?p=2) i have modded it to makes it the second page like this
page2.html
Added following line to .htaccess file
## Pagination Rewrite
RewriteRule page(.*)\.html$ (.*)/?p=$1
Modify /templates/footer.tpl
FROM: {assign var=’url_pattern’ value=’?p=$’}
TO: {assign var=’url_pattern’ value=’page$.html’}
Modify /includes/functions.php
FROM: $qp = strpos($path, ‘?’);
TO: $qp = strpos($path, ‘page’);
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");
?>