View Full Version : Plugboard


Yuki H.
04-11-2005, 12:00 AM
I want my plugboard to display in rows instead of columns
I looked at the FAQ and it has that there but I do not understand what
they are saying. *confused* I know they said something with plug.php
here is the coding:
<?
include "config.php";
include "banned.php";
if($action == "plug")

{

// Check if they entered a Button URL.
if ($button == 'Button URL' || strlen($button) == 0) {
echo "<center><body bgcolor=$bgcolor><font face=$font_error size=$font_error_size color=$font_error_color>You forgot to enter a Button URL!<br>Redirecting you now. <meta http-equiv='refresh' content='4; URL=index.php'></center></font>";
exit();
}

// Check if they entered a URL.
if ($url == 'http://' || strlen($url) == 0) {
echo "<body bgcolor=$bgcolor><font face=$font_error size=$font_error_size color=$font_error_color><center>You didn't enter a your sites URL! <br>Redirecting you now. <meta http-equiv='refresh' content='4; URL=index.php'></font></center>";
exit();
}

// Check if they already plugged.
if($plugged == 2){
echo "<body bgcolor=$bgcolor><font face=$font_error size=$font_error_size color=$font_error_color><center>You can only plug twice a minute.<br>Redirecting you now. <meta http-equiv='refresh' content='4; URL=index.php'></center></font>";
exit();
}
else{ $num = $plugged + 1;
setcookie("plugged","$num",time()+60);
}


//Save the Plug.
if(in_array($url, $blocked))
{die("<body bgcolor=$bgcolor><font face=$font_error size=$font_error_size color=$font_error_color><center>Domain has been banned.</center></font>");}
$savefile = "plug.db.php";
if (!file_exists($savefile))
{
$newfile = fopen($savefile,"w+");
fclose($newfile);
}
$ip = gethostbyname($REMOTE_ADDR);
$url = htmlentities(strip_tags($url));
$url = str_replace(array("\r", "\n"), '', $url);
$button = htmlentities(strip_tags($button));
$button = str_replace(array("\r", "\n"), '', $button);
$lines = file("$savefile");
$add = "<?die ('Access unempowered')?>|$url|$button|$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=0 style="border: none #$bordercolor; background-color: #$bgcolor;" >
<td align="center">
HTML;
$openfile = file("plug.db.php");
$total = count($openfile);
for ($i=0; $i<$total; $i++):
list($UNEMPOWERED,$url,$button,$ip) = explode('|',chop($openfile[$i]));
$url = str_replace("http://","",$url);
$button = str_replace("=","",$button);
echo "<a href=http://$url target=_blank title=$url><img src=$button border=0 width=88 height=31></a>\n";
endfor;
echo "<a href=http://www.`````````````` target=_blank><img src=http://img.photobucket.com/albums/v311/`````````/plugboardorg.gif border=0 title='Thanks for the script ``````````````'></a>";
echo
<<<HTML
<form method='post' action='plug.php?action=plug' name='plug'><input maxlength='$maxchars' value='Button URL' type='text' name='button' size='20' style='font-family: $font; color: #$fontcolor; font-size: 7pt; background-color: #eeeeee; 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: #eeeeee; font-weight: none; border: 1px solid #$bordercolor'>
<input type='submit' size='30' value='plug' style='background-color: #eeeeee; font-family: $font; color: #$fontcolor; font-size: 7pt; border: 1px solid #$bordercolor'></form></td><tr></tr>
<td align="center" style="border-top: 1px solid #$bordercolor"></td></table>
HTML;
}
?>
<head>
<style>
a:link { color: <? echo "$link"; ?>; text-decoration: none; cursor: default; text-align: justify; }
a:visited { color: <? echo "$vlink"; ?>; text-decoration: none; cursor: default; text-align: justify; }
a:active { color: <? echo "$alink"; ?>; text-decoration: none; cursor: default; }
a:hover { color: <? echo "$hlink"; ?>; text-decoration: none; cursor: default; }

</style>
</head>
<body bgcolor="<? echo "$bgcolor"; ?>" topmargin="0" leftmargin="0">

starlet
04-11-2005, 12:55 AM
It should automatically go into rows if the table width is set wide enough to fit more than one button....check config.php and make sure the $tablewidth variable is wide enough.

Yuki H.
04-11-2005, 02:05 AM
I put it as 100% and it is the same way...

thezeppzone
04-11-2005, 02:11 AM
it needs to be a pixel width, like, 200, only enough to fit as many buttons as you want across, remembering they are 88 width each, so figure 90xhowever many you want across is what you put, not a percent

Yuki H.
04-11-2005, 02:39 AM
okay, thank you....
It works now!