CpmFetch php code not working in sidebar widget CpmFetch php code not working in sidebar widget
 

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 php code not working in sidebar widget

Started by Nymheria, May 28, 2016, 07:09:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nymheria

Hello,

I'm new to fansites and this forum so I hope I'm not doing anything wrong by writing here but I'm desperate about an issue happening on my fansite. I wanted to have the "latest images added to the gallery" in a sidebar's widget on my site, so I did everything I had to do with cpmfetch and it all went all as the CpmFetch Installer was showing me the thumbnails of the latest uploads in my gallery.

However, when I'm copying/pasting the code I'm given in the widget, here is what is appearing instead of the thumbnails :

cpm_viewLastAddedMedia(1,4); $objCpm->cpm_close(); ?>

Did I do something wrong ?

By the way, I have WordPress 4.5.2 and Coppermine 1.5.42 (stable) and my gallery is at roselesliesource.com/gallery/

Thank you !

Αndré

That's an issue you probably have to ask in the Wordpress support board. Just to make sure, what code have you copied to the widget?

Nymheria

Alright thank you, should I post there : https://wordpress.org/support/forum/plugins-and-hacks ?

I have copied the second code :

<?php
  include "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,4);
  $objCpm->cpm_close();
?>

Αndré

I'm no CPMFetch expert, but the code looks correct. I don't know how Wordpress handles custom PHP code in their widget functionality, but something goes obviously wrong, as everything after the first ">" is displayed as plain text. It seems Wordpress interprets that digit as closing PHP tag.

Please try to add that code to a new PHP file somewhere on your webspace, to make sure it works as expected.


Nymheria

Thank you so much, I used one of the plugin and it works now !  ;D