Page 1 of 2

OBBLM Hover menus with phones/tablets

Posted: Tue Jun 04, 2013 10:41 pm
by BigSexy
I can use OBBLM fairly well with my iphone but cannot access dropdown menus such as "Matches", "Statistics", etc. These are the dropdowns that are opened when you hover the mouse pointer over them and I've found this is a common issue with websites and mobile touch devices. Is there anykind of work around and development that can fix this? I expect more and more coaches will be wanting to use evil mobile gadgetry to submit match results and such.

Re: OBBLM Hover menus with phones/tablets

Posted: Wed Jun 05, 2013 12:54 am
by Shteve0
Not that I've seen; I have the same issue. I'm working on a possible patch, and though I'm an enthusiastic amateur at best, I'll hopefully have something to show for my efforts within a week or two.

Re: OBBLM Hover menus with phones/tablets

Posted: Wed Jun 05, 2013 10:11 am
by nicholasmr
Please let me know if you patch this! - I'll add it to the official distribution then.

I imagine fixing this by something like making the drop-down unfold if the mouse hovers over the menu OR is clicked on (the latter is probably not enabled at the moment).

Alternatively, maybe a new open source menu system should be used which supports smart phones etc.
? The current one is from before smart phones took off etc...

Nicholas.

Re: OBBLM Hover menus with phones/tablets

Posted: Fri Jun 07, 2013 8:41 pm
by Shteve0
Hi Nicholas

Apparently in the advanced or ultimate versions of the packaged menu the point is to leverage a hyperlink trigger inside a li item to make it open its child menu. In simple version you will need to use a workaround and add onmouseover="" to each li item containing a drop down menu in order to trigger and toggle its visibility.

Does that make sense? I'll have a go at implementing that on my league page shortly, see how it works out.

Re: OBBLM Hover menus with phones/tablets

Posted: Thu Jun 13, 2013 2:49 pm
by BigSexy
Just to update. My Kindle Fire will open the hover menus when I tap the heading, so apparently it will work for some devices.

Re: OBBLM Hover menus with phones/tablets

Posted: Mon Jun 17, 2013 10:42 pm
by Shteve0
Main menu fix, of sorts. I now have a much less irritating issue that once I've opened a menu on my ipod, I have to make a selection to get rid of it. I might move the Home option to the left of the first drop down so I have somewhere to go if I mis-hit?

Anyway, here's the patch.

1) TAKE A BACKUP OF YOUR SITE!

2) Open your host's core panel, navigate to [root]/lib/class_htmlout.php, edit.

3) Find this:

Code: Select all

        if (isset($_SESSION['logged_in']) && is_object($coach)) {
            echo '<li><a href="'.urlcompile(T_URL_PROFILE,T_OBJ_COACH,$coach->coach_id,false,false).'">'.$lng->getTrn('menu/cc').'</a></li>';
            if (!empty($admin_menu)) {
                ?>
                <li><span class="dir"><?php echo $lng->getTrn('menu/admin_menu/name');?></span>
                    <ul>
                    <?php
                    foreach ($admin_menu as $lnk => $desc) {
                        if (!is_array($desc)) {
                            echo "<li><a href='index.php?section=admin&subsec=$lnk'>$desc</a></li>\n";
                        }
                        else {
                            ?>
                            <li><span class="dir"><?php echo $desc['title'];?></span>
                            <ul>
                            <?php
                            foreach ($desc['sub'] as $sub) {
                                echo "<li><a href='index.php?section=admin&subsec=$lnk&$sub[href]'>$sub[title]</a></li>\n";
                            }
                            ?>
                            </ul>
                            </li>
                            <?php
                        }
                    }
                    ?>
                    </ul>
                </li>
                <?php
            }
        }
        ?>
        <li><a href="index.php?section=main"><?php echo $lng->getTrn('menu/home');?></a></li>
        <li><a href="index.php?section=teamlist"><?php echo $lng->getTrn('menu/teams');?></a></li>
        <li><a href="index.php?section=coachlist"><?php echo $lng->getTrn('menu/coaches');?></a></li>
        <li><span class="dir"><?php echo $lng->getTrn('menu/matches_menu/name');?></span>
            <ul>
                <li><a href="index.php?section=matches&type=tours"><?php echo $lng->getTrn('menu/matches_menu/tours');?></a></li>
                <li><a href="index.php?section=matches&type=recent"><?php echo $lng->getTrn('menu/matches_menu/recent');?></a></li>
                <li><a href="index.php?section=matches&type=upcoming"><?php echo $lng->getTrn('menu/matches_menu/upcoming');?></a></li>
                <li><a href="index.php?section=matches&type=usersched"><?php echo $lng->getTrn('menu/matches_menu/usersched');?></a></li>
            </ul>
        </li>
        <li><span class="dir"><?php echo $lng->getTrn('menu/statistics_menu/name');?></span>
            <ul>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_TEAM,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/team_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_PLAYER,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/player_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_COACH,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/coach_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_RACE,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/race_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_STAR,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/star_stn');?></a></li>
            </ul>
        </li>
        <li><span class="dir"><?php echo $lng->getTrn('menu/plugins');?></span>
            <ul>
                <?php if (Module::isRegistered('UPLOAD_BOTOCS') && $settings['leegmgr_enabled']) { ?><li><a href="handler.php?type=leegmgr">Client Match Report Upload</a></li><?php } ?>
                <?php if (Module::isRegistered('Search')){ ?><li><a href="handler.php?type=search"><?php echo $lng->getTrn('name', 'Search');?></a></li><?php } ?>
                <?php if (Module::isRegistered('TeamCompare')){ ?><li><a href="handler.php?type=teamcompare"><?php echo $lng->getTrn('name', 'TeamCompare');?></a></li><?php } ?>
                <?php if (Module::isRegistered('PDFMatchReport'))    { ?><li><a href="handler.php?type=pdfmatchreport"><?php echo $lng->getTrn('name', 'PDFMatchReport');?></a></li><?php } ?>
                <?php if (Module::isRegistered('HOF'))   { ?><li><a href="handler.php?type=hof"><?php echo $lng->getTrn('name', 'HOF');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Wanted')){ ?><li><a href="handler.php?type=wanted"><?php echo $lng->getTrn('name', 'Wanted');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Prize')) { ?><li><a href="handler.php?type=prize"><?php echo $lng->getTrn('name', 'Prize');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Memmatches')) { ?><li><a href="handler.php?type=memmatches"><?php echo $lng->getTrn('name', 'Memmatches');?></a></li><?php } ?>
                <?php if (Module::isRegistered('SGraph'))     { ?><li><a href="handler.php?type=graph&gtype=<?php echo SG_T_LEAGUE;?>&id=none"><?php echo $lng->getTrn('name', 'SGraph');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Gallery'))    { ?><li><a href="handler.php?type=gallery"><?php echo $lng->getTrn('name', 'Gallery');?></a></li><?php } ?>
				<?php if (Module::isRegistered('LeagueTables'))    { ?><li><a href="handler.php?type=leaguetables"><?php echo $lng->getTrn('menu-label', 'LeagueTables');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Conference'))    { ?><li><a href="handler.php?type=conference"><?php echo $lng->getTrn('menu-conf', 'Conference');?></a></li><?php } ?>
            </ul>
        </li>

        <li><a href="index.php?section=rules"><?php echo $lng->getTrn('menu/rules');?></a></li>
        <li><a href="index.php?section=about">OBBLM</a></li>
        <?php
        if (!empty($settings['forum_url'])) {
            ?><li><a href="<?php echo $settings['forum_url'];?>"><?php echo $lng->getTrn('menu/forum');?></a></li><?php
        }
        ?>
    </ul>
    <?php
Replace with this:

Code: Select all

        if (isset($_SESSION['logged_in']) && is_object($coach)) {
            echo '<li><a href="'.urlcompile(T_URL_PROFILE,T_OBJ_COACH,$coach->coach_id,false,false).'">'.$lng->getTrn('menu/cc').'</a></li>';
            if (!empty($admin_menu)) {
                ?>
                <li onmouseover=""><span class="dir"><?php echo $lng->getTrn('menu/admin_menu/name');?></span>
                    <ul>
                    <?php
                    foreach ($admin_menu as $lnk => $desc) {
                        if (!is_array($desc)) {
                            echo "<li><a href='index.php?section=admin&subsec=$lnk'>$desc</a></li>\n";
                        }
                        else {
                            ?>
                            <li onmouseover=""><span class="dir"><?php echo $desc['title'];?></span>
                            <ul>
                            <?php
                            foreach ($desc['sub'] as $sub) {
                                echo "<li><a href='index.php?section=admin&subsec=$lnk&$sub[href]'>$sub[title]</a></li>\n";
                            }
                            ?>
                            </ul>
                            </li>
                            <?php
                        }
                    }
                    ?>
                    </ul>
                </li>
                <?php
            }
        }
        ?>
        <li><a href="index.php?section=main"><?php echo $lng->getTrn('menu/home');?></a></li>
        <li><a href="index.php?section=teamlist"><?php echo $lng->getTrn('menu/teams');?></a></li>
        <li><a href="index.php?section=coachlist"><?php echo $lng->getTrn('menu/coaches');?></a></li>
        <li onmouseover=""><span class="dir"><?php echo $lng->getTrn('menu/matches_menu/name');?></span>
            <ul>
                <li><a href="index.php?section=matches&type=tours"><?php echo $lng->getTrn('menu/matches_menu/tours');?></a></li>
                <li><a href="index.php?section=matches&type=recent"><?php echo $lng->getTrn('menu/matches_menu/recent');?></a></li>
                <li><a href="index.php?section=matches&type=upcoming"><?php echo $lng->getTrn('menu/matches_menu/upcoming');?></a></li>
                <li><a href="index.php?section=matches&type=usersched"><?php echo $lng->getTrn('menu/matches_menu/usersched');?></a></li>
            </ul>
        </li>
        <li onmouseover=""><span class="dir"><?php echo $lng->getTrn('menu/statistics_menu/name');?></span>
            <ul>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_TEAM,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/team_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_PLAYER,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/player_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_COACH,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/coach_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_RACE,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/race_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_STAR,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/star_stn');?></a></li>
            </ul>
        </li>
        <li onmouseover=""><span class="dir"><?php echo $lng->getTrn('menu/plugins');?></span>
            <ul>
                <?php if (Module::isRegistered('UPLOAD_BOTOCS') && $settings['leegmgr_enabled']) { ?><li><a href="handler.php?type=leegmgr">Client Match Report Upload</a></li><?php } ?>
                <?php if (Module::isRegistered('Search')){ ?><li><a href="handler.php?type=search"><?php echo $lng->getTrn('name', 'Search');?></a></li><?php } ?>
                <?php if (Module::isRegistered('TeamCompare')){ ?><li><a href="handler.php?type=teamcompare"><?php echo $lng->getTrn('name', 'TeamCompare');?></a></li><?php } ?>
                <?php if (Module::isRegistered('PDFMatchReport'))    { ?><li><a href="handler.php?type=pdfmatchreport"><?php echo $lng->getTrn('name', 'PDFMatchReport');?></a></li><?php } ?>
                <?php if (Module::isRegistered('HOF'))   { ?><li><a href="handler.php?type=hof"><?php echo $lng->getTrn('name', 'HOF');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Wanted')){ ?><li><a href="handler.php?type=wanted"><?php echo $lng->getTrn('name', 'Wanted');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Prize')) { ?><li><a href="handler.php?type=prize"><?php echo $lng->getTrn('name', 'Prize');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Memmatches')) { ?><li><a href="handler.php?type=memmatches"><?php echo $lng->getTrn('name', 'Memmatches');?></a></li><?php } ?>
                <?php if (Module::isRegistered('SGraph'))     { ?><li><a href="handler.php?type=graph&gtype=<?php echo SG_T_LEAGUE;?>&id=none"><?php echo $lng->getTrn('name', 'SGraph');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Gallery'))    { ?><li><a href="handler.php?type=gallery"><?php echo $lng->getTrn('name', 'Gallery');?></a></li><?php } ?>
				<?php if (Module::isRegistered('LeagueTables'))    { ?><li><a href="handler.php?type=leaguetables"><?php echo $lng->getTrn('menu-label', 'LeagueTables');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Conference'))    { ?><li><a href="handler.php?type=conference"><?php echo $lng->getTrn('menu-conf', 'Conference');?></a></li><?php } ?>
            </ul>
        </li>

        <li><a href="index.php?section=rules"><?php echo $lng->getTrn('menu/rules');?></a></li>
        <li><a href="index.php?section=about">OBBLM</a></li>
        <?php
        if (!empty($settings['forum_url'])) {
            ?><li><a href="<?php echo $settings['forum_url'];?>"><?php echo $lng->getTrn('menu/forum');?></a></li><?php
        }
        ?>
    </ul>
    <?php
Now hit save, and you should be fine.

That sorts out the main menu. There are a few more I need to look at. Confirmed working on my ipod.

Re: OBBLM Hover menus with phones/tablets

Posted: Mon Jun 17, 2013 10:56 pm
by Shteve0
Found another two in the team screen. Is that all of them? Relatively easy fix, this; you want /lib/class_team_htmlout.php

Find:

Code: Select all

  <li><span class="dir">Roster</span>
            <ul>
                <?php if ($pdf)    { ?><li><a TARGET="_blank" href="<?php echo $pdf;?>">PDF</a></li> <?php } ?>
                <?php if ($botocs) { ?><li><a TARGET="_blank" href="<?php echo $botocs;?>">BOTOCS-XML</a></li> <?php } ?>
                <?php if ($cyanide) { ?><li><span class="dir">Cyanide-DB</span>
                    <ul>
Replace with:

Code: Select all

  <li onmouseover=""><span class="dir">Roster</span>
            <ul>
                <?php if ($pdf)    { ?><li><a TARGET="_blank" href="<?php echo $pdf;?>">PDF</a></li> <?php } ?>
                <?php if ($botocs) { ?><li><a TARGET="_blank" href="<?php echo $botocs;?>">BOTOCS-XML</a></li> <?php } ?>
                <?php if ($cyanide) { ?><li onmouseover=""><span class="dir">Cyanide-DB</span>
                    <ul>

Re: OBBLM Hover menus with phones/tablets

Posted: Tue Jun 18, 2013 6:14 am
by Hegel
Just changed the /lib/class_htmlout.php and the main menu works fine on my iPhone now ! Thanks a lot Shteve0 !!! The minor bug with the menu staying open until I select something is neglectable for me.

OBBLM Hover menus with phones/tablets

Posted: Tue Jun 18, 2013 7:47 am
by Shteve0
Cool, you're very welcome. The second post fixes the Roster drop down on the team screen, just so you're aware. I personally like to use the pdf version a lot, so that's a big deal for me to have that working.

Enjoy!

Re: OBBLM Hover menus with phones/tablets

Posted: Tue Jun 18, 2013 11:03 am
by Hegel
I only have the PDF option available, but as I don´t have an AirPrint printer I can´t print from the iPad/Phone anyway :) . But thanks for the hint, I´ll fix that too.

Re: OBBLM Hover menus with phones/tablets

Posted: Tue Jun 18, 2013 12:33 pm
by funnyfingers
Has a bug report been made on this with all the specific changes? If you can't get to making the changes to the trunk, I can if it is all written out in one place.

Re: OBBLM Hover menus with phones/tablets

Posted: Thu Jun 20, 2013 1:02 pm
by Hegel
I´ve been in contact with Nicolas before. I´ve not been aware that there is an option to report bugs somewhere. He´s been here in that topic so I guess he´s already aware of the solution.

OBBLM Hover menus with phones/tablets

Posted: Thu Jun 20, 2013 6:21 pm
by Shteve0
No, not been raised as yet. May get to it this weekend unless a kind soul beats me to it!

http://code.google.com/p/obblm/issues/list

Re: OBBLM Hover menus with phones/tablets

Posted: Thu Jun 20, 2013 7:55 pm
by funnyfingers
Shteve0 wrote:No, not been raised as yet. May get to it this weekend unless a kind soul beats me to it!

http://code.google.com/p/obblm/issues/list

If you can get the bug report all spelled out for me, I think I can get it including in the hosting stuff that I am setting up for OBBLM.

Re: OBBLM Hover menus with phones/tablets

Posted: Thu Jun 20, 2013 9:20 pm
by Shteve0
Issue: On some tablet or mobile computer devices (namely those operating on an iOS), "hover" triggers don't expand the lwis.net drop down menus coded into the obblm software; they simply don't act as clickable links and the functionality of the sub menus is lost.

Solution: the empty onmouseover() is added within each <li> item with an expandable menu to force the iphone to expand that menu, allowing the secondary/tertiary levels to be selected.

As an aside, this generates a new issue in that once the dropdown menu is expanded on an iOS devide, another menu selection needs to be made (or a page refresh carried out) in order to collapse it again (ie refresh the menu). All told, it's a minor inconvience and, I'd suggest, much the lesser of the two evils.

You can see a demo of the fix in action by visiting my league page, http://nzcbbl.obblm.com; from an iOS device the drop downs are functional, and from a normal pc browser there should be no apparent difference (ie I've not actually disabled the hover, just added an empty onmouseover() for iphone browsing).

How To Apply: In simple terms, replace the first code strings in each of my earlier posts within the second code strings (whereby you will essentially be adding the onmouseover() code in the positions that I did). Make sure you take a backup of your site first! You should be able to do this within the source code prior to install without any issues.

Clear enough?

Credit: lwis.net (known fix)