Location: PHPKode > scripts > Plug-a-thug > plug-a-thug/plug.php
<?
//#########################
//SETTINGS
//#########################
$font = "verdana";         //Font used to display plugs
$fontsize = "1";           //Font size used to display plugs
$fontcolor = "000000";     //Font color used to display plugs
$bgcolor = "9c9c9c";       //Background color of the input boxes and button
$bordercolor = "000000";   //Bordercolor of the input boxes and button
$tablewidth = "118";       //Width of the plugathug's table
$maxdata = "13";           //Maximum plugs to show on the list at one time
$maxchars = "13";          //Maximum number of characters a person is allowed to use for their site name
//##############################################################################
//SETTINGS END. DO NOT EDIT ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
//##############################################################################
if($action == "plug")
 {
//SAVE PLUG
  if ($url == "" || $url == "http://" || $sitename == "sitename" || $sitename == ""){die("<font face=$font><center>Error: one of the fields you submitted are invalid, please hit your back button and try again</center>");}
  $savefile = "plug.db.php";
  if (!file_exists($savefile))
   {
    $newfile = fopen($savefile,"w+");
    fclose($newfile);
   }
  $ip = gethostbyname($REMOTE_ADDR);
  $url = ereg_replace('<([^>]|\n)*>', '', $url);
  $sitename = ereg_replace('<([^>]|\n)*>', '...', $sitename);
  $lines = file("$savefile");
  $add = "<?die ('Access unempowered')?>|$url|$sitename|$ip|";
  $openfile = fopen("$savefile","w");
  fwrite($openfile, "$add\n");
   for ($i = 0; $i < $maxdata; $i++)
    {
     @fwrite($openfile, "$lines[$i]");
    }
  fclose($openfile);
  echo "<script language=\"JavaScript\">window.location='index.php'</script>";
 }
  else
 {
//SHOW PLUGS
echo <<<HTML
<table width=$tablewidth cellspacing=0 cellpadding=2 style="border: 1px solid #$bordercolor">
<td>
HTML;
  $openfile = file("plug.db.php");			
  $total = count($openfile);
  for ($i=0; $i<$total; $i++):
  list($UNEMPOWERED,$url,$sitename,$ip) = explode('|',chop($openfile[$i]));
  $url = str_replace("http://","",$url);
  $url = str_replace("www.","",$url);
  $url = str_replace("/","",$url);
  echo "<a href=http://$url target=_new title=$url><font face=$font size=$fontsize color=#$fontcolor>$sitename</a><br>\n";
  endfor;
echo <<<HTML
<form method='post' action='plug.php?action=plug' name='plugathug'>
<input maxlength='$maxchars' value='sitename' type='text' name='sitename' size='20' style='font-family: $font; color: #$fontcolor; font-size: 7pt; background-color: #$bgcolor; font-weight: none; border: 1px solid #$bordercolor'>
<input value='http://' type='text' name='url' size='20' style='font-family: $font; color: #$fontcolor; font-size: 7pt; background-color: #$bgcolor; font-weight: none; border: 1px solid #$bordercolor'>
<input type='submit' size='30' value='plug' style='background-color: #$bgcolor; font-family: $font; color: #$fontcolor; font-size: 7pt; border: 1px solid #$bordercolor'>
</form>
</td>
<tr></tr>
<td style="border-top: 1px solid #$bordercolor">
<!--LEAVE THE LINK BELOW THIS THERE-->
<center><a href=http://jakez.net target=_blank><font face=$font size=$fontsize color=#$fontcolor>get plugathug</a></center>
</td></table>
HTML;
 }
?>
Return current item: Plug-a-thug