• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Gesior ACC] Name generator

witmar

New Member
Joined
Oct 21, 2008
Messages
248
Reaction score
0
Location
Poland, Dębica
Hi everyone.​
Today i want to show you script for name generator.

How its work?

Like tibia.com, this generate 15 incidental names.

<?php

function del_mult_chars($str) {
return preg_replace('/(\w)\1+/', "$1", $str);
}

function world_name() {
$chars = array(
"aeiou",
"bcdfghjklmnpqrstvwxzy"
);
$end_letters = rand(1, 2) == 1 ? "a" : "ia";
$world_name = "";

for ($i=rand(0, 1); $i <= rand(3, 4); $i++) {
$str = $chars[$i%2];
$world_name .= $str[rand(0, strlen($str)-1)];
}

return ucwords(del_mult_chars($world_name.$end_letters));
}

$main_content .= "<table cellspacing='0' cellpadding='1' border='0'>";
for ($i=1; $i<=15; $i++) {
$main_content .= "
<tr>
<td style='font-size: 10px;' valign='bottom'>$i.</td>
<td style='font: bold 12px verdana;'>" . world_name() . "</td>
</tr>
";
}
$main_content .= "</table>";
?>

if you want to add more names then you must change this:
for ($i=1; $i<=15; $i++) {


If i help you then rep++ me ;)
 
Where add it?

Make a file named namegenerator.php

add it into your htdocs folder

go to index.php and register the namegenerator.php



then just add it to either your createaccount or navigation menu, by editing layout.php

then just either enter the link on ur navigation / create account or simply enter http://yourhost.com/?subtopic=<thesubtopicnameyouset>
 
Back
Top