Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Driving Me Nuts - display images from specific USER in SMF Profile  (Read 7119 times)

0 Members and 1 Guest are viewing this topic.

DangRabbit

  • Coppermine newbie
  • Offline Offline
  • Posts: 19

I got a link to their Coppermine profile showing up in their SMF profile (nothing to do with cpmFetch) but I also want to get 3 images from that person as well.

If I use this:

Code: [Select]
$objCpm = new cpm("/photos");
$objCpm->cpm_viewLastAddedMediaFrom(3,1,"owner=Mom");
$objCpm->cpm_close();

It works fine... but that's hardly dynamic (hardcoding the person's username in).

I tried:

Code: [Select]
$objCpm = new cpm("/photos");
      $objCpm->cpm_viewLastAddedMediaFrom(3,1,"owner= $context['member']['name'] ");
      $objCpm->cpm_close();

And I'm getting an error:

"Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in... .../Profile.template.php on line 259"

I also tried:

Code: [Select]
$objCpm = new cpm("/photos");
      $objCpm->cpm_viewLastAddedMediaFrom(3,1,'"owner='$context['member']['name']'");
      $objCpm->cpm_close();

and end up this error:

"Parse error: parse error, unexpected T_VARIABLE in .../Profile.template.php on line 259"

Any help would be SOOO appreciated and I might actually send money or gifts ;)
« Last Edit: December 30, 2006, 08:20:22 pm by vuud »
Logged

DangRabbit

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: Driving Me Nuts - display images from specific USER in SMF Profile
« Reply #1 on: December 29, 2006, 07:24:55 am »

FINALLY... I figured it out. Ya know, it would help if I knew PHP more.

code that finally worked:

Code: [Select]
$objCpm = new cpm("/photos");
$source = "owner={$context['member']['name']}";
$objCpm->cpm_viewLastAddedMediaFrom(3,1,$source);
$objCpm->cpm_close();
Logged

asterix23

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Driving Me Nuts - display images from specific USER in SMF Profile
« Reply #2 on: January 04, 2007, 05:29:53 pm »

I have a problem with your code
I'v included it on a test.php page
Code: [Select]
<?php

error_reporting(E_ALL);
ini_set('display_errors',1);  // 0 is off, 1 is on
include "cpmfetch.php";
$objCpm = new cpm("/galerie");
$source = "owner={$context['member']['name']}";
$objCpm->cpm_viewLastAddedMediaFrom(3,1,$source);
$objCpm->cpm_close();
?>
But I get this error:
Notice: Undefined variable: context in /home/site.com/public_html/galerie/cpmfetch/test.php on line 7

Please help
Logged

Nibbler

  • Guest
Re: Driving Me Nuts - display images from specific USER in SMF Profile
« Reply #3 on: January 04, 2007, 05:31:59 pm »

How do you expect it to work on a test page? It needs to be on the SMF profile page.
Logged

asterix23

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Driving Me Nuts - display images from specific USER in SMF Profile
« Reply #4 on: January 04, 2007, 05:43:24 pm »

Ok I have added this code
Code: [Select]
include "galerie/cpmfetch/cpmfetch.php";
$objCpm = new cpm("/galerie");
$source = "owner={$context['member']['name']}";
$objCpm->cpm_viewLastAddedMediaFrom(3,1,$source);
$objCpm->cpm_close();
on Profile.template.php but I get this error
Fatal error: Cannot instantiate non-existent class: cpm in /home/site.com/public_html/smf/Sources/Load.php(1770) : eval()'d code on line 312
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Driving Me Nuts - display images from specific USER in SMF Profile
« Reply #5 on: January 04, 2007, 06:19:25 pm »

Ok I have added this code
Code: [Select]
include "galerie/cpmfetch/cpmfetch.php";
$objCpm = new cpm("/galerie");
$source = "owner={$context['member']['name']}";
$objCpm->cpm_viewLastAddedMediaFrom(3,1,$source);
$objCpm->cpm_close();
on Profile.template.php but I get this error
Fatal error: Cannot instantiate non-existent class: cpm in /home/site.com/public_html/smf/Sources/Load.php(1770) : eval()'d code on line 312

try changing to include_once ...

I think your path is screwy and include_once if I remember correctly fails harder and more apparent.

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

asterix23

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Driving Me Nuts - display images from specific USER in SMF Profile
« Reply #6 on: January 04, 2007, 06:59:09 pm »

fixed thanks!
but there are a problem with members who have a different Username and Displayname, maybe you should use $context['member']['id'] instead of $context['member']['name'] ?
Logged

PirateZipp

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
  • Hotimage.dk
    • HotImage
Re: Driving Me Nuts - display images from specific USER in SMF Profile
« Reply #7 on: September 06, 2007, 03:22:26 am »

Hey.. i  try to set in the code.. but i'm not shure where to set it...

can som 1 tell me a line to set it in? and what file?

thank you :D
Logged
.
Pages: [1]   Go Up
 

Page created in 0.039 seconds with 20 queries.