Hi,
With the new version of catads (1.4) (
here), the waiting module doesn't display the waiting ads.
Please change the file catads.php on modules\waiting\plugins
<?php
function b_waiting_catads(){
$xoopsDB =& Database::getInstance();
$block = array();
$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("catads_ads")." WHERE waiting ='1'");
if ( $result ) {
$block['adminlink'] = XOOPS_URL."/modules/catads/admin/index.php";
list($block['pendingnum']) = $xoopsDB->fetchRow($result);
$block['lang_linkname'] = _PI_WAITING_SUBMITTED ;
}
return $block;
}
?>
or with a better code :
<?php
function b_waiting_catads(){
$block = array();
$ads_hnd =& xoops_getmodulehandler('ads', 'catads');
$criteria = new Criteria('waiting', '1', '=');
$nbads = $ads_hnd->getCount($criteria);
if ( $nbads > 0 ) {
$block['adminlink'] = XOOPS_URL."/modules/catads/admin/index.php?action=waiting";
$block['pendingnum'] = $nbads;
$block['lang_linkname'] = _PI_WAITING_WAITINGS ;
}
return $block;
}
?>
Then, i've a suggestion for the bloc (more readable) with this code (waiting_block_waiting.html in templates) :
<{foreach item=module from=$block.modules}>
<b><{$module.name}></b>
<ul>
<{foreach item=pending from=$module.pending}>
<li>
<a href="<{$pending.adminlink}>"><{$pending.lang_linkname}></a> :
<{if $pending.pendingnum}>
<font color=red><b><{$pending.pendingnum}></b></font>
<{else}>
<{$pending.pendingnum}>
<{/if}>
</li>
<{/foreach}>
</ul>
<hr />
<{/foreach}>
- number of waitings in red and bold font
- separate line after each modules
hi alain.
Thank you for telling me information.
If you can contact to the author of catads, tell him/her to add include/waiting.plugin.php.
This is a module's side plugin, and it have major priority than plugin in waiting.
Anyway, I've just modified a plugin for catads as your second code, though I don't thik using XoopsObject is better way.
Quote:
Then, i've a suggestion for the bloc (more readable) with this code (waiting_block_waiting.html in templates) :
Thanks.
But, I think that adding <hr /> is just "LIKES and DISLIKES" about designs.
Another suggestions will be adopted in next release.