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 not properly displaying  (Read 10692 times)

0 Members and 1 Guest are viewing this topic.

LoganSix

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 9
    • Dean Logic
template_user_admin_menu not properly displaying
« on: July 24, 2007, 09:40:42 pm »

I am working on a custom theme based on a WordPress theme. (my site http://www.dean-logan.com/photo )
In the theme the menu items are bullet lists which have classes and styles assigned to them to give them icons and proper layout.

I have been using the Sample theme and others to try and get my theme working. So far, I have all of the menu lists working except the User Admin Menu.  I did searches on the forum to see if I could figure it out, but the search results didn't return any threads that solved my problem.

The Issue Breakdown
When the Admin Menu is displayed while logged as a Admin, the formatting style is correctly used and the menu is displayed correctly.
When logged as a Admin and selecting User Mode, the menu is not displayed at all.
When the User Admin Menu is displayed while logged as a User, the formatting style sheet is ignored.  It should look similar to the admin

In the theme.php file I have added the parameter $template_user_admin_menu
Code: [Select]
// HTML template for user admin menu
$template_user_admin_menu = <<<EOT
<h2 style="font-size: 14px; color: #333000;">User Controls</h2>
<ul id="adminnav">
<li class="album"><a href="albmgr.php" title="{ALBMGR_TITLE}">{ALBMGR_LNK}</a></li>
<li class="config"><a href="modifyalb.php" title="{MODIFYALB_TITLE}">{MODIFYALB_LNK}</a></li>
<li class="profile"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></li>
<li class="picmanage"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></li>
</ul>
EOT;

I have attached my theme.php, template.html, and a combined screen shot.
I am sure it is just something simple that I am missing.  Any ideas as to what it is?
« Last Edit: July 26, 2007, 04:13:11 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: template_user_admin_menu not properly displaying
« Reply #1 on: July 25, 2007, 07:44:54 am »

Maybe you're encountering the same issues that are being discussed in "$template_user_admin_menu variable, from theme.php, is ignored". Please do as I suggested there:
please zip your custom theme and attach it to your posting (using "additional options" when composing your message).
Logged

LoganSix

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 9
    • Dean Logic
Re: template_user_admin_menu not properly displaying
« Reply #2 on: July 25, 2007, 02:00:26 pm »

Yes, it seems to be the same issue.
But, it wasn't resolved on that thread and considered a non-issue.

I have attached both the WordPress version of theme and the Coppermine version of theme.
I am not sure how the actual css would cause the code not to show up, which is why I only posted the template.html and theme.php file before.  I did not include all of the icons for the WordPress theme since those do not affect the HTML layout of the list.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: template_user_admin_menu not properly displaying
« Reply #3 on: July 25, 2007, 06:07:26 pm »

This has been harder than I expected. Nice theme btw - we'd appreciate if you would share it once you are done with it.

Here's a list of things I did:

Code: [Select]
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/ie-gif.css" type="text/css" />won't work, as PHP code is not being parsed within template.html




rating2.gif and rating3.gif have been missing. I added them.



Double definition of {GAL_DESCRIPTION} both in pageheader() as well as pagefooter. I removed one of the definitions.



The line
Code: [Select]
'{USER_ADMIN_MENU}' => theme_user_admin_mode_menu(),is made up and does not correspond to a token in curly brackets in template.html. Removed.



The function theme_user_admin_mode_menu() is never being called. Removed



The header data that contains
Code: [Select]
  Coppermine version: 1.4.11
  $Source$
  $Revision: 3338 $
  $Author: gaugau $
  $Date: 2006-11-09 06:12:18 +0100 (Do, 09 Nov 2006) $
is SVN output. Don't abuse it for your own purposes. Removed.



Using the full, absolute path (seen from your webroot) is bad for portability. Changed
Code: [Select]
/photo/themes/life-is-a-byte/images/to
Code: [Select]
themes/life-is-a-byte/images/



Cleaned up some functions that were defined in your custom theme for no apparent reason, as they didn't differ from the orginal function definition in include/themes.inc.php that is being used as default if no custom function overrides it.



The string
Code: [Select]
{ADMIN_MENU}in
Code: [Select]
// HTML template for the album list
$template_album_list = <<<EOT
<!-- BEGIN stat_row -->
        {STATISTICS}
<!-- END stat_row -->
<!-- BEGIN header -->
        {ADMIN_MENU}
<!-- END header -->
doesn't do anything except shining through. Removed




Please find my edited copy of your theme attached to this thread. Back up your version first before overwritting it with my copy in case I over-edited something.

Joachim
« Last Edit: July 25, 2007, 06:31:16 pm by GauGau »
Logged

LoganSix

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 9
    • Dean Logic
Re: template_user_admin_menu not properly displaying
« Reply #4 on: July 25, 2007, 09:46:42 pm »

Sorry for the mess, it's a work in process.
I made the updates you suggested.  I have the images for rating already, just didn't include them.  Also, I fixed the URL to the css pages and the images.

I see from BlackRock's thread that he has discovered that the problem is related to Stramm's Mod pack, which I have installed.
So, I guess you can close this thread or combine it with his, since we are having the same issue.

Now the question is, what needs to be fixed in Stramm's Mod pack to fix this issue.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: template_user_admin_menu not properly displaying
« Reply #5 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.
Logged

blackRock

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 20
    • DecoClub
Re: template_user_admin_menu not properly displaying
« Reply #6 on: July 26, 2007, 11:03:05 am »

I had exactly the same problem. Sami's suggestions worked fine for me.

Please, see this topic: http://forum.coppermine-gallery.net/index.php?topic=45463.0
Logged

LoganSix

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 9
    • Dean Logic
Re: template_user_admin_menu not properly displaying
« Reply #7 on: July 26, 2007, 02:08:50 pm »

Adding the "{ }" worked for me too.
Except for that the Admin menu does not display when in User Mode and signed in as Admin.
I am assuming that "User Mode" means that what the user sees who is not signed in to the application.  If that is the case, then it's not a problem.
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: template_user_admin_menu not properly displaying
« Reply #8 on: July 26, 2007, 02:28:48 pm »

Except for that the Admin menu does not display when in User Mode and signed in as Admin.
This is expected behavior 
http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_user_mode
Logged
‍I don't answer to PM with support question
Please post your issue to related board

LoganSix

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 9
    • Dean Logic
Re: template_user_admin_menu not properly displaying
« Reply #9 on: July 26, 2007, 03:08:31 pm »

Thanks.
This is solved then.


But, I will remark that it seems to me that developers should use
if () {
}
instead of just
if ()

statements throughout the code.  If this practice was done, then the bug probably would not have happened.
Usually the "{}" are only left out when an "if" statement is only one line.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: template_user_admin_menu not properly displaying
« Reply #10 on: July 26, 2007, 04:12:37 pm »

But, I will remark that it seems to me that developers should use
if () {
}
instead of just
if ()

statements throughout the code.  If this practice was done, then the bug probably would not have happened.
Usually the "{}" are only left out when an "if" statement is only one line.
We're aware of this and have been doing exactly what you suggest for ages. That's why the missing curly brackets in this particular file has been labelled as a bug - it was an omission that caused a malfunction. That's the meaning of the word bug.

This is solved then.
Marking thread accordingly.
Logged

LoganSix

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 9
    • Dean Logic
Re: template_user_admin_menu not properly displaying
« Reply #11 on: July 26, 2007, 05:09:14 pm »

We're aware of this and have been doing exactly what you suggest for ages. That's why the missing curly brackets in this particular file has been labelled as a bug - it was an omission that caused a malfunction. That's the meaning of the word bug.

You should have the developer look at the rest of the file, because the "if" statement that was fixed for this issue was not the only one without the "{}" brackets.  Unless you are saying that all the missing brackets in the file is being labeled as one bug.  To have that many missing and not noticed would be part of a review issue.  Since I just started looking at Coppermine, I don't know what your review process is for development of mods, but I assume you have people who review code that is submitted.  If that is the case, the code should have been rejected due to poor formatting.  But, I understand if you don't have the resources to do such checks, since this is an free application.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: template_user_admin_menu not properly displaying
« Reply #12 on: July 27, 2007, 09:17:23 am »

Coppermine is a community effort - we rely on user contributions. Subsequently, you're welcome to review the code and submit your suggestions for code changes (each one in a separate thread).
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: template_user_admin_menu not properly displaying
« Reply #13 on: July 27, 2007, 09:45:06 am »

Reviewing include/themes.inc.php I discovered that you're absolutely right: there have been a lot of curly brackets missing. I added them to the cpg1.4.x trunk of the SVN, so they will be in the next maintenance release (cpg1.4.13). If you want to review my changes, checkout out using web SVN: http://coppermine.svn.sourceforge.net/viewvc/coppermine/trunk/cpg1.4.x/include/themes.inc.php?view=log
Logged

LoganSix

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 9
    • Dean Logic
Re: template_user_admin_menu not properly displaying
« Reply #14 on: July 27, 2007, 02:09:50 pm »

Thanks for the update.

Hopefully I will have time to help review changes and give more feedback.
But for now, I still need to clean up the mess with my theme.  One page and menu done, a bunch more pages to tweak.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.