coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: David McKim on August 23, 2006, 12:29:43 AM

Title: Showing images by a specific user
Post by: David McKim on August 23, 2006, 12:29:43 AM
Now I spoke with Vuud personally on this, he said that currently he doesn't believe that cpmfetch can do this. He recommended that I post here. He said that an experienced php coder may be able to find a way to do this. Basically I would just like to be able to show the latest uploaded piece of art, by a specified user. I would really appreciate it if someone could help me out and code something up.

Thank you,


-D
Title: Re: Showing images by a specific user
Post by: vuud on August 23, 2006, 01:07:16 AM
Quote from: David McKim on August 23, 2006, 12:29:43 AM
Now I spoke with Vuud personally on this, he said that currently he doesn't believe that cpmfetch can do this.

Heh, Vuud wrote the code... Vuud knows it cannot do this :D

If anyone has a bit of PHP experience and can help David out, I would recommend using the cpmfetch to return the recently added images as a dataset (instead of html) and then iterating over the array to yank a specific user only.  (set the requested number to some insane amount so you are sure to get the user (like 100 rows x 100 columns).

Since you are getting the dataset, you won't be displaying all of these.

Some examples of working with data from cpmfetch are here:
http://www.fistfullofcode.com/projects/copperminefetch/tests/test6.php

Anyway, I am a bit swamped right now - if no one else hits this, I will code something up...  I mostly wanted it posted to share the knowledge so to speak.


So long for now...

Vuud (now returning to his mindless activities)




Title: Re: Showing images by a specific user
Post by: Joachim Müller on August 23, 2006, 05:56:59 AM
Where is that random pic suppossed to appear - on a coppermine page or non-coppermine page?
Title: Re: Showing images by a specific user
Post by: vuud on August 23, 2006, 06:12:33 PM
Quote from: GauGau on August 23, 2006, 05:56:59 AM
Where is that random pic suppossed to appear - on a coppermine page or non-coppermine page?

He wants it outside of coppermine...  basically the only issue is that I dont have a provision to filter down to a specific user yet...

I did think of a good place in the interface to include it though :)

Title: Re: Showing images by a specific user
Post by: vuud on August 26, 2006, 03:39:42 PM
Quote from: vuud on August 23, 2006, 01:07:16 AM
Heh, Vuud wrote the code... Vuud knows it cannot do this :D

Vuud is also, apparently addlebrained.

Yes, the code can do this... its one of those features I must have stuck in, but never documented and then forgot about...

Any of the calls that end in "from" can do this...  So for instance:

$objCpm->cpm_viewRandomMediaFrom(1,2,"owner=vuud,admin");

Works fine.

Any of the calls that take a source parameter supports this - completely forgot.

Even narrowing it down should work:

$objCpm->cpm_viewRandomMediaFrom(1,2,"owner=vuud,admin:cat=1,5");


Sorry I forgot about that... I should make sure it gets documented

:D Vuud


On the bright side, one less thing I need to get done.

Title: Re: Showing images by a specific user
Post by: freesouljah on September 19, 2006, 05:14:53 AM
I kind of have this figured out...but not perfected...

is there a way to have the owner as a variable?

$objCpm->cpm_viewLastAddedMediaFrom(1,2,"owner=$owner",$options)

or (I would prefer this method for .tpl files)

$objCpm->cpm_viewLastAddedMediaFrom(1,2,"owner={OWNER},$options)

I am using it to intergrate with a bridged phpbb database...I kind of have it working...but I have to integrate it directly into my .php file to get it to work..and it doesn't work exactly like I would like it to...

peace
8)

Title: Re: Showing images by a specific user
Post by: vuud on September 21, 2006, 09:16:14 PM
Quote from: freesouljah on September 19, 2006, 05:14:53 AM
I kind of have this figured out...but not perfected...

is there a way to have the owner as a variable?

$objCpm->cpm_viewLastAddedMediaFrom(1,2,"owner=$owner",$options)

or (I would prefer this method for .tpl files)

$objCpm->cpm_viewLastAddedMediaFrom(1,2,"owner={OWNER},$options)

I am using it to intergrate with a bridged phpbb database...I kind of have it working...but I have to integrate it directly into my .php file to get it to work..and it doesn't work exactly like I would like it to...

peace
8)


Whatzup?

Both of what you are looking to do are a function of the environment you are using cpmfetch in.  I don't know what to say more than that...

In the dharma,

Vuud



Title: Re: Showing images by a specific user
Post by: freesouljah on September 22, 2006, 10:34:48 AM
Quote from: vuud on September 21, 2006, 09:16:14 PM
Whatzup?

Both of what you are looking to do are a function of the environment you are using cpmfetch in.  I don't know what to say more than that...

In the dharma,

Vuud



I can't get it to work using just the {OWNER} substitute in .tpl files....I can sortof get it playing with core php files of phpbb...but I would like to just use the same placeholder, but I don't know if that is possible...

that is mainly what I am concerned with...

it is also a question involving the username variable for a template inside the php of cpmfetch...

in the karma,
forrest

Title: Re: Showing images by a specific user
Post by: David McKim on October 02, 2006, 03:30:57 PM
Quote from: freesouljah on September 22, 2006, 10:34:48 AM
I can't get it to work using just the {OWNER} substitute in .tpl files....I can sortof get it playing with core php files of phpbb...but I would like to just use the same placeholder, but I don't know if that is possible...

that is mainly what I am concerned with...

it is also a question involving the username variable for a template inside the php of cpmfetch...

in the karma,
forrest



Yeah that is what I was trying to tell Vuud but he blocked my pms <_< apparently he didnt like my format... Anyways yea this code doesnt work on my site either, what exactly is required for this code to work?
Title: Re: Showing images by a specific user
Post by: Joachim Müller on October 05, 2006, 11:18:11 PM
So you sent vuud PMs and you wonder why he didn't react >:(?
This is your very last chance: read the board rules extra carefully. Read them now. Then re-read them. Read the section about not sending PMs to supporters once more. Then read all of the other rules. You have the time to read them even once more, because you're banned from posting for three days. Next ban will be permanent. You have been told repeatedly that you're suppossed to respect board rules.