Making phpBB3 Mobile Compatible

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Anti-Spam Guide
User avatar
vellatechie
Registered User
Posts: 185
Joined: Fri Feb 01, 2008 7:33 pm

Re: Making phpBB3 Mobile Compatible

Post by vellatechie »

I have installed quick reply and handyman chat on my forums lite version theme.. can anyone temme if its any good??

http://www.phpbb.com/rules/#rule6a

I knwo i need to probably reduce the font size to something like .75em or something but any suggestion will be will be appreciated :)
Last edited by stickerboy on Thu Jan 14, 2010 2:17 am, edited 1 time in total.
Reason: Please don't spam your site thanks (see rule in post) :)
User avatar
mcjambi
Registered User
Posts: 38
Joined: Fri Dec 11, 2009 3:48 pm
Contact:

Re: Making phpBB3 Mobile Compatible

Post by mcjambi »

Sorry my english is very bad but i have a questtion:
if u can detect hand device so it can change style? or redirected where? because i have hand device theme but do not know how to change, just by hand?
please help me!
http://www.phpbb.com/rules/#rule6a
Last edited by stickerboy on Wed Mar 17, 2010 9:35 pm, edited 1 time in total.
Reason: Please don't spam your site thanks - just like the post right above yours
Pony99CA
Registered User
Posts: 4783
Joined: Thu Sep 30, 2004 3:13 pm
Location: Hollister, CA
Name: Steve
Contact:

Re: Making phpBB3 Mobile Compatible

Post by Pony99CA »

mcjambi wrote:Sorry my english is very bad but i have a questtion:
if u can detect hand device so it can change style? or redirected where? because i have hand device theme but do not know how to change, just by hand?
You can write a JavaScript browser detector or you can use CSS. On my main site, I use the following CSS:

Code: Select all

<link rel="STYLESHEET" type="text/css" href="./styles/svppc-handheld.css" media="handheld" />
I put that below my main CSS links and let the browser figure out if the device is handheld or not.

If you need something more specific that can work with different screen sizes, you'll have to use a JavaScript browser/screen size detector.

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.
sadiaaa
Registered User
Posts: 28
Joined: Thu Aug 19, 2010 2:54 pm

Re: Making phpBB3 Mobile Compatible

Post by sadiaaa »

is this code will automatically detect mobile and what will be the theme if it will detect mobile?
phpsingh
Registered User
Posts: 7
Joined: Thu Sep 16, 2010 2:49 pm

Re: Making phpBB3 Mobile Compatible

Post by phpsingh »

awesome info in here, thanks much.
cwallace
Registered User
Posts: 523
Joined: Tue Dec 14, 2004 4:26 am
Location: Fort Wayne, Indiana
Contact:

Re: Making phpBB3 Mobile Compatible

Post by cwallace »

So how does this effect the style you are using?

I see no difference between my computer browser and my cell browser.

I would like to detect and redirect to a different layout for the cell phone, but I don't see any reference to that in this detection option.

I already direct cell users on the main page (outside of the forums) to a mobile version of our site.

Chris
http://www.FortWayneMusic.com - Your source for the best in local music and entertainment.
Pony99CA
Registered User
Posts: 4783
Joined: Thu Sep 30, 2004 3:13 pm
Location: Hollister, CA
Name: Steve
Contact:

Re: Making phpBB3 Mobile Compatible

Post by Pony99CA »

cwallace wrote:So how does this effect the style you are using?

I see no difference between my computer browser and my cell browser.

I would like to detect and redirect to a different layout for the cell phone, but I don't see any reference to that in this detection option.

I already direct cell users on the main page (outside of the forums) to a mobile version of our site.
Using a CSS Handheld style (look earlier in the topic) is a good first attempt unless you want to try to support different styles for different mobile devices.

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.
YukataNinja
Registered User
Posts: 2
Joined: Thu Apr 15, 2010 5:27 pm

Re: Making phpBB3 Mobile Compatible

Post by YukataNinja »

I don't know if someone has already figured this out, but I had been wondering how to get one single forum to assign different styles for multiple domains or subdomains. This way I can assign a mobile subdomain like m.mydomain.com to be a mobile style and if the user wants full version they just go to http://www.mydomain.com.

I found out how to do this by looking at a similar solution for WordPress (http://wordpress.org/extend/plugins/domain-theme/). It's much simpler than I thought it would be. You can use the php function $_SERVER['HTTP_HOST']. For some people they may need to use $_SERVER['SERVER_NAME'] (I think if your host is behind a proxy or something). To find which you need write a simple php script and run it on your host.

test.php

Code: Select all

<?php
echo 'HTTP_HOST = ' . $_SERVER['HTTP_HOST'] . ', SERVER_NAME = ' . $_SERVER['SERVER_NAME'];
?>
To get this working you'll need the ID number for the theme you want. You could code this smarter but I'm lazy. To get the ID number, log into ACP, go to styles, and click on the details for the style you want to use. Now look at the URL that you just navigated to, the ID of the theme is in the URL where &id=## (should be something like 1 through 100).

Now open your style.php
Find

Code: Select all

	if (!$user)
	{
		$id			= ($id) ? $id : $config['default_style'];
//		Commented out because calls do not always include the SID anymore
//		$recompile	= false;
		$user		= array('user_id' => ANONYMOUS);
	}
Add after

Code: Select all

	if (strtolower($_SERVER['HTTP_HOST']) == 'mysubdomain.mydomain.com')
	{
		$id = ##;
	}
Change the above mysubdomain.mydomain.com to your subdomain/domain. Change the above ## to your style id number you want to use.

Now open includes/session.php
Find

Code: Select all

		else
		{
			// Set up style
			$style = ($style) ? $style : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);
		}
Add after

Code: Select all

		if (strtolower($_SERVER['HTTP_HOST']) == 'mysubdomain.mydomain.com')
		{
			$style = ##;
		}
Make the same changes again, mysubdomain.mydomain.com to your domain and ## to the id you want to use.

If you have problems, try the suggestion at the top of this post about using $_SERVER['SERVER_NAME'] instead of $_SERVER['HTTP_HOST'].
mbelek
Registered User
Posts: 2
Joined: Mon Oct 11, 2010 6:47 am

Re: Making phpBB3 Mobile Compatible

Post by mbelek »

newsbee.........I am sorry to disturb you .. May I ask for your help .. pbpbb mobile version .. .. I'm confused because the language of command ordered destroyed my eng .. please .. love tutor for version STG-Mobile Style) .. if you do not mind .. upload script that already .. let you edit directly replace me .. thanks
mbelek
Registered User
Posts: 2
Joined: Mon Oct 11, 2010 6:47 am

Re: Making phpBB3 Mobile Compatible

Post by mbelek »

why not replay?
craiga
Registered User
Posts: 191
Joined: Fri Apr 10, 2009 8:14 am
Contact:

Re: Making phpBB3 Mobile Compatible

Post by craiga »

I am attempting to write my own mobile theme and have found some good information so far in this thread. My mobile style is going to start small and probably wont implement all the PHPBB features, at least not to start with, so i would ideally like to give the visitor the ability to switch to the normal style. Has anyone got any ideas how i could do this?
craiga
Registered User
Posts: 191
Joined: Fri Apr 10, 2009 8:14 am
Contact:

Re: Making phpBB3 Mobile Compatible

Post by craiga »

craiga wrote:I am attempting to write my own mobile theme and have found some good information so far in this thread. My mobile style is going to start small and probably wont implement all the PHPBB features, at least not to start with, so i would ideally like to give the visitor the ability to switch to the normal style. Has anyone got any ideas how i could do this?
I realised that you can simply add in the parameter style=x in the URL. The forums append_sid function seems to handle the change throughout the session. Nice
MasterEvilAce
Registered User
Posts: 3
Joined: Fri Feb 11, 2011 6:55 am

Re: Making phpBB3 Mobile Compatible

Post by MasterEvilAce »

craiga wrote:
craiga wrote:I am attempting to write my own mobile theme and have found some good information so far in this thread. My mobile style is going to start small and probably wont implement all the PHPBB features, at least not to start with, so i would ideally like to give the visitor the ability to switch to the normal style. Has anyone got any ideas how i could do this?
I realised that you can simply add in the parameter style=x in the URL. The forums append_sid function seems to handle the change throughout the session. Nice
This does seem to be the case, but only if you're logged in.. if you're a guest this does not seem to work. How can I make this work for guests?
max-li
Registered User
Posts: 1
Joined: Sun Feb 13, 2011 5:20 pm

Re: Making phpBB3 Mobile Compatible

Post by max-li »

@YukataNinja, or anyone else


I see the edits, and I can do dem, but it's not clear to me how that should work. what files do I have to put in the directory of the subdomain? a copy of the hole board?

If anyone could help me on that, that would be great.
mvmsk
Registered User
Posts: 36
Joined: Sun Feb 12, 2012 12:17 pm

Re: Making phpBB3 Mobile Compatible

Post by mvmsk »

max-li wrote:@YukataNinja, or anyone else


I see the edits, and I can do dem, but it's not clear to me how that should work. what files do I have to put in the directory of the subdomain? a copy of the hole board?

If anyone could help me on that, that would be great.
yes its the same doubt for me.

should i copy all the board files into the subdomain ?

ps: This is what i understood.

1. Original forum url: mydomain.com
2. use mobile detection and redirect to mysubdomain.mydomain.com
3. in mysubdomain.mydomain.com i should place whole forum files with some mobile theme activated.

Is this correct?
Proud Admin of NolanTalk
Post Reply

Return to “phpBB Discussion”