forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 modpack by Stramm => Topic started by: blackRock on July 21, 2007, 10:27:21 am

Title: $template_user_admin_menu variable, from theme.php, is ignored
Post by: blackRock on July 21, 2007, 10:27:21 am
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!
Title: Re: $template_user_admin_menu variable, from theme.php, is ignored
Post by: Sami 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 (http://forum.coppermine-gallery.net/index.php?board=51.0) board if you need support

this not a bug , marking as an invalid ....
Title: Re: $template_user_admin_menu variable, from theme.php, is ignored
Post by: Joachim Müller on July 25, 2007, 07:37:47 am
Post your problem on themes/skins/templates (http://forum.coppermine-gallery.net/index.php?board=51.0) 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 (http://forum.coppermine-gallery.net/index.php?board=29.0)", 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
Title: Re: $template_user_admin_menu variable, from theme.php, is ignored
Post by: blackRock 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
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.
Title: Re: $template_user_admin_menu variable, from theme.php, is ignored
Post by: Joachim Müller 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 (http://forum.coppermine-gallery.net/index.php?topic=45563.0):
Moving both your thread as well as the thread by BlackRock (http://forum.coppermine-gallery.net/index.php?topic=45463.0) from "cpg1.4 themes/skins/templates (http://forum.coppermine-gallery.net/index.php?board=51.0)" 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.
Title: Re: $template_user_admin_menu variable, from theme.php, is ignored
Post by: Sami 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 ...
Title: Re: $template_user_admin_menu variable, from theme.php, is ignored
Post by: Joachim Müller 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
Title: Re: $template_user_admin_menu variable, from theme.php, is ignored
Post by: Sami 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
Title: Re: $template_user_admin_menu variable, from theme.php, is ignored
Post by: Joachim Müller 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?
Title: Re: $template_user_admin_menu variable, from theme.php, is ignored
Post by: Sami 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 (http://forum.coppermine-gallery.net/index.php?board=29.0) ?
Title: Re: $template_user_admin_menu variable, from theme.php, is ignored
Post by: blackRock 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!