Updating from 1.4.25 (stable) bridged to SMF - Page 6 Updating from 1.4.25 (stable) bridged to SMF - Page 6
 

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

Updating from 1.4.25 (stable) bridged to SMF

Started by Nightmaster, January 13, 2014, 11:00:39 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Nightmaster

Oh, sorry for posting here again, just one last thing...
I have custom php code addded on portal which shows latest comments from gallery and latest images as well.

Here's the code I used until now:

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

echo
'
<br>
<div class="sp_block tborder">
<table class="sp_block">
<tbody><tr>
<td class="sp_block_padding catbg">
<img id="sp_collapse_20" src="http://parnat.com/forum/Themes/SoftWhite1/images/collapse.gif" alt="*">
&#1055;&#1086;&#1089;&#1083;&#1077;&#1076;&#1085;&#1080;&#1077; &#1050;&#1086;&#1084;&#1077;&#1085;&#1090;&#1072;&#1088;&#1080;&#1080; &#1074; &#1043;&#1072;&#1083;&#1077;&#1088;&#1077;&#1080; </td></tr>
</tbody></table>
<br>'
;




$objCpm->cpm_viewLastCommentedImages(1,5$options2);

$objCpm->cpm_close();
?>





Attached current preview of it.

gmc

CPMFetch opens its own database connection... I'll take a look at its settings/config to see what support is there for dbcharset...
Greg
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

gmc

Not sure if you had rerun the CPMFetch install - but I did to be sure it was set to correct database and see if it picked up the $CONFIG parm change...

CPMFetch (at least at the 2.0.0 level you are running doesn't seem to honor the $CONFIG['dbcharset']... (At install, the script copies the dbconfig and many CPG config vars into its own config file - but not that variable...)

I made a temp change to pictures/cpmfetch/cpmfetch_dao.php to issue the same "SET NAMES 'utf8';" as the mainline code does at database connection time...
I'll put together a more permanent fix for CPMFetch 2.0.0 (and check 2.1.1) over the weekend... and post to the CPMFetch thread.

But your comments should appear normal now...

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

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.

ΑndrĂ©

Quote from: Nightmaster on February 25, 2014, 07:59:44 PM
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.

http://forum.coppermine-gallery.net/index.php/topic,55415.msg270618.html#msg270618