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: Listing Albums  (Read 6383 times)

0 Members and 1 Guest are viewing this topic.

niks_007

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 73
Listing Albums
« on: September 10, 2006, 05:47:04 am »

Dear Friends i have tried out the cpm fetch to meet my requirment but having some problem please help me out

Code: [Select]


<?
include "cpmfetch.php";
$objCpm = new cpm('/wallpapers');

$objCpm->cpm_setReturnType("resultset");
$data = $objCpm->cpm_viewLastAddedMediaFrom(1000, 1000, "cat=5");

$cnt = 0;
$arrayofalbums = array();

foreach ($data as $row) {
if (! in_array($row['aTitle'],$arrayofalbums)) {

print $row['aTitle'];
print "";
print "\n";
array_push($arrayofalbums,$row['aTitle']);
$cnt++;
print "<br>";
if ($cnt == 6) break;
}
}



?>

this code is not showing the link to the concern album. i want the list of albums to be linked so one can click on it.

Aishwarya Rai
Rakhi Sawant
Negar Khan
Preity Zinta
Tanushree Dutta
Rimi Sen

it is showing like above but the title of album are not linked with there album..

please modify the code so the albums can also be linked.

Thanks
« Last Edit: September 10, 2006, 05:05:23 pm by vuud »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: please update the code
« Reply #1 on: September 10, 2006, 08:39:54 am »

Moving thread to sub-board where you should have posted in the first place.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Listing Albums
« Reply #2 on: September 10, 2006, 05:05:10 pm »


Why don't you just change your print statement to make a url to your coppermine gallery?  Look at the way the CPG references albums and stick it in.

Links to albums in CPG look like so:
Code: [Select]
http://www.fistfullofcode.com/photos/thumbnails.php?album=6
So you need to work in your own album, and set it with the 'pAid' that gets returned in row


Code: [Select]

            foreach ($data as $row) {
if (! in_array($row['aTitle'],$arrayofalbums)) {

print '<a href="http://www.fistfullofcode.com/photos/thumbnails.php?album=' . $row[pAid] . '"\>";
print $row['aTitle'];
print '</a>';
print "";
print "\n";
array_push($arrayofalbums,$row['aTitle']);
$cnt++;
print "<br>";
if ($cnt == 6) break;
}
}


I did not test it, but that should work... work out any syntax errors I may have in there.


Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.