Image paths in the database Image paths in the database
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Image paths in the database

Started by rphMedia, November 18, 2004, 09:50:37 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

rphMedia

Hi,

I'm trying to go into Coppermine database and pull out the (user) image paths.  I got a hack from one of the users here and am just trying to modify it a little to output image paths.  I'm close but I can't seem to get the exact path output.  I can can get "either one of them", but I can't seem to get them tied together (don't know enough about how to do it actually). The goal is to list on a page, all of the normal_ sized images.  Eventually, I will just select a few, either random or whatever, but if someone could give me a head start here, I'd appreciate it.  It has nothing to do with displayimage.php, that's why I'm here in the Misc section.  Here's what I have so far, it's probably ugly to you and remember, it doesn't work perfect right now.


<?php 
define
('IN_COPPERMINE'true);

require(
'include/init.inc.php');
pageheader(Welcome);

// Select all photos
$result mysql_query("SELECT a.pid, a.aid, a.filename, a.filepath, b.title atitle from {$CONFIG['TABLE_PICTURES']} a, {$CONFIG['TABLE_ALBUMS']} b where a.aid = b.aid order by a.aid, a.pid desc");
if (!
mysql_num_rows($result)) cpg_die(ERROR$lang_errors['non_exist_ap']);

$p_aid = -;
// Result to table
starttable("100%"Welcome3);
   while (
$row mysql_fetch_array($result)) 
        { 
                if (
$row[aid] != $p_aid) {
           }
            
// I would like this output to be a "graphical" array of the images using "filepath" somehow
            
echo "<tr><td><img src =\"$row[filepath]\" title=\"$row[filename]\">$row[filename]</td></tr>"
       
$p_aid $row[aid] ;
    } ; 
// while
                
endtable();
pagefooter();
?>


I'd like the output to be something like this -

albums/userpics/10006/image1.jpg
albums/userpics/10006/image2.jpg
albums/userpics/10007/image1.jpg
etc....you get the idea.

This is what it gives me so far (attached).  I think I'm pretty close here, but just need a little guidance, thanks!






[attachment deleted by admin]

Nibbler

You need to add 'albums/' to the start of the pic links, preferably using $CONFIG['fullpath'].

rphMedia