XMB Forum Software
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: XMB Mobile View (1.9.11)
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-9-2020 at 05:19 AM
XMB Mobile View (1.9.11)


Even though this doesn't really mess with existing files excessively it is still extremely important to conduct a full backup. That means database, PHP files, templates (yes its redundant I know) and every pretty little image you've ever created! :)

^Please do not skip this step! It is the most important part of any modification!

I have been working to adapt this once hard-coded hack created for my own forum so others can use it. Please note this is still a work in progress, and many features will need to be added (such as creating a new thread). In general, it was created to meet the needs of my own users who wanted a way to browse the forums and reply to various topics.

It is a work in progress, and I welcome peer review and suggestions/modifications and taking any and all requests!

Please also note that for the time being, pagination has not been implemented (yet) and this only returns the 30 most recently replied to topics. Again this was a result of my own userbase's posting habits but is a feature I will add.

The installation steps will essentially be as follow:

1) Create mobile.php with the code below.
2) Add our templates using XMB's Admin CP
3) Modify a handful of existing templates
4) Modify a couple of XMB's PHP files

Lets start with the big one! The meat & potatoes of our mobile version.

mobile.php

Code:
<?php define('X_SCRIPT', 'mobile.php'); //Settings - most of these are here for expansion purposes //Use http if your board doesn't support SSL $ssl = "https://"; //$ssl = "http://"; $redirect_url = $ssl . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $base_url = $ssl . $_SERVER['HTTP_HOST']; $title_blurb = ""; //End Settings require 'header.php'; $fids = permittedForums(forumCache(), 'thread', 'csv'); if (strlen($fids) == 0) { $restrict = ' FALSE'; } else { $restrict = ' fid IN ('.$fids.')'; } loadtemplates('mobile_header', 'css', 'mobile_login', 'mobile_forumdisplay', 'mobile_forumdisplay_row', 'mobile_index', 'mobile_index_row', 'mobile_footer'); eval('$css = "'.template('css').'";'); if($mobileoption == "usemobile"){ $switchback = "<font class='mediumtxt'>You are currently using our Mobile View as your default view. <a href='?mobile=default'>Switch to desktop instead</a>.</font>"; }else{ $switchback = "<font class='mediumtxt'>You are currently using our Desktop/Full View as your default view. <a href='?mobile=usemobile'>Switch to mobile instead</a>.<br><br><a href='index.php'><b>Return to full forum index...</b></a></font>"; } if (X_GUEST) { $loggedin = "<font class='mediumtxt'>You are not logged in. <a href='member.php?action=coppa'>Register Now</a> or <a href='mobile.php?login=1'>Login</a></font>"; }else{ $loggedin = "<font class='mediumtxt'>Welcome " . $xmbuser . "! <a href='misc.php?action=logout'>Logout</a></font>"; } eval('$mobile_header = "'.template('mobile_header').'";'); echo $mobile_header; eval('$mobile_footer = "'.template('mobile_footer').'";'); if( X_GUEST && isset($_GET['login'])) { eval('$mobile_login = "'.template('mobile_login').'";'); echo $mobile_login; echo $mobile_footer; exit; } if(isset($_GET['forum'])) { //show forum $fid = ""; if(is_numeric($_GET['forum'])) $fid = $_GET['forum']; if(strlen($fid) > 3) exit; $query = $db->query("SELECT COUNT(*) FROM ".X_PREFIX."threads WHERE fid='$fid' AND $restrict"); $resultsnum = $db->result($query, 0); $tpp = 30; $pages = 1; $pages = ceil($resultsnum / $tpp); if($pages < 1) $pages = 1; $page = 1; if(isset($_GET['page']) && is_numeric($_GET['page'])) $page = $_GET['page']; $upper = ($page * $tpp); $lower = ($upper - $tpp); if($page > $pages) { $upper = ($pages * $tpp); $lower = ($upper - $tpp); } $pagelink = "page: "; for($i=1; $i <= $pages; $i++) { $pagelink = $pagelink . "<a href='mobile.php?forum=".$fid."&page=".$i."'>".$i."</a> "; } $pagelink = trim($pagelink); if($pages == 1) $pagelink = ""; //get forum info $query = $db->query("SELECT name FROM ".X_PREFIX."forums WHERE fid='$fid' AND $restrict LIMIT 1"); while($row = $db->fetch_array($query)) { $forumdisplayname = $row['name']; } $displaythreads = ""; $query = $db->query("SELECT * FROM ".X_PREFIX."threads WHERE fid='$fid' AND $restrict ORDER BY lastpost DESC LIMIT 30"); while($row = $db->fetch_array($query)) { $threadid = $row['tid']; $threadsubject = $row['subject']; $threadviews = $row['views']; $threadreplies = $row['replies']; $threadauthor = $row['author']; eval('$forumrow = "'.template('mobile_forumdisplay_row').'";'); $displaythreads = $displaythreads . $forumrow; } eval('$mobile_forumdisplay = "'.template('mobile_forumdisplay').'";'); echo $mobile_forumdisplay; }else{ //show index $forumid = ""; $forumname = ""; $forumdesc = ""; $forumtopics = ""; $forumposts = ""; $lastpost = ""; $displayforums = ""; $query = $db->query("SELECT * FROM ".X_PREFIX."forums WHERE type='forum' AND $restrict ORDER BY fup, displayorder ASC"); while($row = $db->fetch_array($query)) { $forumid = $row['fid']; $forumname = $row['name']; $forumdesc = html_entity_decode($row['description']); $forumtopics = $row['threads']; $forumposts = $row['posts']; //$forumdesc = substr($forumdesc, 0, 40); //$forumdesc = $forumdesc . "..."; //You can uncomment the above two lines if you want shorter descriptions eval('$indexrow = "'.template('mobile_index_row').'";'); $displayforums = $displayforums . $indexrow; } eval('$mobile_index = "'.template('mobile_index').'";'); echo $mobile_index; } echo $mobile_footer; ?>


Next post, on to the templates!



View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-9-2020 at 05:24 AM


Template "mobile_header"

Code:
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=0.75"> $css <title>{$SETTINGS['bbname']} -$title_blurb Mobile Version</title> </head> <body bgcolor="{$THEME['toptable']}"> $logo<br><br> $switchback<br><br> $loggedin <br><br>


Template "mobile_footer"

Code:
<p>$switchback</p> <p class='smalltxt'>Powered by <a href='https://www.xmbforum2.com/' target='_blank'><b>XMB Forum Software</b></a></p> </body> </html>


Template "mobile_login"

Code:
<form method="post" action="misc.php?action=login"> <input type="hidden" name="token" value="" /> <input type="hidden" name="hide" value="2" /> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td nowrap="nowrap" bgcolor='$altbg1'> Username: <input type="text" name="username" size="7" accesskey="u" /><br> Password: <input type="password" name="password" size="7" accesskey="p" /><br><br> <input type="submit" class="submit" name="loginsubmit" value="Login" /> </td> </tr> </table> </form>


Template "mobile_index"

Code:
<table border="0"> <tr> <td class="category"><font color="$cattext"><strong>{$SETTINGS['bbname']} Mobile</strong></font></td> </tr> $displayforums </table>


Template "mobile_index_row"

Code:
<tr><td bgcolor='$altbg1'><a href='mobile.php?forum=$forumid'><font class='mediumtxt' style='color: {$THEME['link']}'><b>$forumname</b></font></a><br><font class='smalltxt'><b>$forumposts posts</b> in <b>$forumtopics topics</b></font><br><font class='mediumtxt'>$forumdesc</font></td></tr>


Template "mobile_forumdisplay"

Code:
<a href='mobile.php'><font class='mediumtxt' style='color: {$THEME['link']}'><b>&laquo; Return to Mobile Index</b></font></a> <br><br> $pagelink <table border="0"> <tr> <td colspan="4" class="category"><font color="$cattext"><strong>$forumdisplayname</strong></font></td> </tr> <tr> <td class='smalltxt' bgcolor='$altbg1' align='center'>Topic Title</td><td class='smalltxt' bgcolor='$altbg2' align='center'>Replies</td><td class='smalltxt' bgcolor='$altbg1' align='center'>Views</td><td class='smalltxt' bgcolor='$altbg2' align='center'>Author</td> </tr> $displaythreads </table>


Template "mobile_forumdisplay_row"

Code:
<tr><td bgcolor='$altbg1'><a href='viewthread.php?action=printable&tid=$threadid&mobile=yes'><font class='mediumtxt' style='color: {$THEME['link']}'><b>$threadsubject</b></font></a></td><td bgcolor='$altbg2'><font class='mediumtxt'>{$threadreplies} replies</font></td><td bgcolor='$altbg1'><font class='mediumtxt'>{$threadviews} views</font></td><td bgcolor='$altbg2'><font class='mediumtxt'>by {$threadauthor}</font></td></tr>


Template "viewthread_mobile_qreply"

Code:
<br /> <a name="qreply"></a> <form method="post" name="input" action="post.php?action=reply&amp;tid=$tid"> <input type="hidden" name="token" value="" /> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="$bordercolor"> <tr> <td><input type="hidden" name="subject" value="" /> <table width="100%" border="0" cellpadding="$tablespace" cellspacing="{$THEME['borderwidth']}"> <tr bgcolor="$altbg1"> <td colspan="3" class="category"><div align="left"><font color="#000000"><strong>&nbsp;&raquo;&nbsp;$lang[quickreply]</strong>&nbsp;- [$lang[loggedin] <strong>$self[username]</strong>]</font></div></td> </tr> <tr class="quickreply"> <td bgcolor="$altbg2" width="64%" class="tablerow"> <div align="center"><textarea rows="10" cols="80" name="message" id="message" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" style="width: 100%;"></textarea></div></td> $quickbbcode <td width="20%" height="101" bgcolor="$altbg2" class="tablerow"> <div align="center"> <table width="100%" border="0" class="tablerow" cellspacing="0" cellpadding="0"> <tr> <td width="15%"> <div align="left"><input type="checkbox" name="smileyoff" value="yes" /></div></td> <td width="85%"> <div align="left">$lang[textdissmileys]</div></td> </tr> <tr $disableguest> <td width="15%"> <div align="left"><input type="checkbox" name="usesig" value="yes" $usesigcheck /></div></td> <td width="85%"> <div align="left">$lang[textusesig]</div></td> </tr> <tr> <td width="15%"> <div align="left"><input type="checkbox" name="bbcodeoff" value="yes" /></div></td> <td width="85%"> <div align="left">$lang[bbcodeoff] </div></td> </tr> <tr $disableguest> <td width="15%"> <div align="left"><input type="checkbox" name="emailnotify" value="yes" /></div></td> <td width="85%"> <div align="left">$lang[textemailnotify] </div></td> </tr> </table></div> <div align="left"> <br />&nbsp;&nbsp;<input type="submit" name="replysubmit" value="$lang[textpostreply]" class="submit" /> <br /> </div></td> </tr> </table> </td> </tr> </table> </form> <br>




View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-9-2020 at 05:32 AM


On our forum, we removed the printable option and basically cannibalized it for our mobile viewthread. You may not want to do that. We did it as our server logs indicated it was not a feature members were using, but this was done primarily (admittedly) out of laziness and not because the printable option wasn't nice to have.

Here's what I did with our viewthread_printable template. If you need something else done with this, let me know and I'll see what I can do! The end result of this hack will be a totally distinct viewthread_mobile that doesn't rely on the printable function.

Existing Template "viewthread_printable"

Code:
<?xml version="1.0" encoding="$charset"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- $versionlong --> <!-- Build: $versionbuild --> <!-- $versioncompany --> <head> $baseelement$canonical_link <meta http-equiv="Content-Type" content="text/html; charset=$charset" /> <title>{$SETTINGS['bbname']} $threadSubject - Powered by XMB</title> <style type="text/css"> .mediumtxt { font-size: 14px; font-family: arial, verdana; } h2, h3 { margin-bottom: 0px; margin-top: 0px; } .s14px { font-size: 14px; font-family: arial, verdana; font-weight: bold; } .s13px { font-size: 14px; font-family: arial, verdana; } code { white-space: pre-wrap; } a { color: #ff5733; } </style> </head> <body bgcolor="$altbg1"> $logo <br /> $mobilereturnlink <br /> <h2>$thread[subject]</h2> <!--<h2><a href="$threadlink" rev="alternate">$thread[subject]</a></h2>--> <!-- As you can see I removed the link that returns to the regular viewthread in favor of the mobilereturnlink variable above--> $multipage $posts $multipage $quickreply </body> </html>


Whether you replace yours with ours or decide to just edit it, the important part is that these two parts are added:

$mobilereturnlink and $quickreply

You can put the link and QR box wherever you like. Or do it how we did. That's the beauty of XMB, you can do it however you think is best for your own community. And me? I'll be here to help in any way humanly possible.

Moving on to the PHP modification!



View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-9-2020 at 05:48 AM


Locate viewthread.php and find the call to load templates. It should look like this:

Code:
loadtemplates( 'functions_bbcode_quickreply', 'functions_smilieinsert', 'functions_smilieinsert_smilie', 'viewthread_reply', 'viewthread_quickreply', 'viewthread_quickreply_captcha', 'viewthread', 'viewthread_modlog', 'viewthread_modoptions', 'viewthread_newpoll', 'viewthread_newtopic', 'viewthread_poll_options_view', 'viewthread_poll_options', 'viewthread_poll_submitbutton', 'viewthread_poll', 'viewthread_post', 'viewthread_post_email', 'viewthread_post_site', 'viewthread_post_icq', 'viewthread_post_aim', 'viewthread_post_msn', 'viewthread_post_yahoo', 'viewthread_post_search', 'viewthread_post_profile', 'viewthread_post_u2u', 'viewthread_post_ip', 'viewthread_post_repquote', 'viewthread_post_report', 'viewthread_post_edit', 'viewthread_post_attachmentthumb', 'viewthread_post_attachmentimage', 'viewthread_post_attachment', 'viewthread_post_sig', 'viewthread_post_nosig', 'viewthread_printable', 'viewthread_printable_row', 'viewthread_multipage', 'viewthread_mobile_qreply' );


As you can see, all I did was add 'viewthread_mobile_qreply' (which you created in step 2) to the list of templates that need loaded. If your viewthread.php is already customized (ie: not a standard installation) you can add this to the end just above the );

Code:
, 'viewthread_mobile_qreply'


Next, find the following block of code in viewthread.php

Code:
$thread['subject'] = shortenString(rawHTMLsubject(stripslashes($thread['subject'])), 125, X_SHORTEN_SOFT|X_SHORTEN_HARD, '...'); $lastPid = isset($thislast[2]) ? $thislast[2] : 0; $expire = $onlinetime + X_ONLINE_TIMER; if ( false === strpos( $oldtopics, "|$lastPid|" ) ) { if ( empty( $oldtopics) ) { $oldtopics = "|$lastPid|"; } else { $oldtopics .= "$lastPid|"; } put_cookie( 'oldtopics', $oldtopics, $expire, $cookiepath, $cookiedomain, $cookiesecure ); } $fid = $thread['fid']; $forum = getForum($fid);


And add this below it

Code:
if(isset($_GET['mobile']) && $_GET['mobile'] == "yes") { $mobilereturnlink = "<br><a href='mobile.php?forum=" . $fid . "'><b>&laquo; Return to Mobile Forum View</b></a><br>"; }else{ $mobilereturnlink = ""; }


Further down, locate this block of code:

Code:
$post['message'] = postify(stripslashes($post['message']), $smileyoff, $bbcodeoff, $forum['allowsmilies'], $forum['allowhtml'], $forum['allowbbcode'], $forum['allowimgcode']); eval('$posts .= "'.template('viewthread_printable_row').'";'); $counter++; } $db->free_result($querypost);


...and add this below it.

Code:
//viewthread mobile reply option if ($perms[X_PERMS_REPLY] And ($thread['closed'] == '' Or X_SADMIN)) { eval('$replylink = "'.template('viewthread_reply').'";'); if ($SETTINGS['quickreply_status'] == 'on') { $usesigcheck = ($self['sig'] != '') ? $cheHTML : ''; $captchapostcheck = ''; if (X_GUEST && $SETTINGS['captcha_status'] == 'on' && $SETTINGS['captcha_post_status'] == 'on') { require ROOT.'include/captcha.inc.php'; $Captcha = new Captcha(); if ($Captcha->bCompatible !== false) { $imghash = $Captcha->GenerateCode(); if ($SETTINGS['captcha_code_casesensitive'] == 'off') { $lang['captchacaseon'] = ''; } eval('$captchapostcheck = "'.template('viewthread_quickreply_captcha').'";'); } } if ($SETTINGS['smileyinsert'] == 'on' And $forum['allowsmilies'] == 'yes' And $smiliesnum > 0) { eval('$quickbbcode = "'.template('functions_bbcode_quickreply').'";'); $smilies = '<div align="center"><hr /><table border="0"><tr>'; $smilies .= smilieinsert('quick'); $smilies .= '</tr></table>'; $smilies .= "<a href=\"misc.php?action=smilies\" onclick=\"Popup(this.href, 'Window', 200, 250); return false;\">{$lang['moresmilies']}</a>"; $smilies .= "</div></td>"; } else { $quickbbcode = ''; $smilies = ''; } $disableguest = X_GUEST ? 'style="display:none;"' : ''; eval('$quickreply = "'.template('viewthread_mobile_qreply').'";'); } } //end mobile qreply


^NOTE although Smilies are currently not present I left the code (carbon copied from the regular quick reply feature) in order to expand functionality as I suspect some of you may desire this

We only have a few more files to edit before this is functional!



View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-9-2020 at 05:55 AM


Now we need to edit header.php.

Locate this line in header.php

Code:
/* Perform HTTP Connection Maintenance */


And add the following code ^ABOVE^ this comment

Code:
if(isset($_GET['mobile']) && $_GET['mobile'] == "usemobile"){ setcookie("MobileDefault", "usemobile"); header("Location: mobile.php"); }elseif(isset($_GET['mobile']) && $_GET['mobile'] == "default"){ setcookie("MobileDefault", "no"); header("Location: index.php"); } $mobileoption = $_COOKIE['MobileDefault'];


Next we want to open up index.php and locate this line:

Code:
require 'header.php';


Just below this, add:

Code:
$catchmobiles = 1; if($catchmobiles == 1){ $useragent=$_SERVER['HTTP_USER_AGENT']; if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4))) header("Location: index.php?mobile=usemobile"); } if($mobileoption == "usemobile"){ header("Location: mobile.php"); }


The reason for the if($variable) check is because I will integrate this into Admin CP->Settings. For now, change it to any value other than 1 to disable automatic mobile recognition.



View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-9-2020 at 05:59 AM


Then you'll want to open post.php and locate this code:
Code:
$topicpages = quickpage($posts, $ppp); $topicpages = ($topicpages == 1) ? '' : '&page='.$topicpages;


And add this below it:

Code:
//redirect user back to mobile version if mobile cookie is set //link format viewthread.php?action=printable&tid=99999&mobile=yes if($mobileoption == "usemobile"){ message($lang['replymsg'], TRUE, '', '', $full_url."viewthread.php?action=printable&tid={$tid}{$topicpages}&mobile=yes#pid{$pid}", true, false, true); }else{ message($lang['replymsg'], TRUE, '', '', $full_url."viewthread.php?tid={$tid}{$topicpages}#pid{$pid}", true, false, true); } //end mobile reply redirect



The last step is to let people using the Who's Online feature know when somebody is using the mobile version. Open online.inc.php and locate the following segment:

Code:
$location = $lang['onlinefaq'];


Add this just below it:

Code:
} else if (false !== strpos($url, '/mobile.php')) { $location = "Browsing the mobile optimized version";




View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-9-2020 at 08:36 AM


Working on pagination for forumdisplay now. :xmb:

-Also need to make sure to parse HTML contained in forum description



View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-12-2020 at 11:16 PM


5/12/20 - Fixed mobile index forum list, now shows HTML entities in description :)

Pagination for mobile forumdisplay coming next



View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-13-2020 at 12:02 AM


Pagination added to mobile forumdisplay :)

Next is adding U2U and a host of other features my own members are clamoring for.

If anybody wants to view a live demo: https://www.bigfish-gaming.com/community/mobile.php

No reg/login required to use all features (with the sole exception of quick reply)

If your own forum needs guest posting enabled, I already recycled some of XMB's permissions code to achieve that.

One other upgrade I want to make here is to use topics per page from the $SETTINGS superglobal instead of the hard-coded value it has now. Will be a very simple addition. Also a new thread option needs added.



View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-13-2020 at 07:31 PM


Will be adding the features listed above and access to today's posts as well as subforum displays.

Also going to begin integrating this with XMB's Admin CP.

Our security audit will be happening on 5/20 so I will have this completed before that date (in order to have the most complete evaluation possible).



View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 52
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 5-22-2020 at 04:19 AM


Our security audit is happening tomorrow! I will be sure to update any code revision suggestions here along with any (potential) issues found with the existing software. :up:



View user's profile Visit user's homepage View All Posts By User

  Go To Top

Powered by XMB 1.9.12 (Debug Mode)
XMB Forum Software © 2001-2024 The XMB Group
[Queries: 16] [PHP: 33.2% - SQL: 66.8%]