News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Add or Remove buttons

Started by live627, July 23, 2010, 10:11:58 PM

Previous topic - Next topic

ɔɔɔɔɔɔuɥoɾ

Yea damn XAMPP messing me up lol, I will clean up the code later, fortunately the mod still actually works, I will add the new version right now, its not a big mess, if your currently using the mod, just give it a few minutes then check back at the mod site.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Hj Ahmad Rasyid Hj Ismail

John, I like this mod but it conflicts with Simple Portal when installing with regards to the 'home' menu. I have a thought to improve it in order for it to work even if Simple Portal mod is installed (I believe it doesn't conflict with other mod with regards to this home menu line) since it changed the home menu code in Subs.php.

Why not change instead of find this:
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),

to find this:
$scripturl,
'show' => true,
'sub_buttons' => array(
),


And from changing it to this:
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => empty($modSettings['addremovetab_home']) ? true : false,
'sub_buttons' => array(
),

to changing it to this:
$scripturl,
'show' => empty($modSettings['addremovetab_home']) ? true : false,
'sub_buttons' => array(
),


It simplifies the code but I think it should work. Just a thought that it may useful for the betterment of this mod.  :D

ɔɔɔɔɔɔuɥoɾ

I will be releasing other versions as soon as I get more demand and time for testing to do so.

Add or Remove buttons (no portal)
Add or Remove buttons (Simple Portal)
Add or Remove buttons (Tinyportal)
Add or Remove buttons (other portals)


I have to keep (find) code big, we never know who will change or add a buttons in their somewhere, where the link is $scripturl too (I don't know why they would, but some people do these things) lol

Once I get all my testing forums side by side, I will come up with a Universal Version which will work on all, If possible.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

diamondred123

you should make it update, like when i install ismple portal it adds it in
Learner but knows a little

lowburb

Quote from: JohnCcCcCc on July 24, 2010, 04:25:41 PM
Bug found;

When removing the "Home" button, all default current actions result in an empty button on the right side at the end, I'm working on a fix for this at the moment, for now, just leave your home buttons on.

I was going to post this "bug" but saw that you already found it. So instead I'm posting in here so I can be notified when an update is released.

*patiently waiting*  ;D

ɔɔɔɔɔɔuɥoɾ

Quote from: lowburb on August 08, 2010, 12:09:18 AM
Quote from: JohnCcCcCc on July 24, 2010, 04:25:41 PM
Bug found;

When removing the "Home" button, all default current actions result in an empty button on the right side at the end, I'm working on a fix for this at the moment, for now, just leave your home buttons on.

I was going to post this "bug" but saw that you already found it. So instead I'm posting in here so I can be notified when an update is released.

*patiently waiting*  ;D

The mod is still completely usable, just don't use the home button remove :), even if you do use the home button remove, it throws a few errors but nothing serious and forum changing :)


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

lowburb

It just so happens that I was looking to remove the Home button hence the "patiently waiting" LOL

Do you have any plans on figuring that out?

ɔɔɔɔɔɔuɥoɾ

Quote from: lowburb on August 08, 2010, 12:31:51 AM
It just so happens that I was looking to remove the Home button hence the "patiently waiting" LOL

Do you have any plans on figuring that out?

Its actually more complicated that it seems, even the customization team missed it when approving this mod, it happens because of the $current_action array, everything defaults to home that does not have an current action set, so when you use these actions which default to the home button and the home button does not exist, well then it causes that error.

I have one solution, not very ethical though, we can just disable the current action array completely, but then the buttons will not be selected, however, you will have no errors in your log then.

As for a completely working solution, none yet, still working on that...


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

ɔɔɔɔɔɔuɥoɾ

Version 0.3 Released

Version 0.3
The Home button bug is fixed, no more errors when disabling the home button.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

ɔɔɔɔɔɔuɥoɾ

Version 0.4 Released

Changelog;
Version 0.4
Fixed the other buttons, they had the same errors as the home button
nobody probably noticed since the buttons were not their to click
if a member stumbles on an action where you have disabled the button
for that action, it will not attempt to select that button as its
disabled.
Added a lot more default to home actions, this mod should be completely
bug free now.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Vandaahl

I'm getting compatibily errors when I use this mod with the Sitemap mod. If I hide menu buttons, and then open the sitemap link on my board, error messages show up in my error log, pointing to the template_menu() function on index.template.php, these lines to be exact:

<a class="', $button['active_button'] ? 'active ' : '', '" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
', $button['title'], '
</a>';


The error messages are: 8: Undefined index: title, and 8: Undefined index: href. Any ideas?

ɔɔɔɔɔɔuɥoɾ

I have never seen that in testing, I will set up a test forum using this mod and the Sitemap mod too and see if I can track it down.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Vandaahl

Quote from: JohnCcCcCc on September 05, 2010, 07:27:25 PM
I have never seen that in testing, I will set up a test forum using this mod and the Sitemap mod too and see if I can track it down.

I have fixed the Sitemap issue by editing Subs.php and adding 'sitemap' to this part of your mod:

// Custom actions after this line  - In quotes with a comma between -  | , 'mycustomaction1', 'mycustomaction2' |

ɔɔɔɔɔɔuɥoɾ

I implemented that part of the code just for situations like this, its actually designed for additional actions that default to home created by mods, so if the sitemap mod has an additional action that defaults to home when its page is active, that should fix the issue.

Have all your errors gone now?


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Vandaahl

Actually I had some more errors with other actions, but I solved them in the same way. No more errors (for now ;))

ɔɔɔɔɔɔuɥoɾ

Quote from: Vandaahl on September 06, 2010, 04:05:09 PM
Actually I had some more errors with other actions, but I solved them in the same way. No more errors (for now ;))

I'm glad that the new implementation I added has made it easy to solve errors :)

Enjoy the mod :)


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Ken.

Have an issue that popped up and I'm not finding a solution so far.

Because of all the testing that happens on my site it sometimes needs to be reloaded with fresh copies of the SMF files and that process was started yesterday.

Add Remove Buttons v02 was working OK before the files reload, but after the reload v04 was installed. Because of some 'test failed' errors the mod was manually installed and now works as expected except for one issue... When the link for 'My Messages' is turned off the message count indicator remains and is moved to the end of the line of links/buttons.

I've tried any number of fixes that can be found here on SMF for commenting out links ..etc, but so far nothing helps.

Any tips would be greatly appreciated.  :)

ɔɔɔɔɔɔuɥoɾ

This happens only when this mod is installed?

That's very odd since my mod only changes the true/false factor ???


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Ken.

Yes, it only happens when the message button is turned off in the cp for ARB.
This error is showing it the logs:
Quote8: Undefined index:  addremovetab_settings_menu Apply Filter: Only show the errors from this file  File: ../Sources/Admin.php
Line: 246

ɔɔɔɔɔɔuɥoɾ

Have you checked to make sure modifications.english.php has the edit

$txt['addremovetab_settings_menu'] = 'Add or Remove buttons';

Something like the above


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Advertisement: