WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • General Community »
  • WebsiteBaker Website Showcase »
  • Mobile-Device Version of an existing Site
  • Print
Pages: [1]   Go Down

Author Topic: Mobile-Device Version of an existing Site  (Read 7179 times)

fischstäbchenbrenner

  • Guest
Mobile-Device Version of an existing Site
« on: April 19, 2012, 01:03:58 PM »
fetic.com/m/
Erotic drawings


Ja - mein englisch ist unter Sau, also deutsch weiter:
Die "Weiche" ist mit Javascript auf der Startseite (www.fetic.com), das scheint recht gut zu funktionieren, obwohl es brachial ist.

Die Navigation sehr spartanisch und fingergerecht. Die Struktur ist im wesentlichen von der Desktop-Version übernommen, sonst hätte ich wirklich alles neu machen müssen.
Die Bilder sind relativ groß (und gestaucht), damit man auch gleich reinzoomen kann. Klar schlägt sich das auf die Ladezeit, aber: Die Zoombilder sind (dateigröße) nur doppelt so groß wie die kleinen, also nicht so schlimm.

Technisch: Im wesentlichen ist das immer die gleiche Seite, mit mod_rewrite wird ein parameter übergeben, dann die Inhalte aus Topics übernommen.
Die Menüseiten sind "normale" WB-Seiten, mit nur einem Include per Code-Modul.

Ich kann es (abgesehen von Emulatoren) nur auf Android 4 testen, da geht das recht gut.
Möglicherweise kann man auf iPhone nicht zoomen. (?)
Logged

Offline nibz

  • Posts: 684
  • Gender: Male
Re: Mobile-Device Version of an existing Site
« Reply #1 on: April 21, 2012, 11:40:51 PM »
Nice menu :)...

Really handy for touch navigation.
Tested on iPhone, it is posible to zoom :)..
But zoom has a limit.. but that is no matter ..

Good job!
Logged

fischstäbchenbrenner

  • Guest
Re: Mobile-Device Version of an existing Site
« Reply #2 on: April 23, 2012, 04:38:50 PM »
Thank you very much for testing.
The zoom-limit seems to depend on the size of the pictures, they all are 960px high.
Logged

Offline Sokhim Sim

  • Posts: 101
  • Gender: Male
    • Angkor Design Website
Re: Mobile-Device Version of an existing Site
« Reply #3 on: April 24, 2012, 04:40:21 AM »
I found this code to link to mobile website detect so you can past this code to the top of index file. I work for me i have test it.  :-D

Code: [Select]
<?php 
    
    
// Stop this file being access directly
if(!defined('WB_URL')) {
    
header('Location: ../index.php');
    exit(
0);
}
 
$mobile_browser = '0';
 
if(
preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
$mobile_browser++;
}
 
if((
strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml')>0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))) {
$mobile_browser++;
} 
 
$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4));
$mobile_agents = array(
'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',
'newt','noki','oper','palm','pana','pant','phil','play','port','prox',
'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
'wapr','webc','winw','winw','xda','xda-');
 
if(
in_array($mobile_ua,$mobile_agents)) {
$mobile_browser++;
}
 
if (
strpos(strtolower($_SERVER['ALL_HTTP']),'OperaMini')>0) {
$mobile_browser++;
}
 
if (
strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows')>0) {
$mobile_browser=0;
}
 
else {
if(
$mobile_browser>0) {
    
header("Location:  http://www.fetic.com/m/"); 
    exit;
} 
} 
?>

Logged
Freelance Website Design in Cambodia.

Clients: http://www.websitebaker2.org/forum/index.php/topic,24514.0.html

fischstäbchenbrenner

  • Guest
Re: Mobile-Device Version of an existing Site
« Reply #4 on: April 24, 2012, 10:46:27 AM »
The switcher is made with javascript on the startpage:

Code: [Select]
<?php if(!$page_id) { ?>
<script type="text/javascript">// <![CDATA[  
var mobile = (/iphone|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));      
// ]]>
if( screen.width <= 600) { mobile=true; }
if (mobile) {  
        document.write('<a class="mobileheader" href="/m/">Change to handheld view</a>');
}  
</script>
<?php } ?>

For a handheld there is a blue bar with the link to the reduced version.
On each page of the handheld-version there is a link to the desktop version.

People dont like it, if they are forced to use the handheld-version.

[gelöscht durch Administrator]
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • General Community »
  • WebsiteBaker Website Showcase »
  • Mobile-Device Version of an existing Site
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2