本文整理汇总了PHP中qa_html_theme_base::doctype方法的典型用法代码示例。如果您正苦于以下问题:PHP qa_html_theme_base::doctype方法的具体用法?PHP qa_html_theme_base::doctype怎么用?PHP qa_html_theme_base::doctype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qa_html_theme_base
的用法示例。
在下文中一共展示了qa_html_theme_base::doctype方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doctype
function doctype()
{
if (qa_opt('embed_smileys')) {
$this->smilies = array('(finger)' => array('name' => 'Finger', 'static' => 'images/emoticon-00173-middlefinger.png', 'animated' => 'images/emoticon-00173-middlefinger.gif'), '(bandit)' => array('name' => 'Bandit', 'static' => 'images/emoticon-00174-bandit.png', 'animated' => 'images/emoticon-00174-bandit.gif'), '(drunk)' => array('name' => 'Drunk', 'static' => 'images/emoticon-00175-drunk.png', 'animated' => 'images/emoticon-00175-drunk.gif'), '(smoking)' => array('name' => 'Smoking', 'static' => 'images/emoticon-00176-smoke.png', 'animated' => 'images/emoticon-00176-smoke.gif'), '(toivo)' => array('name' => 'Toivo', 'static' => 'images/emoticon-00177-toivo.png', 'animated' => 'images/emoticon-00177-toivo.gif'), '(rock)' => array('name' => 'Rock', 'static' => 'images/emoticon-00178-rock.png', 'animated' => 'images/emoticon-00178-rock.gif'), '(headbang)' => array('name' => 'Headbang', 'static' => 'images/emoticon-00179-headbang.png', 'animated' => 'images/emoticon-00179-headbang.gif'), '(bug)' => array('name' => 'Bug', 'static' => 'images/emoticon-00180-bug.png', 'animated' => 'images/emoticon-00180-bug.gif'), '(fubar)' => array('name' => 'Fubar', 'static' => 'images/emoticon-00181-fubar.png', 'animated' => 'images/emoticon-00181-fubar.gif'), '(poolparty)' => array('name' => 'Poolparty', 'static' => 'images/emoticon-00182-poolparty.png', 'animated' => 'images/emoticon-00182-poolparty.gif'), '(swear)' => array('name' => 'Swearing', 'static' => 'images/emoticon-00183-swear.png', 'animated' => 'images/emoticon-00183-swear.gif'), '(tmi)' => array('name' => 'TMI', 'static' => 'images/emoticon-00184-tmi.png', 'animated' => 'images/emoticon-00184-tmi.gif'), '(heidy)' => array('name' => 'Heidy', 'static' => 'images/emoticon-00185-heidy.png', 'animated' => 'images/emoticon-00185-heidy.gif'), '(mooning)' => array('name' => 'Mooning', 'static' => 'images/emoticon-00172-mooning.png', 'animated' => 'images/emoticon-00172-mooning.gif'), '(highfive)' => array('name' => 'High Five', 'static' => 'images/highfive.png', 'animated' => 'images/highfive.png'), '(facepalm)' => array('name' => 'Face Palm', 'static' => 'images/facepalm.png', 'animated' => 'images/facepalm.png'), '(fingers)' => array('name' => 'Fingers Crossed', 'static' => 'images/fingerscrossed.png', 'animated' => 'images/fingerscrossed.png'), '(lalala)' => array('name' => 'Lalala', 'static' => 'images/lalala.png', 'animated' => 'images/lalala.png'), '(waiting)' => array('name' => 'Waiting', 'static' => 'images/waiting.png', 'animated' => 'images/waiting.png'), '(tumbleweed)' => array('name' => 'Tumbleweed', 'static' => 'images/tumbleweed.png', 'animated' => 'images/tumbleweed.png'), '(wfh)' => array('name' => 'Working From Home', 'static' => 'images/wfh.png', 'animated' => 'images/wfh.png'), ':)' => array('name' => 'Smile', 'static' => 'images/emoticon-00100-smile.png', 'animated' => 'images/emoticon-00100-smile.gif'), ':(' => array('name' => 'Sad Smile', 'static' => 'images/emoticon-00101-sadsmile.png', 'animated' => 'images/emoticon-00101-sadsmile.gif'), ':D' => array('name' => 'Big Smile', 'static' => 'images/emoticon-00102-bigsmile.png', 'animated' => 'images/emoticon-00102-bigsmile.gif'), '8-)' => array('name' => 'Cool', 'static' => 'images/emoticon-00103-cool.png', 'animated' => 'images/emoticon-00103-cool.gif'), ':o' => array('name' => 'Wink', 'static' => 'images/emoticon-00105-wink.png', 'animated' => 'images/emoticon-00105-wink.gif'), ';(' => array('name' => 'Crying', 'static' => 'images/emoticon-00106-crying.png', 'animated' => 'images/emoticon-00106-crying.gif'), '(sweat)' => array('name' => 'Sweating', 'static' => 'images/emoticon-00107-sweating.png', 'animated' => 'images/emoticon-00107-sweating.gif'), ':|' => array('name' => 'Speechless', 'static' => 'images/emoticon-00108-speechless.png', 'animated' => 'images/emoticon-00108-speechless.gif'), ':*' => array('name' => 'Kiss', 'static' => 'images/emoticon-00109-kiss.png', 'animated' => 'images/emoticon-00109-kiss.gif'), ':P' => array('name' => 'Tongue Out', 'static' => 'images/emoticon-00110-tongueout.png', 'animated' => 'images/emoticon-00110-tongueout.gif'), '(blush)' => array('name' => 'Blush', 'static' => 'images/emoticon-00111-blush.png', 'animated' => 'images/emoticon-00111-blush.gif'), ':^)' => array('name' => 'Wondering', 'static' => 'images/emoticon-00112-wondering.png', 'animated' => 'images/emoticon-00112-wondering.gif'), '|-)' => array('name' => 'Sleepy', 'static' => 'images/emoticon-00113-sleepy.png', 'animated' => 'images/emoticon-00113-sleepy.gif'), '|(' => array('name' => 'Dull', 'static' => 'images/emoticon-00114-dull.png', 'animated' => 'images/emoticon-00114-dull.gif'), '(inlove)' => array('name' => 'In love', 'static' => 'images/emoticon-00115-inlove.png', 'animated' => 'images/emoticon-00115-inlove.gif'), ']:)' => array('name' => 'Evil grin', 'static' => 'images/emoticon-00116-evilgrin.png', 'animated' => 'images/emoticon-00116-evilgrin.gif'), '(talk)' => array('name' => 'Talking', 'static' => 'images/emoticon-00117-talking.png', 'animated' => 'images/emoticon-00117-talking.gif'), '(yawn)' => array('name' => 'Yawn', 'static' => 'images/emoticon-00118-yawn.png', 'animated' => 'images/emoticon-00118-yawn.gif'), '(puke)' => array('name' => 'Puke', 'static' => 'images/emoticon-00119-puke.png', 'animated' => 'images/emoticon-00119-puke.gif'), '(doh)' => array('name' => 'Doh!', 'static' => 'images/emoticon-00120-doh.png', 'animated' => 'images/emoticon-00120-doh.gif'), ':@' => array('name' => 'Angry', 'static' => 'images/emoticon-00121-angry.png', 'animated' => 'images/emoticon-00121-angry.gif'), '(wasntme)' => array('name' => 'It wasn\'t me', 'static' => 'images/emoticon-00122-itwasntme.png', 'animated' => 'images/emoticon-00122-itwasntme.gif'), '(party)' => array('name' => 'Party!!!', 'static' => 'images/emoticon-00123-party.png', 'animated' => 'images/emoticon-00123-party.gif'), ':S' => array('name' => 'Worried', 'static' => 'images/emoticon-00124-worried.png', 'animated' => 'images/emoticon-00124-worried.gif'), '(mm)' => array('name' => 'Mmm...', 'static' => 'images/emoticon-00125-mmm.png', 'animated' => 'images/emoticon-00125-mmm.gif'), '8-|' => array('name' => 'Nerd', 'static' => 'images/emoticon-00126-nerd.png', 'animated' => 'images/emoticon-00126-nerd.gif'), ':x' => array('name' => 'Lips Sealed', 'static' => 'images/emoticon-00127-lipssealed.png', 'animated' => 'images/emoticon-00127-lipssealed.gif'), '(hi)' => array('name' => 'Hi', 'static' => 'images/emoticon-00128-hi.png', 'animated' => 'images/emoticon-00128-hi.gif'), '(call)' => array('name' => 'Call', 'static' => 'images/emoticon-00129-call.png', 'animated' => 'images/emoticon-00129-call.gif'), '(devil)' => array('name' => 'Devil', 'static' => 'images/emoticon-00130-devil.png', 'animated' => 'images/emoticon-00130-devil.gif'), '(angel)' => array('name' => 'Angel', 'static' => 'images/emoticon-00131-angel.png', 'animated' => 'images/emoticon-00131-angel.gif'), '(envy)' => array('name' => 'Envy', 'static' => 'images/emoticon-00132-envy.png', 'animated' => 'images/emoticon-00132-envy.gif'), '(wait)' => array('name' => 'Wait', 'static' => 'images/emoticon-00133-wait.png', 'animated' => 'images/emoticon-00133-wait.gif'), '(bear)' => array('name' => 'Bear', 'static' => 'images/emoticon-00134-bear.png', 'animated' => 'images/emoticon-00134-bear.gif'), '(makeup)' => array('name' => 'Make-up', 'static' => 'images/emoticon-00135-makeup.png', 'animated' => 'images/emoticon-00135-makeup.gif'), '(giggle)' => array('name' => 'Covered Laugh', 'static' => 'images/emoticon-00136-giggle.png', 'animated' => 'images/emoticon-00136-giggle.gif'), '(clap)' => array('name' => 'Clapping Hands', 'static' => 'images/emoticon-00137-clapping.png', 'animated' => 'images/emoticon-00137-clapping.gif'), '(think)' => array('name' => 'Thinking', 'static' => 'images/emoticon-00138-thinking.png', 'animated' => 'images/emoticon-00138-thinking.gif'), '(bow)' => array('name' => 'Bow', 'static' => 'images/emoticon-00139-bow.png', 'animated' => 'images/emoticon-00139-bow.gif'), '(rofl)' => array('name' => 'Rolling on the floor laughing', 'static' => 'images/emoticon-00140-rofl.png', 'animated' => 'images/emoticon-00140-rofl.gif'), '(whew)' => array('name' => 'Whew', 'static' => 'images/emoticon-00141-whew.png', 'animated' => 'images/emoticon-00141-whew.gif'), '(happy)' => array('name' => 'Happy', 'static' => 'images/emoticon-00142-happy.png', 'animated' => 'images/emoticon-00142-happy.gif'), '(smirk)' => array('name' => 'Smirking', 'static' => 'images/emoticon-00143-smirk.png', 'animated' => 'images/emoticon-00143-smirk.gif'), '(nod)' => array('name' => 'Nodding', 'static' => 'images/emoticon-00144-nod.png', 'animated' => 'images/emoticon-00144-nod.gif'), '(shake)' => array('name' => 'Shaking', 'static' => 'images/emoticon-00145-shake.png', 'animated' => 'images/emoticon-00145-shake.gif'), '(punch)' => array('name' => 'Punch', 'static' => 'images/emoticon-00146-punch.png', 'animated' => 'images/emoticon-00146-punch.gif'), '(emo)' => array('name' => 'Emo', 'static' => 'images/emoticon-00147-emo.png', 'animated' => 'images/emoticon-00147-emo.gif'), '(y)' => array('name' => 'Yes', 'static' => 'images/emoticon-00148-yes.png', 'animated' => 'images/emoticon-00148-yes.gif'), '(n)' => array('name' => 'No', 'static' => 'images/emoticon-00149-no.png', 'animated' => 'images/emoticon-00149-no.gif'), '(handshake)' => array('name' => 'Shaking Hands', 'static' => 'images/emoticon-00150-handshake.png', 'animated' => 'images/emoticon-00150-handshake.gif'), '(skype)' => array('name' => 'Skype', 'static' => 'images/emoticon-00151-skype.png', 'animated' => 'images/emoticon-00151-skype.gif'), '(h)' => array('name' => 'Heart', 'static' => 'images/emoticon-00152-heart.png', 'animated' => 'images/emoticon-00152-heart.gif'), '(u)' => array('name' => 'Broken heart', 'static' => 'images/emoticon-00153-brokenheart.png', 'animated' => 'images/emoticon-00153-brokenheart.gif'), '(e)' => array('name' => 'Mail', 'static' => 'images/emoticon-00154-mail.png', 'animated' => 'images/emoticon-00154-mail.gif'), '(f)' => array('name' => 'Flower', 'static' => 'images/emoticon-00155-flower.png', 'animated' => 'images/emoticon-00155-flower.gif'), '(rain)' => array('name' => 'Rain', 'static' => 'images/emoticon-00156-rain.png', 'animated' => 'images/emoticon-00156-rain.gif'), '(sun)' => array('name' => 'Sun', 'static' => 'images/emoticon-00157-sun.png', 'animated' => 'images/emoticon-00157-sun.gif'), '(o)' => array('name' => 'Time', 'static' => 'images/emoticon-00158-time.png', 'animated' => 'images/emoticon-00158-time.gif'), '(music)' => array('name' => 'Music', 'static' => 'images/emoticon-00159-music.png', 'animated' => 'images/emoticon-00159-music.gif'), '(~)' => array('name' => 'Movie', 'static' => 'images/emoticon-00160-movie.png', 'animated' => 'images/emoticon-00160-movie.gif'), '(mp)' => array('name' => 'Phone', 'static' => 'images/emoticon-00161-phone.png', 'animated' => 'images/emoticon-00161-phone.gif'), '(coffee)' => array('name' => 'Coffee', 'static' => 'images/emoticon-00162-coffee.png', 'animated' => 'images/emoticon-00162-coffee.gif'), '(pizza)' => array('name' => 'Pizza', 'static' => 'images/emoticon-00163-pizza.png', 'animated' => 'images/emoticon-00163-pizza.gif'), '(cash)' => array('name' => 'Cash', 'static' => 'images/emoticon-00164-cash.png', 'animated' => 'images/emoticon-00164-cash.gif'), '(muscle)' => array('name' => 'Muscle', 'static' => 'images/emoticon-00165-muscle.png', 'animated' => 'images/emoticon-00165-muscle.gif'), '(^)' => array('name' => 'Cake', 'static' => 'images/emoticon-00166-cake.png', 'animated' => 'images/emoticon-00166-cake.gif'), '(beer)' => array('name' => 'Beer', 'static' => 'images/emoticon-00167-beer.png', 'animated' => 'images/emoticon-00167-beer.gif'), '(d)' => array('name' => 'Drink', 'static' => 'images/emoticon-00168-drink.png', 'animated' => 'images/emoticon-00168-drink.gif'), '(dance)' => array('name' => 'Dance', 'static' => 'images/emoticon-00169-dance.png', 'animated' => 'images/emoticon-00169-dance.gif'), '(ninja)' => array('name' => 'Ninja', 'static' => 'images/emoticon-00170-ninja.png', 'animated' => 'images/emoticon-00170-ninja.gif'), '(*)' => array('name' => 'Star', 'static' => 'images/emoticon-00171-star.png', 'animated' => 'images/emoticon-00171-star.gif'));
}
qa_html_theme_base::doctype();
}
示例2: doctype
function doctype()
{
$this->content['navigation']['footer']['feedback']['label'] = '<div class="feedback-image"></div>';
$this->content['search']['button_label'] = '';
$this->content['logo'] = '<A HREF="../" CLASS="qa-logo-link">' . qa_opt('site_title') . '</A>';
qa_html_theme_base::doctype();
}
示例3: doctype
function doctype()
{
qa_html_theme_base::doctype();
$qw_notification_id = qa_get('ra_notification');
if (isset($qw_notification_id)) {
qw_set_notification_as_read($qw_notification_id);
}
}
示例4: doctype
/**
* Doctype function
*/
function doctype()
{
if (!property_exists('qa_html_theme_base', 'isRTL')) {
/*Fall back for the version 1.6.3*/
$this->isRTL = isset($this->content['direction']) && $this->content['direction'] === 'rtl';
}
parent::doctype();
}
示例5: doctype
function doctype()
{
qa_html_theme_base::doctype();
if (isset($this->content['a_form'])) {
$a_form = $this->content['a_form'];
unset($this->content['a_form']);
$this->content['a_form'] = $a_form;
}
}
示例6: doctype
public function doctype()
{
if (qa_caching_main::now_caching()) {
if (isset($this->content['notices'])) {
unset($this->content['notices']);
}
}
qa_html_theme_base::doctype();
}
示例7: doctype
function doctype()
{
// print HTML5 doctype with full plugin compatibility
ob_start();
qa_html_theme_base::doctype();
$output = ob_get_clean();
$doctype = str_replace('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">', '<!DOCTYPE html>', $output);
$this->output($doctype);
}
示例8: doctype
function doctype()
{
$this->can_comment = qa_user_permit_error('permit_post_c') == false;
global $qa_state;
$this->qa_state = $qa_state;
if (!isset($_POST['ajax_comment_content']) || !$this->can_comment) {
qa_html_theme_base::doctype();
}
}
示例9: doctype
function doctype()
{
$this->widgets = get_all_widgets();
// Setup Navigation
global $qa_request;
//var_dump($qa_request);
$this->content['navigation']['user']['widgets'] = array('label' => 'Theme Widgets', 'url' => qa_path_html('widgets'), 'icon' => 'icon-puzzle');
if ($qa_request == 'widgets') {
$this->content['navigation']['user']['widgets']['selected'] = true;
$this->content['navigation']['user']['selected'] = true;
$this->template = "widgets";
$this->content['site_title'] = "Theme Widgets";
$this->content['error'] = "";
$this->content['suggest_next'] = "";
$this->content['title'] = "Theme Widgets";
//$this->content['custom']='';
$saved = false;
if (qa_clicked('cs_remove_all_button')) {
qa_db_query_sub('TRUNCATE TABLE ^cs_widgets');
$saved = true;
}
if (qa_clicked('cs_reset_widgets_button')) {
$handle = fopen(Q_THEME_DIR . '/demo_content/widget_builder.sql', 'r');
$sql = '';
if ($handle) {
while (($line = fgets($handle, 4096)) !== false) {
$sql .= trim(' ' . trim($line));
if (substr($sql, -strlen(';')) == ';') {
qa_db_query_sub($sql);
$sql = '';
}
}
fclose($handle);
}
$saved = true;
}
$cs_page = '
<div id="ra-widgets">
<div class="widget-list col-sm-5">
' . $this->cs_get_widgets() . '
</div>
<div class="widget-postions col-sm-7">
' . $this->cs_get_widgets_positions() . '
</div>
</div>
<div class="form-widget-button-holder">
<form class="form-horizontal" method="post">
<input class="qa-form-tall-button btn-primary" type="submit" name="cs_remove_all_button" value="Remove All Widgets" title="">
<input class="qa-form-tall-button btn-primary" type="submit" name="cs_reset_widgets_button" value="Reset All Widgets To Theme Default" title="">
</form>
</div>
';
$this->content['custom'] = $cs_page;
}
qa_html_theme_base::doctype();
}
示例10: doctype
function doctype()
{
if (qa_opt('priv_active') && $this->template == 'user' && qa_get_logged_in_handle() === $this->_user_handle()) {
if (!isset($this->content['navigation']['sub'])) {
$this->content['navigation']['sub'] = array('profile' => array('url' => qa_path_html('user/' . $this->_user_handle(), null, qa_opt('site_url')), 'label' => $this->_user_handle(), 'selected' => !qa_get('tab') ? true : false), 'privileges' => array('url' => qa_path_html('user/' . $this->_user_handle(), array('tab' => 'privileges'), qa_opt('site_url')), 'label' => qa_opt('priv_title'), 'selected' => qa_get('tab') == 'privileges' ? true : false));
} else {
$this->content['navigation']['sub']['privileges'] = array('url' => qa_path_html('user/' . $this->_user_handle(), array('tab' => 'privileges'), qa_opt('site_url')), 'label' => qa_opt('priv_title'), 'selected' => qa_get('tab') == 'privileges' ? true : false);
}
}
qa_html_theme_base::doctype();
}
示例11: doctype
function doctype()
{
parent::doctype();
if (QA_FINAL_EXTERNAL_USERS) {
return;
}
// check if logged in
$handle = qa_get_logged_in_handle();
if (isset($handle)) {
if (qa_request() == '' && count($_GET) > 0) {
// Check if we need to associate another provider
$this->process_login();
}
// see if the account pages are accessed
$tmpl = array('account', 'favorites');
$user_pages = array('user', 'user-wall', 'user-activity', 'user-questions', 'user-answers');
$logins_page = qa_request() == 'logins' && !qa_get('confirm');
$urlhandle = qa_request_part(1);
if (in_array($this->template, $tmpl) || $logins_page || in_array($this->template, $user_pages) && $handle == $urlhandle) {
// add a navigation item
$this->content['navigation']['sub']['logins'] = array('label' => qa_lang_html('plugin_open/my_logins_nav'), 'url' => qa_path_html('logins'), 'selected' => $logins_page);
return;
}
} else {
$title = qa_lang_html('plugin_open/login_title');
$descr = qa_lang_html('plugin_open/login_description');
// hide login/register links from navigation on any page
if (qa_opt('open_login_hideform') == '1') {
unset($this->content['navigation']['user']['login']);
unset($this->content['navigation']['user']['register']);
}
// then check if login/register pages are accessed
$tmpl = array('register', 'login');
if (!in_array($this->template, $tmpl)) {
return;
}
// hide regular login/register form on those pages only
if (qa_opt('open_login_hideform') == '1') {
$this->content['title'] = $title;
$this->content['form'] = null;
}
// add some custom text
if (!empty($this->content['custom'])) {
$content = str_ireplace('<BR>', '', $this->content['custom']);
$this->content['custom'] = "<div><p>{$descr}</p>{$content}</div>";
if ($this->content['form'] != null) {
$this->content['custom'] = "<br /><br /><h1>{$title}</h1>{$this->content['custom']}";
}
}
}
}
示例12: doctype
function doctype()
{
global $qa_theme_switch_is_mobile;
if ($qa_theme_switch_is_mobile && qa_opt('theme_switch_enable_mobile') && qa_opt('site_theme') != qa_opt('theme_switch_mobile')) {
$this->content['navigation']['footer']['theme_switch'] = array('label' => 'Mobile Version', 'url' => qa_path($this->request, array('theme_switch' => qa_opt('theme_switch_mobile'))));
} else {
if (qa_opt('theme_switch_enable_mobile') && qa_opt('site_theme') == qa_opt('theme_switch_mobile')) {
$this->content['navigation']['footer']['theme_switch'] = array('label' => 'Full Site', 'url' => qa_path($this->request, array('theme_switch' => qa_opt('theme_switch_default'))));
}
}
if (@$_GET['theme_switch']) {
/*
if($userid = qa_get_logged_in_userid()) {
qa_db_query_sub(
'INSERT INTO ^usermeta (user_id,meta_key,meta_value) VALUES (#,$,$) ON DUPLICATE KEY UPDATE meta_value=$',
$userid,'custom_theme',$_GET['theme_switch'],$_GET['theme_switch']
);
}
*/
setcookie('qa_theme_switch', $_GET['theme_switch'], time() + 86400 * 365, '/', QA_COOKIE_DOMAIN);
qa_redirect($this->request, array());
}
if (qa_opt('theme_switch_enable')) {
if ($this->template == 'user' && !qa_get('tab')) {
// add theme switcher
$handle = preg_replace('/^[^\\/]+\\/([^\\/]+).*/', "\$1", $this->request);
$theme_form = $this->theme_switch_form();
if ($theme_form) {
// insert our form
if ($this->content['q_list']) {
// paranoia
// array splicing kungfu thanks to Stack Exchange
// This adds form-theme-switch before q_list
$keys = array_keys($this->content);
$vals = array_values($this->content);
$insertBefore = array_search('q_list', $keys);
$keys2 = array_splice($keys, $insertBefore);
$vals2 = array_splice($vals, $insertBefore);
$keys[] = 'form-theme-switch';
$vals[] = $theme_form;
$this->content = array_merge(array_combine($keys, $vals), array_combine($keys2, $vals2));
} else {
$this->content['form-theme-switch'] = $theme_form;
}
// this shouldn't happen
}
}
}
qa_html_theme_base::doctype();
}
示例13: doctype
function doctype()
{
if (qa_post_text('merge_from') && qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN) {
$merged = qa_merge_do_merge();
if ($merged === true) {
qa_redirect(qa_q_request(qa_post_text('merge_to'), null), array('merged' => qa_post_text('merge_from')));
} else {
$error1 = $merged[0];
$error2 = $merged[1];
$this->content['error'] = "Error merging posts.";
}
}
qa_html_theme_base::doctype();
}
示例14: doctype
function doctype()
{
qa_html_theme_base::doctype();
if (qa_opt('cp_enable') && ($this->template == 'ask' || isset($this->content['q_list']) || isset($this->content['q_view']))) {
global $qa_request;
global $wiki_enable;
if ($this->template == 'ask' && !qa_user_permit_error('permit_post_q') && !qa_opt('site_maintenance') && qa_permit_check('permit_create_cp')) {
$this->content['form']['tags'] .= ' onSubmit="pollSubmit(event)"';
$this->content['form']['fields'][] = array('label' => qa_lang('cp/checkbox_text'), 'tags' => 'NAME="cp_community" ID="cp_community"', 'type' => 'checkbox', 'value' => qa_post_text('cp_community') ? 1 : 0);
}
if (isset($this->content['q_view'])) {
$qid = $this->content['q_view']['raw']['postid'];
$author = $this->content['q_view']['raw']['userid'];
if (!isset($wiki_enable)) {
$result = qa_db_query_sub('SELECT * FROM ^postmeta WHERE meta_key=$ AND post_id=#', 'is_community', $qid);
$wiki_enable = $result->num_rows > 0;
}
if ($wiki_enable) {
// is a community post
$this->content['title'] .= ' ' . qa_lang('cp/question_title');
// $this->content['q_view']['content'] = @$this->content['q_view']['content'].'<div id="qa-wiki-div">'.$this->getPollDiv($qid,qa_get_logged_in_userid()).'</div>';
$this->content['q_view']['main_form_tags'] = @$this->content['q_view']['main_form_tags'] . ' class="qa-community-posts"';
// print_r($this->content['q_view']['form']['buttons']);
if (isset($this->content['q_view']['form']['buttons']['edit'])) {
$this->content['q_view']['form']['buttons']['edit']['label'] = qa_lang_html('cp/contribute');
$this->content['q_view']['form']['buttons']['edit']['popup'] = qa_lang_html('cp/contribute_description');
}
unset($this->content['q_view']['form']['buttons']['answer']);
unset($this->content['q_view']['form']['buttons']['comment']);
unset($this->content['a_form']);
unset($this->content['c_form']);
}
}
if (isset($this->content['q_list'])) {
$wiki_array = qa_db_read_all_assoc(qa_db_query_sub('SELECT * FROM ^postmeta WHERE meta_key=$', 'is_community'));
foreach ($wiki_array as $q) {
$wiki[(int) $q['post_id']] = $q['meta_value'];
}
foreach ($this->content['q_list']['qs'] as $idx => $question) {
if (isset($wiki[$question['raw']['postid']])) {
$this->content['q_list']['qs'][$idx]['title'] .= ' ' . qa_lang('cp/question_title');
}
}
}
}
}
示例15: doctype
function doctype()
{
if (@$this->content['error'] == qa_lang_html('main/page_not_found') && preg_match('/^[0-9]+\\//', $this->request) !== false) {
$pid = preg_replace('/\\/.*/', '', $this->request);
$merged = qa_db_read_one_assoc(qa_db_query_sub("SELECT ^posts.postid as postid,^posts.title as title FROM ^postmeta, ^posts WHERE ^postmeta.meta_key='merged_with' AND ^postmeta.post_id=# AND ^posts.postid=^postmeta.meta_value", $pid), true);
if ($merged) {
qa_redirect(qa_q_request($merged['postid'], $merged['title']), array('merged' => $pid));
}
} else {
if (qa_get('merged')) {
$this->content['error'] = str_replace('^post', qa_get('merged'), qa_opt('merge_question_merged'));
}
}
if (qa_post_text('ajax_merge_get_from')) {
return;
}
qa_html_theme_base::doctype();
}