function q_view_clear() { // call default method output qa_html_theme_base::q_view_clear(); // return if not admin! if (qa_get_logged_in_level() < QA_USER_LEVEL_ADMIN) { return; } // check if question is duplicate $closed = @$this->content['q_view']['raw']['closedbyid'] !== null; if ($closed) { // check if duplicate $duplicate = qa_db_read_one_value(qa_db_query_sub('SELECT postid FROM `^posts` WHERE `postid` = # AND `type` = "Q" ;', $this->content['q_view']['raw']['closedbyid']), true); if ($duplicate) { $this->output('<div id="mergeDup" style="margin:10px 0 0 120px;padding:5px 10px;background:#FCC;border:1px solid #AAA;"><h3>Merge Duplicate:</h3>'); // form output $this->output(' <FORM METHOD="POST"> <TABLE> <TR> <TD CLASS="qa-form-tall-label"> From: <INPUT NAME="merge_from" id="merge_from" TYPE="text" VALUE="' . $this->content['q_view']['raw']['postid'] . '" CLASS="qa-form-tall-number"> To: <INPUT NAME="merge_to" id="merge_to" TYPE="text" VALUE="' . $this->content['q_view']['raw']['closedbyid'] . '" CLASS="qa-form-tall-number"> </TD> </TR> <TR> <TD CLASS="qa-form-tall-label"> Text to show when redirecting from merged question: </TD> </TR> <TR> <TD CLASS="qa-form-tall-label"> <INPUT NAME="merge_question_merged" id="merge_question_merged" TYPE="text" VALUE="' . qa_opt('merge_question_merged') . '" CLASS="qa-form-tall-text"> </TD> </TR> <TR> <TD style="text-align:right;"> <INPUT NAME="merge_question_process" VALUE="Merge" TITLE="" TYPE="submit" CLASS="qa-form-tall-button qa-form-tall-button-0"> </TD> </TR> </TABLE> </FORM> '); $this->output('</div>'); } } }
function page_title_error() { if ($this->template == 'question' or $this->template == 'ask') { $this->output('<h1>'); $this->title(); $this->output('</h1>'); if (isset($this->content['error'])) { $this->error(@$this->content['error']); } } elseif ($this->template == 'tag' or $this->template == 'questions') { // fill array with breadcrumb fields and show them $bc = array(); // breadcrumb $bc[0]['title'] = qa_opt('site_title'); $bc[0]['content'] = '<i class="fa fa-home"></i>'; $bc[0]['url'] = qa_opt('site_url'); if ($this->template == 'tag') { $bc[1]['title'] = 'Tags'; $bc[1]['content'] = 'Tags'; $bc[1]['url'] = qa_path_html('tags'); $req = explode('/', $this->request); $tag = $req[count($req) - 1]; $bc[2]['title'] = $tag; $bc[2]['content'] = 'Tag "' . $tag . '"'; $bc[2]['url'] = qa_path_html($this->request, null, null, null, null); } elseif ($this->template == 'questions') { $req = explode('/', $this->request); $cat = $req[count($req) - 1]; if (count($req) > 1) { $category_name = $this->content["q_list"]["qs"][0]["raw"]["categoryname"]; $bc[1]['title'] = 'Categories'; $bc[1]['content'] = 'Categories'; $bc[1]['url'] = qa_path_html('categories'); $bc[2]['title'] = $category_name; $bc[2]['content'] = $category_name; $bc[2]['url'] = qa_path_html($this->request, null, null, null, null); } else { unset($bc); } } if (isset($bc)) { $this->output('<div class="header-buttons btn-group btn-breadcrumb pull-left">'); foreach ($bc as $item) { $this->output(' <a href="' . $item['url'] . '" title="' . $item['title'] . '" class="btn btn-default">' . $item['content'] . '</a>'); } $this->output('</div>'); } } else { qa_html_theme_base::page_title_error(); } if ($this->template == 'admin' or $this->template == 'users' or $this->template == 'user' or qa_opt('it_nav_type') == 'standard') { $this->show_nav('sub', 'nav navbar-nav sub-navbar pull-right'); } qa_html_theme_base::q_view_clear(); }