PHP Link Directory Mods and Plugins
PHP Link Directory has been installed on over 10,000 websites. These mods and plugins will help you
differentiate your directory from the rest, and having a cool new directory that's different than the
other 9,999 will mean more submissions and more money.
Premium Mods (Click to Expand)
Dynamically add RSS feeds to your categories
RSSFeed.tpl is a simple template file that you can drop into any existing directory to instantly get
RSS Feeds from either Yahoo or Google News.
To use it one simply references the tpl as such:
{include file="rssfeed.tpl"}
Now News feeds will appear at that spot in your template.
The Version 3.xx plugin feeds are based on the keywords for that category page, so you must have keywords
defined for every category you want news feeds to appear in. The version 2.xx plugin uses the category path
(for example: Directory » Computers » Directories » Free)
You must purchase access to the Member's Area to get this PHP Link Directory plugin
Allow HTML Attributes in Link Descriptions
In php Link Directory version 3.1, an option was added to allow users to use html to format their listings.
The directory admin is given a field to enter allowable html tags like <p>, <table>, <div>,
or <span>. Unfortunately, all attributes for these tags are stripped by default. While this does
create a secure script, it is still a bit constrictive. For example, the title attribute (that is <div
title="This is my div">) is fairly inocuous as are align, width, or type. It also prevents you from
doing something spiffy like allowing users to post a link to an image file hosted on a remote server.
Granted, stupid users could still use these tags to make their listing look goofy by setting the width
of a div to some huge number for example, but that's where editors come in. So, I created a mod that adds
an allowable attributes field in the admin panel sso that you can not only allow users to enter HTML,
you can also specify which attributes are allowed.
You should be warned that allowing attributes increases the risk of XSS attacks and stupid/malicious users
defacing their listing in an attempt to discredit your site. The input filter will still strip all known
"nasty words" (like javascript) and prevent all known XSS attacks, but its the unkown threats that we worry
about. If you install this mod, please be sure to review your submissions carefully!
You must purchase access to the Member's Area to get this PHP Link Directory plugin
Link Submission Calendar
This is a nifty mod that will add a few pages to your directory. It creates a calendar (borrowing heavily
from the Smarty Calendar plugin written by Michael Yoon and Andrew Nagy) with each day hyperlinked. As you
browse through the days, the calendar will display what links were added that day. This is a great plugin to
let people know that your directory isn't dead.
The best way to describe this mod is to see it in action: http://www.dakotatundra.com/link_history.php
You must purchase access to the Member's Area to get this PHP Link Directory mod
Email Confirmation Link
This is a handy mod that will help cut down on spam in your directory. Emailed confirmations will require users
to click a confirmation link that is included in their "Your Link Was Submitted" email before it gets placed in
your Approve Links queue. Once they click the link, their link status will be set to pending so that you can
review it for inclusion in your directory. If they never click the link, their link remains inactive. Because
they must click the link in their email, you are assured that they are using an email address that is valid and
controlled by them.
Another feature of this script is that it meets the double opt in requirement so that you can legally send
newsletters or other email messages (such as those promoting your latest affiliate program) to users. This can
help turn your directory's measly adsense profits into something more.
You must purchase access to the Member's Area to get this PHP Link Directory mod
Require Submission From Category Pages Only
This mod requires submitters to browse to their desired category page before they are able to submit their link.
No category selection is allowed from the submit page. Even if someone goes directly to submit.php in your
directory, most of the submit fields will be disabled, and they will not be able to submit links.
You must purchase access to the Member's Area to get this PHP Link Directory mod
Random Banner/Image/Whatever Rotator
This mod will allow you to randomly display banners, images, text, or what ever you want on your site. It can be
used to rotate images, display affiliate banners, give a quote of the day, or display any other thing at random.
All you have to do is create a tpl file for every item you want randomly rotated, and this script does the rest.
You must purchase access to the Member's Area to get this PHP Link Directory mod
Improved RSS Feed
This mod improves the quality of the RSS feed from your directory by adding more details to the Channel and each Item.
It ustilizes a version checking routine that makes it compatible with all versions of phpLD.
You must purchase access to the Member's Area to get this PHP Link Directory mod
Newsletters
This PLD Mod gives you the ability to send out an HTML newsletter to everyone in your directory that has submitted
and confirmed a link (see requirements).
Requirements:
PHP Link Directory 2.xx
Due to laws concerning unsolicited emails, this mod is coded to require the Emailed Confirmation link Mod.
You must purchase access to the Member's Area to get this PHP Link Directory mod
Free Mods (Click to Expand)
Get Actual IP Addresses so you can Ban Spammers
Spammers are always a problem. Until we treat them like the terrorists they are (by sending a cruise missile through
their front door), we will have to come up with ways to prevent their spam. Here's one method to help you combat
the spam submissions to your directory.
First, open include/functions.php and find the following (around line 114 in pld 2.xx and around line 806 in pld 3.xx):
function get_client_ip() {
if (isset ($_SERVER['HTTP_X_FORWARDED_FOR']))
$ipAddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
else
$ipAddress = $_SERVER['REMOTE_ADDR'];
return $ipAddress;
}
Change this to:
function get_client_ip() {
$ipAddress = $_SERVER['REMOTE_ADDR'];
return $ipAddress;
}
Here's why:
X_FORWARDED_FOR can easily be spoofed by using a proxy server and a spoofed IP. By getting rid of this in favor of
the proxy server's IP address (which will be reported by REMOTE_ADDR), we can ban it in our htaccess. Sure, we aren't
banning the spammer, but we are banning the proxy server they are using. HTTP_X_FORWARDED_FOR should really only be
used when you can be certain no one is spoofing IPs (only in an intranet maybe?)
Show the Last 5 Submissions on the Index page
In index.php find:
// Assign template variables
$tpl->assign('category' , $path[count ($path) - 1]);
$tpl->assign('path' , $path);
and BEFORE it add:
$last5 = array();
$last5 = $db->GetAll("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' ORDER BY `ID` DESC LIMIT 0,5");
$last5=addCategPathToLinks($last5);
$tpl->assign('last_5',$last5);
Now open up main.tpl (or whatever template you intend to include this in) and add:
{section name=last_link loop=$last_5}
<div>
<a href="{$last_5[last_link].URL}">{$last_5[last_link].TITLE}</a>
<br />
{$last_5[last_link].DESCRIPTION}
<br />
<span class="url">{$last_5[last_link].URL}</span>
<br />
Category: <a href="{$last_5[last_link].CATEGORY_URL}">{$last_5[last_link].CATEGORY_TITLE}</a>
</div><br /><br />
{/section}
Change the Order of the Breadcrumb Trail
This code will change the order in which categories are displayed in the top bar. The default order is like this:
Directory » Category » Sub-Category
This mod will make the path display as:
Sub-Category « Category « Directory
Open topbar.tpl and find this code:
{* 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|trim}</a>
{else}
{$cat.TITLE|escape|trim}
{/if}
{/foreach}
Replace it with this code:
{* Display current path in reverse *}
{assign var="current_path" value=""}
{section name=foo loop=$path step=-1}
{assign var="current_path" value="`$current_path``$path[foo].TITLE_URL`/"}
{if !$smarty.section.foo.first}
« <a href="{if $smarty.const.ENABLE_REWRITE}{$current_path}{else}index.php?c={$path[foo].ID}{/if}">{$path[foo].TITLE|escape|trim}</a>
{else}
{$path[foo].TITLE|escape|trim}
{/if}
{/section}