wrote some new code (i use version 1.2 subdir edition so will no doubt need some major overhaul!)
the code creates this kind of output:
You can have...
www.domain.com/deathstar
www.domain.com/replicant
www.domain.com/banana
www.domain.com/present
www.domain.com/briefcase
(these domains are free to register)
...but you're too late for
www.domain.com/loveofbristolcity
www.domain.com/phanta-ladies
www.domain.com/uvectrum
www.domain.com/uvepting
www.domain.com/jagvetinte
(these domains have just been taken)
random list of possible domains are given, each link to relevant signup. latest registered domains follow.
to use the code:
add this to functions.php
- Code: Select all
function getsamples() //gives sample and recently registered domains (www.hm)
{
include("include/vars.php");
$avail = "<b>You can have...</b><br>";
$listwords=mysql_query("SELECT * FROM $aword_table ORDER BY RAND() LIMIT 0,5");
$words=mysql_num_rows($listwords);
if ($words < 1) {
$avail.="An error has occurred<br>";
} else {
while($rowwords=mysql_fetch_array($listwords)) {
$theword=$rowwords[theword];
$avail.="<a href='signup.php?do=do_signup&dom=$theword'>www.hm/$theword</a> <br>";
}
}
$avail.="(these domains are free to register)<br><br>";
$avail.="<b>...but you're too late for</b><br>";
$listusers=mysql_query("SELECT * FROM $redir_table ORDER BY time DESC LIMIT 0,5");
$users=mysql_num_rows($listusers);
if ($users < 1) {
$avail.="An error has occurred<br>";
} else {
while($rowusers=mysql_fetch_array($listusers)) {
$host=$rowusers[host];
$avail.="<a href='http://$host'>$host</a> <br>";
}
}
$avail.="(these domains have just been taken)";
return $avail;
}
and create new table using this http://www.hm/wordlist.txt set of random words, already in SQL (hosted on my site as its pretty big!)
this line needs to be added to each user accessible php file (under the include and require section) eg members.php
- Code: Select all
$available = getsamples();
and this to where each php file calls the template
- Code: Select all
$template->assign("available", $available);
finally, add {available} to the template where you want it to appear.
Now i haven't even used 1.4 - maybe this kind of script is already in there?! either way, its in a scruffy infancy and have just knocked it together without testing. For example the random list of available domains isn't even checked against existing user accounts. I just thought id put the code out, see what you thought. (suggestions/improvements more than welcome!!)