Ok. I do have a history of copying other peoples codes and pasting them here and saying that I made them.
Well, I am new now. I got a new name, new hairstyle, etc. A new me.
I am more clever than my old self. I know how to create my own modifications now.
Please could everyone forgive my sins and welcome the new me.
Many of these have been made but this is one file of php coding without the need of installing any SQLs. It grabs the information from the attacklogs.
So I created this.......
Create a file called attacks.php[/red]
<?php
/*-----------------------------------------------------
-- Created By: BioHazard
-- Mod Type: Free Mod
-- Mod Name: Your Attack Log
-- File Name: attacks.php
-- Instructions: Don't Remove This. This Is A Free Mod. So, Don't Sell It.
-----------------------------------------------------*/
include_once "globals.php";
$atks=$db->query("SELECT * FROM attacklogs WHERE attacker=$userid OR attacked=$userid ORDER BY time DESC LIMIT 50");
print "<b>These are the last 50 attacks you were involved in:</b><br />
<table width=100%><tr><th>Time</th><th>Opponent</th><th>Who Attacked</th><th>Result</th><th>Money Gained</th></tr>";
while($r=$db->fetch_row($atks))
{
if($r['attacker'] != $userid)
{
$realidd = $r['attacker'];
}
if($r['attacked'] != $userid)
{
$realid = $r['attacked'];
}
$q=$db->query("SELECT username FROM users WHERE userid='$realidd' or userid='$realid'");
$ID=$db->fetch_row($q);
if($r['attacker'] != $userid)
{
$att = "<a href='viewuser.php?u={$r['attacker']}'>{$ID['username']}</a>";
}
if($r['attacked'] != $userid)
{
$att = "<a href='viewuser.php?u={$r['attacked']}'>{$ID['username']}</a>";
}
if($r['attacker'] == $userid && $r['result'] == 'won')
{
$res = "<font color=green>You Won</a>";
}
else
{
$res = "<font color=red>You lost</a>";
}
if($r['stole'] > 0)
{
$stole = "<font color=green>\${$r['stole']}</a>";
}
else
{
$stole = "<font color=red>\${$r['stole']}</a>";
}
if($r['attacker'] == $userid)
{
$attac = "<font color=green>You Attacked</a>";
}
else
{
$attac = "<font color=red>They Attacked</a>";
}
$d=date('F j, Y, g:i:s a',$r['time']);
print "<tr><td>$d</td><td>$att</td><td>$attac</td><td>$res</td><td>$stole</td></tr>";
}
print "</table>";
$h->endpage();
?>
Now
Just put a link wherever you want.
<a href=attacks.php>Your Attack Log</a>
Thank You Again.
DEMO: At http://www.gangstercity.net/attacks.php