本文整理汇总了PHP中qa_lang_html函数的典型用法代码示例。如果您正苦于以下问题:PHP qa_lang_html函数的具体用法?PHP qa_lang_html怎么用?PHP qa_lang_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qa_lang_html函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_form
function admin_form(&$qa_content)
{
// Process form input
$ok = null;
if (qa_clicked('prevnav_save_button')) {
qa_opt('prevnav_plugin_css', qa_post_text('prevnav_plugin_css'));
qa_opt('prevnav_plugin_widget_only', (bool) qa_post_text('prevnav_plugin_widget_only'));
qa_opt('prevnav_plugin_widget_title', qa_post_text('prevnav_plugin_widget_title'));
$ok = qa_lang('admin/options_saved');
} else {
if (qa_clicked('prevnav_reset_button')) {
foreach ($_POST as $i => $v) {
$def = $this->option_default($i);
if ($def !== null) {
qa_opt($i, $def);
}
}
$ok = qa_lang('admin/options_reset');
}
}
// Create the form for display
$fields = array();
$fields[] = array('type' => 'blank');
$fields[] = array('label' => 'PrevNav buttons custom css', 'tags' => 'NAME="prevnav_plugin_css"', 'value' => qa_opt('prevnav_plugin_css'), 'type' => 'textarea', 'rows' => 20);
$fields[] = array('label' => 'Widget Title', 'tags' => 'NAME="prevnav_plugin_widget_title"', 'value' => qa_opt('prevnav_plugin_widget_title'));
$fields[] = array('type' => 'blank');
$fields[] = array('type' => 'blank');
return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="prevnav_save_button"'), array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="prevnav_reset_button"')));
}
示例2: admin_form
function admin_form(&$qa_content)
{
$ok = null;
if (qa_clicked('short_url_save_button')) {
qa_opt('short_url_content_on', (bool) qa_post_text('short_url_content_on'));
qa_opt('short_url_bitly_username', (string) qa_post_text('short_url_bitly_username'));
qa_opt('short_url_bitly_api_key', (string) qa_post_text('short_url_bitly_api_key'));
$ok = qa_lang('admin/options_saved');
} else {
if (qa_clicked('short_url_reset_button')) {
foreach ($_POST as $i => $v) {
$def = $this->option_default($i);
if ($def !== null) {
qa_opt($i, $def);
}
}
$ok = qa_lang('admin/options_reset');
}
}
$fields = array();
$ready = strlen(qa_opt('short_url_bitly_username')) && strlen(qa_opt('short_url_bitly_api_key'));
if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
$fields[] = array('label' => 'You cannot enable when in localhost', 'tags' => 'NAME="short_url_content_on"', 'value' => qa_opt('short_url_content_on'), 'type' => 'checkbox', 'disabled' => 'disabled');
} else {
$fields[] = array('label' => 'Enable Short Url', 'tags' => 'NAME="short_url_content_on"', 'value' => qa_opt('short_url_content_on'), 'type' => 'checkbox');
}
$fields[] = array('label' => 'Your Bitly username', 'tags' => 'NAME="short_url_bitly_username"', 'value' => qa_opt('short_url_bitly_username'), 'type' => 'string');
$fields[] = array('label' => 'Your Bitly api key', 'tags' => 'NAME="short_url_bitly_api_key"', 'value' => qa_opt('short_url_bitly_api_key'), 'type' => 'string', 'error' => $ready ? null : 'You can find your api key <a href="https://bitly.com/a/your_api_key">here</a>');
return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="short_url_save_button"'), array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="short_url_reset_button"')));
}
示例3: output_widget
public function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
require_once QA_INCLUDE_DIR . 'db/selects.php';
$populartags = qa_db_single_select(qa_db_popular_tags_selectspec(0, (int) qa_opt('tag_cloud_count_tags')));
$maxcount = reset($populartags);
// $themeobject->output(sprintf('<h2 style="margin-top: 0; padding-top: 0;">%s</h2>', qa_lang_html('main/popular_tags')));
// $themeobject->output('<div style="font-size: 10px;">');
$themeobject->output(sprintf('<div class="panel panel-primary" style="padding: 0;"><div class="panel-heading"><h3 class="panel-title">%s</h3></div>', qa_lang_html('main/popular_tags')));
$themeobject->output('<div class="panel-body">');
$maxsize = qa_opt('tag_cloud_font_size');
$minsize = qa_opt('tag_cloud_minimal_font_size');
$scale = qa_opt('tag_cloud_size_popular');
$blockwordspreg = qa_get_block_words_preg();
foreach ($populartags as $tag => $count) {
$matches = qa_block_words_match_all($tag, $blockwordspreg);
if (empty($matches)) {
if ($scale) {
$size = number_format($maxsize * $count / $maxcount, 1);
if ($size < $minsize) {
$size = $minsize;
}
} else {
$size = $maxsize;
}
$themeobject->output(sprintf('<a href="%s" style="font-size: %dpx; vertical-align: baseline;">%s</a>', qa_path_html('tag/' . $tag), $size, qa_html($tag)));
}
}
// $themeobject->output('</div>');
$themeobject->output('</div></div>');
}
示例4: admin_form
function admin_form(&$qa_content)
{
$ok = null;
if (qa_clicked('obvious_save_button')) {
qa_opt('obvious_content_on', (bool) qa_post_text('obvious_content_on'));
qa_opt('obvious_content_color', (string) qa_post_text('obvious_content_color'));
qa_opt('obvious_max_tags', (int) qa_post_text('obvious_max_tags'));
qa_opt('obvious_content_category_on', (bool) qa_post_text('obvious_content_category_on'));
qa_opt('obvious_content_category_color', (string) qa_post_text('obvious_content_category_color'));
$ok = qa_lang('admin/options_saved');
} else {
if (qa_clicked('obvious_reset_button')) {
foreach ($_POST as $i => $v) {
$def = $this->option_default($i);
if ($def !== null) {
qa_opt($i, $def);
}
}
$ok = qa_lang('admin/options_reset');
}
}
$fields = array();
$fields[] = array('label' => 'Enable Obvious Favorite Tags', 'tags' => 'NAME="obvious_content_on"', 'value' => qa_opt('obvious_content_on'), 'type' => 'checkbox');
$fields[] = array('label' => 'Your color in Hex', 'tags' => 'NAME="obvious_content_color"', 'value' => qa_opt('obvious_content_color'), 'type' => 'string');
$fields[] = array('label' => 'Enable Obvious Favorite Category', 'tags' => 'NAME="obvious_content_category_on"', 'value' => qa_opt('obvious_content_category_on'), 'type' => 'checkbox');
$fields[] = array('label' => 'Your color in Hex', 'tags' => 'NAME="obvious_content_category_color"', 'value' => qa_opt('obvious_content_category_color'), 'type' => 'string');
$fields[] = array('type' => 'blank');
$fields[] = array('label' => 'Maximum tags for the Widget', 'tags' => 'NAME="obvious_max_tags"', 'value' => qa_opt('obvious_max_tags'), 'type' => 'int');
return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="obvious_save_button"'), array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="obvious_reset_button"')));
}
示例5: admin_form
function admin_form(&$qa_content)
{
// Process form input
$ok = null;
if (qa_clicked('adchat_save_button')) {
qa_opt('adchat_plugin_css', qa_post_text('adchat_plugin_css'));
if (qa_post_text('adchat-expand-categories') == 1) {
qa_opt('adchat-expand-categories', "1");
} else {
qa_opt('adchat-expand-categories', "0");
}
$ok = qa_lang('admin/options_saved');
} else {
if (qa_clicked('adchat_reset_button')) {
foreach ($_POST as $i => $v) {
$def = $this->option_default($i);
if ($def !== null) {
qa_opt($i, $def);
}
}
$ok = qa_lang('admin/options_reset');
}
}
// Create the form for display
$fields = array();
$fields[] = array('type' => 'blank');
$fields[] = array('label' => 'Adchat custom css', 'tags' => 'NAME="adchat_plugin_css"', 'value' => qa_opt('adchat_plugin_css'), 'type' => 'textarea', 'rows' => 20);
$fields[] = array('label' => 'Make all categories into chat room', 'note' => 'Otherwise only top level categories are made to chat room', 'tags' => 'NAME="adchat-expand-categories"', 'value' => qa_opt('adchat-expand-categories'), 'type' => 'checkbox');
return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="adchat_save_button"'), array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="adchat_reset_button"')));
}
示例6: shutdown
/**
* Function that is called at the end of page rendering
* @param type $reason
* @return type
*/
function shutdown($reason = false)
{
if ($this->do_caching() && !$this->is_logged_in) {
if (!$this->check_cache()) {
if (QA_CACHING_COMPRESS && $this->is_html()) {
$this->content = $this->compress_content(ob_get_contents());
} else {
$this->content = ob_get_contents();
}
$this->content = trim($this->content);
if (empty($this->content)) {
// if empty page
return;
}
if (strpos($this->content, qa_lang_html('main/page_not_found')) !== false) {
// if 404 page
return;
}
if (QA_DEBUG_PERFORMANCE && $this->is_html()) {
$endtag = '</html>';
$rpos = strrpos($this->content, $endtag);
if ($rpos !== false) {
$this->content = substr($this->content, 0, $rpos + strlen($endtag));
}
}
$total_time = number_format(microtime(true) - $this->timer, 4, ".", "");
$this->debug .= "\n<!-- ++++++++++++CACHED VERSION++++++++++++++++++\n";
$this->debug .= "Created on " . date('Y-m-d H:i:s') . "\n";
$this->debug .= "Generated in " . $total_time . " seconds\n";
$this->debug .= "++++++++++++CACHED VERSION++++++++++++++++++ -->\n";
$this->write_cache();
}
}
return;
}
示例7: admin_form
function admin_form(&$qa_content)
{
// Process form input
$ok = null;
if (qa_clicked('cp_save')) {
// Save
qa_db_query_sub('CREATE TABLE IF NOT EXISTS ^postmeta (
meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
post_id bigint(20) unsigned NOT NULL,
meta_key varchar(255) DEFAULT \'\',
meta_value longtext,
PRIMARY KEY (meta_id),
KEY post_id (post_id),
KEY meta_key (meta_key)
) ENGINE=MyISAM DEFAULT CHARSET=utf8');
qa_opt('cp_enable', (bool) qa_post_text('cp_enable'));
$ok = qa_lang('admin/options_saved');
} else {
if (qa_clicked('cp_reset')) {
// Reset
foreach ($_POST as $i => $v) {
$def = $this->option_default($i);
if ($def !== null) {
qa_opt($i, $def);
}
}
qa_opt('cp_enable', true);
$ok = qa_lang('admin/options_reset');
}
}
// Create the form for display
$fields = array();
$fields[] = array('label' => qa_lang('cp/enable_community_posts'), 'tags' => 'NAME="cp_enable"', 'value' => qa_opt('cp_enable'), 'type' => 'checkbox');
return array('ok' => $ok && !isset($error) ? $ok : null, 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="cp_save"'), array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="cp_reset"')));
}
示例8: logout_html
function logout_html($tourl)
{
require_once QA_INCLUDE_DIR . "qa-base.php";
$_SESSION['logout_url'] = $tourl;
$logout_url = qa_path('auth/logout', null, qa_path_to_root());
echo '<a href="' . $logout_url . '">' . qa_lang_html('main/nav_logout') . '</a>';
}
示例9: output_widget
function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
/*
$requestparts=qa_request_parts();
$requestlower=strtolower(qa_request());
$firstlower=strtolower($requestparts[0]);
$routing=qa_page_routing();
// unanswered & questions pages may contain categories.
unset($routing['activity/']);
unset($routing['unanswered/']);
unset($routing['questions/']);
if ( (isset($routing[$requestlower])) or (isset($routing[$firstlower.'/'])) or (is_numeric($requestparts[0])) )
return;
$explicitqa=(strtolower($requestparts[0])=='qa' or strtolower($requestparts[0])=='unanswered' or strtolower($requestparts[0])=='questions' or strtolower($requestparts[0])=='activity');
if ($explicitqa)
$slugs=array_slice($requestparts, 1);
elseif (strlen($requestparts[0]))
$slugs=$requestparts;
else
$slugs=array();
*/
$slugs = useo_get_current_category_slug();
$countslugs = count($slugs);
list($categories, $categoryid) = qa_db_select_with_pending(qa_db_category_nav_selectspec($slugs, false, false, true), $countslugs ? qa_db_slugs_to_category_id_selectspec($slugs) : null);
if ($countslugs && isset($categoryid)) {
/*
$categoryid is current categories ID
$backpath = implode('/', array_reverse($slugs));
echo "countslugs: <pre>"; var_dump($countslugs); echo "</pre>";
$fullcategory=qa_db_select_with_pending(qa_db_full_category_selectspec($categoryid, true));
echo "fullcategory: <pre>"; var_dump($fullcategory); echo "</pre>";
echo "categoryid: <pre>"; var_dump($categoryid); echo "</pre>";
echo "slugs: <pre>"; var_dump($slugs); echo "</pre>";
echo "template: <pre>"; var_dump($template); echo "</pre>";
echo "request: <pre>"; var_dump($request); echo "</pre>";
*/
require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
$description = qa_db_categorymeta_get($categoryid, 'useo_cat_description');
if (!qa_opt('useo_cat_desc_format')) {
$description = qa_html($description);
}
$editurlhtml = qa_path_html('category-edit/' . $categoryid);
$allowediting = !qa_user_permit_error('useo_cat_desc_permit_edit');
if (strlen($description)) {
echo '<SPAN CLASS="entry-content qa-category-description">';
echo $description;
echo '</SPAN>';
if ($allowediting) {
echo ' - <A HREF="' . $editurlhtml . '">edit</A>';
}
} elseif ($allowediting) {
echo '<A HREF="' . $editurlhtml . '">' . qa_lang_html('useo/create_desc_link') . '</A>';
}
}
}
示例10: output_widget
function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
$widget_opt = $themeobject->current_widget['param']['options'];
if (@$themeobject->current_widget['param']['locations']['show_title']) {
$themeobject->output('<h3 class="widget-title">' . qa_lang_html('cleanstrap/askbox_placeholder') . '</h3>');
}
$themeobject->output('<div class="ra-tags-widget">');
$themeobject->output($this->cs_top_users((int) @$widget_opt['cs_tc_count'], (int) @$widget_opt['cs_tc_avatar']));
$themeobject->output('</div>');
}
示例11: process_request
function process_request($request)
{
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('example_page/page_title');
$qa_content['error'] = 'An example error';
$qa_content['custom'] = 'Some <b>custom html</b>';
$qa_content['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'style' => 'wide', 'ok' => qa_post_text('okthen') ? 'You clicked OK then!' : null, 'title' => 'Form title', 'fields' => array('request' => array('label' => 'The request', 'tags' => 'name="request"', 'value' => qa_html($request), 'error' => qa_html('Another error'))), 'buttons' => array('ok' => array('tags' => 'name="okthen"', 'label' => 'OK then', 'value' => '1')), 'hidden' => array('hiddenfield' => '1'));
$qa_content['custom_2'] = '<p><br>More <i>custom html</i></p>';
return $qa_content;
}
示例12: process_request
function process_request($request)
{
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('example_page/page_title');
$qa_content['error'] = 'An example error';
$qa_content['custom'] = 'Some <B>custom html</B>';
$qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'wide', 'ok' => qa_post_text('okthen') ? 'You clicked OK then!' : null, 'title' => 'Form title', 'fields' => array('request' => array('label' => 'The request', 'tags' => 'NAME="request"', 'value' => qa_html($request), 'error' => qa_html('Another error'))), 'buttons' => array('ok' => array('tags' => 'NAME="okthen"', 'label' => 'OK then', 'value' => '1')), 'hidden' => array('hiddenfield' => '1'));
$qa_content['custom_2'] = '<P><BR>More <I>custom html</I></P>';
return $qa_content;
}
示例13: mp_announcements_sub_navigation
function mp_announcements_sub_navigation()
{
$level = qa_get_logged_in_level();
$navigation = array();
if ($level >= QA_USER_LEVEL_EDITOR) {
$navigation = array('default' => array('url' => qa_path_html('mp-announcements-page'), 'label' => qa_lang_html('announcements/link_all')), 'create' => array('url' => qa_path_html('mp-announcements-create-page'), 'label' => qa_lang_html('announcements/link_create')));
} else {
$navigation = array('default' => array('url' => qa_path_html('mp-announcements-page'), 'label' => qa_lang_html('announcements/link_all')));
}
return $navigation;
}
示例14: output_widget
function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
$widget_opt = @$themeobject->current_widget['param']['options'];
$type = @$widget_opt['type'];
if (@$themeobject->current_widget['param']['locations']['show_title']) {
$themeobject->output('<h3 class="widget-title">' . qa_lang_html('cleanstrap/site_status') . '</h3>');
}
$themeobject->output('<div class="ra-site-status-widget">');
$themeobject->output($this->cs_stats_chart($type));
$themeobject->output('</div>');
}
示例15: nav_user_search
public function nav_user_search()
{
if (!qa_is_logged_in()) {
if (isset($this->content['navigation']['user']['login']) && !QA_FINAL_EXTERNAL_USERS) {
$login = $this->content['navigation']['user']['login'];
$this->output('<form class="qam-login-form" action="' . $login['url'] . '" method="post">', '<input type="text" class="qam-login-text" name="emailhandle" dir="auto" placeholder="' . trim(qa_lang_html(qa_opt('allow_login_email_only') ? 'users/email_label' : 'users/email_handle_label'), ':') . '"/>', '<input type="password" class="qam-login-text" name="password" dir="auto" placeholder="' . trim(qa_lang_html('users/password_label'), ':') . '"/>', '<div class="qam-rememberbox"><input type="checkbox" name="remember" id="qam-rememberme" value="1"/>', '<label for="qam-rememberme" class="qam-remember">' . qa_lang_html('users/remember') . '</label></div>', '<input type="hidden" name="code" value="' . qa_html(qa_get_form_security_code('login')) . '"/>', '<input type="submit" value="' . qa_lang_html('users/login_button') . '" class="qa-form-tall-button qa-form-tall-button-login" name="dologin"/>', '</form>');
// remove regular navigation link to log in page
unset($this->content['navigation']['user']['login']);
}
}
qa_html_theme_base::nav_user_search();
}