The My Profile button and its location The My Profile button and its location
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

The My Profile button and its location

Started by skad4life, May 03, 2006, 01:15:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

skad4life

Hi all!

Yesterday GauGau and Nibbler helped me resolve my profile linking issue, that was great.

My issue today is probably theme related. I noticed that once I allowed a user access to creating their own albums, the location of the My Profile link/button is moved. It goes from a pretty top row button to a small text link in the user admin sub menu (the one for picture/album management). I have searched the code for various strings, but I realize there is more to it than simply changing the html around. Somewhere it tells the script that if a user has certain admin privileges (manage albums, sort pictures), to move the My Profile button. But I don't think it should be in one row with the album and picture management - why would it be, since it's not a special privilege?

Anyway, not sure how much help I can get on this, since it's probably theme related, though it might be in themes.inc.php. It must have something to do with $template_user_admin_menu, so if someone could possibly point me in the right direction?
Url: here
name: pretzelogic
pass: test

Thank you very much!
Jael

Joachim Müller

So you want to change the visuals of the user admin menu and want to make it match the sys_menu or sub_menu? If yes, then edit themes/yourtheme/theme.php, find// HTML template for user admin menu
$template_user_admin_menu
and modify the code. If it doesn't exist in your theme, copy it from the sample theme into a new line before ?>The code to copy is// HTML template for user admin menu
$template_user_admin_menu = <<<EOT

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
                                <td class="admin_menu"><a href="albmgr.php" title="{ALBMGR_TITLE}">{ALBMGR_LNK}</a></td>
                                <td class="admin_menu"><a href="modifyalb.php" title="{MODIFYALB_TITLE}">{MODIFYALB_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                        </tr>
                </table>
                </div>

EOT;


Moving items between menus is not that easy (and not recommended - your users might not notice that additional menu entries appeared after loging in, yet they will notice that an additional menu bar shows up).

skad4life

Hello GauGau!

Thanks for your reply. That's not what I wanted to do though, or at least I did know how to do that (I read the FAQ). I'm gonna post pictures of what's happening.

Without giving users the ability to create their own galleries/albums, the menu looks like this:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.pixelportal.net%2Fweb%2Ftemp%2Fcoppermine_menu_withoutgallery.gif&hash=2eedb431050d2175a4a5ebce78733612ce4ba652)

When users do have the ability to create their own galleries/albums (user admin), that pretty profile button on the top vanishes and becomes part of the user_admin_menu:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.pixelportal.net%2Fweb%2Ftemp%2Fcoppermine_menu_withgallery.gif&hash=2a9ff63490b55bf2ed13e34fa147189bda1677a1)

I don't think it makes sense. This probably also explains why I, as the admin, don't see the My Profile button in user mode.
I have searched the template, and there are some strings that are probably it, but I don't know how to tell the template not to move the My Profile button like that. I can eliminate it from the user_admin_menu the way you showed above, but then it's gone altogether.

Thank you!
Jael

skad4life

#3
Double post. Connection seemed to have timed out, so I tried again  :P

Joachim Müller

Never leave admin mode!
As suggested, you're free to add the user admin menu to the sys_menu

skad4life

I figured something out now. The thing that confused me the most was that the html code for the profile was already in the block with the html code for all the other buttons in theme.php. You kept saying I could just put it in there, and I just didn't get it.

I figured out now that, when I add the same block of html code, and take the comment lines before and after the profile html out ( <!-- BEGIN my_profile --> and <!-- END my_profile --> ), the button shows up fine!

<!-- BEGIN my_profile -->
                                        <td style="background: url(themes/onestepbeyond/images/buttoncenter.gif);">
                                                <a href="{MY_PROF_TGT}" class="static" title="{MY_PROF_LNK}">{MY_PROF_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/onestepbeyond/images/buttonright.gif" width="7" height="25" border="0"  alt="" /></td>
<!-- END my_profile -->
                                        <td style="background: url(themes/onestepbeyond/images/buttoncenter.gif);">
                                                <a href="{MY_PROF_TGT}" class="static" title="{MY_PROF_LNK}">{MY_PROF_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/onestepbeyond/images/buttonright.gif" width="7" height="25" border="0"  alt="" /></td>


Which tells me that something tells the script it should not show anything between <!-- BEGIN my_profile --> and <!-- END my_profile --> if user_admin_mode is enabled. This will work fine for me though.

Thank you for your suggestions and your patience, GauGau.
Jael

Joachim Müller

removing the comments will make the profile link show no matter what, even if a user is not logged in. Not a good idea imo, but if this works for you, then fine.