TinyPortal

Development => Support => Topic started by: maximx86 on January 04, 2008, 11:19:46 AM

Title: Extra Nav Button - Edit Buddies
Post by: maximx86 on January 04, 2008, 11:19:46 AM
Hi,

How can I add a button with link to 'Edit Buddies'? I tried to edit index.template.php adding the following lines but received an error
     // Show the [main site] button.
echo '<li><a href="http://mysite.com/index.php?action=profile;u=1;sa=editBuddies">Show Buddies</a></li>';


I am sure there is a more reasonable way of doing it...

Thanks



Title: Re: Extra Nav Button - Edit Buddies
Post by: G6Cad on January 04, 2008, 11:24:08 AM
Please read and follow the posting guidlines we have for this support forum.
Make the proper edits to your first post and then we go from there.
Title: Re: Extra Nav Button - Edit Buddies
Post by: maximx86 on January 04, 2008, 11:39:47 AM
I am sorry for hassling you. Can you send me a link to the "Posting Guide"?
It's quite difficult to find it and I am new to this site. I found a link to 'Forum Rules'

http://www.tinyportal.net/smf/index.php?topic=2520.0

but it seems to be broken...

Title: Re: Extra Nav Button - Edit Buddies
Post by: G6Cad on January 04, 2008, 11:40:58 AM
Sticky topic in this very forum holds the posting guide.
Title: Re: Extra Nav Button - Edit Buddies
Post by: maximx86 on January 04, 2008, 12:07:57 PM
Thanks,

I am using the latest version (Powered by SMF 1.1.4 ) and TP  TinyPortal v0.9.8. I am using the 'Outlline' theme designed by 'dzinerstudio

These are the mods I have insta;;ed
Ad Managment      2.3
SMF Gallery Lite      1.8.1.2
Enhanced Calendar      1.1

The error I get while adding the lines below into ndex.template.php is

// Show the [main site] button.
echo '<li><a href="http://mysite.com/index.php?action=profile;u=1;sa=editBuddies">Show Buddies</a></li>';


An Error Has Occurred!
You are not allowed to access this section 

I am not using any other CMSs... The SMF is installed on a linux box which has access to the Internet yet so I cannot give you the url yet...I will be online next week...

I hope this is enough information for you to help me. Let me know please if you need anything else.

Thanks
Title: Re: Extra Nav Button - Edit Buddies
Post by: maximx86 on January 04, 2008, 12:13:28 PM
The linux box has NO access to the Internet

Thank you
Title: Re: Extra Nav Button - Edit Buddies
Post by: IchBin on January 04, 2008, 02:53:23 PM
You are getting that error because the link is pointing to the u=1 account which is admin. If everyone tried to click that link then of course, they will get an error because they cannot edit the admins buddies.
// Show the [main site] button.
echo '<li><a href="http://mysite.com/index.php?action=profile;u=',$context['user']['id'],';sa=editBuddies">Show Buddies</a></li>';

Title: Re: Extra Nav Button - Edit Buddies
Post by: maximx86 on January 04, 2008, 04:56:43 PM
Thanks IchBin

Works great  ::).
There is one more thing. The button isn't displayed correctly and it is not underlined when mouseover.

Last time I was adding something in here (code below) to get the button look normal, but I do not know what to put in here now..

$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register',


Many thanks
Title: Re: Extra Nav Button - Edit Buddies
Post by: G6Cad on January 04, 2008, 05:39:14 PM
For the layout you ave to ask the theme author as we dont have to much knowlage on the theme your using.
Title: Re: Extra Nav Button - Edit Buddies
Post by: maximx86 on January 04, 2008, 05:50:30 PM
Thanks,

I will ask them  :knuppel2: