menu->params); $template = $params->get('template'); if (!isset($id)) { $id = $params->get('default_section'); } if (!$id) { trigger_error('Failed get id', E_USER_WARNING); mosNotAuth(); return; } global $database; $section = new mosSection($database); if (preg_match('/^[1-9][0-9]*$/', $id)) { /* * 数値ならばセクションID として利用 */ $id = (int) $id; $result = $section->load($id); } else { /* * 数値以外ならばセクション名として利用 */ $quoted_name_column = $database->NameQuote('name'); $quoted_name = $database->Quote($id); $query = <<<__PHP__ SELECT * FROM #__sections WHERE {$quoted_name_column} = {$quoted_name} __PHP__; $database->setQuery($query); $result = $database->loadObject($section); } if (!$result) { trigger_error("Unknown section: {$id}", E_USER_WARNING); mosNotAuth(); return; } $id = (int) $section->id; $access = (int) $section->access; if ($access > $gid) { trigger_error("User can not access section: {$id}", E_USER_WARNING); mosNotAuth(); return; } $unpublish = $params->get('unpublish'); if (!$unpublish && !$section->published) { trigger_error("Section unpublish: {$id}", E_USER_NOTICE); mosNotAuth(); return; } if ($params->get('section_page_title')) { $mainframe->setPageTitle($section->title); } else if ($params->get('menu_page_title')) { $mainframe->setPageTitle($mainframe->menu->name); } if ($constant = $params->get('view_id_constant_name')) { define($constant, $id); } $template_resource = $params->get('template_resource'); if ($template_resource === 'file') { global $mosConfig_absolute_path; $template = "{$mosConfig_absolute_path}/{$template}"; if (!is_file($template)) { trigger_error("Failed get template: {$template}", E_USER_NOTICE); mosNotAuth(); return; } $template = file_get_contents($template); } else { $template_content = new mosContent($database); $result = $template_content->load($template); if (!$result) { trigger_error("Failed get template content: {$template}", E_USER_NOTICE); mosNotAuth(); return; } $template_content->text = $template_content->introtext; $template_content_params = new mosParameters("introtext=1\nintro_only=0"); $template_content_params->set('image', true); global $_MAMBOTS; $_MAMBOTS->loadBotGroup( 'content' ); $results = botMosImage( true, $template_content, $template_content_params ); $template = $template_content->text; } require_once $mainframe->getPath('front_html', $option); $html = new HTML_kingyoya_section_view(); $html->option = $option; $html->id = $id; $Itemid and $html->Itemid = $Itemid; $html->section = $section; $html->section = $section; $html->template = $template; $html->show(); } } if ($option === 'com_kingyoya_section_view') { TASK_kingyoya_section_view::show($option, $gid, isset($_REQUEST['id']) ? $_REQUEST['id'] : null, $Itemid); }