coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: joeyhavlock on July 22, 2007, 04:06:55 AM

Title: cpmFetch on vBulletin User Profile
Post by: joeyhavlock on July 22, 2007, 04:06:55 AM
Hi Folks,

I am trying to use cpmFetch to display photos on my user's profile page.

I know that when you are viewing the user's profile, the userid variable is there somewhere for the taking, it must be.

So, how do I pass to the cpmFetch source the user's userid to retrieve the photos for that particular user?

Thanks much!
Joey
Title: Re: cpmFetch on vBulletin User Profile
Post by: joeyhavlock on July 22, 2007, 04:10:49 AM
Sorry, I forgot to add this to my last post (can I edit my own posts here, I could not find a link)

What I want to do is replace the XXX below with the username/userid (whichever will work) of the person's profile I am viewing

  $objCpm->cpm_viewRandomMediaFrom("owner=XXX",5, 1, $options);

Thanks!
Title: Re: cpmFetch on vBulletin User Profile
Post by: joeyhavlock on July 22, 2007, 04:39:16 AM
I should add that I am having to call my cpmFetch into an iframe as I cannot seem to get cpmFetch to run with the code directly in the user profile.

The code in my User profile is:

<div align="center"><iframe
src ="http://www.tradingcardspace.com/community/fetch/coppermine-home-mod1.php"
width="90%" HEIGHT="100%" FRAMEBORDER=0 SCROLLING=YES> </iframe> </div>



and the code in my fetch file (coppermine-home-mod1.php) is:



<div align="center">
  <?php
  include_once "../../coppermine/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("../../coppermine/cpmfetch/cpmfetch_config.php");
  $options = array("windowtarget" => "_top");
  $objCpm->cpm_viewRandomMediaFrom("owner=XXX",1, 7, $options);
  $objCpm->cpm_close();
?>
</div>


again, I am trying to figure out how to replace the "owner=XXX" with the username of the person's profile I am viewing so that I see the files belonging to that person.

Thanks again
Joey
Title: Re: cpmFetch on vBulletin User Profile
Post by: vuud on July 23, 2007, 03:38:50 AM
Quote from: joeyhavlock on July 22, 2007, 04:39:16 AM
I should add that I am having to call my cpmFetch into an iframe as I cannot seem to get cpmFetch to run with the code directly in the user profile.

The code in my User profile is:

<div align="center"><iframe
src ="http://www.tradingcardspace.com/community/fetch/coppermine-home-mod1.php"
width="90%" HEIGHT="100%" FRAMEBORDER=0 SCROLLING=YES> </iframe> </div>



and the code in my fetch file (coppermine-home-mod1.php) is:



<div align="center">
  <?php
  include_once "../../coppermine/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("../../coppermine/cpmfetch/cpmfetch_config.php");
  $options = array("windowtarget" => "_top");
  $objCpm->cpm_viewRandomMediaFrom("owner=XXX",1, 7, $options);
  $objCpm->cpm_close();
?>
</div>


again, I am trying to figure out how to replace the "owner=XXX" with the username of the person's profile I am viewing so that I see the files belonging to that person.

Thanks again
Joey


owner=name

should work.... Unless you are bridged with something, in which case all bets are off.


Title: Re: cpmFetch on vBulletin User Profile
Post by: joeyhavlock on July 23, 2007, 05:53:08 AM
Quote from: vuud on July 23, 2007, 03:38:50 AM
owner=name
should work.... Unless you are bridged with something, in which case all bets are off.


Thanks for the reply Vuud...

I dont know whether you are say in this case that "name" is an actual or a variable name, either way when I tried "owner=name" I get no results whatsoever.

I am bridged with Vbulletin, and I want to pass a variable to replace name with the username of the persons profile I am looking at.


i.e.  I am signed in as Joey and am looking at Fred's profile, and on Fred's profile I want to see the images he has contributed to the coppermine gallery.  Since I am looking at fred's profile, the variable containing Fred's name is in the air somewhere and that is I want to pass to cpmFetch.

Any possibility that this is accomplishable?
Thanks much
Joey
Title: Re: cpmFetch on vBulletin User Profile
Post by: flowmo on August 09, 2007, 08:26:13 AM
I used this method to get the username to pull from phpbb

You HAVE to be using the extreme styles mod for phpbb , and I also include
  include "../cpmfetch/cpmfetch.php";
in line 24 of usercp_viewprofile.php so i only have to include it once


<!-- PHP -->
$usernamed = $this->vars['USERNAME'];
$options = array(
"imageStyle" => "gensmall2" );
  $objCpm = new cpm("../cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMediaFrom("owner=$usernamed",1,4,$options);
  $objCpm->cpm_close();
<!-- ENDPHP -->


that code should work for you if you using extreme styles, if u haven't installed it it's very easy to install
Title: Re: cpmFetch on vBulletin User Profile
Post by: flowmo on August 09, 2007, 08:29:08 AM
wow please remove that... i put this in the entirely wrong thread... feel free to take all my karma away  :-[