1
I am trying hard to make a new block for yogurt displaying recently created groups based on Last pictures block.
So far I have done:
yogurt/xoops_version.php
added before ?>
$modversion['blocks'][3]['file'] = "blocks.php";
$modversion['blocks'][3]['name'] = _MI_TRIBES_LAST;
$modversion['blocks'][3]['description'] = _MI_TRIBES_LAST_DESC;
$modversion['blocks'][3]['show_func'] = "b_yogurt_tribes_show";
$modversion['blocks'][3]['options'] = "5";
$modversion['blocks'][3]['template'] = 'yogurt_block_lasttribes.html';
Then i created a file
yogurt/block/templates/yogurt_block_lasttribes.html
and writed this inside:
<{section name=j loop=$tribes}>
<div style="width:80%; text-align: center; page-break-after: always; margin: auto; page-break-before: always;">
<a href="{$xoops_url}>/modules/yogurt/tribes.php?tribe_id=<{$tribes[j].id}>"><img src="<{$xoops_upload_url}>/<{$tribes[j].img}>" alt="<{$tribes[j].title}>" title="<{$tribes[j].title}>" />a>
div>
<{/section}>
and in the file
yogurt/blocks.php
I tried to create function function b_yogurt_lasttribes_show but it looks there is something wrong with this:
function b_yogurt_lasttribes_show($options) {
global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
$myts =& MyTextSanitizer::getInstance();
$block = array();
/**
* Filter for fetch votes ishot and isnothot
*/
$criteria = new criteria('tribe_id',0,">");
$criteria->setSort("tribe_id");
$criteria->setOrder("DESC");
$criteria->setLimit($options[0]);
/**
* Creating factories of tribes and votes
*/
//$album_factory = new Xoopsyogurt_imagesHandler($xoopsDB);
$tribes_factory = new Xoopsyogurt_tribesHandler($xoopsDB);
$block = $tribes_factory->getLastTribesForBlock($options[0]);
return $block;
}
Anyone could test it and finish this job? This is what I can do by myself to contribute but the rest is in your hands.
best