ok so i did what i said i would not do and made a random avatar kit. the advantage to doing this is that i can just ignore any further comments or questions about random avatars.
how to get a random avatar
1) download this file: http://nate.metroid2002.com/avatars/random_avatar.zip 2) use a program such as winrar or stuffit expander to unzip the file. (if you are using mac os x, there is a 99% chance you will just be able to double-click the file and have it unzip without having to download additional software.) 3) upload both files you see (avatar.jpg and DELETE_THIS_PART_BEFORE_THE_PERIOD.htaccess) to a folder on your webspace with your avatars in it. this will become the folder the script uses to pick a random avatar from. 4) rename the uploaded (on your webhost) file DELETE_THIS_PART_BEFORE_THE_PERIOD.htaccess so that it is now called just .htaccess (delete the part of its name before the period/full stop). the file may disappear at this point - that is fine; you don't need to mess with it again anyway. 5) link to your new rotating avatar at http://your_webhost_here/your_avatars_folder/avatar.jpg. keep in mind that with this script, that web address "becomes" the random avatar, so you will need to link to that address (ending in avatar.jpg), not to the random avatar image it becomes if you enter the address into your browser.
notes: firefox will cache the result of the script, so that you will have to hit "reload" to see a new random avatar every time you visit a new forum thread.
I dun get it. How do you put a folder (like in my documents) in webspace (in freewebstown I chose a random "look" and it was about bikes for some reason...)?
ohh, it's a way to transfer files between computers, so in other words, the way you can upload files to a host in this case. normally you use an ftp client like smartftp (for windows) or something.
ok, howtousefreewebtown101 time! 1. getting an account just hit the sign up button on the main page and put all the information you need, your password etc. 2. logging in type in your pass and account name in the left hand side password boxes and hit "filemanagement" when its done loading. *IMPORTNAT NOTE!* when you login, you sometimes have to do it multiple times, this is normal 3. uploading files on the file management screen, hit the upload files button and browse your computers for the files you wish to upload. you can upload 8 files at a time, none can exceed 100 mb (trust me, ive crashed the site 7 times already trying) 4. viewin the files on the file management screen, right click on the file you want to view and choose "copy shortcut" and paste it into your Address box on your internet explorer. ding! the file is displayed, and you now know your file's URL
*note* if free web town seems to have crashed, dont worry, its probably that i just tried to upload a 100 MB file or bigger accidently
Hey Nate, would the random subtitle javascript you gave me work with <img> tags? That'd be a pretty simple way of doing random avvies, if it would work.
Nope. Reason: the way the scripts are coded. The Javascript script only selects from a static predefined array of lines; the PHP script opens a directory dynamically, and uses all the matching files inside it.
Nope. Reason: the way the scripts are coded. The Javascript script only selects from a static predefined array of lines; the PHP script opens a directory dynamically, and uses all the matching files inside it.
couldn't you include a php script on every page that writes every image in the directory to the .js file (so basically writes the entire .js file) and then include the .js later on down the page?
Nope. Reason: the way the scripts are coded. The Javascript script only selects from a static predefined array of lines; the PHP script opens a directory dynamically, and uses all the matching files inside it.
couldn't you include a php script on every page that writes every image in the directory to the .js file (so basically writes the entire .js file) and then include the .js later on down the page?
That sounds similar to the way Walrus (the php comic archive script I'm using) works, except it skips the javascript entirely. Actually, if the code to Walrus is looked at, and all the stuff about dates and navigation is taken out, and a random generator is put in, that might present us with a much, much simpler way of having random avvies. All Walrus does, at its core, is look for files with extension .jpg, .png, or.gif in a given directory, the path of which you specify. Basically, it looks for comics in [blah blah blah]paragonsigma.com/strips, and I could make it .com/banana/happygnomes/fortinbrasisking/forgreatjustice if I wanted. It seems a lot simpler than whatever is being described here.
couldn't you include a php script on every page that writes every image in the directory to the .js file (so basically writes the entire .js file) and then include the .js later on down the page?
Instead of that, I could rewrite the Random Av Script to be used with an include_once() in order to echo the string instead of the <img> tags. You'd just need to create a folder which will hold a series of text files with a single line in them: the line you want displayed.
In fact, I'm gonna get into that right now. If no further replies are made, will bump this thread with the completed version of the script, and instructions on how to use.
Ok, I got the damn thing working. :P Here go installation instructions:
1. Create a directory called "lines" exactly as shown (meaning, without any capitals, or else PHP will crash) inside the forum root directory. Here you will place several .txt files that contain the lines you want the script to display. As with the Random Av version, you can use any number of files you want, and any filename you might want as well.
2. In the same "lines" directory, upload the randomizer.php file inside the zip file attached to this post. This is the actual script. Since it's optimized to work perfectly (just tested it over a hundred times), no modifications need to be done.
3. Upload all your .txt files to your "lines" directory before doing anything else. Just as a precaution, or else the script crashes. ;)
4. Open your forum main header file for modification (BE SURE TO MAKE A BACKUP FIRST!). We will now replace the Javascript with our brand-new PHP script.
Select all the Javascript text (or the include function that embeds the actual script), and replace it with the following code:
Code:
<?php
include_once('./lines/randomizer.php');
?>
(I seriously DO hope you did a backup of the file before altering it, in case something goes wrong. :P Just making sure. ;))
5. Go to your new index, and test the script by refreshing a few times. It should be working smoothly. :)