Skeena
06-18-2008, 10:50 AM
I was on this website and I cant remember what it was. It had like a site namer where you click this button and a site name comes up. When I viewed the page source it had like many different names and I think 2 words just got randomly selected. Anyone know a code for that?
vasilios
06-18-2008, 02:57 PM
Do you need the code or the website?
vasilios
06-19-2008, 06:06 AM
I can give you one with PHP, is that fine? Or do you want Javascript?
Shivz
06-19-2008, 07:39 AM
Just wondering, was it my website?
I'll give you the code if you want it.
diamondicing
06-19-2008, 07:43 AM
oh yeh i have that
http://freewebs.com/diamondicing/nameit.htm
view the source =]
Skeena
06-19-2008, 11:04 AM
Just wondering, was it my website?
I'll give you the code if you want it.
No, I THINK it was lyrical desire but thats deleted now.
but it was exactly like that! so yes please can I have the code? also on your site when you click generate nothing comes up :/
Shivz
06-20-2008, 10:21 AM
It worked before I changed the layout =/
Mehh, I'm taking it down anyway.
<script LANGUAGE="JavaScript">
<!-- Begin
var first = new Array(
"Retro", "Elegant", "Amazing", "Crazy", "Sparkling", "Shattered", "Ruined", "Faded", "Dark", "Glittering", "Freaky", "Fabulous", "MySpace", "Exotic", "Flawless", "Luscious", "Vintage", "Glossy", "Pink", "Sexy", "Mystical", "Toxic", "Strawberry", "Sweet", "Delicious", "Lemon", "Electric", "Glamour", "Minty", "Bubblegum", "Starlit", "Candy", "Choco", "Cherry" "Fizzy" "Colourful"
)
var last = new Array(
"Kiss", "Heat", "Shock", "Kizz", "Beauty", "Thoughts", "Mirror", "Wish", "Desire", "Dreams", "Moonlight", "Sky", "Night", "Glitters", "Charm", "Swirls", "Dip", "Crush", "Slush", "Gloss", "Secret", "Silence" "Splash" "Pop"
)
var r = 0;
var q = 0;
function RandomName(nameform) {
r = Math.floor(Math.random() * last.length);
q = Math.floor(Math.random() * first.length);
nameform.band.value=first[q] + " " + last[r];
}
// End -->
</script>
<br>
<form>
<input type="text" name="band" size="30"> <br>
<input type="button" name="generate" value="Generate!" onClick="RandomName(this.form)" ></form>
Skeena
06-20-2008, 11:03 AM
Yes thats it! I recognized because of them words that get put together. Thank you =]
Unfortunately it is doing the same thing it did not your site, when you click generate nothing comes up
vasilios
06-21-2008, 12:50 PM
A PHP version:
<?php
function random_name($double_shuffle = true) {
// Define the first word and second word.
$first = array("First1", "First2", "First3");
$second = array("Second1", "Second2", "Second3");
// Shuffle them...
shuffle($first);
shuffle($second);
// Double Shuffle?
if ($double_shuffle === true) {
shuffle($first);
shuffle($second);
}
// Get the first random word
$first_count = count($first);
$first_random = $first[rand(0, $first_count - 1)];
// ...and the second
$second_count = count($second);
$second_random = $second[rand(0, $second_count - 1)];
echo $first_random." ".$second_random;
}
?>
To use it just write this:
<?php random_name(); ?>
Skeena
06-21-2008, 02:42 PM
I dont think php will work. on my site all things are on cutenews.
vasilios
06-23-2008, 06:31 AM
If your site is run by cutenews, you should be able to use that, since it's all PHP. Just put the function in your header file, if you have one. Then just call it like I said before.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.