Driving Me Nuts - display images from specific USER in SMF Profile Driving Me Nuts - display images from specific USER in SMF Profile
 

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

Main Menu

Driving Me Nuts - display images from specific USER in SMF Profile

Started by DangRabbit, December 29, 2006, 06:48:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DangRabbit

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:

$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:

$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:

$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 ;)

DangRabbit

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

code that finally worked:

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

asterix23

I have a problem with your code
I'v included it on a test.php page
<?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

Nibbler

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

asterix23

Ok I have added this code
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

vuud

Quote from: asterix23 on January 04, 2007, 05:43:24 PM
Ok I have added this code
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.

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

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'] ?

PirateZipp

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
.