Listing Albums Listing 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

Listing Albums

Started by niks_007, September 10, 2006, 05:47:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

niks_007

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




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

Joachim Müller

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

vuud


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



            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.


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