Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Apr 2009
    Posts
    4,289
    Tokens
    2,022
    Habbo
    iLogan

    Latest Awards:

    Default Site # Pages +REP

    Hiya guys,

    I need some help (+REP of course!), you see how Habbox has like pages https://habbox.com/#/Home how do you make it so like /#/home generates home etc kinda hard to explain, any ideas?

    Logan
    ex-hxl manager
    ex-event organizer
    ex-gfx designer
    ex-competition staff
    ex-content staff
    OFWGKΔ

  2. #2
    Join Date
    Jan 2010
    Location
    Scotland
    Posts
    3,641
    Tokens
    4,896
    Habbo
    Mark

    Latest Awards:

    Default

    You mean a redirect? So you type in www.habbox.com/home and it takes you to the URL www.habbox.com/#/home ?

    EDIT: I don't think that's what you're on about lol, apologies if it's not I don't fully understand what you mean
    Last edited by Mark; 24-04-2011 at 12:17 AM.

  3. #3
    Join Date
    Nov 2006
    Location
    Liverpool/Manchester
    Posts
    2,457
    Tokens
    0

    Latest Awards:

    Default

    Do you mean like...

    http://www.domain.com/anything_here_you_want/home

    and it takes you to the home page?

    If so it's done by making / editing your .htaccess file and putting in something like this

    Code:
    RewriteEngine on
    
    RewriteRule ^/([^/\.]+)/home/?$ /home.html [L]
    Should work :s
    Joe


  4. #4
    Join Date
    Oct 2006
    Posts
    9,905
    Tokens
    26,858
    Habbo
    Zak

    Latest Awards:

    Default

    I don't think the hash does anything at all, I've been typing in websites such as http://www.bt.com/#/ & http://www.youtube.com/#/. They all load the companies home pages!

    Try it with yours if that's what your aiming for.

    example: www.yourwebsiteurl.com/#/

  5. #5
    Join Date
    Jul 2007
    Location
    UK
    Posts
    2,470
    Tokens
    2,975

    Latest Awards:

    Default

    I believe Habbox uses Ajax to load the pages in frames, But you could get the same effect by using PHPIncludes. (/index.php=home, /index.php=page etc)

  6. #6
    Join Date
    Apr 2009
    Posts
    4,289
    Tokens
    2,022
    Habbo
    iLogan

    Latest Awards:

    Default

    +REP to all,


    Quote Originally Posted by Jaaaack! View Post
    I believe Habbox uses Ajax to load the pages in frames, But you could get the same effect by using PHPIncludes. (/index.php=home, /index.php=page etc)
    Yeah, I think that's it, do you have any good tutorials on php includes?
    ex-hxl manager
    ex-event organizer
    ex-gfx designer
    ex-competition staff
    ex-content staff
    OFWGKΔ

  7. #7
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    846
    Tokens
    1,766
    Habbo
    triston220

    Latest Awards:

    Default

    Quote Originally Posted by RemelKiid View Post
    +REP to all,




    Yeah, I think that's it, do you have any good tutorials on php includes?
    I think he means using the GET argument to load the correct page. For example:

    PHP Code:
    <?PHP
    if (isset($_GET['action'])){
    if (
    $_GET['action'] == 'aboutus'){
    Echo 
    "We are a company dedicated to providing you with quality food at affordable prices.";
    }else if (
    $_GET['action'] == 'products'){
    Echo 
    "Our product range:";
    }
    }
    ?>
    To view these, you would navigate to: PAGENAME.php?action=aboutus or PAGENAME.php?action=products .

    I hope I've helped.


    Quote Originally Posted by Jaaaack! View Post
    See, however much I want this, my girlfriend uses my PC too much, and I would be killed.





  8. #8
    Join Date
    Jul 2007
    Location
    UK
    Posts
    2,470
    Tokens
    2,975

    Latest Awards:

    Default

    Quote Originally Posted by triston220 View Post
    I think he means using the GET argument to load the correct page. For example:

    PHP Code:
    snip 
    To view these, you would navigate to: PAGENAME.php?action=aboutus or PAGENAME.php?action=products .

    I hope I've helped.

    No, I ment PHPincludes.

  9. #9
    Join Date
    May 2007
    Posts
    10,481
    Tokens
    3,140

    Latest Awards:

    Default

    http://www.habboxforum.com/showthrea...t=43037&page=1

    Use the second method and you can dynamically choose which page to load using the doohickeys (Forgot their namess OK?!?!).

    I think there's a good link for a JS one as well, I'll look for that also... brb.

    Edit, found it, some reassembly required for it to work as you'd like:
    http://www.dynamicdrive.com/dynamici...jaxcontent.htm
    Last edited by Chippiewill; 03-05-2011 at 08:58 PM.
    Chippiewill.


  10. #10
    Join Date
    Jul 2004
    Location
    California
    Posts
    8,725
    Tokens
    3,789
    Habbo
    HotelUser

    Latest Awards:

    Default

    The contents of the URL past the hashtag (#) don't get sent to the webserver, and are only client side. Because of this Habbox is able to detect changes in the URL past # dynamically by checking for a change 10 times a second and when one's detected we use AJAX (.load() in jQuery to be specific) to grab the specified page and stick the contents in a div.

    Habbox.com/#/page/variable/value/variable2/value2

    works out to be

    page.php?variable=value&variable2=value2

    If we used mod rewrite in lieu of our Javascript clean urls spinoff you would have to reload the webpage each time you click a link which would mean widgets like the Habbox Live radio player wouldn't work.

    How to load content dynamically using AJAX:
    http://api.jquery.com/load/

    Habbox use our own self written functions to accomplish hashtag navigation, but there are jQuery plugins available if you wanted to use one of them:
    http://plugins.jquery.com/plugin-tags/hash
    I'm not crazy, ask my toaster.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •