$template_user_admin_menu variable, from theme.php, is ignored $template_user_admin_menu variable, from theme.php, is ignored
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

$template_user_admin_menu variable, from theme.php, is ignored

Started by blackRock, July 21, 2007, 10:27:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

blackRock

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:

// 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:

<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!

Sami

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 ....
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

Quote from: Sami on July 25, 2007, 06:19:33 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

blackRock

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.


$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 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.

Joachim Müller

Thanks for the clarification. Here's what I posted in the other thread that deals with a similar issue:
Quote from: GauGau on July 26, 2007, 08:16:48 AM
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.

Sami

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

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


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 ...
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

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

Sami

Oh , BTW may be you could remove $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 don't answer to PM with support question
Please post your issue to related board

Joachim Müller

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

Sami

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 ?
‍I don't answer to PM with support question
Please post your issue to related board

blackRock

Thanks Sami, solved!
Both suggestions work!

1. add curly brackets
Quote from: 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)
...

2. remove line #213
Quote from: Sami on July 26, 2007, 09:44:02 AM
Oh , BTW may be you could remove $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!