UBB.Dev
Posted By: sirdude [7.2.1] - Hop to as a popup menu - 07/20/2007 7:54 PM
Had a couple requests for this and threw it together. This essentially removes the 'Hop to:' pulldown and 'Go' button functionality from the bottom of showflat and postlist and makes it a popup menu.

Before pic:

[Linked Image]

After pic (on a different board of course - i can't modify ubbcentral!! laugh

[Linked Image]

Instructions:

Just read the Readme.txt (attached) and do it.

You can fiddle with '$jumpbox = $html -> hop_to(40);' and change the number 40 to your liking. The number 40 signifies the number of characters to display for forum/sub-forum(s), before using the '...' continuation. you'd do this in 2 places. showflat.inc.php and postlist.inc.php. no need to fiddle with the ubbthreads.inc.php class, as that is just the default over there.

This allows for loooong stuff to be trimmed and then the menu doesn't go bonkers width wise..

Good luck.

Notes:

1. you can easily move this menu to the right (over by the pager), but simply editing the tpls. Keep in mind, if there is no right side portal, you might have the popup to wide to fit on screen.
2. you can also duplicate the menus that are on top to down below as well.
3. you may want to edit the language for 'Hop to:' to 'Hop to' to get rid of the colon, if you are anal about it wink

example:

[Linked Image]

once again, it's a simple .tpl mod. I've done it, but am time pressed to post here. I'm quite sure someone could take this example and post those mods as a part of this thread though wink

we have enough tpl gooooos, to be able to slice and dice as needed.

Good luck wink



Description: Prolly want to read it ;)
Attached File
2459-ReadMe.txt  (28 downloads)
Posted By: Gizmo Re: [7.2] - Hop to as a popup menu - 07/21/2007 3:15 AM
Lookin good wink
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/21/2007 2:13 PM
Thanks SD .. going to apply it now. smile
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/21/2007 2:44 PM
SD, I got this error:

Fatal error: Call to undefined function: hop_to() in /xxx/xxx/xxx-www/forums/scripts/postlist.inc.php on line 487

This is the line that has the following code:

Code
$jumpbox = $html -> hop_to(40); 


Any ideas?

Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/21/2007 5:26 PM
hop_to function is added new in ubbthreads.inc.php. that's step 1, so either you didn't do that step or you didn't upload the new ubbthreads.inc.php..

:2c:
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/21/2007 6:48 PM
Ok, will try again. smile
Posted By: Mike G Re: [7.2] - Hop to as a popup menu - 07/22/2007 12:51 AM
Originally Posted by sirdude
hop_to function is added new in ubbthreads.inc.php. that's step 1, so either you didn't do that step or you didn't upload the new ubbthreads.inc.php..

:2c:

I got the same thing last night and figured I applied the mod incorrectly. So I tried again today and got the same action.

On the ubbthreads.inc.php modifications, you basically add your function to the bottom of the file just above the closing "?>" and that pretty much does it?

Get this when clicking on the forum:

Fatal error: Call to undefined method html::hop_to() in /usr/home/dunsire/ubb7test/scripts/postlist.inc.php on line 487

Get this when clicking on the last topic:

Fatal error: Call to undefined method html::hop_to() in /usr/home/dunsire/ubb7test/scripts/showflat.inc.php on line 528
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/22/2007 5:08 AM
no, the hop to is within the html class. so you need to search for:

Code

// #######################################################################
// Do login - Logs the user on
// #######################################################################

and add just above it, the hop_to function. Step 1 had a typo in the Find:

---
---

Bad copy/paste on my part. Its all updated now..

Matter of fact, hop_to essentially obsoletes jump_box and that routine could be deleted. I chose not to for this mod, just in case it might be needed somewhere else.
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/22/2007 5:16 AM
Oh good ... I tried it three times and got the same error every time. Thanks for updating it SD - will try again. smile

Thanks too for these great mods. You guys who do these mods are fabulous. I can't write code (except HTML) to save my life!
Posted By: Gizmo Re: [7.2] - Hop to as a popup menu - 07/22/2007 6:05 AM
It's you (and I) who make the feature request that deserve all of the thanks; if there was nothing to do, we'd have nothing to do wink
Posted By: Mike G Re: [7.2] - Hop to as a popup menu - 07/22/2007 7:20 AM
Awesome! Works like a charm!

One thing I did notice is the hopto behavour when viewing a topic. I don't know if this is IE7 or what but when I click the "hopto" button I only get the current forum I'm in and there is no table around the pick list, just the current forum and the "Go" button. If I click any where but on the button or list the border shows up.

If I click the pick list I see all of the forums and if I select one the hopto box disappears and I'm still looking at the active topic.

Aw heck, here's a link! crazy

http://ubb7test.bobdunsire.com/ubbthreads.php?ubb=showflat&Number=24#Post24

This is our test site, the live site is still running v7.1.1

Posted By: Mike G Re: [7.2] - Hop to as a popup menu - 07/22/2007 7:26 AM
Quote
Thanks too for these great mods. You guys who do these mods are fabulous. I can't write code (except HTML) to save my life!

I would also like to say THANKS for the hard work and effort you guys put into these mods.

I just got dropped into the deep end with UBB about a month ago with a decent sized site (11k members). I helped them move from Classic 6.7.0 on Winblows to 7.1.1 on Nix and away from a eastcoast datacenter to mine! smile

I'm currently running a few phpBB sites and after working with UBB I'm considering migrating them over to UBB.
thumbsup
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/22/2007 7:26 AM
looks like you did postlist fine... but the showflat looks like it's using the old jump_box stuff..

not sure why that is happening..

i will recheck the readme, but it looks like you almost got it, but like didn't delete something...

bleh.. dunno yet
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/22/2007 7:29 AM
lol @ winblows..

i wish my OS (z80 operating system) got a title like that! i'd be a billionaire!

wink

ps: looks like (for whatever reason) you are enabling the old jump_box as the popup..

my guess is that you didn't modify showflat.inc.php to call hop_to and are still calling jump_box..

paste from readme:

Code

Open: /scripts/showflat.inc.php

Find:

---
// --------------------
// Give the jumper box
$jumpbox = $html -> jump_box($Board);
---

Replace with:

---
// --------------------
// Give the jumper box
$jumpbox = $html -> hop_to(40);
---

:2c:
Posted By: Mike G Re: [7.2] - Hop to as a popup menu - 07/22/2007 7:33 AM
Originally Posted by sirdude
looks like you did postlist fine... but the showflat looks like it's using the old jump_box stuff..

not sure why that is happening..

i will recheck the readme, but it looks like you almost got it, but like didn't delete something...

bleh.. dunno yet

Nope, it was me! Sorry about that! I was putting in Gizmo's AdminIP mod and was moving files around and forgot to re-add your bit.

Its working just fine now. smashpc
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/22/2007 7:34 AM
cool [Linked Image]
Posted By: Gizmo Re: [7.2] - Hop to as a popup menu - 07/22/2007 9:39 AM
i love being referanced in other peoples mod threads wink
Posted By: Gizmo Re: [7.2] - Hop to as a popup menu - 07/22/2007 9:40 AM
You know, the only sugguestion that I have is to use the tdheader class for categories
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/22/2007 2:01 PM
Ok, I got it to work, but the "40" width doesn't change when I change it in the scripts. And my subforums are not showing.

I was so careful, and was real pleased when it worked, but looks like I've done something wrong again. frown
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/22/2007 2:11 PM
Here's a screencap:

[Linked Image]

I change the menu width in four places, right?

1 place in postlist.inc.php
1 place in showflat.inc.php
2 places in ubbthreads.inc.php

Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/22/2007 5:36 PM
Ok, my husband looked at this, and he says the "count" parameter in the php function "str_replace" (that is used to set the value of $level for the code added to lib/ubbthreads.inc.php in the mod) was introduced in php version 5.0.0. Our server is using a lower php version, so the value of $level in the mod cannot be set.

Also, for some reason, in the new Gallery forum, the Hop To menu didn't appear at the top, but down the bottom where it used to be, was the full menu - sort of like embedded there. Not sure if this is also a PHP version thing.

Anyway, until our host gets their act together to upgrade their PHP, I'll have to abandon this. I will come back to it though. smile
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/22/2007 5:50 PM
i'll change that to be php4/5 compatible. should be that way in the 1st place.

okie dokie Rose, i've made it php4/5 compatible locally. i've also added a little tweak for the continuation char string. right now it is hardwired to '...' . Some peeps might want '+' or whatever, so that's a variable.

i need to cruise to the hospital to pick up a friend and will post the updates in the .zip and readme.txt later on today.

thanks for point that incompatibility out. i miss php4/5 stuff, because of the fact that i'm so hardwired to v5 now.. blush
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/22/2007 9:31 PM
Oh gee SD, you don't need to do that. I can wait until our PHP is upgraded. We sent in a request this morning.
Posted By: Gizmo Re: [7.2] - Hop to as a popup menu - 07/23/2007 1:04 AM
It's best to remain PHP4 compatable; the UBB isn't planning to be PHP5+ for some while now since a large majory of hosts aren't even up to PHP4 yet lol...

Though, at this point, I say that, if your webhost isn't PHP5/Apache2/MySQL5, you should go elsewhere as updates go through pretty fast...
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/23/2007 4:53 AM
Updated for php4/5 now. Was an easy change. New readme.txt in initial topic post.

Btw, only place(s) that you would need to change the value from 40 chars to different is in the call to html->hop_to(40) in either showflat.inc.php or postlist.inc.php or both.

No need to change the function itself, as it takes the value you send it. If you don't send it anything. ie: html->hop_to(), the routine will default to 40.

One thing to also note. If your .popup_menu_content class has a width restriction on it, you'll have to consider what to do. My classes have width:auto; on them. :2c:

And to giz-unit. To change the class for the categories is easy peasy too.

Code

$hopCat = "<tr><td class=\"popup_menu_content\"><a href=\"{$config['BASE_URL']}/ubbthreads.php{$var_start}ubb{$var_eq}cfrm{$var_sep}c{$var_eq}$cat\">$cat_title</a></td></tr>";

change that "popup_menu_content" to oh say... "popup_menu_header" and the categories will be classed appropriately. you can of course use tdheader too.. whatever fluffs your flannel wink

keep in mind that there are two instances of "popup_menu_content". the 1st one is for the category loop and the 2nd one is for the forum/subforum loop. you'd be changing the 1st one, most likely.

Thanks for the input(s) peeps..

Enjoy!
Posted By: Ian_W Re: [7.2] - Hop to as a popup menu - 07/23/2007 9:20 AM
The problem going to php5 is that some scripts are still not fully compatible with PHP5 frown
Posted By: Gizmo Re: [7.2] - Hop to as a popup menu - 07/23/2007 9:31 AM
Originally Posted by Ian_W
The problem going to php5 is that some scripts are still not fully compatible with PHP5 frown
Have you actually seen why? It's miniscule, people assume you have global variables on vs defining them individually, takes all of 20 minutes to update a huge script like a *nuke
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/23/2007 12:52 PM
Thanks SD! Will try again tonight. smile
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/24/2007 3:38 AM
Ok, I got it to work just fine this time, except in the gallery forum (it did some very strange things in there), and not until I had undone it again did I realize that the same changes have to be made to gallery.tpl. So I'll try it again, but I'm sure it will work this time.

There's only one other thing, and I don't think it has to do with the mod - more an IE thing because this doesn't happen in Firefox. See the screencap.

The browser adds this awful side-scrolling scroll bar. Any ideas about that? I'm determined to have this Hopto mod, and that scroll bar thing is the last piece of problem. help

Attached picture 2454-hopto.jpg
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/24/2007 5:12 AM
try width:auto for your css classes. i don't know what you have now, but that might be the case.

i also have height:auto as well.

good catch on gallerylist.tpl. i guess i need to add that to the original .zip and readme.txt too.

looks like showgallery.tpl too..

m'kay i will update the readme shortly for the gallery stuff.

Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/25/2007 3:01 AM
SD, which CSS classes? I'm really just learning about CSS, although I can use the UBB ones just fine. Not sure which classes I'd adjust or add the width and height though.
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/25/2007 3:55 AM
popup_menu
popup_menu_content
popup_menu_header
popup_menu_highlight

Those style all your popups. sooo, for example giz wanted to make the catagories stand out from the forums/sub-forums.

he could style the categories with class="popup_menu_header" and the others with "popup_menu_content"

they are all in "Popup menu properties" section of the styles editor in the cpanel.

Also, i'll bet you are using IE ?
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/25/2007 1:04 PM
Thanks SD. Yes, I'm using IE. The scroll-bar thing doesn't happen in Firefox. I'm not sure if the CSS thing will help, but I'll try it.

Also, I can't find a showgallery.tpl.

You'll be glad to see the back of me, I'm sure. smile

Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/25/2007 6:29 PM
never mind about showgallery.. senior moment smile

i think i have a template fix for you rose. will test on ie7 and ie6, then post here..
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/25/2007 10:54 PM
ok Rose, i found this works..

edit your tpl's and use:

Code
<div id="hopto_popup" style="display: none; height: 350px; width:auto; overflow-x:hidden; overflow-y:scroll;">{$jumpbox}</div>

for the hopto_popup div(s). should get rid of those annoying scrollies wink
Posted By: Zarzal Re: [7.2] - Hop to as a popup menu - 07/25/2007 11:55 PM
Quote
postlist.tpl: Find:

---
Code
<div style="float: right">
{$jumpbox}
</div>
this must be removed 2 times!
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/26/2007 2:09 AM
that only occurs 1 time in postlist.tpl

as for gallerylist.tpl, the readme.txt reflects that now!! wink

the readme is also updated with the IE5/6/7 friendly scrollie fix, prompted by Rose's comments
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/26/2007 3:33 AM
sirdude .. you're the best. smile I'll let you know how I go. Thanks for all your help. smile
Posted By: Rose Re: [7.2] - Hop to as a popup menu - 07/26/2007 4:09 AM
SD, it's perfect!! Thanks so much for putting up with me. ((((hugs)))) smile
Posted By: Gizmo Re: [7.2] - Hop to as a popup menu - 07/26/2007 4:52 AM
boo, ie, booooo wink
Posted By: Zarzal Re: [7.2] - Hop to as a popup menu - 07/26/2007 9:06 AM
Originally Posted by sirdude
that only occurs 1 time in postlist.tpl
No, it is in two times. Line 229-231 and line 284-286.
If You dont remove the second one you get an open jumperlist below the posting list.
Can it be that you use a template from 7.2b? The code in your instructions for the galery template looks a little bit different too.
Posted By: Zarzal Re: [7.2] - Hop to as a popup menu - 07/26/2007 9:22 AM
I apply your last changes but it look like this in IE 6. The popup is under the selct boxes. In FireFox it looks good.




Description: Problem with IE6
Attached picture 2457-ieprob.jpg
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/26/2007 1:36 PM
may just need a z-index added to the div, so it's on top for ie..

and i learn what 'Hop to' in german is too!! "Gehe Zu" laugh
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/26/2007 1:46 PM
Originally Posted by Zarzal
Originally Posted by sirdude
that only occurs 1 time in postlist.tpl
No, it is in two times. Line 229-231 and line 284-286.
If You dont remove the second one you get an open jumperlist below the posting list.
Can it be that you use a template from 7.2b? The code in your instructions for the galery template looks a little bit different too.


line 229-231 is the pager.. you DON'T want to delete that..

284-286 is the one to delete wink

and i dl'd 7.2 again just to check. your search needs to be more precise wink

these are two totally different things... one for 'page 3of3 1 2 3' the other for how old 'Hop to:' worked..

we never had 2 hop to's per page before.

btw, readme.txt is updated with all the latest changes and suggestions.

note: if you are having a problem with the pop-up menu not always being on top. ala what Zarzal has. just add z-index:50; to the inline style declaration. that is only for IE quirks and probably only if your forum number of posts is low enough that the popup actually runs into the 'Display Options' stuff.

good luck!
Posted By: Zarzal Re: [7.2] - Hop to as a popup menu - 07/26/2007 7:14 PM
Thanks. I dont read carefully enough so I think I have to remove it two times in postlist.tpl. My fault. I replaced it.

The issue with IE is not fixed. I put in the z-index, raise the value up to 999 but is stil under it.
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 07/26/2007 7:22 PM
simple solution is to get more topics in that forum laugh

seriously though,

i'll find a forum with few topics and reproduce with IE 6/7 and get back to you wink

edit: ie7 works fine.. are you ie6 or 5.5 ?

you might also try adding position:relative; to the inline style.
Posted By: sirdude Re: [7.2] - Hop to as a popup menu - 08/22/2007 5:58 PM
just tested in opera too.. this works in 99+% of browsers.
© UBB.Developers