Multi Direct V1.00b By Deviancex

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Multi Direct V1.00b By Deviancex

    Here is a new script/idea i have for redirection. I have been using it for some of my sites. I used and updated a short line of code i found in the index.php of one of the old cult scripts
    ---
    Multi Direct - by devianceX
    ---
    This is a multi redirection script that will detect if a browser can accept html, wml, or both.
    The theory behind this is simple: if the browser accepts only html it is more than likely to be a web browser, if the browser accepts only wml it must be a wap 1.0 device, if it accepts html and wml it is more than likely a wap 2.0 device/pda/symbian/smartphone, and if its none of the above.. Mmm maybe its a bot script or a hacking attempt?
    ---
    Install
    ---
    This script is super simple to install, simply change the variables in index.php and upload to your portal site.
    If you are already using index.php you could rename the file and just use the PHP INCLUDE command to include it in your index.php or simply copy the code to your existing index.php above the header
    ---
    To Do
    ---
    Still need to work out how to determine a symbian device from a wap 2.0 device that don't support symbian apps, if you know how to do this please mail admin@hack.s-60.org or visit me at http://wapforum.uk.to and send a private message to devianceX
    ---
    © 2001-2006 devianceX
    ---
    DOWNLOAD MULTI DIRECT BY DEViANCE HERE:
    http://wapforum.uk.to/files/multi_di...b_devX_258.zip

    #2
    Error 404 file not found
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      Mom strange.. To be honest i never tried it, the file is on my site at that location. Maybe my download script protects from hotlinking. I would upload but the cookie settings on this board stop me from staying logged in with opera mobile on my 6630. If someone can grab it from my site an upload it that would be helpfull.

      COPYING.txt
      [code]
      GNU GENERAL PUBLIC LICENSE
      Version 2, June 1991

      Copyright © 1989, 1991 Free Software Foundation, Inc.
      675 Mass Ave, Cambridge, MA 02139, USA
      Everyone is permitted to copy and distribute verbatim copies
      of this license document, but changing it is not allowed.

      Preamble

      The licenses for most software are designed to take away your
      freedom to share and change it. By contrast, the GNU General Public
      License is intended to guarantee your freedom to share and change free
      software--to make sure the software is free for all its users. This
      General Public License applies to most of the Free Software
      Foundation's software and to any other program whose authors commit to
      using it. (Some other Free Software Foundation software is covered by
      the GNU Library General Public License instead.) You can apply it to
      your programs, too.

      When we speak of free software, we are referring to freedom, not
      price. Our General Public Licenses are designed to make sure that you
      have the freedom to distribute copies of free software (and charge for
      this service if you wish), that you receive source code or can get it
      if you want it, that you can change the software or use pieces of it
      in new free programs; and that you know you can do these things.

      To protect your rights, we need to make restrictions that forbid
      anyone to deny you these rights or to ask you to surrender the rights.
      These restrictions translate to certain responsibilities for you if you
      distribute copies of the software, or if you modify it.

      For example, if you distribute copies of such a program, whether
      gratis or for a fee, you must give the recipients all the rights that
      you have. You must make sure that they, too, receive or can get the
      source code. And you must show them these terms so they know their
      rights.

      We protect your rights with two steps: (1) copyright the software, and
      (2) offer you this license which gives you legal permission to copy,
      distribute and/or modify the software.

      Also, for each author's protection and ours, we want to make certain
      that everyone understands that there is no warranty for this free
      software. If the software is modified by someone else and passed on, we
      want its recipients to know that what they have is not the original, so
      that any problems introduced by others will not reflect on the original
      authors' reputations.

      Finally, any free program is threatened constantly by software
      patents. We wish to avoid the danger that redistributors of a free
      program will individually obtain patent licenses, in effect making the
      program proprietary. To prevent this, we have made it clear that any
      patent must be licensed for everyone's free use or not licensed at all.

      The precise terms and conditions for copying, distribution and
      modification follow.

      GNU GENERAL PUBLIC LICENSE
      TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

      0. This License applies to any program or other work which contains
      a notice placed by the copyright holder saying it may be distributed
      under the terms of this General Public License. The "Program", below,
      refers to any such program or work, and a "work based on the Program"
      means either the Program or any derivative work under copyright law:
      that is to say, a work containing the Program or a portion of it,
      either verbatim or with modifications and/or translated into another
      language. (Hereinafter, translation is included without limitation in
      the term "modification".) Each licensee is addressed as "you".

      Activities other than copying, distribution and modification are not
      covered by this License; they are outside its scope. The act of
      running the Program is not restricted, and the output from the Program
      is covered only if its contents constitute a work based on the
      Program (independent of having been made by running the Program).
      Whether that is true depends on what the Program does.

      1. You may copy and distribute verbatim copies of the Program's
      source code as you receive it, in any

      Comment


        #4
        index.php
        Code:
        <?php
        /** 
        *
        * @package Multi Direct
        * @version 1.00 BETA 2006/12/02 12:30:00 devianceX
        * @copyright (c) 2001-2006 devianceX 
        * @license [url]http://opensource.org/licenses/gpl-license.php[/url] GNU Public License 
        *
        */
        
        /**
        */
        
        //EDIT BELOW
        
        //your web url
        $WEB_URL = &#39;[url]http://wapforum.uk.to/&#39;;[/url]
        
        //your wap 1.0 url
        $WAP_URL = &#39;[url]http://wapforum.uk.to/wap/&#39;;[/url]
        
        //url for wap 2.0 and similar html and wml compatible browsers
        $BOTH_URL = &#39;[url]http://wapforum.uk.to/archive/&#39;;[/url]
        
        //a url to redirect strange or unrecognized browsers, its very unlikely this will be needed
        $MMM_URL = &#39;[url]http://wapforum.uk.to/&#39;;[/url]
        
        //DO NOT EDIT BELOW THIS LINE UNLESS YOUR EXPERIENCED IN PHP
        
        //if browser does NOT accept wml then html variable is true
        if ((eregi ("text/vnd.wap.wml", $HTTP_ACCEPT)) != true)
                {
        $HTML = &#39;TRUE&#39;;
                }
        
        //lets see if wml is true also or if its a pure web browser
        if ((eregi ("text/html", $HTTP_ACCEPT)) != true)
                {
        $WML = &#39;TRUE&#39;;
                }
        
        //if wml AND html are true  it must be wap 2.0 phone and we should direct to html lo-fi (or give a choice)
        if ($HTML=&#39;TRUE&#39; AND $WML=&#39;TRUE&#39; AND $S60=&#39;FALSE&#39;)
        {
        //both wml and html set true
        $BOTH = &#39;TRUE&#39;;
        }
        
        //if wml and html true
        if ($BOTH=&#39;TRUE&#39;)
        {
        //redirect to both url
        //exit
                header("Location: $BOTH_URL");
                exit;
        }else
        {
        
        //if wml is true
        if ($WML=&#39;TRUE&#39;)
        {
        //redirect to wap url
        //exit
                header("Location: $WAP_URL");
                exit;
        }else
        {
        
        //if web is true
        if ($WEB=&#39;TRUE&#39;)
        {
        //redirect to web url
        //exit
                header("Location: $WEB_URL");
                exit;
        }else
        {
        
        //if for some strange reason its not any of the above let it carry on to the web site.. Or is it a bot? Pmpl 
        //redirect to mmm
        //exit
                header("Location: $MMM_URL");
                exit;
        }}}
        
        // END OF REDIRECTION - SCRIPT BY DEVIANCEX
        // [url]HTTP://WAPFORUM.UK.TO[/url] - THE BEST WAPFORUM
        ////////////////////////////////
        //(c) 2001-2006 devianceX
        ////////////////////////////////
        ?>
        Mmm.. I was posting a topic.. Do you have to stick you nose in?

        Comment


          #5
          Mom strange.. To be honest i never tried it, the file is on my site at that location. Maybe my download script protects from hotlinking. I would upload but the cookie settings on this board stop me from staying logged in with opera mobile on my 6630. If someone can grab it from my site an upload it that would be helpfull.

          COPYING.txt
          [code]
          GNU GENERAL PUBLIC LICENSE
          Version 2, June 1991[/b]
          Why do you put a gnu license to such a simple code?
          Advertise your mobile site for FREE with AdTwirl

          Comment


            #6
            cause hes a noob GumSlone, you should know that by now
            8th wonder of the world

            Comment


              #7
              Mmm ok dj (coming from someone that can&#39;t write anything and just uses scripts he stole from blaze, me, and others).
              @Gumslone: because i put it to some script sites and they were asking for license details, also i plan to add more functions to it. Also it makes it look more professional.

              cause hes a noob GumSlone, you should know that by now [/b]
              *giggles* n00b = newbie
              dj.dance = mcommunity owner who begged to be admin on a mobiilchat site and devoted months to bugging me. Who is the n00b? Pmpl QUOTE=dj.dance "If you don&#39;t link to my mcommunity site and make me admin i will bug you forever" ha ha.. Now stop being silly an grow up. I been around wap alot longer than you and many people here.

              Comment


                #8
                eh wtf? that was ages ago??? also that was in my first 2 months of site building? how da hell can you take that for granted? get a life..
                8th wonder of the world

                Comment


                  #9
                  eh wtf? that was ages ago??? also that was in my first 2 months of site building? how da hell can you take that for granted? get a life..[/b]
                  ages ago or not your clearly as childish now as you were then. Think its you little teenage losers that need a life, i got a great life thanks ;-)

                  Comment


                    #10
                    Code:
                    <?php
                    //Description
                    //Do not remove the below code. This will lead to violation of Terms Of Use
                    /****************************************************************************
                    This script is written by Anurag Singh
                    Title: Wap Redirect
                    Version: 1.0
                    Email: [email]tom.anu007@gmail.com[/email],
                    Homepage: [url]http://tom.anu007.googlepages.com/wapredirect[/url]
                    Special thanks to Harald Hope, Website: [url]http://techpatterns.com/[/url]
                    And also to Joseph George Jacobs , Email [email]joe@spitzbucket.com[/email]
                    ****************************************************************************/
                    //Configuration
                    global $userBrowser;
                    
                    // Your wapsite
                    //enter the link you want user to be redirected in case of WML browser
                    $wmllink = "http://bcfc.me.uk/index2.php/";
                    
                    // Your website
                    //enter the link you want user to be redirected in case of PC browser
                    $htmllink = "http://www.wapsilon.com/bcfc.me.uk/index.php";
                    
                    //There is no need to edit any information from this point on
                    //however in case if you want to contribute please do so
                    //please be sure to let me know about the changes
                    //Detect the browser
                    $userBrowser = $_SERVER[&#39;HTTP_USER_AGENT&#39;]; 
                    
                    //Remove the below // qutoes.
                    //It helps to check if there is any error when editing
                    //If everything is all right it will display the browser information
                    //please remember to put // back after testing or no redirection will occur
                    //echo $userBrowser;
                    
                    //Check for Mozilla
                    if(stristr($userBrowser, &#39;Mozilla&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for Mozilla
                    elseif(stristr($userBrowser, &#39;gecko&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for opera
                    
                    //Check for omniweb
                    elseif(stristr($userBrowser, &#39;omniweb&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for msie
                    elseif(stristr($userBrowser, &#39;msie&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for konqueror
                    elseif(stristr($userBrowser, &#39;konqueror&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for safari
                    elseif(stristr($userBrowser, &#39;safari&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for netpositive
                    elseif(stristr($userBrowser, &#39;netpositive&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for lynx
                    elseif(stristr($userBrowser, &#39;lynx&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for elinks
                    elseif(stristr($userBrowser, &#39;elinks&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for Mozilla
                    elseif(stristr($userBrowser, &#39;Mozilla&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for links
                    elseif(stristr($userBrowser, &#39;links&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for w3m
                    elseif(stristr($userBrowser, &#39;w3m&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for webtv
                    elseif(stristr($userBrowser, &#39;webtv&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for amaya
                    elseif(stristr($userBrowser, &#39;amaya&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for dillo
                    elseif(stristr($userBrowser, &#39;dillo&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for ibrowse
                    elseif(stristr($userBrowser, &#39;ibrowse&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for icab
                    elseif(stristr($userBrowser, &#39;icab&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for crazy browser
                    elseif(stristr($userBrowser, &#39;crazy browser&#39;)) 
                    {
                      $ub="PC";
                    }
                    //Check for IE
                    elseif(stristr($userBrowser, &#39;internet explorer&#39;)) 
                    {
                      $ub="PC";
                    }
                    //If it&#39;s not any of the above browsers
                    //Then it gotta be a WML or very unpopular browser
                    else
                    {
                      $ub="WML";
                      }
                    //Code for redirecting based upon the results
                    if($ub == "PC") {
                        header("Location: ".$htmllink);
                        exit;
                        }
                        else 
                        {
                        header("Location: ".$wmllink);
                        exit;
                        }
                        
                    ?>
                    Want something coded email me at sales@webnwaphost.com for a prices.




                    Comment


                      #11
                      its a good idea but not excelent. some phones like motorola L2 or nk 3220 have strage behavior with header location. those phone have option to redirect , and end user chose yes or no in this situation.
                      the end user dont know what is http redirect or what means redirect, its a noob so, in that case when the phone is recognized like wml or xhtml compliant create 2 cases (1 for each wml and xhtml mode) and redirect with meta.
                      look here one simple example.
                      1. if ((eregi ("htm", $_SERVER[&#39;HTTP_ACCEPT&#39;])) == true){ ?>
                      2. <!DOCTYPE html
                      3. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      4. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                      5. <html>
                      6. <head>
                      7. <meta http-equiv="content-type" content="text/html;charset=utf-8" />
                      8. <meta http-equiv="refresh" content="1;url=xhtml.php" />
                      9. <title>ngeo chat</title>
                      10. <link rel="stylesheet" type="text/css" href="style_logo/style.css" />
                      11. </head>
                      12. <body>
                      13. <div align="center">
                      14. Please wait...
                        Click below if yo do not wish to wait, or your Mobile Phone don &apos;t make the transfer
                      15. enter
                      16. </div>
                      17. </body>
                      18. </html>
                      19. <?php
                      20. exit();
                      21. }
                      22. else
                      23. {
                      24. header("Content-type: text/vnd.wap.wml");
                      25. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
                      26. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
                      27. header("Cache-Control: no-cache, must-revalidate");
                      28. header("Pragma: no-cache");
                      29. header("Provided-by:ngeo@ngeo.ro");
                      30. echo "<?xml version=\"1.0\"?>
                      31. <!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
                      32. ." \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
                      33. ?>
                      34. <wml>
                      35. <card id="ngeo" title="ngeo chat" ontimer="wml.php">
                      36. <timer value="1"/>
                      37. <p align="center">
                      38. Please wait...
                        Click below if yo do not wish to wait, or your Mobile Phone don &apos;t make the transfer
                      39. enter
                      40. </p>
                      41. </card>
                      42. </wml>
                      43. <?php
                      44. exit();
                      45. }
                      the meta redirect alow redirection and user dont choose in every redirect if is agree or not. its a best way to redirect.
                      (this is just an example)
                      http://ngeo.ro

                      Comment


                        #12
                        Code:
                        class Browser {
                        
                            public $Browser;
                        
                            public function check()
                            {
                                $this->o = $_GET["o"];
                        
                                if($this->o == "wml")
                                {
                                    $this->Browser = &#39;wml&#39;;
                        
                                }else if($this->o == "xhtml")
                                {
                                    $this->Browser = &#39;xhtml&#39;;
                        
                                }else if($this->o == "html")
                                {
                                    $this->Browser = &#39;html&#39;;
                        
                                }else{
                                    $mobile_Browser = &#39;0&#39;;   
                          
                                    if(preg_match(&#39;/(up.Browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i&#39;,strtolower($_SERVER[&#39;HTTP_USER_AGENT&#39;])))
                                    {   
                                            $mobile_Browser++;   
                                        }   
                          
                                    if((strpos(strtolower($_SERVER[&#39;HTTP_ACCEPT&#39;]),&#39;text/vnd.wap.wml&#39;)>0) or ((isset($_SERVER[&#39;HTTP_X_WAP_PROFILE&#39;]) or isset($_SERVER[&#39;HTTP_PROFILE&#39;]))))
                                    {   
                                            $mobile_Browser++;   
                                        }   
                          
                                    $mobile_ua = strtolower(substr($_SERVER[&#39;HTTP_USER_AGENT&#39;],0,4));   
                          
                                    $mobile_agents = array(   
                                            &#39;w3c &#39;,&#39;acs-&#39;,&#39;alav&#39;,&#39;alca&#39;,&#39;amoi&#39;,&#39;audi&#39;,&#39;avan&#39;,&#39;benq&#39;,&#39;bird&#39;,&#39;blac&#39;,   
                                            &#39;blaz&#39;,&#39;brew&#39;,&#39;cell&#39;,&#39;cldc&#39;,&#39;cmd-&#39;,&#39;dang&#39;,&#39;doco&#39;,&#39;eric&#39;,&#39;hipt&#39;,&#39;inno&#39;,   
                                            &#39;ipaq&#39;,&#39;java&#39;,&#39;jigs&#39;,&#39;kddi&#39;,&#39;keji&#39;,&#39;leno&#39;,&#39;lg-c&#39;,&#39;lg-d&#39;,&#39;lg-g&#39;,&#39;lge-&#39;,   
                                            &#39;maui&#39;,&#39;maxo&#39;,&#39;midp&#39;,&#39;mits&#39;,&#39;mmef&#39;,&#39;mobi&#39;,&#39;mot-&#39;,&#39;moto&#39;,&#39;mwbp&#39;,&#39;nec-&#39;,   
                                            &#39;newt&#39;,&#39;noki&#39;,&#39;oper&#39;,&#39;palm&#39;,&#39;pana&#39;,&#39;pant&#39;,&#39;phil&#39;,&#39;play&#39;,&#39;port&#39;,&#39;prox&#39;,   
                                            &#39;qwap&#39;,&#39;sage&#39;,&#39;sams&#39;,&#39;sany&#39;,&#39;sch-&#39;,&#39;sec-&#39;,&#39;send&#39;,&#39;seri&#39;,&#39;sgh-&#39;,&#39;shar&#39;,   
                                            &#39;sie-&#39;,&#39;siem&#39;,&#39;smal&#39;,&#39;smar&#39;,&#39;sony&#39;,&#39;sph-&#39;,&#39;symb&#39;,&#39;t-mo&#39;,&#39;teli&#39;,&#39;tim-&#39;,   
                                            &#39;tosh&#39;,&#39;tsm-&#39;,&#39;upg1&#39;,&#39;upsi&#39;,&#39;vk-v&#39;,&#39;voda&#39;,&#39;wap-&#39;,&#39;wapa&#39;,&#39;wapi&#39;,&#39;wapp&#39;,   
                                            &#39;wapr&#39;,&#39;webc&#39;,&#39;winw&#39;,&#39;winw&#39;,&#39;xda&#39;,&#39;xda-&#39;);   
                          
                                        if(in_array($mobile_ua,$mobile_agents))
                                        {   
                                            $mobile_Browser++;   
                                        }   
                          
                                        if (strpos(strtolower($_SERVER[&#39;ALL_HTTP&#39;]),&#39;OperaMini&#39;)>0)
                                        {   
                                            $mobile_Browser++;   
                                        }   
                          
                                        if (strpos(strtolower($_SERVER[&#39;HTTP_USER_AGENT&#39;]),&#39;windows&#39;)>0)
                                        {   
                                            $mobile_Browser = 0;   
                                        }   
                          
                                          if($mobile_Browser>0)
                                        {   
                                              if(!stristr($_SERVER[&#39;HTTP_ACCEPT&#39;],&#39;application/vnd.wap.xhtml+xml&#39;))
                                            {
                                                // old wml broser
                                                $this->Browser = &#39;wml&#39;; 
                                            } else {
                                                // new xhtml mobile
                                                $this->Browser = &#39;xhtml&#39;; 
                                            }
                          
                                           } else {   
                                              // web Browser
                                            $this->Browser = &#39;html&#39;;  
                          
                                           }
                                }
                                return $this->Browser;
                            }
                        }
                        dis is pretty good, i use bits from another detection script to my ideas to make it

                        Comment


                          #13
                          Yeah it works fine u can view the test @ www.xmobile.ws

                          Comment


                            #14
                            http://ngeo.ro

                            Comment

                            Working...
                            X