Advanced search  

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]

Pages: [1]   Go Down

Author Topic: cpmfetch in PHPBB3  (Read 12640 times)

0 Members and 1 Guest are viewing this topic.

Stewwake

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
cpmfetch in PHPBB3
« 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
« Last Edit: June 25, 2007, 12:38:26 am by vuud »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: cpmfetch in PHPBB3
« Reply #1 on: June 23, 2007, 03:55:24 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





Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Stewwake

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: cpmfetch in PHPBB3
« Reply #2 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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: cpmfetch in PHPBB3
« Reply #3 on: June 24, 2007, 04:18:01 am »

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

Code: [Select]
$objCpm = new cpm("../wakeboarding-photos/cpmfetch/cpmfetch_config.php");
Note the two dots instead of one.

Lets see how that goes
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Stewwake

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: cpmfetch in PHPBB3
« Reply #4 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?
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: cpmfetch in PHPBB3
« Reply #5 on: June 24, 2007, 05:05:46 pm »

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.





Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Stewwake

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: cpmfetch in PHPBB3
« Reply #6 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
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 19 queries.