hello,
first: sorry for my english. i speak german :-)
i have a problem:
in the admin userface on the right side is a box with "The last 10 Comments"
Now i want to put this box in a other side of my zenphoto gallerie.
The Problem is, i can`t. i saw here a "Tutorial" but i can't the script import in my webpage. maybe i'm to stupide?!?
is anyone here can show me a functioning script?
Thanks. Now i wish you a nice evening.
Comments
when i this script import in my page then i see a white site
Why? The script is still ok?
this is "my" script
<?php
/**
* Prints out latest comments for images and albums
*
* @param int $number how many comments you want.
* @param string $shorten the number of characters to shorten the comment display
* @param string $type "all" for all latest comments of all images and albums
* "image" for the lastest comments of one specific image
* "album" for the latest comments of one specific album
* @param int $itemID the ID of the element to get the comments for if $type != "all"
*/
function printLatestComments($number='20', $shorten='123',$type="all",$itemID="") {
if(getOption('mod_rewrite')) {
$albumpath = "/"; $imagepath = "/"; $modrewritesuffix = getOption('mod_rewrite_image_suffix');
} else {
$albumpath = "/index.php?album="; $imagepath = "&image="; $modrewritesuffix = "";
}
$comments = getLatestComments($number,$type,$itemID);
echo "<ul id=\"showlatestcomments\">\n";
foreach ($comments as $comment) {
if($comment['anon'] === "0") {
$author = " ".gettext("by")." ".$comment['name'];
} else {
$author = "";
}
$album = $comment['folder'];
if($comment['type'] != "albums" AND $comment['type'] != "news" AND $comment['type'] != "pages") { // check if not comments on albums or Zenpage items
$imagetag = $imagepath.$comment['filename'].$modrewritesuffix;
} else {
$imagetag = "";
}
$date = $comment['date'];
$albumtitle = $comment['albumtitle'];
if ($comment['title'] == "") $title = $image; else $title = get_language_string($comment['title']);
$website = $comment['website'];
$shortcomment = truncate_string($comment['comment'], $shorten);
if(!empty($title)) {
$title = ": ".$title;
}
echo "
".$albumtitle.$title.$author."\n";
echo "<span class=\"commentbody\">".$shortcomment."</span>
";
}
echo "\n";
}
?>
now i imported in the image.php file (themes/default/...) this script
<?php void printLatestComments( int $number = "10"], [string $shorten = '123'], [string $type = "all"], [int $itemID = ""] ) ?>
And then my browser saw:
Parse error: syntax error, unexpected T_STRING in /home/www/my ordner.../themes/default/image.php on line 87
what is fals on my idea to import this script?
<?php void printLatestComments( 10, 123, "all", "") ?>
<?php printLatestComments( 10, 123, "all", "") ?>
`<?php printLatestComments(10, 123, 'all', ''); ?>`