![]() |
|
#1
|
|||
|
|||
|
Plugboard not showing new plugs...
I followed the tutorials on the download site, and I changed it to allow more plugs, but nother shows up, and it just redirects to the index page, and nothing happens.
Code:
<?
//#########################
//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 = "ffffff"; //Background color.
$bordercolor = "4F001E"; //Bordercolor of the input boxes and button.
$tablewidth = "378"; //Width of the plugboard's table.
$maxdata = "29"; //Maximum plugs to show on the list at one time -1 (If you want it to display 5 buttons but 4 here).
$maxchars = "300"; //Maximum number of characters a person is allowed to use for their button url.
$blocked = Array('http://domain.com','http://www.domain.com'); // These URLS are not allowed.
//##############################################################################
//SETTINGS END. DO NOT EDIT BELOW THIS LINE UNLESS YOU HAVE PHP SKILLS!
//##############################################################################
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>");}
if(in_array($url, $blocked))
{die("<font face=$font><center>Domain not allowed.</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=0 style="border: none #$bordercolor; background-color: #$bgcolor;" >
<td align="center">
HTML;
$openfile = file("plug/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);
$sitename = str_replace("=","",$sitename);
echo "<a href=http://$url target=_new title=$url><img src=$sitename border=0 width=88 height=31></a>\n";
endfor;
echo <<<HTML
<form method='post' action='plug.php?action=plug' name='plug'><input maxlength='$maxchars' value='Button' type='text' name='sitename' 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;
}
?>
|
|
#2
|
||||
|
||||
|
Have you set the file permissions correctly for the files?
If you have, then this is the code I am using for my working plugboard. I changed the parts at the top to suit you: PHP Code:
Chris
__________________
by Christopher |
|
#3
|
|||
|
|||
|
Well, I am pretty sure I did(set plug.db to 666, right?)
I'll try that code out. |
|
#4
|
|||
|
|||
|
Quote:
Ok, I tried that code...and it made my site have this error. Parse error: parse error, unexpected T_STRING in /home/hinotama/public_html/rose/plug/plug.php on line 29 I checked on line 29 and that is $ip = gethostbyname($REMOTE_ADD R); And I am pretty sure thats nothing I did... |
|
#5
|
||||
|
||||
|
I don't see how that is possible, seeing as there is no "T_STRING" in the code...
Starlet will be the best person to help you with this, so trying PMing her. Sorry I couldn't help Thanks, Chris
__________________
by Christopher |
|
#6
|
|||
|
|||
|
Quote:
Alright, thank you for trying though!
|
|
#7
|
||||
|
||||
|
Your welcome
![]() Thanks, Chris
__________________
by Christopher |
| Thread Tools | |
| Display Modes | |
|
|