Second php block in TP Second php block in TP
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Second php block in TP

Started by Nefeli, May 10, 2007, 07:52:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nefeli

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

Joachim Müller

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.

Nefeli

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

Nefeli

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  :-*

Joachim Müller

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');

Nefeli

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