function d3forum_display_comment($mydirname, $forum_id, $params) { global $xoopsUser, $xoopsConfig, $xoopsModule; // check the d3forum exists and is active $module_hanlder =& xoops_gethandler('module'); $module =& $module_hanlder->getByDirname($mydirname); if (!is_object($module) || !$module->getVar('isactive')) { return; } // check permission of "module_read" $moduleperm_handler =& xoops_gethandler('groupperm'); $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS); if (!$moduleperm_handler->checkRight('module_read', $module->getVar('mid'), $groups)) { return; } // subject_raw $params['subject_raw'] = empty($params['subject_escaped']) ? @$params['subject'] : d3forum_common_unhtmlspecialchars(@$params['subject']); // read d3comment class and make the object // for using d3forum_comment plugin with d3com class if (!empty($params['class'])) { $class_name = preg_replace('/[^0-9a-zA-Z_]/', '', $params['class']); $external_dirname = @$params['mydirname']; $external_trustdirname = @$params['mytrustdirname']; // auto external_dirname if ($external_dirname == '' && is_object($GLOBALS['xoopsModule'])) { $external_dirname = $GLOBALS['xoopsModule']->getVar('dirname'); } // naao from require_once dirname(dirname(__FILE__)) . '/class/D3commentObj.class.php'; // search and include the class file if ($external_trustdirname && file_exists(XOOPS_TRUST_PATH . "/modules/{$external_trustdirname}/class/{$class_name}.class.php")) { require_once XOOPS_TRUST_PATH . "/modules/{$external_trustdirname}/class/{$class_name}.class.php"; } else { if ($external_dirname && file_exists(XOOPS_ROOT_PATH . "/modules/{$external_dirname}/class/{$class_name}.class.php")) { require_once XOOPS_ROOT_PATH . "/modules/{$external_dirname}/class/{$class_name}.class.php"; } else { include_once dirname(dirname(__FILE__)) . "/class/{$class_name}.class.php"; $external_dirname = ''; $external_trustdirname = ''; } } $m_params['forum_dirname'] = $mydirname; $m_params['external_dirname'] = $external_dirname; $m_params['class_name'] = $class_name; $m_params['external_trustdirname'] = $external_trustdirname; if (class_exists($class_name)) { $obj =& D3commentObj::getInstance($m_params); $external_link_id = $obj->d3comObj->external_link_id($params); } // naao to } // for conventional module if (!is_object($obj->d3comObj)) { if (!empty($params['itemname'])) { $external_link_id = @$_GET[$params['itemname']]; if (empty($external_link_id)) { return; } } else { echo "set valid itemname or class in <{d3forum_comment}> of the template"; return; } } $params['external_link_id'] = $external_link_id; $params['external_dirname'] = $external_dirname; $params['external_trustdirname'] = $external_trustdirname; $smarty = null; d3forum_render_comments($mydirname, $forum_id, $params, $smarty); }
} else { $allow_notify = false; $notify = 0; } } else { $allow_sig = false; $attachsig = 0; $allow_notify = false; $notify = 0; } // solved changeable? if (!empty($xoopsModuleConfig['use_solved']) && $isadminormod) { $can_change_solved = true; } else { $can_change_solved = false; } // form elements or javascripts for anti-SPAM if (d3forum_common_is_necessary_antispam($xoopsUser, $xoopsModuleConfig)) { $antispam_obj =& d3forum_common_get_antispam_object($xoopsModuleConfig); $antispam4assign = $antispam_obj->getHtml4Assign(); } else { $antispam4assign = array(); } // WYSIWYG (some editor needs global scope ... orz) $d3forum_wysiwygs = array('name' => 'message', 'value' => d3forum_common_unhtmlspecialchars($message4html)); include dirname(dirname(__FILE__)) . '/include/wysiwyg_editors.inc.php'; // dare to set 'template_main' after header.php (for disabling cache) include XOOPS_ROOT_PATH . '/header.php'; $xoopsOption['template_main'] = $mydirname . '_main_post_form.html'; $xoopsTpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'mode' => $mode, 'ispreview' => intval(@$ispreview), 'formtitle' => $formTitle, 'uid' => $uid, 'uname' => $uid ? $xoopsUser->getVar('uname') : @$guest_name4html, 'guest_name' => @$guest_name4html, 'guest_email' => @$guest_email4html, 'guest_url' => @$guest_url4html, 'guest_pass' => @$guest_pass4html, 'subject' => @$subject4html, 'message' => @$message4html, 'reference_quote' => @$quote4html, 'reference_subject' => @$reference_subject4html, 'reference_message' => @$reference_message4html, 'reference_name' => @$reference_name4html, 'reference_time' => @$reference_time, 'reference_time_formatted' => formatTimestamp(@$reference_time, 'm'), 'preview_subject' => @$preview_subject4html, 'preview_message' => @$preview_message4html, 'icon_options' => $d3forum_icon_meanings, 'icon_selected' => intval(@$icon), 'pid' => $pid, 'post_id' => $post_id, 'topic_id' => $topic_id, 'forum_id' => $forum_id, 'external_link_id' => @$external_link_id, 'can_change_solved' => $can_change_solved, 'solved' => $solved, 'solved_checked' => $solved ? 'checked="checked"' : '', 'allow_mark' => @$xoopsModuleConfig['allow_mark'], 'u2t_marked' => intval(@$u2t_marked), 'u2t_marked_checked' => @$u2t_marked ? 'checked="checked"' : '', 'allow_hideuid' => @$xoopsModuleConfig['allow_hideuid'] && $uid, 'hide_uid' => intval(@$hide_uid), 'hide_uid_checked' => @$hide_uid ? 'checked="checked"' : '', 'invisible' => intval(@$invisible), 'invisible_checked' => @$invisible ? 'checked="checked"' : '', 'approval' => intval(@$approval), 'approval_checked' => @$approval ? 'checked="checked"' : '', 'smiley' => $smiley, 'smiley_checked' => $smiley ? 'checked="checked"' : '', 'xcode' => $xcode, 'xcode_checked' => $xcode ? 'checked="checked"' : '', 'br' => $br, 'br_checked' => $br ? 'checked="checked"' : '', 'number_entity' => $number_entity, 'number_entity_checked' => $number_entity ? 'checked="checked"' : '', 'special_entity' => $special_entity, 'special_entity_checked' => $special_entity ? 'checked="checked"' : '', 'allow_sig' => $allow_sig, 'attachsig' => $attachsig, 'attachsig_checked' => $attachsig ? 'checked="checked"' : '', 'allow_notify' => $allow_notify, 'notify' => $notify, 'notify_checked' => $notify ? 'checked="checked"' : '', 'allow_html' => $allow_html, 'html' => $html, 'html_checked' => $html ? 'checked="checked"' : '', 'category' => $category4assign, 'forum' => $forum4assign, 'topic' => @$topic4assign, 'post' => $mode == 'edit' ? @$post4assign : array(), 'body_wysiwyg' => $d3forum_wysiwyg_body, 'antispam' => $antispam4assign, 'xoops_module_header' => "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"" . str_replace('{mod_url}', XOOPS_URL . '/modules/' . $mydirname, $xoopsModuleConfig['css_uri']) . "\" />" . $xoopsTpl->get_template_vars("xoops_module_header") . "\n" . $d3forum_wysiwyg_header, 'xoops_pagetitle' => $formTitle, 'xoops_breadcrumbs' => array_merge($xoops_breadcrumbs, array(array('name' => $formTitle))))); include XOOPS_ROOT_PATH . '/footer.php';