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 php code not working in sidebar widget  (Read 13129 times)

0 Members and 1 Guest are viewing this topic.

Nymheria

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
CpmFetch php code not working in sidebar widget
« on: May 28, 2016, 07:09:08 pm »

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 !
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: CpmFetch php code not working in sidebar widget
« Reply #1 on: May 30, 2016, 10:14:08 am »

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?
Logged

Nymheria

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: CpmFetch php code not working in sidebar widget
« Reply #2 on: May 31, 2016, 08:09:39 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: CpmFetch php code not working in sidebar widget
« Reply #3 on: May 31, 2016, 09:30:25 am »

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.
Logged

Nymheria

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: CpmFetch php code not working in sidebar widget
« Reply #5 on: May 31, 2016, 04:30:30 pm »

Thank you so much, I used one of the plugin and it works now !  ;D
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.