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
$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
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