MyBB Community Forums

Full Version: Updating GoMobile Navigation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

I'm currently working on a test MyBB forum to see what I can do with it. I haven't gotten too far (this is more of a side project that I've been working on for the last few days), but I wanted to add mobile support. I don't have the knowledge to do a rewrite of MyBB for a responsive theme as I see a few people have started (but not finished? [1] [2]). So I found myself a copy of MyBB GoMobile.

I like it, but it could be better; specifically the navigation. When I add links it gets too crowded and then overlaps. So I did some research on Google to see how I could fix the problem, and came up with three possible solutions:
  • A mobile navigation drop down [link] - too ugly
  • A CSS based drop down menu [link] - can't do this with the Header Templates coding (at least with my limited knowledge)
  • Or integrate a third party plugin [link] - just right [maybe?] Smile
...which brings me to my problem. According to the instructions, I've done everything correctly, but my menus don't appear and I'm not sure why Sad

I've included two pictures (one of my mobile site with no menus, and the other of my /jscripts/slidebars/ directory to show I've uploaded the necessary files). I've done my best to write out my thinking process, problem and attempted solution the best I can. If anything is unclear, then please do not hesitate to ask. Any and all help will be appreciated, please remember, I'm a novice to this. So thank you for your time Big Grin


Edited Templates:

headerinclude (MyBB GoMobile Templates -> Ungrouped Templates -> headerinlcude)
<!-- Start Edit -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="jscripts/slidebars/slidebars.min.css">
<!-- End edited -->

<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1603"></script>
{$stylesheets}
<script type="text/javascript">
<!--
	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var cookiePrefix = "{$mybb->settings['cookieprefix']}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
	var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
	var my_post_key = "{$mybb->post_code}";
	var imagepath = "{$theme['imgdir']}";
// -->
</script>
{$newpmmsg}

header - (MyBB GoMobile Templates -> Header Templates -> header)
<a name="top" id="top"></a>
	<div id="header">
                
                <!-- Start Edit -->
                <span class=".sb-toggle-left">Profile</span>
		<!--<div id="panel"> --><div class="sb-slidebar sb-left">
                       {$welcomeblock}
		</div>
		<div id="logo">
			<a href="{$mybb->settings['bburl']}/index.php">{$mybb->settings['gomobile_mobile_name']}</a>
		</div>
                <span class=".sb-toggle-right">Menu</span>		
                <!-- <div id="menu"> --><div class="sb-slidebar sb-left">                        
                        <a href="{$mybb->settings['bburl']}/forums.php">Forums</a></li>                                        
			<a href="{$mybb->settings['bburl']}/memberlist.php">Members</a></li>
			<a href="{$mybb->settings['bburl']}/calendar.php">{$lang->toplinks_calendar}</a></li>
                        <a href="{$mybb->settings['bburl']}/search.php?action=getnew">{$lang->welcome_newposts}</a>
                        <a href="{$mybb->settings['bburl']}/search.php">{$lang->toplinks_search}</a></li>
		</div>
        <!-- End Edit --> 

	</div>
	<navigation>
	<div id="container">
			{$pm_notice}
			{$bannedwarning}
			{$bbclosedwarning}
			{$unreadreports}

index (MyBB GoMobile Templates -> Index Page Templates -> index)
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
	lang.no_new_posts = "{$lang->no_new_posts}";
	lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}

<!-- Main content -->
<div id="sb-site">
   {$forums}
   {$boardstats}
   {$footer}
</div>

<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

<!-- Slidebars -->
<script src="path/to/slidebars.min.js"></script>
<script>
   (function($) {
     $(document).ready(function() {
       $.slidebars();
     });
   }) (jQuery);
</script>
</body>
</html>

**Please note that I did upload all 4 files in the Distribution -> 0.9.4 folder [download] to the /jscript/slidebars directory of my site. I only linked to the slidebars.min. though.
This menu is jQuery powered - are you already loading jQuery somewhere else?
(2014-04-28, 06:06 AM)Leefish Wrote: [ -> ]This menu is jQuery powered - are you already loading jQuery somewhere else?

I think so, I installed MyShoutbox 1.7. I didn't tweak anything on the shoutbox yet, so I'm not sure if it uses jQuery or not, though.

If this plugin doesn't use jQuery, then I would have to say I'm not using it anywhere else. The only other plugins I have installed/activated are Page Manager and of course GoMobile (link in original post). Unless GoMobile uses jQuery to find out if a user is on a movie device?

If I am using jQuery somewhere else, is that what the problem is? How would I go about fixing it? I am not familiar at all with jQuery sadly, only basic php and JavaScript.

(2014-04-28, 06:06 AM)Leefish Wrote: [ -> ]This menu is jQuery powered - are you already loading jQuery somewhere else?

I think so, I installed MyShoutbox 1.7. I didn't tweak anything on the shoutbox yet, so I'm not sure if it uses jQuery or not, though.

If this plugin doesn't use jQuery, then I would have to say I'm not using it anywhere else. The only other plugins I have installed/activated are Page Manager and of course GoMobile (link in original post). Unless GoMobile uses jQuery to find out if a user is on a movie device?
if this plugin depends on jQuery - which I think it does - then really you need to load jQuery as well in the headerinclude. That is a second js library loading for a menu - up to you of course.

There are lots of navigation patterns here : http://responsivenavigation.net/examples...index.html

I use one of them on leefish and redid the code to be Prototype rather than jQuery.
(2014-04-28, 03:19 PM)Leefish Wrote: [ -> ]if this plugin depends on jQuery - which I think it does - then really you need to load jQuery as well in the headerinclude. That is a second js library loading for a menu - up to you of course.

There are lots of navigation patterns here : http://responsivenavigation.net/examples...index.html

I use one of them on leefish and redid the code to be Prototype rather than jQuery.

I have the jQuery loading in the index template. I just tried inserting the same jQuery script into the headerinclude template as you suggested, and it seems nothing has changed sadly.

I have contacted the developer today, and hopefully will get a reply. Until then I guess I will try this out. Though thank you for the link, I have not seen that before and have been looking into it Smile


I'm still open to any other suggestions/ideas that could get this plugin to work. Thank you.
I would suggest you not use Go Mobile considering it seems to have been abandoned.
I don't think its abandoned - Jason recently posted to say he was updating it.

I do think that it is a mobile THEME rather than a mobile solution; its still loading most of the js from the "standard" theme and so can be slow on some mobile devices.
(2014-04-28, 08:10 PM)Anarchy Wrote: [ -> ]I would suggest you not use Go Mobile considering it seems to have been abandoned.

I find it to be the only (free) solution available at the moment, as I mentioned before in my original post, I found two other responsive themes, but they are not finished and do not work on my forum.

I feel it would be easier to just customize GoMobile since it appears to be finished at least, unless you have a better alternative? I would be happy to hear it.
Other than the header not meshing with sidebars, I've found GoMobile to be great. Quite zippy. Relatively easy to mod as well. Anything that's missing, I've been able to add straight from desktop theme variables.
(2014-05-02, 08:53 PM)DrXotick Wrote: [ -> ]Other than the header not meshing with sidebars, I've found GoMobile to be great. Quite zippy. Relatively easy to mod as well. Anything that's missing, I've been able to add straight from desktop theme variables.

I have gotten other side bars to work with MyBB GoMobile, but I like this one the best, so of course it won't work for me. I've contacted the dev and am awaiting a reply.

I have tried a second time to implement this plugin, still with no luck. This is the website (on the mobile version of course).

If anyone is still interested in taking a look, I'll reupload my templates.