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: Second php block in TP  (Read 4094 times)

0 Members and 1 Guest are viewing this topic.

Nefeli

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 10
    • Nefelokokkygia
Second php block in TP
« on: May 10, 2007, 07:52:58 pm »

Hi everybody

I have  installed SMF 1.1.1, TinyPortal v0.9.7, Coppermine Photo Gallery v1.4.10 and copperminefetch-2.0.0

After a lot of trials I accomplished to pass rightly the code in php block.
This code is:
Code: [Select]
echo "<CENTER>";
  include "./Gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,8);

and it works!!!

However, in my effort  to pass the code in a second php block, I take the following fault.
Code: [Select]
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /xxxxxx/xxxxxxx/xxxxxxxxxx/Sources/Load.php(1733) : eval()'d code(35) : eval()'d code on line 3
In line 3 on Load.php:
Code: [Select]
* Load.php                                                                        *
What I make wrong? Can i make multiple php blocks with cpmfetch in TP? If the answer is yes, how can i do this?

Thanks
« Last Edit: May 12, 2007, 01:30:57 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Second php block in TP
« Reply #1 on: May 11, 2007, 09:07:37 am »

either use "include_once" instead of "include" or don't include twice. The actual syntax for the include command is with parenthesis. Post the actual line of code that results in your error. A parse error is a "Syntax error" - there is something wrong with your syntax there.
Logged

Nefeli

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 10
    • Nefelokokkygia
Re: Second php block in TP
« Reply #2 on: May 11, 2007, 08:14:43 pm »

It didn't work  :-\ :-\ :-\ :-\

first block php
Code: [Select]
echo "<CENTER>";
  include_once "./Gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,8);
>>> OK

second block php
Code: [Select]
include_once "./Gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php");
  objCpm->cpm_viewRandomMediaFrom("cat=10,13",1, 4, $options);
or
Code: [Select]
$objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php");
  objCpm->cpm_viewRandomMediaFrom("cat=10,13",1, 4, $options);
or
Code: [Select]
include "./Gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php");
  objCpm->cpm_viewRandomMediaFrom("cat=10,13",1, 4, $options);
>>> Don't work


If i have only one block php with the code
Code: [Select]
include_once "./Gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php");
  objCpm->cpm_viewRandomMediaFrom("cat=10,13",1, 4, $options);
>>> Don't work!!!!!!!!!!

It seems that the problem is on objCpm->cpm_viewRandomMediaFrom("cat=10,13",1, 4, $options);

Thanks anyway....
Logged

Nefeli

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 10
    • Nefelokokkygia
Re: Second php block in TP
« Reply #3 on: May 11, 2007, 09:04:54 pm »

Finaly the combination that functioned ΟΚ was:

First php block:
Code: [Select]
echo "<CENTER>";
  include_once "./Gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,8);

Second php block:
Code: [Select]
echo "<CENTER>";
include_once "./Gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php"); 
$objCpm->cpm_viewRandomMediaFrom("cat=10,13",1, 8, $options);

Note that the code resembles with the one of the codes of previous post!!!!!

The code dont work for hours and then, suddenly it works!!!!!!!!!!!!

This auto-correction happened on the same way, yesterday when i tryed again and again the first code!!!!!!!!!!!!

Sorry for my English :-X

Thanks anyway  :-*
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Second php block in TP
« Reply #4 on: May 12, 2007, 01:30:14 pm »

OK, thanks for returning and posting your solution (although I'm not a believer of miracle cures) - marking thread accordingly. However, fix your include statements - review the correct syntax (with parenthesis): http://www.php.net/manual/en/function.include.php and http://www.php.net/manual/en/function.include-once.php
Code: [Select]
include 'foo.php';may work, but I suggest using
Code: [Select]
include('foo.php');
Logged

Nefeli

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 10
    • Nefelokokkygia
Re: Second php block in TP
« Reply #5 on: May 12, 2007, 06:14:00 pm »

OK  :) i add parenthesis.

Quote
although I'm not a believer of miracle cures
Nor i.
Ηowever, τhe truth  is that no other regulation did not intervene between the repetitions of trials.  :-\

I have heard that servers sometimes present a different timing of implementation.
This has not happened to me never again. ??? ???
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 16 queries.