1
jfebus
HELP!! HELP!!! Adding a new block to wfsections!
  • 2004/9/9 16:19

  • jfebus

  • Just popping in

  • Posts: 97

  • Since: 2004/9/1 1


Hi All,

I wanted to have a block that will show articules in random order, so I try to do it myself!

As you can imagine I am having a problem!

I did the following changes:

xoops_version.pgp
le="color: #000000"><?php $modversion['blocks'][10]['file'] = "wfs_random.php"; $modversion['blocks'][10]['name'] = "random"; $modversion['blocks'][10]['description'] = "Shows random articles"; $modversion['blocks'][10]['show_func'] = "b_wfs_random_show"; $modversion['blocks'][10]['edit_func'] = "b_wfs_random_edit"; $modversion['blocks'][10]['options'] = "published|10|19|1|1|1|1|100"; $modversion['blocks'][10]['template'] = 'wfs_block_random.html';


copied wfs_new.php into wfs_random.php
and change the sql statement
le="color: #000000"><?php function b_wfs_random_show($options) { global $xoopsDB, $xoopsModuleConfig, $wfsPathConfig; $modhandler = &xoops_gethandler('module'); $xoopsModule = &$modhandler->getByDirname(WFSECTION); $config_handler = &xoops_gethandler('config'); $xoopsModuleConfig = &$config_handler->getConfigsByCat(0, $xoopsModule->getVar('mid')); $myts = &MyTextSanitizer::getInstance(); $block = array(); $sql = "SELECT articleid, title, published, expired, counter, groupid, articleimg, url, summary FROM " . $xoopsDB->prefix(WFS_ARTICLE_DB) . " WHERE published < " . time() . " AND published > 0 AND noshowart = 0 AND offline = 0 ORDER BY RAND() LIMIT 10";


copied the file wfs_block_new.html into wfs_block_random.html without any changes.

then I update the module, got the ramdom block in the admin block area, gave all the groups access to it, but it still doesn't appears!

any idea?

Best Regards


2
jfebus
Re: Adding a new block to wfsections!
  • 2004/9/9 19:23

  • jfebus

  • Just popping in

  • Posts: 97

  • Since: 2004/9/1 1


Is there any other place I must declare a new block?

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits