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: Rainy Day: Home button  (Read 4843 times)

0 Members and 1 Guest are viewing this topic.

zillion

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 6
Rainy Day: Home button
« on: December 11, 2004, 07:01:01 pm »

When using the "Classic" Theme, hitting the "Coppermine" logo seems to hyperlink you back to the home page (index.php) no matter where you are.  The Rainy Day Theme suits me (except you can't read any error messages when uploading files!), but doesn't seem to have that feature.  Can anyone give me a clue as to how I can add a "Home" (or whatever) button onto the menu?   I've studied various files, and concluded that the menu I want to add to is "menu2"; but where is it? Any guidance appreciated!!

EDIT:
Ah.  Getting somewhere.  Found the menu in theme.php  
Now all I've got to do is fathom out what the bits in curly brackets are!
« Last Edit: December 11, 2004, 07:13:57 pm by zillion »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Rainy Day: Home button
« Reply #1 on: December 11, 2004, 07:13:17 pm »

Instead of deleting posts, it's better to share the solution so that others can learn from you just as you learn from others.
Logged

zillion

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 6
Re: Rainy Day: Home button
« Reply #2 on: December 11, 2004, 07:32:45 pm »

Quite true.  The solution is simply to find this:

$template_main_menu2 = <<<EOT
<!-- BEGIN album_list -->

and add this in between those two lines.

<td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
<td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
<td background="themes/rainy_day/images/button1_r1_c2.gif">
<a href="index.php">Home Page</a>
</td>
<td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>

Easy.  I don't know how it could have taken me so long digging, delving and - yes - using the SEARCH facility here.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Rainy Day: Home button
« Reply #3 on: December 11, 2004, 07:49:49 pm »

The classic theme works in exactly the same way as the others.  The 'album list' button/link is not a return to index.php, but a return to the album list of the category you are viewing.  But it is easy to change it, or to add a link to return to your index.php, as you have discovered.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Rainy Day: Home button
« Reply #4 on: December 23, 2004, 06:46:49 am »

[nitpick]

Quote
id="button1_r1_c3"

Should be removed, ID's are supposed to be UNIQUE names to be used with CSS id "#" selectors.  "NAME" fields are also depreciated and should be removed.

If you see two ID's with the same name you know there is a problem. If there's no # selector in the themes style.css or embedded in template.html then the ID can and should be deleted.

[/nitpick]
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Rainy Day: Home button
« Reply #5 on: December 23, 2004, 07:04:24 am »

If there's no # selector in the themes style.css or embedded in template.html then the ID can and should be deleted.
Not quite true, JavaScript (using DOM) can access objects using the id as well - removing a unique id you can't find reference to in the css definition can get you into trouble...
Of course you're right that it's mandatory that IDs are unique. The use of the name attribute is deprecated, but sometimes needed for backward compatibility with old browsers (especially when using JavaScript).

Joachim
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Rainy Day: Home button
« Reply #6 on: December 23, 2004, 07:11:38 am »

True enough, I was just thinking in terms what a novice user could find. If they new enough about how Java uses ID's and Names, they probably wouldn't have duplicate ID's.  8)

I need to go clean those up in rainy day; they are still in the devel version. I'll check the other core themes while I'm at it.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Rainy Day: Home button
« Reply #7 on: December 23, 2004, 07:17:10 am »

very good - we shouldn't give out code to users that is just wrong, fixing the id issues on the coppermine themes is mandatory. Thanks for doing the needfull.

Joachim
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 19 queries.