This is probably extremely rookie'ish, but we apparently need someone to walk us through embedding cpmfetch with SMF. The installation seems to have gone fine because we have the sample images on the installation page. However, everytime we try to embed cpmfetch, we continue to get template parse errors. Can someone help us drag us to the answer? My head is getting sore from falling over on the keyboard. :D
- cpmfetch 1.9.8 is installed with our coppermine folder
- Both SMF 1.1.2 and Coppermine are each in the root dir.
We're trying to pull it in just below users online today stats of the index but..... :'(
index.template.php?
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/cpg");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>
Quote from: GP on February 18, 2007, 07:03:34 PM
This is probably extremely rookie'ish, but we apparently need someone to walk us through embedding cpmfetch with SMF. The installation seems to have gone fine because we have the sample images on the installation page. However, everytime we try to embed cpmfetch, we continue to get template parse errors. Can someone help us drag us to the answer? My head is getting sore from falling over on the keyboard. :D
- cpmfetch 1.9.8 is installed with our coppermine folder
- Both SMF 1.1.2 and Coppermine are each in the root dir.
We're trying to pull it in just below users online today stats of the index but..... :'(
index.template.php?
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/cpg");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>
What is the exact parse error?
Thanks for the quick response vuud! I'm sure the problem is with our inexperience with adding something to the SMF files because the cpmfetch seems to do the trick. Here's just one of the many parse errors that we've gotten with the trial and error of finding a spot for the display.
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/Alienation/index.template.php on line 387
Any help is appreciated.
Quote from: GP on February 18, 2007, 07:25:27 PM
Thanks for the quick response vuud! I'm sure the problem is with our inexperience with adding something to the SMF files because the cpmfetch seems to do the trick. Here's just one of the many parse errors that we've gotten with the trial and error of finding a spot for the display.
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/Alienation/index.template.php on line 387
Any help is appreciated.
What is line 387?
This typically means you botched something
Yep - I'm sure we've botched something :D The parse error varies with each location we've tried in the index template - so it's got to be our ignorance. ::) In this particular case it was just the following lines that were erroring because of our insert.
// Show the load time?
if ($context['show_load_time'])
echo '<br />
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';
Yeah, I know, that's what you get when a marketing major tries to help work on a site! :-\
Quote from: GP on February 18, 2007, 07:42:48 PM
Yep - I'm sure we've botched something :D The parse error varies with each location we've tried in the index template - so it's got to be our ignorance. ::) In this particular case it was just the following lines that were erroring because of our insert.
// Show the load time?
if ($context['show_load_time'])
echo '<br />
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';
Yeah, I know, that's what you get when a marketing major tries to help work on a site! :-\
Is it becuase the cpmfetch stuff you are inserting is in a <?php block, in a location that is already in a php block in the template?
We removed the php tags, with that in mind, but continue to get parse errors. :-\
Quote from: GP on February 18, 2007, 09:32:17 PM
We removed the php tags, with that in mind, but continue to get parse errors. :-\
So when you take out the cpmfetch stuff, the errors go away?
correct
vuud - based on the pm that I sent you, do I have the cpmfetch code correct?
Quote from: GP on February 18, 2007, 09:41:30 PM
vuud - based on the pm that I sent you, do I have the cpmfetch code correct?
Probably not now that I look at it...
Your running a dev version without reading the readme that came with it and the installation instructions.
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/cpg");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>
The $objCpm = new cpm("/cpg"); is wrong for the dev series. The /cpg needs to be a path to the cpmfetch_config.php file.
So it could be something like
$objCpm = new cpm("../cpg132/cpmfetch/cpmfetch_config.php");
But... having that wrong does not give a syntax error. So while it would be your problem eventually, it would not be it now.
Please post your whole file and I will see if I notice anything.