Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 01:58 am EST
Geeklog Forums
New Plugin For Classified Ads
Dirk
I've been using Michael De La Rue's Classifads script to provide classified ads on one of my sites for some time now. Then I thought that this would also make a nice plugin for Geeklog. So I hacked on it long enough until in gave up and integrated nicely into Geeklog.
Please note that this is my first plugin and the integration is not as complete yet, as one might wish. Let me know what you think about it.
The feature list of this plugin is almost identical to the original script by Michael De La Rue:
- Any number of easily configurable categories
- Posters choose how many weeks to display their ad for.
- A "new listings" front page with a drop-down selection of categories to choose from.
- The script uses a combination of IP logging and cookies, so that if visitors have either a static IP address or cookies enabled, they can alter their ad without having to remember a password. Any ads posted by the visitor are listed with an "alter it" and "delete it" button beneath them.
- If an email address / url is given, the listing will include an EMAIL / SITE link at the bottom. If not, only the Title - Author & Description are shown.
- The script automatically erases expired ads from the database.
Additional features, specific to the Geeklog plugin:
- easy install (you have to copy some files manually, then call an install script that does the rest)
- available in two languages (English and German)
Download here (21 K
bye, Dirk
Dirk
Okay, the first issues have come up (thanks to toad for the quick feedback). It seems my version of PHP is a bit more fault-tolerant than others ...
If you get "undeclared function" errors, check public_html/index.php and public_html/updata.php and remove the dollar signs from these lines:
echo $COM_endBlock();
echo $COM_siteFooter();
While you're at it, add the following line in public_html/index.php:
$i = "0";
$posti = array (); // this is the line to add
while($ad = mysql_fetch_assoc($query)) {
(that's lines 57-59).
Of course, you could instead just download the updated tarball from the URL provided in the original story.
Sorry about that.
bye, Dirk
Anonymous
squatty
In a world without walls and fences, who needs Windows and Gates?
Dirk
Sounds like a good idea. We have these hints in Geeklog whenever you can enter a URL, so we should have them in the plugins, too. I will add this in the next release of the plugin.
BTW, you might want to add this in updata.php, too.
bye, Dirk
Dirk
Thanks, squatty. That will make a nice addition to the plugin and make it integrate further into Geeklog. It should be relatively easy to pull the necessary code from public_html/index.php. Let me know how you get on with it.
bye, Dirk
squatty
I created a separate php file named display_ads.php. You can view the source code here. Note, the select statement will ONLY display ads submitted within the last 48 hours (at least that's what it's supposed to do
To deploy the block, complete the following:
function phpblock_classifieds()
{
global $_CONF;
$path = $_CONF['path_html'] . "classifads";
include_once($path . "/display_ads.php");
$display = getads();
return $display;
}
You will also notice that I added two links at the bottom of the block. The submit link goes to an additional page I created. I removed the submit logic from the original index.php. This was just a preference of mine. You can see my version of the plug-in at http://www.squatty.com.
Thanks,
Squatty
In a world without walls and fences, who needs Windows and Gates?
Dirk
Thanks, squatty! I had to hack it a bit to get it working, though. But it sure is as nice addition to the plugin, so I will add something like this to the next version of the plugin. I also borrowed your "Fields in bold are required" line, if you don't mind ;-)
bye, Dirk
toad
squatty
In a world without walls and fences, who needs Windows and Gates?
toad
toad
squatty
In a world without walls and fences, who needs Windows and Gates?
toad
toad
toad
squatty
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content