MOD Author: Sniper_E
MOD Description: Full page style for mobile device users.
Have your mobile device users directed to your mobile style for easy mobile access.
Hey guys and girls!
Any Mobile Device Users out there?
Let's go » » » » » » » STG-Mobile
Connect mobile @ http://startrekguide.com
You can also watch this style in it's development from your desktop.
STG-Mobile Demo: index.php?style=9
We are putting together a style that will be viewable on any mobile device for the forums.
Do we have anyone out there that has a mobile device that could help us out with this?
I have started on this style's theme and layout and need anyone/everyone to look at it and fine tune it.
Can't wait to hear from you.... Thanks!
- - - - - - - - - - - - - - - - - - - - - -
Here is the mobile browser detection script used for this mobile style.
Sithnar wrote:Im happy for anyone to have the script.![]()
Open ./include/session.php
FIND [ Line 1318 ]AFTER ADD
- Code: Select all
* Setup basic user-specific items (style, language, ...)
*/
function setup($lang_set = false, $style = false)
{
global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;Change the "$style = 3;" to whatever style# your mobile style is installed as.
- Code: Select all
// begin mobile browser detection mod - by sithnar
$user_browser = strtolower($this->browser);
$this->data['is_mobile'] = false;
$browsers_array = array('android', 'avantgo', 'blackberry', 'blazer', 'compal', 'elaine', 'fennec', 'hiptop', 'ip(hone|od)', 'iris', 'kindle', 'lge', 'maemo', 'midp', 'mmp', 'mobile', 'o2', 'opera m(ob|in)i', 'palm( os)?', 'p(ixi|re)\/', 'plucker', 'pocket', 'psp', 'smartphone', 'treo', 'up\.(browser|link)', 'vodafone', 'wap', 'windows ce; (iemobile|ppc)', 'xiino/i','240x320', '320x240', 'iemobile', 'minimobile', 'mobile', 'pda', 'nokia', 'phone', 'pocket', 'psp', 'sony', 'samsung', 'epoc', 'nitro', 'j2me', 'midp', 'cldc', 'netfront', 'mot', 'up.browser', 'audiovox', 'ericsson', 'panasonic', 'philips', 'sanyo', 'sharp', 'android', 'portalmmm', 'blazer', 'avantgo', 'danger', 'series60', 'palmsource', 'pocketpc', 'smartphone', 'rover', 'ipaq', 'au-mic', 'alcatel', 'ericy', 'up.link', 'wap1.', 'wap2.', 'symbian', 't-shark', 'wireless', 'webOS', 'Pre/', 'Android');
foreach ($browsers_array as $ua_match)
{
if (strpos($user_browser, $ua_match) !== false)
{
$style = 3;
$this->data['is_mobile'] = true;
break;
}
}
// end mobile browser detection mod
Open ./posting.php
FIND [ Line 670 ]AFTER ADD
- Code: Select all
// Parse Attachments - before checksum is calculated
$message_parser->parse_attachments('fileupload', $mode, $forum_id, $submit, $preview, $refresh);Change the "http://yoursite.com/phpBB/images/mobile.png" image url to your mobile image url address.
- Code: Select all
// begin mobile browser detection mod - by sithnar
if ($user->data['is_mobile'] && $mode != 'edit' && !$preview && !$refresh)
{
$message_parser->message .= "\n\n[size=80][b][i][ Post made via Mobile Device ][/i][/b][/size] [img]http://yoursite.com/phpBB/images/mobile.png[/img]";
}
// end mobile browser detection mod
Close and SAVE all files.
You can copy this image I created and use it if you like.
or customize one of your own to use with your custom style.- - - - - - - - - - - - - - - - - - - - - -
This script will resize the large images in your page.
legionnaire wrote:I'm solved the problem with too large images in posts!![]()
This is image resizer, and on my Nokia N95 works perfectly.
Images are reduced only in the STG-Mobile Style, desktop version style is unchanged.
Try the following:
*Before adding this code to your forum, you should back up overall_header.html file from template folder!
Open .../template/overall_header.html
FIND:
- Code: Select all
// ]]>
</script>
BEFORE ADD:
- Code: Select all
<!-- IF SCRIPT_NAME == "viewtopic" -->
window.onload = resizeimg;
function resizeimg()
{
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.width > 225)
{
im.style.width = '225px';
}
}
}
}
<!-- ENDIF -->
Save & update...
- - - - - - - - - - - - - - - - - - - - - -
If you are adding iphone and ipod to your array list, use this....
microfud wrote:I'm assuming you are using an iphone or iPod. If that is the case, add the following two meta tags to the header section of overall_header.html.
- Code: Select all
<meta name="viewport" content="width=320">
<meta name="apple-mobile-web-app-capable" content="yes" />
I worked on a web app for the iphone for my company a while back. The text issue will be solved by the first meta tag. The 2nd one can temporarily mask the url bar, making the web page look like a real iPhone app, if you save launch it from your home page, rather than the browser.
- - - - - - - - - - - - - - - - - - - - - -
To be able to go to index.php?style=# you need a small edit in your include/session.php file.
FIND (line 1538)
- Code: Select all
if (!empty($_GET['style']) && $auth->acl_get('a_styles'))
- Code: Select all
// Setup for ?style=# to work for style viewing.
// if (!empty($_GET['style']) && $auth->acl_get('a_styles'))
if (!empty($_GET['style']))
- - - - - - - - - - - - - - - - - - - - - -
Adding QUICK REPLY
Sniper_E wrote:heredia21 wrote:Is there a way to add the quick reply open box to mobile version?
Open stg_mobile/template/viewtopic_body.html
FIND
- Code: Select all
<!-- IF S_DISPLAY_ONLINE_LIST -->
BEFORE ADD
- Code: Select all
<!-- IF S_QUICK_REPLY -->
<!-- INCLUDE quickreply_editor.html -->
<!-- ENDIF -->
Then save this as styles/stg_mobile/template/quickreply_editor.html
- Code: Select all
<form method="post" action="{U_QR_ACTION}">
<hr />
<table cellspacing="0">
<tr>
<th align="center">{L_QUICKREPLY}</th>
</tr>
</table>
<hr />
<table cellspacing="0">
<tr>
<td class="row1" align="center"><b class="genmed">{L_SUBJECT}</b><br />
<input class="post" style="width:98%" type="text" name="subject" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" /></td>
</tr>
</table>
<hr />
<table cellspacing="0">
<tr>
<td class="row2" align="center"><b class="genmed">{L_MESSAGE}</b><br />
<textarea name="message" rows="7" cols="76" tabindex="3" style="width:98%"></textarea> </td>
</tr>
</table>
<hr />
<table cellspacing="0">
<tr>
<td class="cat" align="center">
<input class="btnmain" type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" />
{S_FORM_TOKEN}
{QR_HIDDEN_FIELDS}
</td>
</tr>
</table>
</form>
<hr />
<br clear="all" />
- - - - - - - - - - - - - - - - - - - - - -
Here is the STG-Mobile Style in progress.
You can use this style for your testing and get the updated version when it's released.
Over 1,500 downloads plus.... Updated March 18, 2010, 2:22 pm













j/k
)


