call list of albums in a category call list of albums in a category
 

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

call list of albums in a category

Started by fangweile, December 27, 2011, 08:22:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fangweile

Hello there,

i am trying to create a custom page to display all albums in specific category in text link only.
for example

category 1                     category 2                        category 3
--> album 1 here            ---> album 1 here               ---> album 1 here 
--> album 2 here            ---> album 2 here               ---> album 2 here 
--> .....                        --->...                              ---> album ....

I used this code earlier and I manually listing all albums in a category. And it really take me a hard time doing it manually.
<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');
pageheader('Album List (A-Z)');
starttable('Welcome');
?>

<div>
Album List Content here
</div>
<?php
endtable
();
pagefooter();
ob_end_flush();
?>


I have attached the screenshot how the list is being displayed..
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

Αndré

Do you know your way around with SQL? It's done with some quite easy SELECT queries.

fangweile

i am not that adept with sql and php coding and only knows some basic html coding. I am still learning about it and i think its getting me crazy lol   :o
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

Αndré

Use a code like
$result = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = 13");
$rowset = cpg_db_fetch_rowset($result);
mysql_free_result($result);
foreach ($rowset as $album) {
    echo '<a href="thumbnails.php?album='.$album['aid'].'">'.$album['title'].'</a><br />';
}

for each category list.

fangweile

Thanks a lot Αndré  ;), it works really great.
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

Αndré

Then please:
Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.