PEAK XOOPS - waiting module : modif for the news version of catads (1.4) in englishin japanese

waiting module : modif for the news version of catads (1.4)

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 | Posted on 2005/8/2 0:00
alain01  Private From: FRANCE  Posts: 10
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
Votes:6 Average:10.00
Previous post - Next post | Parent - No child | Posted on 2005/8/6 17:01
GIJOE  Gunnery Sergeant   Posts: 4110
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.

Votes:0 Average:0.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!