Menu with all albums Menu with all albums
 

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]

Main Menu

Menu with all albums

Started by zom, March 02, 2008, 04:01:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zom

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.
Thanks to everyone

Nibbler


$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>';
}

Hassan

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

Garry2k8

#3
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,



<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


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

Nibbler

Change the query to

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

Garry2k8

Wow, that's a fast solve, its okay now, THANKS!