[Request Feature] Place the output on Sidebar

You have feature Requests, or some Bugs found within the port of PHPIDS WPIDS? Tell them here.

[Request Feature] Place the output on Sidebar

Postby Ronnie on Mon Nov 26, 2007 4:50 pm

Hello

I'm currently using the v0.1.1 version fo WPIDS, and i love it. But, i don't know how to put the "attack" output on my wordpress theme sidebar, totally like on the sidebar of php-ids website : http://php-ids.org/

So, can you tell me how to do it? and/or perhaps you can adding that feature? Thanks you.
Ronnie
 

Re: [Request Feature] Place the output on Sidebar

Postby Philnate on Fri Dec 28, 2007 10:07 am

Currently you need to add it manually to your sidebar of your template, we may release some Widget which will allow you to easily show these informations. But we're not sure about it, as it's sense is doubtable. But if you like to display some Informations you can do it with something like that within your Blog template:
Code: Select all
<?php
echo ("<li id=wpids><h2>Latest caught Attacks:</h2><ul>");
$attackfields = array("GET","POST","REQUEST","SERVER REQUEST_URI","SERVER USER_AGENT","SERVER REFERER","COOKIE");
$records = $wpdb->get_results("SELECT `page`, `ip`, `tag`, `value` FROM $GLOBALS[table_prefix]sec_log ORDER BY id DESC LIMIT 10",ARRAY_A);
foreach ($records as $record)
{
echo ("<li title=\"".htmlspecialchars($record['value'])."\"><strong><a href=\"http://www.ip2location.com/$record[ip]\">".ereg_replace("[^[:digit:].]", "", $record[ip])."</a></strong><br />");
if ($record['tag']=='')
{
echo($attackfields[$record['attacked']]."=".htmlspecialchars(substr($record['value'],0,20)."...")."</li>");
}else
{
echo($record['tag']."=".htmlspecialchars(substr($record['value'],0,20)."...")."</li>");
}
}
echo ("</ul></li>");?>

This isn't a really nice approach as this can break with any newer Version of WPIDS, so you need to be careful with it. Anyway it show you how it's done at PHPIDS, in general.
Last bumped by Anonymous on Fri Dec 28, 2007 10:07 am.
Philnate
Site Admin
 
Posts: 78
Joined: Sun Jun 12, 2005 7:54 pm


Return to WPIDS

Who is online

Users browsing this forum: No registered users and 1 guest

cron