Vous êtes sur la page 1sur 3

{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww19720\viewh13180\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \f0\b\fs24 \cf0 // META\ \ Code Name \b0 \ "Studio Hyperset

PHP Mobile Redirect Script"\ \ \b Code URL \b0 \ http://code.google.com/p/studio-hyperset\ \ \b Author\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \b0 \cf0 Quimby Melton\ SH Web Developer & Director of Operations\ quimby@studiohyperset.com\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \b \cf0 Aditional Credits \b0 \ v.1.2 build thanks to Google Code user: http://code.google.com/u/@WRdQQ1NTBBREXQ d%2F/\ \ \b SH Home \b0 \ http://studiohyperset.com\ \ \b SH Blog "hyper/bo\uc0\u650 l/e" \b0 \ http://studiohyperset.com/posts\ \ \b Relevant Posts\ \pard\pardeftab720\ql\qnatural \b0 \cf0 http://studiohyperset.com/mobile-redirect-script/1652\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \cf0 http://studiohyperset.com/studio-hyperset-mobile-redirection-code-and-the-i phone/1562\ http://studiohyperset.com/mobile-redirect-code-discussion-index/1558\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \b \cf0 // DESCRIPTION

\b0 \ In 2006, SH tried to find a script that would allow it to detect mobile visitors and redirect them to a mobile version of its website. Finding next-to-nothing, it pieced together a simple PHP script anyone can use to (a) identify a visitor' s user agent and (b) redirect that user to a dedicated mobile site or theme. Yea rs later, this script still places highly in search returns such as "mobile redi rect script," even after SH stopped managing the script and allowed it to deprec iate. \ \ As of April 2011, this code is a fully-managed Google Code project. \ \ \b // VERSION \b0 \ 1.2\ \ \b // TAGS \b0 \ \pard\pardeftab720\ql\qnatural \cf0 php, agent, browser, traffic, mobile, detection, redirect, pda, apple, ipad , iphone, gaming, smartphone\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \b \cf0 // FUTURE BUILDS\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \b0 \cf0 - Maintain current user agents per http://www.zytrax.com/tech/web/mobil e_ids.html\ - Build central, web-hosted XML list of user agents that script can draw from; p otentially use WURFL (http://wurfl.sourceforge.net/index.php)\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \b \cf0 // CHANGELOG\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \b0 \cf0 1.2 (5/11/11) - Added "?>" to end of script.\ 1.1 (5/4/11) - Updated performance, thanks to Google Code user: http://code.goog le.com/u/@WRdQQ1NTBBREXQd%2F/\ 1.0 (4/12/11) - Initial Google Code Project Hosting release \b \ \ // INSTRUCTIONS\ \b0 1) Open the sh-mobile-redirect-v1.2.php in your favorite web development app lication (e.g., Dreamweaver). Enter your mobile URL where indicated (line 58). Y ou can also add/remove user agents if (a) you want to redirect ones not listed o r (b) don't want certain user agents listed redirected. (If you find certain use r agents aren't listed, kindly contact the code developer [http://studiohyperset .com/people] to see they're integrated into future builds.)\ \ For example, the script, as delivered, redirects iPads. Some developers may want

tablets to load the desktop version of their site. Ditto PlayStation.\ \ To aid customization, all agents are organized into the following categories: Ap ple, eReaders, gaming, PDAs, phones and mobile carriers.\ \ 2) Upload the script to your server. Make sure it's executable (chmod 755).\ \ 3) Enter the following above your doctype declaration (e.g., <!DOCTYPE html \'85 ) where "RELATIVE PATH TO SCRIPT" is the relative path to the script on your se rver.\ \ <?php include( 'RELATIVE PATH TO SCRIPT' ); ?>\ \ Many servers don't allow URL includes (e.g., <?php include( 'http://example.com/ scripts/script.php' ); ?>). As such, it's best to use a relative or, if necessar y, an absolute file path (e.g., <?php include( 'scripts/script.php' ); ?>).\ \ 4) Make sure your mobile site is ready to go because mobile and tablet traffic w ill now be heading there!\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx792 0\tx8640\ql\qnatural\pardirnatural \b \cf0 // SUPPORT \b0 \ Feel like supporting SH? \ \ You can do so here: \ \ https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=C2KQADH2TGT S4}

Vous aimerez peut-être aussi