I have ZenPHOTO 1.2.3 installed and the getCommentCount() function didn't work. Not sure why, it just didn't. If anyone else has the same problem just download ZenPHOTO 1.2.1 and replace:
`
function getCommentCount() {
global $_zp_current_image, $_zp_current_album, $_zp_current_zenpage_page, $_zp_current_zenpage_news;
if (in_context(ZP_IMAGE) & in_context(ZP_ALBUM)) {
if (is_null($_zp_current_image)) return false;
return $_zp_current_image->getCommentCount();
} else if (!in_context(ZP_IMAGE) & in_context(ZP_ALBUM)) {
if (is_null($_zp_current_album)) return false;
return $_zp_current_album->getCommentCount();
}
if(function_exists('is_News')) {
if(is_News()) {
return $_zp_current_zenpage_news->getCommentCount();
}
if(is_Pages()) {
return $_zp_current_zenpage_page->getCommentCount();
}
}
}
`
with:
`
function getCommentCount() {
global $_zp_current_image, $_zp_current_album, $current_zenpage;
if (in_context(ZP_IMAGE) AND in_context(ZP_ALBUM)) {
return $_zp_current_image->getCommentCount();
} else if (!in_context(ZP_IMAGE) AND in_context(ZP_ALBUM)) {
return $_zp_current_album->getCommentCount();
}
if(function_exists('is_News')) {
if(is_News() OR is_Pages()) {
return $current_zenpage->getCommentCount();
}
}
}
`
Not sure if that is the recommended procedure -- but it fixed my problem. *I tried to highlight this in green. If it doesn't work my apologies.
Josh
Comments
Josh
There are only two places that need to be changed.
The original code is:
`
if (in_context(ZP_IMAGE) & in_context(ZP_ALBUM)) {
`
It should be:
`
if (in_context(ZP_IMAGE) AND in_context(ZP_ALBUM)) {
`
================================================================
The next change is:
The original code is:
`
} else if (!in_context(ZP_IMAGE) & in_context(ZP_ALBUM)) {
`
It should be:
`
} else if (!in_context(ZP_IMAGE) AND in_context(ZP_ALBUM)) {
`
================================================================
Use "AND" instead of the "&". That's all I did and it fixed it. Now my code looks like:
`
function getCommentCount() {
global $_zp_current_image, $_zp_current_album, $current_zenpage, $_zp_current_zenpage_news;;
if (in_context(ZP_IMAGE) AND in_context(ZP_ALBUM)) {
if (is_null($_zp_current_image)) return false;
return $_zp_current_image->getCommentCount();
} else if (!in_context(ZP_IMAGE) AND in_context(ZP_ALBUM)) {
if (is_null($_zp_current_album)) return false;
return $_zp_current_album->getCommentCount();
}
if(function_exists('is_News')) {
if(is_News()) {
return $_zp_current_zenpage_news->getCommentCount();
}
if(is_Pages()) {
return $current_zenpage->getCommentCount();
}
}
}
`
`
function getCommentCount() {
global $_zp_current_image, $_zp_current_album, $_zp_current_zenpage_page, $_zp_current_zenpage_news;
if (in_context(ZP_IMAGE) AND in_context(ZP_ALBUM)) {
if (is_null($_zp_current_image)) return false;
return $_zp_current_image->getCommentCount();
} else if (!in_context(ZP_IMAGE) AND in_context(ZP_ALBUM)) {
if (is_null($_zp_current_album)) return false;
return $_zp_current_album->getCommentCount();
}
if(function_exists('is_News')) {
if(is_News()) {
return $_zp_current_zenpage_news->getCommentCount();
}
if(is_Pages()) {
return $_zp_current_zenpage_page->getCommentCount();
}
}
}
`
Josh