Advanced search  

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

Pages: [1]   Go Down

Author Topic: Image paths in the database  (Read 3661 times)

0 Members and 1 Guest are viewing this topic.

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Image paths in the database
« on: November 18, 2004, 09:50:37 pm »

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]
« Last Edit: November 19, 2004, 09:13:23 am by Casper »
Logged

Nibbler

  • Guest
Re: Image paths in the database
« Reply #1 on: November 18, 2004, 10:39:21 pm »

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

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Image paths in the database
« Reply #2 on: November 19, 2004, 01:05:49 am »

DOH, that did the trick, thanks!
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.