Advanced search  

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

Pages: [1]   Go Down

Author Topic: Menu with all albums  (Read 3295 times)

0 Members and 1 Guest are viewing this topic.

zom

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 83
Menu with all albums
« on: March 02, 2008, 04:01:23 pm »

Hello I would like to display a page with a menu that will display a list, and link, to all the albums (without thumbnails) listed by alphabetic order.

only the part of code to require by php/mysql all albums will be enough for me and I would integrate it in a specific page.

I ve searched in the topic but didn't find answer to that question.


Thank you for help and part of code.
Logged
Thanks to everyone

Nibbler

  • Guest
Re: Menu with all albums
« Reply #1 on: March 02, 2008, 04:09:04 pm »

Code: [Select]
$result = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} ORDER BY title");

while ($album = mysql_fetch_assoc($result)){
echo '<p><a href="thumbnails.php?album=' . $album['aid'] . '">' . $album['title'] . '</a></p>';
}
Logged

Hassan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Menu with all albums
« Reply #2 on: March 06, 2008, 01:10:38 pm »

Nibbler, some more information would be helpful for people like me with lesser knowledge in PHP. :)
Logged

Garry2k8

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Menu with all albums
« Reply #3 on: September 03, 2008, 02:59:29 pm »

I now this is an old topic but this is based on this request.
I’m using a separated menu for an introduction page and works well, with one nasty thing; this code doesn’t respect private albums.


My code,

Code: [Select]

<body STYLE="background-color:transparent">

<style type="text/css">
.boxmenu {
margin: 0px;
text-align: left;
padding: 5px 5px 5px 5px;
font-size: 13px;
line-height: 1.2;
color: #999999;
}
.boxmenu-menu a {
display: block;
margin-left: 0px;
margin-top: 2px;
margin-right: 0px;
margin-bottom: 2px;
font-size: 13px;
font-weight: bold;
font-family: "Microsoft Sans Serif";
}
.boxmenu-menu a:link, .boxmenu-menu a:visited, .boxmenu-menu a:active {
color: #ffffff;
text-decoration: none;
}
.boxmenu-menu a:hover {
color: #ffffff;
text-decoration: none;
  background-image: url(themes/anime/images/iframebg.png);
}

</style>
<div class="boxmenu">
<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');
if (
IN_COPPERMINE) {
$path=$CONFIG['site_url'];
} else {
$path 'http://www.mysite.com/coppermine-paint/'//change this to your specific path to make the output url's absolute with trailing slash
}
if (
$FORBIDDEN_SET != ""$FORBIDDEN_SET "AND $FORBIDDEN_SET";
$result mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} ORDER BY title");
$album mysql_fetch_array($result);
while (
$album mysql_fetch_assoc($result))
{
echo 
"<div class='boxmenu-menu'><a href=".$path."thumbnails.php?album=".$album['aid']." target='_parent'>*" $album['title'] . "</div></a>";
}
?>

</div>
</body>


This php file is placed in the main map of Coppermine named albums-menu_flow.php.
To put it in an html file with iframe
 
Code: [Select]
<iframe name="iFrame1" width="271" height="309" src="http://www.mysite.com/coppermine-paint/albums-menu_flow.php" scrolling="no" frameborder="0" ALLOWTRANSPARENCY="true"></iframe>

I have used this menu for two Coppermine albums to separate the paintings and photo albums.
My image sample sees here,,
http://i89.photobucket.com/albums/k209/Estherdogs/Snap2.jpg [Edit gauGau] Replaced hotlinked image with attachment [/Edit]

As you can see, the folder my private map is also seen in the menu, in Coppermine it's set on private.
So my question is how to fix this code to respect private albums.
« Last Edit: September 03, 2008, 04:31:22 pm by Joachim Müller »
Logged

Nibbler

  • Guest
Re: Menu with all albums
« Reply #4 on: September 03, 2008, 03:04:30 pm »

Change the query to

Code: [Select]
$result = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE visibility = 0 ORDER BY title");
Logged

Garry2k8

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Menu with all albums
« Reply #5 on: September 03, 2008, 03:11:35 pm »

Wow, that’s a fast solve, its okay now, THANKS!
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 21 queries.