I lost comment count after upgrading to 1.75 from MyAlbum 1.1.3. Comments are displayed properly, but displayed number of comments is 0.
Kaper
hmmm.
Since it's a very old issue for me, I've already forgot compatiblities about daniel's myalbum.
But you can repair comment count easily.
Put this script named 'comment_repair.php' in your XOOPS_ROOT_PATH.
Access "XOOPS_URL/comment_repair.php".
That's all.
<?php
include 'mainfile.php';
echo '<html><head><title></title></head><body>';
if (isset($HTTP_POST_VARS['submit'])) {
$module_handler =& xoops_gethandler("module");
$module =& $module_handler->getByDirname("myalbum");
$mid = $module->getVar('mid') ;
$result = $xoopsDB->query( "SELECT lid FROM ".$xoopsDB->prefix("myalbum_photos") ) ;
while( list( $lid ) = $xoopsDB->fetchRow( $result ) ) {
$comments = xoops_comment_count( $mid , $lid ) ;
echo "$lid: $comments <br />\n" ;
if( $comments > 0 ) {
$xoopsDB->query( "UPDATE ".$xoopsDB->prefix("myalbum_photos")." SET comments='$comments' WHERE lid='$lid'" ) ;
}
}
} else {
echo '
<form action="" method="post">
<input type="submit" name="submit" value="Repair it" />
</form>';
}
echo '</body></html>';
?>
So easy... thanks
Why don't you add this tool to the package and mention it in INSTALL?
And I'd add some description to the displayed page - a message like "MyAlbum-P Comment Count Update Tool" and button description like "Update CommentCount".
Kaper