News:

SMF 2.1.2 has been released! Take it for a spin! Read more.

Main Menu

Menu Order

Started by live627, January 16, 2010, 07:55:28 PM

Previous topic - Next topic

the7thGhost

Quote from: Jessica. on July 25, 2011, 11:01:02 AM
still doesn't work
What browser are you using? The javascript drag-and-drop requires a modern browser.

Yngwiedis

Hello...

The mod is creating a lot of title and href errors in my forum.
Please read this thread:  http://www.simplemachines.org/community/index.php?topic=444266.0

Thank you very very much.

AmityHost.com - The Affordable Host

live627

This may be quite tricky to nail.

Code (Find in ./Sources/Subs.php) Select
foreach($context['menu_buttons'] as $key => $button) {
if (empty($button['href'])) {
unset($context['menu_buttons'][$key]);
}
}


Code (Replace with) Select
foreach($context['menu_buttons'] as $key => $button) {
if (empty($button['href'])) {
unset($context['menu_buttons'][$key]);
}
if (empty($button['title'])) {
unset($context['menu_buttons'][$key]);
}
}

MotRude

This mod is Great!!! Thank you.

Branko.

Quote from: Yngwiedis on August 05, 2011, 11:34:25 AM
.....The mod is creating a lot of title and href errors in my forum....
Because you have  Simple Portal or something like that

Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Yngwiedis

Quote from: live627 on August 05, 2011, 12:25:50 PM
This may be quite tricky to nail.

Code (Find in ./Sources/Subs.php) Select
foreach($context['menu_buttons'] as $key => $button) {
if (empty($button['href'])) {
unset($context['menu_buttons'][$key]);
}
}


Code (Replace with) Select
foreach($context['menu_buttons'] as $key => $button) {
if (empty($button['href'])) {
unset($context['menu_buttons'][$key]);
}
if (empty($button['title'])) {
unset($context['menu_buttons'][$key]);
}
}



Hello...

Nothing changed with that.
Errors keep coming...

Quote from: Branko. on August 06, 2011, 06:20:23 AM
Quote from: Yngwiedis on August 05, 2011, 11:34:25 AM
.....The mod is creating a lot of title and href errors in my forum....
Because you have  Simple Portal or something like that



What you mean by that ?
Is not Simple Portal which is creating the errors...
AmityHost.com - The Affordable Host

Hj Ahmad Rasyid Hj Ismail

Simple portal wont create that problem. At least not in my experience. Looking at the given code again, IMO there is something wrong with it.

Quote from: live627 on August 05, 2011, 12:25:50 PM
This may be quite tricky to nail.

Code (Find in ./Sources/Subs.php) Select
foreach($context['menu_buttons'] as $key => $button) {
if (empty($button['href'])) {
unset($context['menu_buttons'][$key]);
}
}


Code (Replace with) Select
foreach($context['menu_buttons'] as $key => $button) {
if (empty($button['href'])) {
unset($context['menu_buttons'][$key]);
}
if (empty($button['title'])) {
unset($context['menu_buttons'][$key]);
}
}


live627 you are putting "if" twice. Did you mean to put else on the second one as that what is most likely.

live627

Quotelive627 you are putting "if" twice. Did you mean to put else on the second one as that what is most likely.
an elseif won't make a difference here

Hj Ahmad Rasyid Hj Ismail

It was just a thought. I highlighted it as Yngwiedis said it doesn't fix the errors. Perhaps it is something else that causes the errors.

the7thGhost

#149
EDIT: Sorry, forgot to say which file: index.template.php

Replace this code (around line 484):
echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>';


With this code:
if (!empty($button['href'])) {
echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>';
}





Also replace (around line 525, it's the last piece of code like it in your file before it says "Generate a strip of buttons"):
echo '
</li>';


With:
if (!empty($button['href'])) {
echo '
</li>';
}


Be sure you include the closing curly brace } in both pieces of code

Yngwiedis

This is great.

With the above code changes the errors are gone.

Thank you very very much the7thGhost  :)
AmityHost.com - The Affordable Host

the7thGhost


Jessica.

Quote from: the7thGhost on July 25, 2011, 08:29:29 PM
Quote from: Jessica. on July 25, 2011, 11:01:02 AM
still doesn't work
What browser are you using? The javascript drag-and-drop requires a modern browser.

I am using Chrome. the latest version
Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

the7thGhost

Quote from: Jessica. on August 17, 2011, 04:25:30 PM
Quote from: the7thGhost on July 25, 2011, 08:29:29 PM
Quote from: Jessica. on July 25, 2011, 11:01:02 AM
still doesn't work
What browser are you using? The javascript drag-and-drop requires a modern browser.

I am using Chrome. the latest version
Can you open the Javascript console (Customize > Tools > JavaScript console), try to re-arrange them, and see if any messages show up?
The Customize button has a wrench icon, normally it's at the top right under the "X" to close Chrome.

Jessica.

#154
okay I did as you said

However I was still unable to re-arrange them. There were no messages

edit: It doesn't work in Firefox either
Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

the7thGhost

Can you type the following into the console, then press Enter:
alert($("#newmenuorder").val());
A message should come up with the names of your menu items, and some other stuff, if Javscript is working correctly. If it is not you should get an error message.

Jessica.

hmmm...I just get a blank pop up...

wait I think there are error messages (in the console, not pop up). I just didn't know they were:

Uncaught SyntaxError: Unexpected token <
index.php:58Uncaught ReferenceError: $ is not defined
Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

the7thGhost

That helps, I know what's happening. We just have to find out why.

Check to make sure these files exists:
/Themes/default/scripts/menuorder.js
/Themes/default/scripts/menuorder.php

Also, if you right-click the page and select "View page source," is there a line like the following? (with your website name though)
<script type="text/javascript" src="http://forumurl.com/Themes/default/scripts/menuorder.php"></script>
Or, better, can you send me a PM with the page's source?

live627

Sounds like jQuery and Mootools are clashing. That can be solved by using jQuery.noConflict() or similar.

Jessica.

Quote from: the7thGhost on August 17, 2011, 10:38:01 PM
That helps, I know what's happening. We just have to find out why.

Check to make sure these files exists:
/Themes/default/scripts/menuorder.js
/Themes/default/scripts/menuorder.php

Also, if you right-click the page and select "View page source," is there a line like the following? (with your website name though)
<script type="text/javascript" src="http://forumurl.com/Themes/default/scripts/menuorder.php"></script>
Or, better, can you send me a PM with the page's source?

checked files. they are there

I could not find that line in the page source at all. is that why I can't drag-n-drop?
Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

Advertisement: