****************************************** Dodo's RandGen Script Version 1.0 Copyright to Dodo http://regretless.com Released as linkware You must credit me if you use it ****************************************** This is a script that can generate random data with the priority setting you supplied. ++++++++++++ Requirements ++++++++++++ If you have a server that supports php, you may use this script anywhere within a php file. i.e. extentions are .php, .phtml, .php3 ++++++++++++ Installation ++++++++++++ I included three examples to demonstrate how you can use this script differently. You can always come up with your own idea. ========== Variables: ========== Each time you want to use this script in a different way, you will have to modify the variables for it. // set number of links you want to show at once $show_link = 5; // separate the links by, i.e. comma would be ","; $separator = " "; // Add links // Please make sure you number entries CORRECTLY // Look at the example for reference! // DO NOT erase the priority part, leave all // to 1 if you don't want them to have different // priorities! $links[0][link] = "x"; $links[0][priority] = 1; $links[1][link] = "x"; $links[1][priority] = 1; Make sure whenever you have " within the ""; for the link, put a \ in front of it if you don't want to get parse error. ================= What is priority? ================= The bigger number you put for the priority, the more likely the random element will be likely to show up. Mathematically if you put 2 for the priority, it means it's twice more likely to show up than 1. If you want everything to be totally random, then just put 1 for all of them. I do not recommend you put any number bigger than 100 for priority, it will slow down your script. ============== Call function: ============== Simply put dodosrangen(); in your php file to use the function. If you want to call it in the html part of your php file, do ========= Examples: ========= 1. I included the dodosrangen.php in the first example. It shows up five links at a time. 2. You may use dodosrangen.php to display a random image along with text. 3. You may even use dodosrangen.php to select a random number. ++++ Logs ++++ March 1, 2002 - released version 1.0