Jump to content

  •  

  • iBotModz CBox


    Photo

    Rotating Site Title


    • Please log in to reply
    3 replies to this topic

    #1 egworld

    egworld

      Private Grade 2

    • Members+

    • 51 posts
    • Joined: 05-June 08

    Posted 29 July 2009 - 02:15 AM

    Does any one know how to do the rotating site title like on bungie.net how it says something different every time you refresh the page? I been searching on how to do this but i cant find any one that knows how and im sorta a nub to html and php so ya.

    Can someone post the code for it, i looked at the source for bungie but nothing...

    #2 miinaturvat

    miinaturvat

      miiinaturvat

    • Donors+

    • 927 posts
    • Joined: 09-April 08
    • Gender:Male
    • Location:Dragon Shores!

    Posted 02 August 2009 - 08:29 AM

    Can't you do some javascript that picks a string from a random number and outputs some HTML that'll display that string in the title?

    I did a similar thing, but with images, on my own site, when I was about 11 :)

    If you want to see it, go to www.violetice.co.uk, but don't complain about how crap it is, because it was the first site I ever made :D

    #3 iBotPeaches

    iBotPeaches

      General Grade 6

    • Owner

    • 6,570 posts
    • Joined: 29-July 07
    • Gender:Male
    • Location:Kansas

    Posted 02 August 2009 - 08:42 AM

    This is what I wrote about 3 years ago for iBotModz, for a random string based on the time.

    It grabs the day, hour and minute in the very beginning that does a ton of if statements to see if its that time, Then it writes the saying. I have it coded at every 20 minutes. I was in process of adding this to our new site, just couldn't think up enough sayings. Except you want to write it to the header, so I think you'll have to google how to write to header via javascript.

    <script LANGUAGE="JavaScript">
    day = new Date()
    hr = day.getHours()
    var min = day.getMinutes()
    if (hr == 0 && min == 00) document.write("Modding isn't cheating, its enhancing the game")
    if (hr == 0 && min == 20) document.write("Killtrocity 1 cannot be bought at stores")
    if (hr == 0 && min == 40) document.write("XBMC, is for Xbox Modders only!")
    if (hr == 1 && min == 10) document.write("XBConnect, I mod it and they don't care")
    if (hr == 1 && min == 20) document.write("Wheres my eeprom located?")
    if (hr == 1 && min == 40) document.write("Hold on...FTP transfer going")
    if (hr == 2 && min == 00) document.write("Modchips are another anwser")
    if (hr == 2 && min == 20) document.write("A Softmod, does not involve soda")
    if (hr == 2 && min == 40) document.write("Modding xbox's is legal")
    if (hr == 3 && min == 00) document.write("Wheres Team Actionsack?")
    if (hr == 3 && min == 20) document.write("SoccerMounds, is a mod")
    if (hr == 3 && min == 40) document.write("iBotModz, is not a pikmin site")
    if (hr == 4 && min == 10) document.write("1337, is modder language")
    if (hr == 4 && min == 20) document.write("If I put the halo 2 autoupdate in my X Folder, can I mod old maps?")
    if (hr == 4 && min == 40) document.write("Where did I Download Zone Alarm too?")
    if (hr == 5 && min == 00) document.write("What is a default.xbe file?")
    if (hr == 5 && min == 20) document.write("The Z Drive, doesn't exist")
    if (hr == 5 && min == 40) document.write("Action Replay..does not allow you to mod")
    if (hr == 6 && min == 00) document.write("I beat Campaign on Legendary in 1 hour")
    if (hr == 6 && min == 20) document.write("5 Years, and all bungie comes out with is 10 new medals wow")
    if (hr == 6 && min == 40) document.write("Bungie doesn't like us")
    if (hr == 7 && min == 10) document.write("D is for Disk drive not Donuts")
    if (hr == 7 && min == 20) document.write("Xbox 150$ Halo 2 30$  AR 25$ Seeing the look on your opposing team as you spawn kill Priceless")
    if (hr == 7 && min == 40) document.write("Whats up with the Pikmin?")
    if (hr == 8 && min == 00) document.write("Can't right now, modding someone elses.")
    if (hr == 8 && min == 20) document.write("Hate the Player, not iBotModz")
    if (hr == 8 && min == 40) document.write("Can you mod the TV?")
    if (hr == 9 && min == 00) document.write("Can you guys help me mod my game boy?")
    if (hr == 9 && min == 20) document.write("You can't order pizza with command prompt")
    if (hr == 9 && min == 40) document.write("what kind of batteries does an xbox take?")
    if (hr == 10 && min == 10) document.write("you can't FTP with a phone cord")
    if (hr == 10 && min == 20) document.write("The similes are threatening me")
    if (hr == 10 && min == 40) document.write("Sometimes the best Halo 2 player, is a retired Modder")
    if (hr == 11 && min == 00) document.write("A no-scope is not a sniper with no scope")
    if (hr == 11 && min == 20) document.write("Bungie...We've beat all updates 1.0-1.5 will another help?")
    if (hr == 11 && min == 40) document.write("Red Bar...O yeah!")
    if (hr == 12 && min == 00) document.write("Time now is 12:10")
    if (hr == 12 && min == 20) document.write("Time now is 1:10")
    if (hr == 12 && min == 40) document.write("Time now is 1:10")
    if (hr == 13 && min == 10) document.write("Time now is 1:10")
    if (hr == 13 && min == 20) document.write("Time now is 1:10")
    if (hr == 13 && min == 40) document.write("Time now is 1:10")
    if (hr == 14 && min == 00) document.write("Time now is 1:10")
    if (hr == 14 && min == 20) document.write("Time now is 1:10")
    if (hr == 14 && min == 40) document.write("Time now is 1:10")
    if (hr == 15 && min == 00) document.write("Time now is 1:10")
    if (hr == 15 && min == 20) document.write("Time now is 1:10")
    if (hr == 15 && min == 40) document.write("Time now is 1:10")
    if (hr == 16 && min == 10) document.write("Time now is 1:10")
    if (hr == 16 && min == 20) document.write("Time now is 1:10")
    if (hr == 16 && min == 40) document.write("Time now is 1:10")
    if (hr == 17 && min == 00) document.write("Time now is 1:10")
    if (hr == 17 && min == 20) document.write("Time now is 1:10")
    if (hr == 17 && min == 40) document.write("Time now is 1:10")
    if (hr == 14 && min == 00) document.write("Time now is 1:10")
    if (hr == 14 && min == 20) document.write("Time now is 1:10")
    if (hr == 14 && min == 40) document.write("Time now is 1:10")
    if (hr == 15 && min == 00) document.write("Time now is 1:10")
    if (hr == 15 && min == 20) document.write("Time now is 1:10")
    if (hr == 15 && min == 40) document.write("Time now is 1:10")
    if (hr == 16 && min == 10) document.write("Time now is 1:10")
    if (hr == 16 && min == 20) document.write("Time now is 1:10")
    if (hr == 16 && min == 40) document.write("Time now is 1:10")
    if (hr == 17 && min == 00) document.write("Time now is 1:10")
    if (hr == 17 && min == 20) document.write("Time now is 1:10")
    if (hr == 17 && min == 40) document.write("Time now is 1:10")
    if (hr == 18 && min == 00) document.write("Time now is 1:10")
    if (hr == 18 && min == 20) document.write("Time now is 1:10")
    if (hr == 18 && min == 40) document.write("Time now is 1:10")
    if (hr == 19 && min == 00) document.write("Time now is 1:10")
    if (hr == 19 && min == 20) document.write("Time now is 1:10")
    if (hr == 19 && min == 40) document.write("Time now is 1:10")
    if (hr == 20 && min == 10) document.write("Time now is 1:10")
    if (hr == 20 && min == 20) document.write("Time now is 1:10")
    if (hr == 20 && min == 40) document.write("Time now is 1:10")
    if (hr == 21 && min == 00) document.write("Time now is 1:10")
    if (hr == 21 && min == 20) document.write("Time now is 1:10")
    if (hr == 21 && min == 40) document.write("Time now is 1:10")
    if (hr == 22 && min == 10) document.write("Time now is 1:10")
    if (hr == 22 && min == 20) document.write("Time now is 1:10")
    if (hr == 22 && min == 40) document.write("Time now is 1:10")
    if (hr == 23 && min == 00) document.write("Time now is 1:10")
    if (hr == 23 && min == 20) document.write("Time now is 1:10")
    if (hr == 23 && min == 40) document.write("Time now is 1:10")
    </script>


    #4 T3RROR

    T3RROR

      Private

    • Members+

    • 33 posts
    • Joined: 19-July 08
    • Gender:Male

    Posted 02 August 2009 - 03:38 PM

    Or you could do it with php and mysql.

    DB TABLE:
    id - int( <img src='http://www.ibotmodz.net/forum/public/style_emoticons/<#EMO_DIR#>/dirol.gif' class='bbc_emoticon' alt='8)' /> - auto_increment 
    text - varchar(300)
    

    index.php :
    <?php
    $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
    if(!$link){
       die('Not connected : ' . mysql_error());
    }
    $db_sel = mysql_select_db('dbname', $link);
    if(!$db_sel){
       die('Can not select db : ' . mysql_error());  
    }
    $num = mysql_num_rows(mysql_query("SELECT * FROM title_quotes"));
    $newid = rand(1,$num);
    $titleary = mysql_fetch_array(mysql_query("SELECT * FROM title_quotes WHERE id = '".$newid."'"));
    echo '<title>MySite.com - '.$titleary['text'].'</title>';
    ?>
    

    add.php :
    <?php
    $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
    if(!$link){
       die('Not connected : ' . mysql_error());
    }
    $db_sel = mysql_select_db('dbname', $link);
    if(!$db_sel){
       die('Can not select db : ' . mysql_error());  
    }
    if($_POST['text']){
      mysql_query("INSET INTO title_quotes (text) VALUES ('".mysql_real_escape_string($_POST['text'])."')");
    }
    echo '<form action="add.php" method="post">';
    echo '<form name="text" id="text">';
    echo '</form>';
    ?>
    


    There's no security on this so if this is public anybody could post to the db. But it is guarded from SQL injections.