I am trying to output pictures from coppermine gallery in a tab. There is a script for coppermine gallery called cpmfetch, which allows to display any picture of your coppermine gallery on external pages. All you need to do is put this into your php page:
PHP Code:
<?php
require_once "./coppermine_gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./coppermine_gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,1,$options);
$objCpm->cpm_close();
?>
This will add the following code to that page location, which represents the last picture added to your coppermine gallery:
Code:
<table >
<tr>
<td><a href='http://your_domain.com/coppermine_gallery/thumbnails.php?album=14' ><img src="http://your_domain.com/coppermine_gallery/albums_directory/categoryname/picture_name.jpg" /></a></td>
</tr>
</table>
When I add the following code for my profile tab, that picture will be shown at the very beginning of the profile page - even before doctype, header and body tags.
Code:
$blocklist = array_merge($blocklist, array(
'copperminegallery' => array(
'class' => 'CoppermineGallery',
'title' => 'Last Added Pic',
'hook_location' => 'profile_left_last'
)
));
class vB_ProfileBlock_CoppermineGallery extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_copperminegallery';
function confirm_empty_wrap()
{
return false;
}
function confirm_display()
{
return ($this->block_data['copperminegallery'] != '');
}
function prepare_output($id = '', $options = array())
{
include "./coppermine_gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./coppermine_gallery/cpmfetch/cpmfetch_config.php");
$this->block_data['copperminegallery'] = $objCpm->cpm_viewLastAddedMedia(1,1,$options);
}
}
When I add the resulting html code manually into the block it works fine:
Code:
$blocklist = array_merge($blocklist, array(
'copperminegallery' => array(
'class' => 'CoppermineGallery',
'title' => 'My Favs',
'hook_location' => 'profile_left_last'
)
));
class vB_ProfileBlock_CoppermineGallery extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_copperminegallery';
function confirm_empty_wrap()
{
return false;
}
function confirm_display()
{
return ($this->block_data['copperminegallery'] != '');
}
function prepare_output($id = '', $options = array())
{
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$this->block_data['copperminegallery'] = '<table >
<tr>
<td><a href=\'http://your_domain.com/coppermine_gallery/thumbnails.php?album=14\' ><img src="http://your_domain.com/coppermine_gallery/albums_directory/categoryname/picture_name.jpg" /></a></td>
</tr>
</table>
';
}
}
I had to put a backslash in front of ' to avoid the following error. But I don' t think that this is the problem, because there is no error with the real code.
Quote:
Parse error: syntax error, unexpected T_STRING in /path/to/your/web/root/member.php(454) : eval()'d code on line 250
|
Does anyone know how to correct the display problem?
Thank you!