Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Jim R on March 23, 2008, 11:15:44 PM

Title: Main user navigation menu problems...
Post by: Jim R on March 23, 2008, 11:15:44 PM
In 1.1.4 I was using the default template, but I had ported over the menu tabs from SAF (various colors).  The changes I made in the index.template.php don't seem to apply in 2.0's version of that page.

(That, and of course, some of the TXT references have changed too.)

What do I need to be looking for to recreate what I have now?   GenericMenu.template.php???  If so, where in that page?

Thanks.
Title: Re: Main user navigation menu problems...
Post by: Croco on March 23, 2008, 11:34:01 PM
try to compare with the new default.template.php file you will notice that there is a call for a loop to $context['menu_buttons'] which is an array, you can add new buttons to it, or simply replace them
check the Subs.php file and search for setupMenuContext() function inside there is definition of $buttons you can add new buttons here or in index.template.php

about the txt try to open index.english.php file and search for the old txt and try to search by its strings in the new index.english.php so you would get the new key to $txt array
Title: Re: Main user navigation menu problems...
Post by: Jim R on March 24, 2008, 12:13:10 AM
Let me ask you this.  Should what I have done in 1.1.4 work in 2.0?  Usually before I have added the .jpg, it just shows the list.  As I changed the language file, not all of the menu items showed up.  I didn't want to make all those changes and have it not work.

I saw the loop in index.template.php.  I could barely make heads or tails of it, but I will check the Subs.php file.

I'll report back.  Thanks.
Title: Re: Main user navigation menu problems...
Post by: Jim R on March 24, 2008, 11:05:02 PM
I can't get any of the menu changes to take.  It's very frustrating because I think I see how it all works through Subs.php.

I added this to Subs.php right next to the Profile button code:

'subscriptions' => array(
'title' => $txt['subscriptions'],
'href' => $scripturl . '?action=profile;u=' . $memID . ';sa=subscriptions',
'show' => !$user_info['is_guest'],
'sub_button' => array(
),
),



I've added the appropriate 'title' to index.english.php.


Furthermore, I made the following change:

$txt['home'] = 'Home';

to

$txt['home'] = 'Forum Home';


I've double checked to make sure I've saved and uploaded the changes.  The above Subscription button doesn't show, and my 'Forum Home' still shows as 'Home'.

What am I missing???

Title: Re: Main user navigation menu problems...
Post by: Croco on March 25, 2008, 01:54:49 AM
if you are using a custom theme make sure that it doesn't have any local language files like index.english.php
Title: Re: Main user navigation menu problems...
Post by: Jim R on March 25, 2008, 08:11:52 AM
Using custom theme.
Title: Re: Main user navigation menu problems...
Post by: 青山 素子 on March 25, 2008, 07:11:14 PM
Also note that the default caching can make these changes take a bit to show. You can try disabling caching and see if it shows up. Make sure to re-enable it after you are done.
Title: Re: Main user navigation menu problems...
Post by: Jim R on March 25, 2008, 10:26:14 PM
Nope, still not working.  I should say the whole time I can see an extra wider space between Profile and My Messages, where I put the new Subscription navigation item.  Just nothing else, and Home still reads as Home, not Forum Home.

Title: Re: Main user navigation menu problems...
Post by: Jim R on March 25, 2008, 10:31:13 PM
Ok...now the Subscriptions menu item shows up but only when I have the Paid Subscriptions page up in the Admin section. 

WTH?   :) :o
Title: Re: Main user navigation menu problems...
Post by: Croco on March 25, 2008, 10:35:08 PM
where did you add the $txt['subscriptions'] ?

Title: Re: Main user navigation menu problems...
Post by: Jim R on March 25, 2008, 10:37:29 PM
index.english.php:

$txt['admin'] = 'Admin';
$txt['moderate'] = 'Moderate';
$txt['subscriptions'] = 'Subscriptions';

Title: Re: Main user navigation menu problems...
Post by: Jim R on March 25, 2008, 10:39:21 PM
Would any of this have anything to do with setting up menu privileges?  I added the code below to set up the button, but I made no changes to section above that in menu privileges.

Again, here is how I set up the button:


'subscriptions' => array(
'title' => $txt['subscriptions'],
'href' => $scripturl . '?action=profile;u=' . $memID . ';sa=subscriptions',
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
),
Title: Re: Main user navigation menu problems...
Post by: Jim R on March 25, 2008, 10:45:29 PM
When I look at my Profile, it shows up as Paid Subscriptions, not just Subscriptions.  Still nothing when I'm on the main part of the forum.

Man...there is something a little screwy with all these different results while just trying to add a menu item.
Title: Re: Main user navigation menu problems...
Post by: Jim R on March 26, 2008, 11:24:06 PM
OK...I had to change this in the index.english.php file:

$txt['admin'] = 'Admin';
$txt['moderate'] = 'Moderate';
$txt['subscriptions'] = 'Subscriptions';


To this:

$txt['admin'] = 'Admin';
$txt['moderate'] = 'Moderate';
$txt['subscribe] = 'Subscriptions';


It was causing a conflict with a similar line in profile.english.php, creating the different results.  Problem still isn't solved though.  Instead of showing different things at different places, it's not showing up anywhere at all now.

How can this not freaking work???   :)

I even changed the text for the admin variable.  It says Admin Baby, but even that doesn't reflect the change.
Title: Re: Main user navigation menu problems...
Post by: Jim R on March 28, 2008, 12:44:57 AM
Hello?

It seems a good amount was put into making adding menu items a little more user friendly.  Smart move, but it's what is causing me the most troubles.  I hope someone can help with this or else this feature is useless.

I even moved the 'Home' button to where I'm trying to add the Subscriptions button.  It doesn't show up.
Title: Re: Main user navigation menu problems...
Post by: noisy1 on March 29, 2008, 03:52:41 AM
hey there,
I "WAS" having same issues, but just for adding a menu tab wasn't a subscription thingy ...
anyways ,,,, I was adding a "Contact US" tab to the menu , now there is a mod to do this BUT for 2.0 beta3 the only mod that does ONLY adds it to the menu if you ARE NOT logged in ...
which works fine .. etxecpt that obviously if you want the tag WHEN USERS ARE LOGGED IN ... bit frustrating ....
anyways I did all the adding of the $txt['Contact'] stuff and still no joy ,, added code for the menu tab as  'contact' => array(
            'title' => $txt['contact'],
            'href' => $scripturl . '?action=contact',
            'show' => $context['allow_search'],
            'sub_buttons' => array(
            ),
            'is_last' => true,

NOTICE the 'show'=>$context['allow_search']   
... previously with the mod it was 'show'=>$context['is_guest']
soooo possibly if you change that line in your code to say ... 'show' => $context['allow_memberlist'],
it would enable the menu tab to be shown to members .... as only members have acces to memberlist ?
I suppose what i am getting at is the show is basically setting the permissions for who can see it ..
anyways i am new at all this too so i just was trial and erroring ...
hope this helps
Cheers George
P.S I had to manually go into admin center and CLEAR CACHE ... to get menu to appear the first time ..
I also did the try changing home text to home_p and after cache clear that worked ...
Title: Re: Main user navigation menu problems...
Post by: Jim R on March 30, 2008, 01:37:01 PM
I didn't do anything you suggested yet, and my changes showed up.  This appears to be a cache issue, but I turned it off three or four days ago.  I'm not a big fan of caching my page, but I don't have a graphic intensive site.