I only miss one thing - Printer Friendly option.
Could someone guide me how to implement that into the module?
I tried to do it myself but I need help. I believe two files have to be hardcoded. First, in the index.php, an additional line has to be added. If we take an example from TINYEVENT module, where this line enables the printer friendly function:
The second change is creating a printer.php file, or adding a print function into the index.php file, just like in the TINYEVENT module.
TINYCONTENT, however, has a different structure, and I don't know how to do all that. Here's the index.php file of the module:
include "../../mainfile.php";
if ( file_exists("language/".$xoopsConfig['language']."/modinfo.php") ) {
include("language/".$xoopsConfig['language']."/modinfo.php");
} else {
include("language/english/modinfo.php");
}
$id = isset($HTTP_GET_VARS['id']) ? intval($HTTP_GET_VARS['id']) : 0;
if ($id != 0) {
$result = $xoopsDB->queryF("SELECT storyid, title, text, visible, nohtml, nosmiley, nobreaks, nocomments, link, address FROM ".$xoopsDB->prefix(_MI_TINYCONTENT_PREFIX)." WHERE storyid=$id");
}
else {
$result = $xoopsDB->queryF("SELECT storyid FROM ".$xoopsDB->prefix(_MI_TINYCONTENT_PREFIX)." WHERE homepage=1");
list($storyid) = $xoopsDB->fetchRow($result);
header("Location: $PHP_SELF?id=$storyid");
}
include_once XOOPS_ROOT_PATH.'/header.php';
list($storyid,$title,$text,$visible,$nohtml,$nosmiley,$nobreaks,$nocomments,$link,$address) = $xoopsDB->fetchRow($result);
if ($link == 1) {
// include external content
$includeContent = XOOPS_ROOT_PATH."/modules/"._MI_DIR_NAME."/content/".$address;
if (file_exists($includeContent)){
$xoopsOption['template_main'] = 'tc_index.html';
ob_start();
include($includeContent);
$content = ob_get_contents();
ob_end_clean();
//$content = include($includeContent);
$xoopsTpl->assign('title', $title);
$xoopsTpl->assign('content', $content);
$xoopsTpl->assign('nocomments', $nocomments);
}
else{
redirect_header("index.php",1,_TC_FILENOTFOUND);
}
}
else {
// tiny content
$xoopsOption['template_main'] = 'tc_index.html';
if ($nohtml == 1) { $html = 0; } else { $html = 1; }
if ($nosmiley == 1) { $smiley = 0; } else { $smiley = 1; }
if ($nobreaks == 1) { $breaks = 0; } else { $breaks = 1; }
$myts =& MyTextSanitizer::getInstance();
$text=$myts->displayTarea($text, $html, $smiley, 1, 1, $breaks);
$xoopsTpl->assign('title', $title);
$xoopsTpl->assign('content', $text);
$xoopsTpl->assign('nocomments', $nocomments);
}
include XOOPS_ROOT_PATH.'/include/comment_view.php';
include_once XOOPS_ROOT_PATH.'/footer.php';
I could certainly use some advice. Please offer your thoughts; I'm sure many of you know how to fix that with no sweat.