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: List of users + random/latest picture?  (Read 10141 times)

0 Members and 1 Guest are viewing this topic.

SNo0py

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
List of users + random/latest picture?
« on: January 02, 2007, 01:53:09 pm »

Hey there,
is there a way to get a list of users + their latest/random pictures out of Coppermine? Something like just the HTML in the content pane on http://server/index-1.html?
cpmfetch does not work for users that don't have categories, so it's useless. Any other simple ideas?

Thanks!
« Last Edit: January 07, 2007, 07:48:08 am by vuud »
Logged

SNo0py

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: List of users + random/latest picture?
« Reply #1 on: January 02, 2007, 02:30:15 pm »

...cpmfetch does not work because of a bug - the table _categories does not contain anything by default for ordinary users, so the straight join "a.aid = p.aid and a.category = c.cid" does not return anything for private albums of the users. It would only work for public albums.
If LEFT JOIN would be used instead it would work fine.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: List of users + random/latest picture?
« Reply #2 on: January 05, 2007, 09:19:00 am »

Potential bug reports for cpmFetch should not be posted on the misc support board, but the one that deals with cpmFetch. Moving thread accordingly.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: List of users + random/latest picture?
« Reply #3 on: January 06, 2007, 12:22:57 am »

Potential bug reports for cpmFetch should not be posted on the misc support board, but the one that deals with cpmFetch. Moving thread accordingly.

Thanks for moving this...
I never would have found it on the other board.



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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: List of users + random/latest picture?
« Reply #4 on: January 06, 2007, 12:27:18 am »

...cpmfetch does not work because of a bug - the table _categories does not contain anything by default for ordinary users, so the straight join "a.aid = p.aid and a.category = c.cid" does not return anything for private albums of the users. It would only work for public albums.
If LEFT JOIN would be used instead it would work fine.

So user level galleries don't have categories assigned to them?  I thought all the user galleries were assigned ID = 1?
Maybe I am not following you...


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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: List of users + random/latest picture?
« Reply #5 on: January 07, 2007, 04:07:24 am »

...cpmfetch does not work because of a bug - the table _categories does not contain anything by default for ordinary users, so the straight join "a.aid = p.aid and a.category = c.cid" does not return anything for private albums of the users. It would only work for public albums.
If LEFT JOIN would be used instead it would work fine.

Never mind my clarification request...  Your right, I was thinking that they were assigned categories since I was coding for over 10000 for id'ing them. 

Problem will be fixed in the 1.9.6 release - hopefully later tonight.
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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: List of users + random/latest picture?
« Reply #6 on: January 07, 2007, 07:46:48 am »

Never mind my clarification request...  Your right, I was thinking that they were assigned categories since I was coding for over 10000 for id'ing them. 

Problem will be fixed in the 1.9.6 release - hopefully later tonight.



As of VERSION 1.9.6 this problem has been resolved.   (6 Jan 2006)

Vuud

http://cpmfetch.fistfullofcode.com/projects/copperminefetch/downloads.php

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

SNo0py

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: List of users + random/latest picture?
« Reply #7 on: January 08, 2007, 07:13:35 am »

Potential bug reports for cpmFetch should not be posted on the misc support board, but the one that deals with cpmFetch. Moving thread accordingly.
Would have loved too, but I'm not allowed to start new threads in the cpmFetch forum!


As of VERSION 1.9.6 this problem has been resolved.   (6 Jan 2006)

Vuud
Wow, thanks, I will check it out right now....
Logged

SNo0py

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: List of users + random/latest picture?
« Reply #8 on: January 08, 2007, 07:33:42 am »

Ok, I checked it now, now it completely stopped working, here is the script:
Code: [Select]
<?php
  
include './cpmfetch.php';
        
error_reporting(E_ALL);
        
ini_set('display_errors',1);  // 0 is off, 1 is on
  
$objCpm = new cpm();
        print 
$objCpm->cpm_debugMode(true);
  
$objCpm->cpm_viewRandomMediaFrom(1,4'user=mike');
  
$objCpm->cpm_close();
?>

Does not print anything. This is the SQL Query:
SQL : SELECT p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb, u.user_lastvisit AS uUser_lastvisit,u.user_regdate AS uUser_regdate,u.user_email AS uUser_email,u.user_profile1 AS uUser_profile1,u.user_profile2 AS uUser_profile2,u.user_profile3 AS uUser_profile3,u.user_profile4 AS uUser_profile4,u.user_profile5 AS uUser_profile5,u.user_profile6 AS uUser_profile6, a.aid AS aAid, a.title AS aTitle, a.description AS aDescription, a.visibility as aVisibility, a.pos as aPos, a.category as aCategory, a.thumb as aThumb, a.keyword as aKeyword FROM cpg148_pictures as p, cpg148_albums as a LEFT JOIN cpg148_categories as c ON a.category = c.cid, cpg148_users AS u WHERE a.aid = p.aid AND p.owner_id = u.user_id AND p.approved='YES' ORDER BY rand(925325) LIMIT 0 ROWS: 0

The LIMIT 0 seems to be wrong and the check for the user name is missing in the WHERE clause, so it can't work....
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: List of users + random/latest picture?
« Reply #9 on: January 08, 2007, 02:34:13 pm »

Ok, I checked it now, now it completely stopped working, here is the script:
Code: [Select]
<?php
  
include './cpmfetch.php';
        
error_reporting(E_ALL);
        
ini_set('display_errors',1);  // 0 is off, 1 is on
  
$objCpm = new cpm();
        print 
$objCpm->cpm_debugMode(true);
  
$objCpm->cpm_viewRandomMediaFrom(1,4'user=mike');
  
$objCpm->cpm_close();
?>

Does not print anything. This is the SQL Query:
SQL : SELECT p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb, u.user_lastvisit AS uUser_lastvisit,u.user_regdate AS uUser_regdate,u.user_email AS uUser_email,u.user_profile1 AS uUser_profile1,u.user_profile2 AS uUser_profile2,u.user_profile3 AS uUser_profile3,u.user_profile4 AS uUser_profile4,u.user_profile5 AS uUser_profile5,u.user_profile6 AS uUser_profile6, a.aid AS aAid, a.title AS aTitle, a.description AS aDescription, a.visibility as aVisibility, a.pos as aPos, a.category as aCategory, a.thumb as aThumb, a.keyword as aKeyword FROM cpg148_pictures as p, cpg148_albums as a LEFT JOIN cpg148_categories as c ON a.category = c.cid, cpg148_users AS u WHERE a.aid = p.aid AND p.owner_id = u.user_id AND p.approved='YES' ORDER BY rand(925325) LIMIT 0 ROWS: 0

The LIMIT 0 seems to be wrong and the check for the user name is missing in the WHERE clause, so it can't work....

I think I may have done something sneaky on you:

From the release notes for 1.9.6
Quote
* Changed a number of calls so $source is the first parameter so it linguistically flows.  For any, insert "" instead of a source.
 - cpm_viewRandomMediaFrom($source,$rows, $columns, $options="")
 - cpm_viewLastAddedMediaFrom($source, $rows, $columns, $options="")
 - cpm_getAlbumListFrom ($source, $rows, $columns, $options="")

So you call is passing things in the wrong order.  Try:

$objCpm->cpm_viewRandomMediaFrom('user=mike', 1, 4);

For the 2.0 I plan on putting together a converting to 2.0 cheat sheet...

I think that will fix your problem.  I know its bad form to change a parameter order around in a program, and i would never do it professionally without great reason, but this is FOSS, so haha!

Thanks for the help...
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

SNo0py

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: List of users + random/latest picture?
« Reply #10 on: January 08, 2007, 02:58:54 pm »

Hey there,
thanks for the help!
Yeah, this is really sneaky... so I have now
Code: [Select]
<?php
  
include './cpmfetch.php';
        
error_reporting(E_ALL);
        
ini_set('display_errors',1);  // 0 is off, 1 is on
  
$objCpm = new cpm();
        print 
$objCpm->cpm_debugMode(true);
  
$objCpm->cpm_viewRandomMediaFrom('user=mike'1,);
  
$objCpm->cpm_close();
?>
which results in
SQL : SELECT p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb, u.user_lastvisit AS uUser_lastvisit,u.user_regdate AS uUser_regdate,u.user_email AS uUser_email,u.user_profile1 AS uUser_profile1,u.user_profile2 AS uUser_profile2,u.user_profile3 AS uUser_profile3,u.user_profile4 AS uUser_profile4,u.user_profile5 AS uUser_profile5,u.user_profile6 AS uUser_profile6, a.aid AS aAid, a.title AS aTitle, a.description AS aDescription, a.visibility as aVisibility, a.pos as aPos, a.category as aCategory, a.thumb as aThumb, a.keyword as aKeyword FROM cpg148_pictures as p, cpg148_albums as a LEFT JOIN cpg148_categories as c ON a.category = c.cid, cpg148_users AS u WHERE a.aid = p.aid AND p.owner_id = u.user_id AND p.approved='YES' ORDER BY rand(507976) LIMIT 4 ROWS: 4

... at least it displays something, but it does not filter to show only my (or someone elses) images... :(

Any other hint?
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: List of users + random/latest picture?
« Reply #11 on: January 08, 2007, 05:52:11 pm »

Hey there,
thanks for the help!

No, thank you.  You found a problem and submitted it with what was broke...  Your my favorite person of the week! 

Quote
Code: [Select]
  $objCpm->cpm_viewRandomMediaFrom('user=mike', 1,4 );
... at least it displays something, but it does not filter to show only my (or someone elses) images... :(

Yes, the syntax is owner=, not user=.  That one I did not change on you... :p
Sorry I missed that - I don't use that feature much.




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

SNo0py

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: List of users + random/latest picture?
« Reply #12 on: January 08, 2007, 06:04:58 pm »

Finally :)
Thanks a lot, works perfect!
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 19 queries.