Advanced search  

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]

Pages: [1]   Go Down

Author Topic: $template_user_admin_menu variable, from theme.php, is ignored  (Read 13751 times)

0 Members and 1 Guest are viewing this topic.

blackRock

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 20
    • DecoClub

I try to override $template_user_admin_menu variable, but it seems to be ignored.

In classic theme, I use the following code in theme.php:
Code: [Select]
// HTML template for user admin menu
$template_user_admin_menu = <<<EOT
User admin menu:<br />
  <a href="albmgr.php" title="{ALBMGR_TITLE}">{ALBMGR_LNK}</a><br />
  <a href="modifyalb.php" title="{MODIFYALB_TITLE}">{MODIFYALB_LNK}</a><br />
  <a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a><br />
  <a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a><br />
EOT;

The output HTML code, has nothing to do with the code above.
Here is the result:
Code: [Select]
<div align="center">
  <table cellpadding="0" cellspacing="1">
    <tr>
      <td class="admin_menu"><a href="albmgr.php" title="Create and order my albums">  Create / order my albums</a></td>
      <td class="admin_menu"><a href="modifyalb.php" title="Go to modify my albums">Modify my albums</a></td>
      <td class="admin_menu"><a href="profile.php?op=edit_profile" title="Go to my personal profile">My profile</a></td>
      <td class="admin_menu"><a href="picmgr.php" title="Sort my pictures">Sort my pictures</a></td>
    </tr>
  </table>
</div>

As you can see it has table and table data, instead of just links that my $template_user_admin_menu has. This code comes from themes.inc.php!

If I override the $template_gallery_admin_menu variable, everything works great!

Please, help!
Thanks in advance!
« Last Edit: July 26, 2007, 12:53:31 pm by GauGau »
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: $template_user_admin_menu variable, from theme.php, is ignored
« Reply #1 on: July 25, 2007, 06:19:33 am »

Works fine for me !
Check your code.... (maybe you have a blank line after ?>)

Post your problem on themes/skins/templates board if you need support

this not a bug , marking as an invalid ....
« Last Edit: July 25, 2007, 06:37:18 am by Sami »
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: $template_user_admin_menu variable, from theme.php, is ignored
« Reply #2 on: July 25, 2007, 07:37:47 am »

Post your problem on themes/skins/templates board if you need support
@Sami: blackRock did post this on the proper support board. It was me who moved it to the board "cpg1.4 Testing/Bugs", as this sounded like a potential bug that needed looking into. Users who are not members of the dev team can't start new threads on the bugs board anyway. Thanks for investigating and clarifying. Moving back from the bugs board to the theme board where this has been posted initially, taking back the tagging "invalid".

@blackRock: please zip your custom theme and attach it to your posting (using "additional options" when composing your message).

@all: sorry for the confusion.

Joachim
Logged

blackRock

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 20
    • DecoClub
Re: $template_user_admin_menu variable, from theme.php, is ignored
« Reply #3 on: July 25, 2007, 06:25:16 pm »

Well, Sami is right. Works fine on CPG 1.4.12 but not with the Stramm's modpack v2.

The simplest way to see that $template_user_admin_menu is ignored, is to copy the following code in classic's theme.php.

Code: [Select]
$template_user_admin_menu = <<<EOT
Admin Menu:
  <a href="albmgr.php" title="{ALBMGR_TITLE}">{ALBMGR_LNK}</a> |
  <a href="modifyalb.php" title="{MODIFYALB_TITLE}">{MODIFYALB_LNK}</a> |
  <a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a> |
 <a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a>
EOT;

You can see the correct output for CPG 1.4.12 in cpg1412_snapshot.png attached file, and the wrong output for CPG 1.4.12 modpack v2 (stable) in cpg1412_modpack_v2_snapshot.png attached file.

The attached file cityscape_theme.zip has my custom theme where you can see the same behaviour. After extracting that, you can use the
  • theme.php from theme.php.for_CPG1412.zip if using CPG 1.4.12 (correct output), or
  • theme.php from theme.php.for_CPG1412_modpack_v2.zip if using CPG 1.4.12 modpack v2
The only difference between the two theme.php files, is the line
Code: [Select]
addbutton($sys_menu_buttons,'{MY_BUDDY_LNK}','','{MY_BUDDY_TGT}','my_friends',$template_sys_menu_spacer);added in order the theme is usable with the modpack.

So, it seems to be a problem that appears when stramm's modpack is present.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: $template_user_admin_menu variable, from theme.php, is ignored
« Reply #4 on: July 26, 2007, 08:20:05 am »

Thanks for the clarification. Here's what I posted in the other thread that deals with a similar issue:
Moving both your thread as well as the thread by BlackRock from "cpg1.4 themes/skins/templates" to the support board that deals with Stramm's modpack, as this definitely is a modpack issue. In the future, please post a link to your gallery in the first place when you start a new thread. It might be a good idea to clarify in your postings as well that you're using the modpack when you start a new thread.
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: $template_user_admin_menu variable, from theme.php, is ignored
« Reply #5 on: July 26, 2007, 09:12:10 am »

There are missing {} (if statement) on themes.inc.php , try this :
- Open {gallery-root}\include\themes.inc.php
- Change this (around line #212)
Code: [Select]
if (!isset($template_user_admin_menu))  //{THEMES}
$uid = USER_ID;
$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}"> {$USER_ID} {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;

To this

Code: [Select]
if (!isset($template_user_admin_menu)){  //{THEMES}
$uid = USER_ID;
$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}"> {$USER_ID} {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;
}

I didn't check this cause I don't have modpack installed please confirm if this works ...
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: $template_user_admin_menu variable, from theme.php, is ignored
« Reply #6 on: July 26, 2007, 09:30:38 am »

Sami,

the missing curly brackets are definitely a bug - thanks for spotting this. I added your suggested fix to the SVN core of the cpg1.4.x trunk.

Joachim
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: $template_user_admin_menu variable, from theme.php, is ignored
« Reply #7 on: July 26, 2007, 09:44:02 am »

Oh , BTW may be you could remove
Code: [Select]
$uid = USER_ID; and this way we can leave the code without curly brackets
IMO, that line is useless there check this thread
http://forum.coppermine-gallery.net/index.php?topic=45072.0
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: $template_user_admin_menu variable, from theme.php, is ignored
« Reply #8 on: July 26, 2007, 09:59:54 am »

Not sure what you mean. Could you start a new thread for this on the bugs board with further clarifications please?
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: $template_user_admin_menu variable, from theme.php, is ignored
« Reply #9 on: July 26, 2007, 10:17:47 am »

Sorry to ask again , I just need confirmation :
This is a modpack bug, is it okay to create a new thread on cpg1.4 Testing/Bugs ?
Logged
‍I don't answer to PM with support question
Please post your issue to related board

blackRock

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 20
    • DecoClub
Re: $template_user_admin_menu variable, from theme.php, is ignored
« Reply #10 on: July 26, 2007, 10:57:40 am »

Thanks Sami, solved!
Both suggestions work!

1. add curly brackets
There are missing {} (if statement) on themes.inc.php , try this :
- Open {gallery-root}\include\themes.inc.php
- Change this (around line #212)
...

2. remove line #213
Oh , BTW may be you could remove
Code: [Select]
$uid = USER_ID; and this way we can leave the code without curly brackets
IMO, that line is useless there check this thread
http://forum.coppermine-gallery.net/index.php?topic=45072.0

I was using the theme with CPG 1.4.10 and modpack v1 without problem. I didn't imagine that it could be caused by modpack as it finally did. Anyway, I should have mention it from the start.

Thank you very much!
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 20 queries.