8
Hi Giba,
The project is not yet completely finished. @Alfred builds still blocks for the footer area in simple XOOPS (as with XOOPS 2.0.16). Preview gives it here:
http://scrumeducations.sprint-it.comClones of a block is very simple. For example - Provide from a comment block:
Edit your /modules/system/xoops_version.php
copy the line (164-170 ???)
Quote:
$modversion['blocks'][10]['file'] = "system_blocks.php";
$modversion['blocks'][10]['name'] = _MI_SYSTEM_BNAME11;
$modversion['blocks'][10]['description'] = "Shows most recent comments";
$modversion['blocks'][10]['show_func'] = "b_system_comments_show";
$modversion['blocks'][10]['options'] = "10";
$modversion['blocks'][10]['edit_func'] = "b_system_comments_edit";
$modversion['blocks'][10]['template'] = 'system_block_comments.html';
search the latest blocknumber (ex. 13)
add the same with new blocknumber and rename the blockname: ex.
Quote:
$modversion['blocks'][14]['file'] = "system_blocks.php";
$modversion['blocks'][14]['name'] = _MI_SYSTEM_BNAME11;
$modversion['blocks'][14]['description'] = "Shows most recent comments";
$modversion['blocks'][14]['show_func'] = "b_system_comments_show";
$modversion['blocks'][14]['options'] = "10";
$modversion['blocks'][14]['edit_func'] = "b_system_comments_edit";
$modversion['blocks'][14]['template'] = 'system_block_comments_block_number_two.html';
add a new template with the new blockname: system_block_comments_block_number_two.html
copy this files via FTP and update the system modul, now you have a new template. If you have a klon of you template, then you can change the code of from the block system_block_comments_block_number_two
Very Easy.
And in this block im have now more extensions to show in this block. (Thanks to Rodrigo!)
Edit the modules/system/block/system_blocks.php and change the "function b_system_comments_show" to:
Quote:
.
.
.
foreach (array_keys($comments) as $i) {
$mid = $comments[$i]->getVar('com_modid');
$com['module'] = ''.$modules[$mid]->getVar('name').'';
if (!isset($comment_config[$mid])) {
$comment_config[$mid] = $modules[$mid]->getInfo('comments');
}
$com['id'] = $i;
$com['title'] = ''.$comments[$i]->getVar('com_title').'';
$com['text'] = $comments[$i]->getVar('com_text');
$com['icon'] = htmlspecialchars( $comments[$i]->getVar('com_icon'), ENT_QUOTES );
$com['icon'] = ($com['icon'] != '') ? "subject/".$com['icon'] : 'subject/icon1.gif';
$com['time'] = formatTimestamp($comments[$i]->getVar('com_created'),'m');
$com['link'] = '[de]Mehr[/de][en]More[/en]...';
if ($comments[$i]->getVar('com_uid') > 0) {
$com['poster'] = array();
$poster =& $member_handler->getUser($comments[$i]->getVar('com_uid'));
if (is_object($poster)) {
$com['poster']['link'] = ''.$poster->getVar('uname').'';
$com['poster']['id'] = $comments[$i]->getVar('com_uid');
$com['poster']['uname'] = $poster->getVar('uname');
$com['poster']['avatar'] = '';
} else {
$com['poster']['link'] = $GLOBALS['xoopsConfig']['anonymous'];
}
} else {
$com['poster']['link'] = $GLOBALS['xoopsConfig']['anonymous'];
}
$block['comments'][] =& $com;
unset($com);
}
.
.
.
Now you can add in your templtes:
< {$comment.poster.link}>
< {$comment.poster.uid}>
< {$comment.poster.uname}>
< {$comment.poster.avatar}>
< {$comment.text}>
< {$comment.link}>