cpmfetch pOwner_name cpmfetch pOwner_name
 

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]

Main Menu

cpmfetch pOwner_name

Started by Nightmaster, February 26, 2014, 11:50:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nightmaster

Is it possible to still use cpmfetch functions like {{pOwner_name}}?
Seems like that one is not working, but {{pTitle}}, {{pCaption}} and {{pOwnerId}} are working just fine.

I'm trying to use this in SMF forum - SP block, which currently looks like this:

<?php
  
include "../pictures/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("../pictures/cpmfetch/cpmfetch_config.php");

$options = array("subtitle" => 
<strong>{{pTitle}}</strong>  
{{pCaption}} 
<br> from  <a href=index.php?action=profile;u={{pOwnerId}}><strong>{{pOwner_name}}</strong></a><br><hr>"
);


$options2 = array( 

//"noimage" => "",

"cellstyle" => "align='center'",

"subtitle" => 
<strong>{{pTitle}}</strong>  
<br> <hr>
<strong> {{%A}}: </strong> {{%C}}  

<br><hr>"

);

$objCpm->cpm_viewRandomMedia(2,4$options);
...

it's the code that worked well with coppermine 1.4.25, but {{pOwner_name}} doesn't seems to be working on 1.5 version.

gmc

The only reference I can find to pOwner_name is in an old format display in cpmFetch which says it is deprecated...
Was cpmFetch upgraded as part of your server move and upgrades??

I'll do some more looking at the code, but want to know what versions to look at..

Greg
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Nightmaster

Thanks for your answer.
I didn't touched the plugin itself while upgrading.

Here's the heading of the cpmfetch.php file:

/**
* CpmFetch
*
* This is a support library to help grab images from a coppermine database and display them on normal php
* pages outside the coppermine program.
* This program is free software; you can redistribute it and/or modify     
* it under the terms of the GNU General Public License as published by     
* the Free Software Foundation; either version 2 of the License, or         
* (at your option) any later version.                                       
* Runs on: Tested on coppermine 1.3.2,
* HTML: Generates XHTML (as far as I can tell)
* PHP: Tested on version 4
* RELEASE VERSION 2.0.0
*
* @version $Revision: 1.12 $
* @package cpmfetch
*/
/**
* cpmfetch_dao is the data access object for cpmfetch.
* @access private
*/

I guess the version from that is relevant, so it's 2.0.0 version, if I'm not wrong.

lurkalot

I asked about this yonks ago, but didn't get it resolved unfortunately.  http://forum.coppermine-gallery.net/index.php/topic,65412.msg336985.html#msg336985

owner name and comment count always worked with cpmfetch 2.0.0 and Coppermine 1.4.x but never with Coppermine 1.5.x  I'd still like to have this working actually.
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Nightmaster

Actually I found interesting code in cpmfetch_dao file:

case ('o'): $output .= $row['pOwner_name']; if ("" == $row['pOwner_name']) $didIfail = true;
break;

Trying to find if there's similar replacement for this variable, but I didn't had a luck so far.

gmc

QuoteActually I found interesting code in cpmfetch_dao file:
That's the code I was referring to - if you scroll up will see reference that the function is the 'old' format and deprecated...
Perhaps a way to still use it - but I need to play with it to see...
You can customize the SQL used as far as select fields, etc in cpmFetch config - but of course owner name is not in the pictures table - so has to be joined with users...

Lurkalot - are you using 2.0 or 2.1.1 dev release?  I was thinking of testing with that to see if it was addressed there... A lot of changes made - but never officially released.  I use it for cfimgget support - just never tried this with it.

Greg

Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

lurkalot

#6
Quote from: gmc on February 26, 2014, 09:29:46 PM

Lurkalot - are you using 2.0 or 2.1.1 dev release?  I was thinking of testing with that to see if it was addressed there... A lot of changes made - but never officially released.  I use it for cfimgget support - just never tried this with it.

Greg

Greg, I'm using version CPMFetch 2.0.0 as attached to my first post Here Which was modified to work with Coppermine 1.5.x
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

gmc

OK... The change from 1.4 to 1.5 was in Coppermine... The owner name field was dropped from the pictures table.
Appears this was defined/populated in 1.3, still defined in 1.4 (though a 1.4 backup of mine had no data in it), and dropped in 1.5 (why we all needed to change line 61 of the cpmfetch install file to remove the reference to p.owner_name to make it work at all with 1.5.

At least one reason for removing was an issue when a users name changed.. The change wasn't reflected in already existing pictures. Since owner_id was already there, a current user name could always be obtained.

To restore the ability to display this info would need changes to cpmfetch... Either adding a join with user table if owner name is needed - or having cpmfetch use a new view that does the join...

I still need to review the 2.1.1 code, but since it needed the same install change as 2.0.0 - I'm expecting the same issue there...
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money