We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22586
    • 74 Posts
    Since the millionth iPhone was sold not to long ago, I was thinking how to make different versions of your site, depending on the client visiting. Ofcourse you could have a different version under a subdomain, like :

    www.example.com -> full desktop site
    m.example.com -> mobile site

    Or the route of agent detecting. This seems an excellent PHP solution:
    http://www.andymoore.info/php-to-detect-mobile-phones/

    For me this a relatively new area, but I am interested in experiences of people. And how one could implement agent detection and ModX, or making a mobile subdomain within modx.
      • 11975
      • 2,542 Posts
      hi,

      there are existing php scripts to create wap version

      here is one
      http://www.hawhaw.de/

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 27708 MODX Staff
        • 2,502 Posts
        It is my understanding that the iPhone doesn’t use wap but an output mod’d version of standard HTML. I am sure that there are great articles out there but my guess would be that the best way to control this would be via a stylesheet and browser detection. I don’t think that creating a second version makes all that much sense.

        Apple has the information for Optimizing Web Applications and Content for iPhone. It suggests a seperate stylesheet for iPhone to deal with the max-width and other sizing issues. Personally I think designs for the iPhone are far less of a hassle than trying to design for handheld versions of Opera or the embedded "browsers" on other deveices.

        Cheers,

        Jay
          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
          • 19132
          • 199 Posts
          Sorry to post on such an old thread, but I searched for "mobile" to find out if there was a simple script or way to detect a mobile device and send it to a subdomain or at least load a different CSS file.

          I checked out Andy Moore’s script, (http://www.andymoore.info/php-to-detect-mobile-phones/) but it interferes with the document.parser includes file.

          I really don’t know what I’m doing nor how to do it with regards to setting up a "sniffer".
            MySQL: 5.0.45
            PHP: 5.2.6
            Linux 2.6.9-023stab048.6-enterprise #1
            cURL enabled
            PDO enabled
            FFox Apple 3.6.8
            Firebug DIS-abled
            • 19132
            • 199 Posts
            That snippet would have to be at the very beginning of your template(s)

            In the first line of the head? Or before the doctype declaration? And forgive me if this sounds stupid, but does the snippet call need to look different than
            [[MobileDetect]]
            ?

            Thanks,
            Peter
              MySQL: 5.0.45
              PHP: 5.2.6
              Linux 2.6.9-023stab048.6-enterprise #1
              cURL enabled
              PDO enabled
              FFox Apple 3.6.8
              Firebug DIS-abled
              • 19132
              • 199 Posts
              Sorry for getting back to this 8 months later. Been busy.

              return true;
              exit();
              header(’Location: http://www.blah.com/’);

              I didn’t see the above anywhere in the snippet.

              The sendRedirect could work if it had "sniffing added to it. I’m exploring this topic further. Eventually I want to have a few capabilities in one snippet:
              1. Option one is loading a CSS file for handhelds/phones. (The above code/code below didn’t work. It gave me a blank page even though the file was present)
              if(detect_mobile_device()){
                header('Location: http://andymoore.mobi/');
                exit;
              }

              2. Load a mobile template. Could be the best option? because it gives designers a concrete template to tweak
              3. Redirect to a mobile subdomain. For SEF purposes this isn’t really an option; it’s a poor man’s workaround because search engines would view it as a completely separate domain. Options 1 and 2 seem to cover the most ground.
                MySQL: 5.0.45
                PHP: 5.2.6
                Linux 2.6.9-023stab048.6-enterprise #1
                cURL enabled
                PDO enabled
                FFox Apple 3.6.8
                Firebug DIS-abled
                • 1343 ☆ A M B ☆
                • 2,213 Posts
                I don’t know if you saw this or not, but here is another method of doing mobile website redirects: http://modxcms.com/forums/index.php/topic,34858.0.html

                Enjoy
                AMDbuilder
                  Patrick | Server Wrangler
                  About Me: Website | Tweets |  MODX Hosting