UBB.Dev
Posted By: Dalantech PDA friendly templates - 03/12/2005 11:16 AM
Update: I am working on a set of mobile templates for UBB Threads 6.5.1 and I'll package it up as a mod and post it in this forum when I'm finished.

Features:
  • No need for the user to select the templates. I've added some script to the ubbt.inc.php file that detects mobile browsers and then sets the template style to "mobile" (I'll probably use the same detection script to force the use of a mobile css file as well). I'm in the process of scripting templates that are mobile friendly.
  • All of the mobile templates will be in a mobile subdirectory to keep them separate from the Threads default template directory (something that I'll also do for future Facelift mods).
If you have any sugestions please post them in this thread.
Posted By: monkeyra Re: PDA friendly templates - 03/12/2005 2:30 PM
No suggestions at the moment, but thanks for sorting this out!
I'm after this for my site, just haven't done it due to lack of time and knowledge.
thankyou!
Posted By: Dalantech Re: PDA friendly templates - 03/12/2005 6:42 PM
You can monitor my progress at my dev site. You won't be able to see the PDA friendly layout unless you go to the site with a PDA.

I'll make a similar set of templates for the new version of Info Pop's forum package.
Posted By: Dalantech Re: PDA friendly templates - 03/13/2005 12:15 AM
I script templates from the outside in, and after finishing my own custom index page I made mobile friendly templates for the main forum page and the postlist. I'll start work on showflat and showthreaded tomorrow.
Posted By: Harold Re: PDA friendly templates - 03/13/2005 4:40 AM
I'm looking forward to seeing this one when you get it done.

Will this work with the older text only browsers or just the newer color ones in todays PDA's and cell phones?
Posted By: Dalantech Re: PDA friendly templates - 03/13/2005 9:52 AM
The mobile css will only work with the latest PDA browsers. The browser detection script should be able to detect smart phones, but I'm not concerned with how Threads displays on them. IMHO surfing the web on a cell phone's tiny screen is pretty pointless. The 3.5" screen that I have on my iPaq is just big enough to make web browsing practical.
Posted By: Ian_W Re: PDA friendly templates - 03/13/2005 1:39 PM
Sounds great - I must admit in the past, I created a user, with no sidebar, no header etc., so that the time to load the page was reduced.

Will log in with my pda to have a look
Posted By: Dalantech Re: PDA friendly templates - 03/13/2005 10:27 PM
Please do! I could use some feedback.

I've finished part of the showflat page, but that's as far as I got this weekend. My boy has the flue, so I haven't had much time to script
Posted By: Ian_W Re: PDA friendly templates - 03/14/2005 2:17 AM
I keep loosing the wireless link on my PDA - will get it back up and give it a try
Posted By: AllenAyres Re: PDA friendly templates - 03/14/2005 4:05 AM
Sweeet! I've considered doing this for a long time but always backed back down after looking at the specs
Posted By: dman_dup1 Re: PDA friendly templates - 03/14/2005 5:42 AM
I just logged in with my Ipaq and it is looking great. Nice, Nice, Nice.
Posted By: Dalantech Re: PDA friendly templates - 03/14/2005 8:03 AM
[]AllenAyres said:
Sweeet! I've considered doing this for a long time but always backed back down after looking at the specs [/]

PDAs are not simple to script for -some of the data currently being displayed in Threads won't make the final cut. There just isn't enough room...
Posted By: Dalantech Re: PDA friendly templates - 03/14/2005 8:04 AM
[]dman said:
I just logged in with my Ipaq and it is looking great. Nice, Nice, Nice. [/]

Thanks for the props!

I should be able to finish it out sometime this week -my boy has the flue, so I didn't get much time to script over the weekend
Posted By: monkeyra Re: PDA friendly templates - 03/14/2005 12:09 PM
testing it on my pda now, an o2 XDA2.
It loads quick, bloody quick. thats good!
fits the screen perfectly.
impressive!
i'm liking it.
Posted By: Dalantech Re: PDA friendly templates - 03/14/2005 2:27 PM
[]monkeyra said:
testing it on my pda now, an o2 XDA2.
It loads quick, bloody quick. thats good!
fits the screen perfectly.
impressive!
i'm liking it. [/]

Thanks for the props
Posted By: JoshPet Re: PDA friendly templates - 03/15/2005 9:53 AM
Very cool !
Posted By: Dalantech Re: PDA friendly templates - 03/15/2005 9:06 PM
Thanks Josh!

Update: I finished the showflat template. It took me a little while because I wanted to use some Graemlins and Instant UBB Code on the quick reply box, so I had to write a custom function (plus another template) to generate 6 Graemlins (the first 6 in the data base) and 6 Instant UBB Code hyperlinks. I'll use the same function to generate the Graemlins and Instant UBB Code for the post, reply, and edit pages.

I had to limit the number of Graemlins and Instant UBB Code due to the size restrictions of surfing on a small display.
Posted By: Charles Re: PDA friendly templates - 03/16/2005 5:34 PM
isn't there a website that allow you to browse a website as if you were on a handheld? I seem to recall that but can't remember the name (maybe something done by microsoft or something)
Posted By: Dalantech Re: PDA friendly templates - 03/17/2005 11:50 AM
I've never heard of it, and I don't see how it would be possible unless it displayed the site in a 240x320 window...
Posted By: dman_dup1 Re: PDA friendly templates - 03/18/2005 7:35 AM
http://www.microsoft.com/windowsmobile/pie/pocketpc/default.aspx
Posted By: dman_dup1 Re: PDA friendly templates - 03/18/2005 7:39 AM
http://www.piefriendly.com
Posted By: Dalantech Re: PDA friendly templates - 03/18/2005 10:00 PM
The first is just an info site from Microsoft, and the second is just a directory of PDA friendly sites.

The stock Threads templates, and even the Facelift templates that I script, will display on Pocket IE. The only problem is all of the horizontal scrolling that you have to do to read everything. My goal is to develop a set of templates that display without a horizontal scroll bar...
Posted By: Dalantech Re: PDA friendly templates - 04/21/2005 7:44 AM
Just a post to let everyone know that I haven't given up on this project, I've just been extremely busy. We had a hardware / software upgrade at the site where I work and all of the scripts that were left for monitoring the new system were hosed. I've been doing so much scripting at work that I haven't even been turning on my PC when I get home...

Edit: After doing a little research I think that the best way to approach mobile templates is to re-write Threads to make it a little more linear and compact, and then add some script to detect mobile browsers and force the use of a mobile style sheet to control how the data is presented in a browser -sounds complicated but it's actually easier than designing two seperate sets of templates (one for mobile users and one for everone else). So I'm gonna look in to scripting a single set of templates and creating a mobile CSS file...
Posted By: AllenAyres Re: PDA friendly templates - 04/22/2005 7:11 AM
in-teresting
Posted By: jenesepas Re: PDA friendly templates - 06/24/2005 2:37 AM
[]Dalantech said:
I've added some script to the ubbt.inc.php file that detects mobile browsers and then sets the template style to "mobile" (I'll probably use the same detection script to force the use of a mobile css file as well).[/]
Does this work for PDAs too? Do you use UserAgent to detect?
Posted By: scroungr Re: PDA friendly templates - 06/25/2005 1:20 AM
actually by examinig the $_SERVER["HTTP_USER_AGENT"] value you can basically detect most types of browsers with a simple call..
Posted By: Dalantech Re: PDA friendly templates - 06/25/2005 5:14 PM
This is what I use on my dev site (added to my ubbt.inc.php file. Replace $tempstyle = "default"; with the code listed below) -I haven't worked on it much lately and I just got back from vacation.

Code
 // --------------------------------------------- <br />// Mobile template hack start <br /> <br />$ua = @find_environmental("HTTP_USER_AGENT"); <br /> <br />if (stristr($ua, "Windows CE") or stristr($ua, "AvantGo") or stristr($ua, <br />"Mazingo") or stristr($ua, "Mobile") or stristr($ua, "T68")  or stristr($ua, <br />"Syncalot") or stristr($ua, "Blazer") or stristr($ua, "NetFront") or stristr($ua, "Palm OS") or stristr($ua, "Elaine") ) { <br />     $DEVICE_TYPE="MOBILE"; <br />} <br /> <br />if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE") { <br />     $tempstyle = "mobile"; <br /> <br />} else { <br />       $tempstyle = "default"; <br />      } <br /> <br /> <br />// --------------------------------------------- <br />// Mobile template hack finish <br /> 


You also need mobile templates
Posted By: Dalantech Re: PDA friendly templates - 06/25/2005 5:33 PM
You also have to look for

Code
 	if ( (!$fstyle) || ($fstyle == "usedefault") ) {<br />			$fstyle = $theme['stylesheet'];<br />		} 


and after that add:

Code
 // ----------------------------------------<br />// Mobile CSS file hack start<br /><br />$ua = @find_environmental("HTTP_USER_AGENT");<br /><br />if (stristr($ua, "Windows CE") or stristr($ua, "AvantGo") or stristr($ua,<br />"Mazingo") or stristr($ua, "Mobile") or stristr($ua, "T68")  or stristr($ua,<br />"Syncalot") or stristr($ua, "Blazer") or stristr($ua, "NetFront") or stristr($ua, "Palm OS") or stristr($ua, "Elaine") ) {<br />     $DEVICE_TYPE="MOBILE";<br />}<br /><br />if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE") {<br />     $fstyle = "mobile";<br /><br />} <br /><br />// ----------------------------------------<br />// Mobile CSS file hack finish 


And youy also have to have a mobile CSS file

I've moved all of the modifications that I made to my dev site to my main web site, www.dalantech.com , and I'll be finishing this mod soon.
© UBB.Developers