MyBB Community Forums

Full Version: how can i put this code in my forum ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hey i use Coppermine Photo Gallery in my site
http://www.haifafans.net/gallery/

and i need to put this code " LATEST UPLOADS picture "
for example in Header

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

when i paste it on header
i have this msg when i open my forum :
Fatal error: Cannot instantiate non-existent class: cpm in c:\camel\www\mybb\global.php(433) : eval()'d code(33) : eval()'d code on line 3
Are you putting that in a template?? You can't use PHP in templates. You should be able to with Yumi's PHP in templates plugin, though.
mmmmmmm i download the plugin PHP and Template Conditionals (1.3) from this link http://community.mybboard.net/thread-318...n+template

i activate it ,
i put the code in header >>> blank page
It probably can't process classes.
You need to change your include statement.
<?php
  include "../gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("../gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,4);
  $objCpm->cpm_close();
?>