coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Nefeli on May 10, 2007, 07:52:58 PM

Title: Second php block in TP
Post by: Nefeli 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:
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.
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:
* 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
Title: Re: Second php block in TP
Post by: Joachim Müller 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.
Title: Re: Second php block in TP
Post by: Nefeli on May 11, 2007, 08:14:43 PM
It didn't work  :-\ :-\ :-\ :-\

first block php
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
include_once "./Gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php");
  objCpm->cpm_viewRandomMediaFrom("cat=10,13",1, 4, $options);

or
$objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php");
  objCpm->cpm_viewRandomMediaFrom("cat=10,13",1, 4, $options);

or
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
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....
Title: Re: Second php block in TP
Post by: Nefeli on May 11, 2007, 09:04:54 PM
Finaly the combination that functioned ΟΚ was:

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


Second php block:
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  :-*
Title: Re: Second php block in TP
Post by: Joachim Müller 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
include 'foo.php';may work, but I suggest using include('foo.php');
Title: Re: Second php block in TP
Post by: Nefeli on May 12, 2007, 06:14:00 PM
OK  :) i add parenthesis.

Quotealthough 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. ??? ???