post post Comments (0) postMarch 4, 2008

My plugboard script is sort of like a tagboard, only people plug themselves with a button rather than text. Here’s what mine looks like…

Mine is set to show 10 buttons before pushing the oldest off and display only 88×31 buttons, but you can of course edit all that to your desire in the plug.php file.

Now first, Download the files and unzip, you should have readme.txt, plug.php, plug.db.php, banned.php, config.php and index.php.

Installation instructions:

1. Open config.php and edit the settings to your desire.
2. Create a folder for the plugboard files. ‘Plugboard’ would be a good thing to call it.
3. Upload config.php, banned.php, plug.php, plug.db.php and index.php to said folder. CHMOD plug.db.php to 666
4. To include the script on your .php page use the following code:

/* Code block */
<? include "plug.php"; ?&gt

If you want to include it in an iframe (in case you don’t use .php extensions on your site) use the following code.

/* Code block */
<iframe src="http://www.domain.com/path-to-plugboard/index.php" width="100" height="195" frameborder="0" scrolling="no"&gt</iframe&gt

FAQs:

Q: I get the error ‘Invalid usage’ whenever someone tries to plug, why?
Make sure you put the correct path in the $path variable in config.php

Q: I really really want to use your script but my host doesn’t support PHP/CHMOD…what can i do?
A. Sign up at Ripway and host it there, to get it on your site you’d just include it in an iframe…that way you still have total control over everything, unlike with the remotely hosted ones :)

Q: How do i edit/delete the buttons and stuff that have been plugged?
A: Grab plug.db.php from your server…then just edit or delete the offending entry and reupload.

Q: How do i ban IPs from using my Plugboard?
Open banned.php and add the IP you wish to ban here…
$blockip = array(“1.1.1.1“);
If you want to ban more than one IP simply separate them with a comma…
$blockip = array(“1.1.1.1, 2.2.2.2“);
Then upload the file, plug.php automatically calls banned.php so that should be all you have to do.

Q: How do i block websites from plugging on my plugboard?
A: Open config.php and enter the URL(s) you want to ban, separated by a comma, in the $blocked area. Make sure you just put the domain name, no http:// or www. in front example..

$blocked = Array(‘domain.com’ , ‘anotherdomain.com’); // These URLS are not allowed..

Q: When i click ‘plug’ it seems to work but then when the board refreshes the button is not added?
A: This usually is a CHMOD problem. Either your host does not support CHMOD, you did it wrong or you forgot to do it. Check this CHMOD tutorial if you need further help! Plugboards also have a tendency to not work on sites hosted by ActiveWebHosting for reasons I’m not yet clear on.

Q: I get a ‘failed to open stream’ message when i install the script, whyyyyyyyy?
A: You forgot to upload whichever file the error message refers to or you uploaded it to the wrong place!

Q: I don’t have a banned.php or config.php file?
A: You are running an older version of the script in that case, please download and install the newer version :)

Q: I want it to display in rows rather than just all in a line, how can i make it do that?
A: Open config.php and change the $tablewidth so it will fit the amount of buttons you want (+a few pixels to account for borders)
If you run the older version of the script you will also need to remove the <br&gt found in the following line

echo “<a href=http://$url target=_new title=$url&gt<img src=$sitename border=0 width=88 height=31&gt</a&gt<br&gt\n”;

Q: How do i make all the links open in a new window rather than the first one opening in a new window and the rest in the same window?
A: Target=”_blank” is default on the newest version of the script so go download and install that :)
If for some strange reason you really don’t want to then just open Plug.php, find

echo “<a href=http://$url target=_new title=$url&gt<img src=$sitename border=0 width=88 height=31&gt</a&gt

Change target=_new to target=_blank. Easy peasy huh?

Q: How do i center the board itself?
A: The board being aligned to the center is default on the newest version of the script so go download and install that :)
If for whatever reason you don’t want to then just open Plug.php, find this TD tag

<td&gt
HTML;
$openfile = file(“plug.db.php”);
$total = count($openfile);
for ($i=0; $i<$maxdata; $i++):

and add align="center" to it. The same method can also be used to align it left or right!

Q: Eeeew theres broken buttons with ugly borders on my plugboard since i deleted some, what did i do wrong?
A: Check all php files for ‘white space’
Usually, after you have deleted something from plug.db.php you accidentally left some white space and that causes that to happen, find it and remove it and you should be good to go. White space includes any return or space bar hits.

Q: How come theres like 4 of your buttons already on it? No offense but i dont want them there.
A: They are there so you know the plugboards working and so you can see how it will look etc, again once those have been pushed off they are gone, they arent permanent except for the one at the bottom linking to plugboard.org and if you can work out how, you may remove that.

Q: Argh, i uploaded it and now it takes over my site, its like replaced my splash page :(
A: Thats why i suggest uploading into a folder, because the script includes a file called index.php it will often overwrite the existing index page you have. So solution one upload all the files into their own folder! Solution 2 if for some reason you totally have to have it uploaded to the root directory

1. Rename the index.php file to something else, such as plugboard.php
2. Open plug.php find the following line and change index.php to plugboard.php (or whatever you renamed the index to)..

echo “<script language=\”JavaScript\”&gtwindow.location=’index.php’</script&gt”;

Q: May i remove the button to Plugboard.org?
Yes, i don’t force people to credit me. However the button is direct linkable so you could just put it elsewhere, or give me a text link on a credits page or something instead…i don’t force credit, but i like it :)

Q: I told it to display 8 buttons but it displays 10, errr?
If you left in the plugboard.org button that remains as the bottom button perminantly then that essentially counts as 1 as well…and the script has always been 1 off due to dodgy coding on my part so take another one off the number…so if you want it to display 8 buttons and you plan on leaving in the credit button to plugboard.org make the number 6.

If you have any questions or require further help on this tutorial please ask at Sway Forum where either myself or someone else will help you out. Any emails asking for help will be ignored.

Popularity: 2% [?]


XXX Starlet

Sorry, comments are closed.