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: call list of albums in a category  (Read 2914 times)

0 Members and 1 Guest are viewing this topic.

fangweile

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 103
  • Saranghaeyo ^_^
    • All Koreans - Home of Korean Actors and Actresses
call list of albums in a category
« on: December 27, 2011, 08:22:44 am »

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.
Code: [Select]
<?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..
Logged
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: call list of albums in a category
« Reply #1 on: January 04, 2012, 03:10:39 pm »

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

fangweile

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 103
  • Saranghaeyo ^_^
    • All Koreans - Home of Korean Actors and Actresses
Re: call list of albums in a category
« Reply #2 on: January 08, 2012, 02:03:13 pm »

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
Logged
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: call list of albums in a category
« Reply #3 on: January 10, 2012, 11:05:46 am »

Use a code like
Code: [Select]
$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.
Logged

fangweile

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 103
  • Saranghaeyo ^_^
    • All Koreans - Home of Korean Actors and Actresses
Re: call list of albums in a category
« Reply #4 on: January 10, 2012, 02:06:06 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: call list of albums in a category
« Reply #5 on: January 10, 2012, 02:55:18 pm »

Then please:
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.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.