Advanced search  

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

Pages: [1]   Go Down

Author Topic: cpmfetch pOwner_name  (Read 6094 times)

0 Members and 1 Guest are viewing this topic.

Nightmaster

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 46
  • samo-opusteno.info
    • Samo-opusteno.info
cpmfetch pOwner_name
« on: February 26, 2014, 11:50:26 am »

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:
Code: [Select]
<?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.
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: cpmfetch pOwner_name
« Reply #1 on: February 26, 2014, 08:11:56 pm »

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
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Nightmaster

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 46
  • samo-opusteno.info
    • Samo-opusteno.info
Re: cpmfetch pOwner_name
« Reply #2 on: February 26, 2014, 08:46:40 pm »

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

Here's the heading of the cpmfetch.php file:
Code: [Select]
/**
 * 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.
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Re: cpmfetch pOwner_name
« Reply #3 on: February 26, 2014, 09:08:09 pm »

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.
Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Nightmaster

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 46
  • samo-opusteno.info
    • Samo-opusteno.info
Re: cpmfetch pOwner_name
« Reply #4 on: February 26, 2014, 09:21:40 pm »

Actually I found interesting code in cpmfetch_dao file:
Code: [Select]
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.
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: cpmfetch pOwner_name
« Reply #5 on: February 26, 2014, 09:29:46 pm »

Quote
Actually 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

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

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Re: Re: cpmfetch pOwner_name
« Reply #6 on: February 26, 2014, 10:40:45 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
« Last Edit: February 26, 2014, 10:46:33 pm by lurkalot »
Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: cpmfetch pOwner_name
« Reply #7 on: February 27, 2014, 04:48:54 am »

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...
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.