Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Hj Ahmad Rasyid Hj Ismail on August 01, 2014, 04:20:12 PM

Title: DMOT: Default Menu To Top For SMF 2.0.x and 1.1.x (Hook Version!)
Post by: Hj Ahmad Rasyid Hj Ismail on August 01, 2014, 04:20:12 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3905)

DMOT: Default Menu On Top (Hook Version!)

- For SMF 2.0.x & 1.1.x
- Fully hook, no file modification for SMF 2.0.x but partly manual is also avalable.

1. Please do your own backup though every installation is backed up automatically.
2. This mod will help you move your main menu from its current position to top.
3. Upon its successful installation, you will need to enable it it mod settings page.
4. There is nothing fancy about this mod but just a simple css mod tricks.
5. You can test it in lower SMF 2.0 and 1.1.x version too as IMO it should work just fine. ;)
6. For SMF 1.1x - this mod now requires Enhanced Mod Settings Page mod to be pre-installed (EMSPv100.zip is attached).


Thank you for using/testing it.


Yours friendly,
Abu Fahim Ismail.

BSD License. Feel free to modify accordingly but keep author's link if it is in there somewhere. ;)

(http://validator.w3.org/images/valid_icons/valid-xhtml10)  (http://jigsaw.w3.org/css-validator/images/vcss)


#Change Logs

@Version 1.4.1
- Fix inconsistency with FARM - Font Awesome Responsive Mod i.e. by disabling css hover and active.
- Add support for smaller screen i.e. margin is adjusted to be more responsive to screen size.

@Version 1.4.0
- Further harmonize between this mod and Alternative Menu mod css stylings.
- Fixed options dependencies between one to another as introduced in version 1.3.0[/u].
- Fixed main menu break when this mod is disable in its mod settings page.

@Version 1.3.0
- Added options to change main menu background, its bottom border and its text color.
- Added options to change top menu background and its text color when active.
- Added options to change top menu background and its text color when hovered upon.

@Version 1.2.2
- Fixed some of minor css alignment within this mod itself.
- Fixed css to work better with Alternative Menu and Search Bar To Menu mods.

@Version 1.2.1
- Added requirement for EMSP - Enhanced Mod Settings Page mod to be pre-installed.
- EMSPv100.zip thus is attached together.
- Reason is because SMF 1.1.x doesn't have its own Mod Settings Page.
- This is will ease forum owner in managing the mods.

@Version 1.2.0
- Added support to Alternative Menu mod.
- Added support to Search Bar To Menu mod.

@Version 1.1.0
- Added support to SMF 1.1.x.

@Version 1.0.0
- Introductory package.
Title: Re: DMOT: Default Menu On Top
Post by: Hj Ahmad Rasyid Hj Ismail on August 04, 2014, 05:19:44 AM
I think I can make this mod works for SMF 1.1.x and I will update with regards to that soon.

I will also try to make several variations for this menu. Among others, I am thinking of:
1. Giving an options for it for it to be on the left, center or right.
2. Moving upshrink button to its right side?
3. Adding search inside it?
4. Moving forum name above or below it?
5. Moving forum name next to it?
6. Adding time and date?

Or may be, it will be just in another mod(s).

Basically, some of this ideas can be seen in anypost forum:
1. Theme pre-face1 (http://anypost.qom.my/)
2. Theme face2 (http://anypost.qom.my/)

This mod will be adjusted accordingly to work together with my other mod: Alternative Menu With Button Remover (http://custom.simplemachines.org/mods/index.php?mod=3902)

Still thinking...
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x
Post by: Hj Ahmad Rasyid Hj Ismail on August 04, 2014, 04:47:10 PM
Now cover 1.1.x version as well. Do report if there is any error / problem in using this mod.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x
Post by: Hj Ahmad Rasyid Hj Ismail on August 13, 2014, 04:03:07 AM
Updated to work together with Alternative Menu With Top Menu Icon & Button Remover mod which is now available to both SMF 2.0.x and SMF 1.1.x.

For SMF 1.1x - this mod now requires Enhanced Mod Settings Page mod to be pre-installed (EMSPv100.zip is attached in mod download page).
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x
Post by: Kimmie on August 15, 2014, 03:40:28 PM
Any screenshots that show the difference between this menu and the one we already have at the top?
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x
Post by: Biology Forums on August 15, 2014, 04:42:48 PM
Could you please provide an image of what this mod does?

Thanks for making it compatible for 1.x...
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x
Post by: Hj Ahmad Rasyid Hj Ismail on August 15, 2014, 09:47:52 PM
Quote from: Kimmie on August 15, 2014, 03:40:28 PM
Any screenshots that show the difference between this menu and the one we already have at the top?

For SMF 2.0.x, it is the same menu as it only moves it to top via css. As for SMF 1.1.x, it is a new menu menu based on the default menu but no dropdown menu is created for the time being.

Quote from: Shuban on August 15, 2014, 04:42:48 PM
Could you please provide an image of what this mod does?

Sorry, I forgot to include a picture. I will post it soonest in both the mod and this support page.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x
Post by: vladok on August 16, 2014, 04:57:00 AM
ahrasis,
You can add a menu down? To get the menu at the forum top and forum bottom?
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x
Post by: Hj Ahmad Rasyid Hj Ismail on August 16, 2014, 11:59:44 PM
Quote from: vladok on August 16, 2014, 04:57:00 AM
ahrasis,
You can add a menu down? To get the menu at the forum top and forum bottom?

Are trying to repeat the same menu at the bottom or are you trying to get a new one?

And for which version of SMF that is?
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x
Post by: vladok on August 17, 2014, 02:24:51 PM
I trying repeat same menu to forum bottom :)
SMF v. 2.0.6
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x
Post by: Hj Ahmad Rasyid Hj Ismail on August 17, 2014, 03:44:33 PM
I guess that will need quite a lot of modifications especially in 2.0.x since this mod only use css to change the position of the menu. When the menu is at the bottom, it will require "push up" for its sub menu rather than "drop down" unless you want to disable its sub menu.

Basically you need two of template_menu(); instead of one. Cover the bottom menu with <div id="bottommenu'></div> respectively. So the idea for bottom menu is to call css #bottommenu #main_menu.

Add this in DefaultMenuOnTop.css
#bottommenu #main_menu
{
padding: 0.7em;
width: 100%;
margin: 0;
background: #eee;
border-top: 2px solid #333;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 9999;
}


You can try to hide all its sub menu by hiding them using #bottommenu #main_menu .dropmenu li { display:none; } or something if you are unable to make them push up because drop down will not work at the bottom of your forum.

Frankly speaking this is all just an idea which you have to test as I have never tested this.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x
Post by: Hj Ahmad Rasyid Hj Ismail on August 17, 2014, 03:52:53 PM
Updated to 1.2.2
- fix some of minor css alignment.
- fix css to work with search bar to menu mod.
- fix css to work with alternative menu mod.

Note: For SMF 1.1x
- this mod now requires Enhanced Mod Settings Page mod to be pre-installed (EMSPv100.zip).
- alternative menu mod requires this mod pre-installed.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on September 01, 2014, 06:16:14 PM
Updated to Version 1.3.0
- This is a hook version for SMF 2.0.x.
- Allows color changes in SMF 2.0.x and SMF 1.1.x for the followings:
1. Background color
2. Background bottom border color
3. Menu font color
4. Active background color
5. Menu font color if active
6. Hover background color
7. Menu font color if hovered
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: DSystem on September 07, 2014, 08:39:36 AM
Was using a few days ago version v. 1.2.2 of this mod without problems.

Yesterday I upgraded to version DMOT.V. 1.3.0 and started having a problem.

Installing mod works perfectly. After a few minutes it shuts down and the menu back to the old location.

Disabling the option "Move default menu to the top of your forum?" and activating again the menu back to the top of the Forum.

After a few minutes the menu always comes back to the old location. :(
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on September 07, 2014, 09:47:31 AM
Did you find any errors in the error logs? If you did, kindly share them here so I can try to give a look at them.

Otherwise, kindly give me a test account so that I can log in and test as a user. Because, so from your website http://eletronicabr.com/ I can only see tat it is working fine.

Before that, have you ever tried to clear all you to hard refresh your browser and clear the caches?
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on September 07, 2014, 10:27:18 AM
I downloaded from SMF and installed this mod in my live and test forums for testing just to be sure. However, frustratingly (as I was looking for a bug :) ), it works as it supposed to and no error(s) has been detected.

DSystem, if you're still facing your error(s), kindly post them here. My latest visit to your site also suggests that the mod is working perfectly.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: DSystem on September 07, 2014, 10:36:43 AM
Thank you very much for your attention. Does not appear any error in the logs.

I'm auditioning. Seems to be an incompatibility with this mod:

Quick Spoiler -> http://custom.simplemachines.org/mods/index.php?mod=2940

I was using version 0.9.4. Now updated to version 0.9.5

Strange that when I remove the mod Quick Spoiler   the DMOT stops functioning.

Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on September 07, 2014, 11:06:57 AM
I visited your site as a regular member using the given login credential and I only find that the menu is always kept on the top. Each action available in the menu has been tested and the result is the same. At no time at all the menu returns to its original position.

The only things that are a bit weird is the menu when action for download and multimedia is being active. It replaces the main menu with its own menu.

One more thing is, if you installed the Alternative Menu and turn on the icon to replace the text menu, the Alternative Menu CSS will override the default css for highlighting active and hovered button. As such, if the download and multimedia change the menu from icon back to text, the background wont be highlighted when active or hovered but the active or hovered text will remain the plain white making it little bit weird.

I am however still not sure whether Quick Spoiler has anything to do with the error that you said. I need more time to test it further. It is kinda late here in Malaysia as such I will update this somewhere later.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: DSystem on September 07, 2014, 11:20:12 AM
After I updated the mod spoller the problem stopped.

The menu really got really bad when clicked in mutimidia or downloads. I would appreciate your help to improve this.

I will provide an account with more access to better analyze.

Here in Brazil it is now noon. nice evening for you until tomorrow.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on September 08, 2014, 09:30:32 AM
I think I found out why that sometime the hook for $context['html_headers'] is not working properly. I believe the best solution for the time being is to provide two packages i.e. fully hook and mostly hook version. In the later, $context['html_headers'] via hook will not be used, but manual modification will be applied so that the css file link can properly be inserted and can fully be used by the mod users.

This will apply to my other "hooked" mods as well and hopefully will resolve problem faced by our friend like DSystem in his forum.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on September 08, 2014, 11:03:40 AM
Updated!

# Version 1.4.0
- Further harmonize between this mod and Alternative Menu mod css stylings.
- Fixed options dependencies between one to another as introduced in version 1.3.0.
- Fixed main menu break when this mod is disable in its mod settings page.

# Version 1.3.0
- Added options to change main menu background, its bottom border and its text color.
- Added options to change top menu background and its text color when active.
- Added options to change top menu background and its text color when hovered upon.

For SMF 2.0.x users:
- If you faced problems with other mods, or $context['html_headers'] via hook is not working correctly, please install mostly hook (m) version.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: DSystem on September 14, 2014, 12:49:57 PM
With version "1.4.0 m" of the mod. The Problem was resolved.

So I'm curious and trying to figure out why the version "1.4.0" doesn't work on my forum.

To test and try to find the mod that is generating this problem was removed all the mods that uses hooks.

But the problem still persists. I found in my tests that disable caching of Forum the problem disappears.

Do you have any idea what else I can do to try and find out where this incompatibility?
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on September 14, 2014, 10:37:17 PM
$context['html_headers'] is the only heading to search and fix your said problem. It seems that somehow, it is not working properly as it should be. It is used to inject codes to the header part of the forum. Somehow rather either but mod or mistake, it is not functional properly or it function has been replaced.

The 1.4.0 m or manual version, makes modification in index.template.php by manually adding code just before the closing of the header. This version need not be used if your $context['html_headers'] is working as it should be. I recommend posting for support in 2.0.x board so that the cause can be properly traced and the problem can be properly resolved.

Currently I am on standby as my mother is critically ill due to her worsened diabetic conditions. I will try to help along when I am a bit freer.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: mulwa on October 07, 2014, 10:55:19 AM
I have shifted the Nav menus to the top, but my logo is covered or completely removed. Please i want to make the logo to be on the same nav row either on the left or right without causing effects to the nav menus.
And also when the nav menus have been moved to the top, a space was left between the nav menus and the body. I failed to figure how to fix that space with firebug. Am using Face1_v2 theme
thanks
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on October 07, 2014, 09:27:02 PM
This mod is not really for custom theme. It is mainly for SMF default theme or its similar variants. If you wanna build your forum from SMF default theme to look like FB, then may be I can help. But not from custom theme even if the custom theme is created by me myself.

But I'd suggest, create a topic in Coding Discussion board or Graphic and Template board on "How To Turn My Forum To Look Like Facebook?".

Using this mod on default theme is as simple as installing it, then your menu is fixed at the top. You might to do some minor adjustment to its css to move it from left to right. Add this code to your default theme index.css file:
#menu_nav
{
float: right;
}


With this, you will have your menu to the right. IMO, this code will work on any theme including Face1 theme as well but without changing its current menu to top.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: mulwa on October 09, 2014, 08:34:04 AM
i have fixed that. The menu have been moved to the top as how i wanted it to be on the custom theme face1, but the logo is hidden both on the default theme and custom theme. I'd like to know how to make the logo appear to either sides of the top menu. Thanks,
i created a topic in graphics and template www.simplemachines.org/community/index.php?topic=528775.0
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: mulwa on October 10, 2014, 03:01:53 PM
please, i wanna make the logo not to be covered by the Nav menu.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on October 11, 2014, 02:13:58 PM
As I said, this mod doesn't cover custom theme.

But you can simply delete forum name and logo lines in index.template.php. Then, you can refer to revamp or simplerevamp theme on how to move forum name / image inside menu.

I haven't created that mod yet, but I will, if there is demand. ;)
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: mulwa on October 11, 2014, 05:10:12 PM
Okay, maybe i open a new topic in custom coding or graphics to get that fixed. Thanks i like the mod
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: DSystem on October 13, 2014, 06:05:39 PM
ahrasis. discovered the problem of $context ['html_headers']. I just don't know how to solve.

The problem happens even on a clean install of SMF. Very easy to simulate the problem.

The hook $context ['html_headers'] doesn't work when enabled the Level 2 Caching

Caching Level = Level 2 Caching

Believe to be a BUG in SMF. Anything but that mod that uses this hook presents problems when you use this setting the cache.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on October 13, 2014, 06:27:42 PM
Thank you for the feedbacks. I am not sure whether that a bug. Have check whether your do support such caching. If so, then you open a topic in coding to discuss whether this is a bug. If it is, a moderator will transfer the topic to bug. Or you can report it as a bug directly.
Title: Re: DMOT: Default Menu On Top For SMF 2.0.x and 1.1.x (Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on January 16, 2015, 07:15:35 AM
Updated to be more responsive to screen size and support to FARM - Font Awesome Responsive Mod.

#Change Logs

@Version 1.4.1
- Fix inconsistency with FARM - Font Awesome Responsive Mod i.e. by disabling css hover and active.
- Add support for smaller screen i.e. margin is adjusted to be more responsive to screen size.
Title: Re: DMOT: Default Menu To Top For SMF 2.0.x and 1.1.x (Hook Version!)
Post by: skb on August 04, 2016, 08:35:28 AM
Nice Mod. Our forum uses 2 themes where member chooses the theme.
With the default theme this mod works fine. With the other theme, it starts to give problems. The second theme is known as Blue Piece by Crip. Attached are the before / after screen shots. If you can help sort that out I'd could also attach the index.css of the second theme
Title: Re: DMOT: Default Menu To Top For SMF 2.0.x and 1.1.x (Hook Version!)
Post by: Hj Ahmad Rasyid Hj Ismail on August 15, 2016, 07:36:18 AM
If you are not using default, you should consult the theme's author. Besides, I'm no longer active in this forum for quite sometimes.
Title: Re: DMOT: Default Menu To Top For SMF 2.0.x and 1.1.x (Hook Version!)
Post by: skb on March 18, 2017, 05:40:47 AM
Hello Ahrasis,

I'm using this Mod and am getting lot of errors from the DMOT.subs.php file.

This is the error

8: Undefined index: dmot_hover_font
File: /home/diabesv6/public_html/forum/Sources/DMOT.subs.php
Line: 31

This is line 30 & 31
' . (!empty($modSettings['dmot_hover']) ? '#main_menu .dropmenu li a.firstlevel:hover, #main_menu .dropmenu li:hover a.firstlevel, #main_menu .dropmenu li a.firstlevel:hover span.firstlevel,
#main_menu .dropmenu li:hover a.firstlevel span.firstlevel{background: ' . $modSettings['dmot_hover'] . '; color: ' . $modSettings['dmot_hover_font'] . ';}' : '') . '


What could be the problem.
Title: Re: DMOT: Default Menu To Top For SMF 2.0.x and 1.1.x (Hook Version!)
Post by: Bob Perry of Web Presence Consulting on March 31, 2017, 03:07:28 AM
Quote from: skb on March 18, 2017, 05:40:47 AM
Hello Ahrasis,

I'm using this Mod and am getting lot of errors from the DMOT.subs.php file.

This is the error

8: Undefined index: dmot_hover_font
File: /home/diabesv6/public_html/forum/Sources/DMOT.subs.php
Line: 31

This is line 30 & 31
' . (!empty($modSettings['dmot_hover']) ? '#main_menu .dropmenu li a.firstlevel:hover, #main_menu .dropmenu li:hover a.firstlevel, #main_menu .dropmenu li a.firstlevel:hover span.firstlevel,
#main_menu .dropmenu li:hover a.firstlevel span.firstlevel{background: ' . $modSettings['dmot_hover'] . '; color: ' . $modSettings['dmot_hover_font'] . ';}' : '') . '


What could be the problem.

I will be glad to take a look and see what's up should be easy to fix I think...

Better yet, I might recommend stop using as when the new beta SMF 2.1 comes to fruition (shouldn't be too much longer, its coming along nicely), you may change your mind about having a menu at the very top, since the author has not been associated with the site or supporting much anymore, what's the point in using it, constant errors are murder in terms of seo...

Title: Re: DMOT: Default Menu To Top For SMF 2.0.x and 1.1.x (Hook Version!)
Post by: skb on April 05, 2017, 04:00:39 AM
I solved my issue, two posts above, with the help of Arantor & Sir Osis of Liver. For anyone interested in that discussion, here's the link ;

http://www.simplemachines.org/community/index.php?topic=553049
Title: Re: DMOT: Default Menu To Top For SMF 2.0.x and 1.1.x (Hook Version!)
Post by: crvteampl on January 29, 2018, 06:01:02 AM
Hello all.
I search solution about  Alternative Menu With Top Menu Icon & Button Remover
I install this mod on my forum and want make other iikon's for some menu category.
I change some code.
$areas['scl']['title'] = empty($modSettings['altmenu_replace_with_icon']) ? $action['scl'] : $txt['shop_icon'];
                $areas['scl']['show'] = empty($modSettings['altmenu_remove_scl']) ? true : false;


when i move mouse over ikon exmple : forum - i see ?action=forum but when i move mouse over new ikon i dont see ?action=scl
>:(



Please help me solve this problem if its possible .