coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Stewwake on June 23, 2007, 02:10:46 AM

Title: cpmfetch in PHPBB3
Post by: Stewwake on June 23, 2007, 02:10:46 AM
Hi there, hope you can help, Ive looked everywhere & so far no soloution.

I am trying to use cpm fetch to display some latest photos from coppermine on the side of a phpbb3 forum page.

I have used the following code (which works on all other pages on my site):


  <?php
include_once "./wakeboarding-photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./wakeboarding-photos/cpmfetch/cpmfetch_config.php");
$options = array("imagewidth" => "80", "imagestyle" => "fetchimg",);
  $objCpm->cpm_viewLastAddedMedia(1, 8, $options);

  $objCpm->cpm_close();
?>

Within the PHPBB3 admin you can set the board to allow php parsing - I have set this to yes.

There are some instructions re using php in PHPBB3 from PHPBB3 as follows:


"PHP
A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:

<!-- PHP -->
   echo "hello!";
<!-- ENDPHP -->
You may also include PHP from an external file using:

<!-- INCLUDEPHP somefile.php -->
it will be included and executed inline."

Thus I have used the <!-- PHP --> & <!-- ENDPHP --> tags directly above & below the cpmfetch code.

I have also played around with the relative paths but no pictures appear. No error occurs, I just dont see any pics.

Any help would be very much gratefully appreciated!!

Thanks

Stew
Title: Re: cpmfetch in PHPBB3
Post by: vuud on June 23, 2007, 03:55:24 AM
Quote from: Stewwake on June 23, 2007, 02:10:46 AM
Hi there, hope you can help, Ive looked everywhere & so far no soloution.

I am trying to use cpm fetch to display some latest photos from coppermine on the side of a phpbb3 forum page.

I have used the following code (which works on all other pages on my site):


  <?php
include_once "./wakeboarding-photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./wakeboarding-photos/cpmfetch/cpmfetch_config.php");
$options = array("imagewidth" => "80", "imagestyle" => "fetchimg",);
  $objCpm->cpm_viewLastAddedMedia(1, 8, $options);

  $objCpm->cpm_close();
?>

Within the PHPBB3 admin you can set the board to allow php parsing - I have set this to yes.

There are some instructions re using php in PHPBB3 from PHPBB3 as follows:


"PHP
A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:

<!-- PHP -->
   echo "hello!";
<!-- ENDPHP -->
You may also include PHP from an external file using:

<!-- INCLUDEPHP somefile.php -->
it will be included and executed inline."

Thus I have used the <!-- PHP --> & <!-- ENDPHP --> tags directly above & below the cpmfetch code.

I have also played around with the relative paths but no pictures appear. No error occurs, I just dont see any pics.

Any help would be very much gratefully appreciated!!

Thanks

Stew


Pls provide a link to the URL... that will tell me so many things that your post did not.

Otherwise I had no idea there even was a phpbb3





Title: Re: cpmfetch in PHPBB3
Post by: Stewwake on June 23, 2007, 12:26:44 PM
Apologies,

Here is the forum url where I have put the code in:

http://www.wakeboardinguk.co.uk/wakeboard-forum/

I have put the code in the div starting: <div class="left-panel" id="gcode_left_index">


And the coppermine gallery is here:

http://www.wakeboardinguk.co.uk/wakeboarding-photos/index.php

thanks
Title: Re: cpmfetch in PHPBB3
Post by: vuud on June 24, 2007, 04:18:01 AM
Quote from: Stewwake on June 23, 2007, 12:26:44 PM
Apologies,

Here is the forum url where I have put the code in:

http://www.wakeboardinguk.co.uk/wakeboard-forum/

I have put the code in the div starting: <div class="left-panel" id="gcode_left_index">


And the coppermine gallery is here:

http://www.wakeboardinguk.co.uk/wakeboarding-photos/index.php

thanks


The first thing to try is changiny your new statement to point at the actual cpmfetch_config.php file

$objCpm = new cpm("../wakeboarding-photos/cpmfetch/cpmfetch_config.php");

Note the two dots instead of one.

Lets see how that goes
Title: Re: cpmfetch in PHPBB3
Post by: Stewwake on June 24, 2007, 11:58:08 AM
Hi there,

Ok, code now reads (have include div headers this time):

<div class="left-panel" id="gcode_left_index">

   <!-- PHP -->
<?php

  include_once "../wakeboarding-photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm("../wakeboarding-photos/cpmfetch/cpmfetch_config.php");
  $options = array("imagestyle" => "fetchimg",);
$objCpm->cpm_viewRandomMostViewedMediaFrom("alb=4",4, 3, $options);
 
 
?>
 
<!-- ENDPHP -->   
        </div>


No photos appearing this time?
Title: Re: cpmfetch in PHPBB3
Post by: vuud on June 24, 2007, 05:05:46 PM
Quote from: Stewwake on June 24, 2007, 11:58:08 AM
Hi there,

Ok, code now reads (have include div headers this time):

<div class="left-panel" id="gcode_left_index">

   <!-- PHP -->
<?php

  include_once "../wakeboarding-photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm("../wakeboarding-photos/cpmfetch/cpmfetch_config.php");
  $options = array("imagestyle" => "fetchimg",);
$objCpm->cpm_viewRandomMostViewedMediaFrom("alb=4",4, 3, $options);
 
 
?>
 
<!-- ENDPHP -->   
        </div>


No photos appearing this time?


I suspect that this is a PHPBB3 problem, or at least a limiting of out understanding of it.

In reviewing the original post (Since Cpmfetch is almost always somewhat vocal), you cite the PHPBB3 example, but then you added in a <?php tag and an ?> php end tag.

They don't seem to include that in their post.  Try it without them.





Title: Re: cpmfetch in PHPBB3
Post by: Stewwake on June 25, 2007, 12:29:32 AM
Excellent!! It works

Thanks alot -

I did try it without the <?php tags but must have had the paths wrong at the same time. Is good to go through it with someone who knows what they are talking about!

Cheers