本文整理汇总了PHP中qa_content_prepare函数的典型用法代码示例。如果您正苦于以下问题:PHP qa_content_prepare函数的具体用法?PHP qa_content_prepare怎么用?PHP qa_content_prepare使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qa_content_prepare函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process_request
function process_request($request)
{
$userid = qa_get_logged_in_userid();
$categoryoptions = array();
$qa_content = qa_content_prepare();
// check if we have done a post of the page
if (qa_post_text('okthen')) {
// update the current category
$newcategory = qa_post_text('category');
if (isset($newcategory)) {
mp_set_categoryid($newcategory);
// redirect to main page
qa_redirect('');
} else {
$qa_content['error'] = 'You must select a course to continue.';
}
}
// retrieve list of categories user is associated with
// populate category options
$results = mp_get_categories_for_user($userid);
foreach ($results as $row) {
$categoryoptions[$row['categoryid']] = $row['title'];
}
$qa_content['title'] = 'Registered courses';
$qa_content['custom'] = 'The following list displays all courses your account is associated with. Select a course from the list below and click <B>Select</B> to change to the new course<br /><br />';
$qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'wide', 'fields' => array('courses' => array('type' => 'select-radio', 'label' => 'Courses', 'tags' => 'NAME="category"', 'options' => $categoryoptions, 'value' => mp_get_categoryid(), 'error' => qa_html(@$errors['course']))), 'buttons' => array('ok' => array('tags' => 'NAME="okthen"', 'label' => 'Select', 'value' => '1')));
return $qa_content;
}
示例2: process_request
function process_request($request)
{
require_once QA_INCLUDE_DIR . 'mp-app-posts.php';
require_once QA_INCLUDE_DIR . 'mp-db-users.php';
$qa_content = qa_content_prepare();
// if the user is not logged in, request user to login
if (!qa_get_logged_in_userid()) {
$qa_content['error'] = qa_insert_login_links('Please ^1log in^2 or ^3register^4 first.', $request);
return $qa_content;
}
$qa_content['title'] = 'Course Announcements';
// DISPLAY ANNOUCEMENTS
$data = '<div class="qa-q-list">';
// retrieve annoucements
$announcements = mp_announcements_get_all(mp_get_categoryid());
if (count($announcements) == 0) {
$data .= "No announcements";
} else {
foreach ($announcements as $announcement) {
$data .= '<div class="qa-q-list-item">';
$data .= '<div class="qa-q-item-title">' . $announcement['title'] . '</div>';
$data .= '<div class="qa-q-view-content">' . $announcement['content'] . '</div>';
$data .= '<div class="qa-q-item-meta">Posted by <A HREF="' . qa_path_html('user/' . $announcement['handle']) . '">' . $announcement['handle'] . '</A> on ' . $announcement['created'] . '</div>';
$data .= '</div>';
$data .= '<div class="qa-q-list-item-clear" ></div>';
}
}
$data .= '</div>';
$qa_content['custom_2'] = $data;
// create the sub menu for navigation
$qa_content['navigation']['sub'] = mp_announcements_sub_navigation();
$qa_content['navigation']['sub']['default']['selected'] = true;
return $qa_content;
}
示例3: process_request
function process_request($request)
{
// double check we are admin
if (qa_get_logged_in_level() < QA_USER_LEVEL_ADMIN) {
return;
}
if (qa_clicked('docancel')) {
qa_redirect('admin/plugins');
}
$qa_content = qa_content_prepare();
$qa_content['title'] = 'Widget Anywhere';
$qa_content['custom'] = '<p><a href="' . qa_path('admin/plugins') . '#' . qa_html($this->anchor) . '">« back to plugin options</a></p>';
$saved_msg = null;
$editid = qa_get('editid');
if (qa_post_text('dodelete')) {
$this->delete_widget();
qa_redirect('admin/plugins');
} else {
if (qa_clicked('save_button')) {
// save widget
$widget = $this->save_widget();
$saved_msg = 'Widget saved.';
} else {
if (empty($editid)) {
// display blank form
$widget = array('id' => 0, 'title' => '', 'pages' => '', 'position' => '', 'ordering' => 1, 'content' => '');
} else {
// load specified widget
$sql = 'SELECT * FROM ^' . $this->pluginkey . ' WHERE id=#';
$result = qa_db_query_sub($sql, $editid);
$widget = qa_db_read_one_assoc($result);
}
}
}
$sel_position = empty($widget['position']) ? null : @$this->positionlangs[$widget['position']];
// set up page (template) list
$widget_pages = explode(',', $widget['pages']);
$sel_pages = array();
$custom_pages = array();
foreach ($widget_pages as $page) {
if (strpos($page, 'custom:') === 0) {
$custom_pages[] = substr($page, 7);
} else {
$sel_pages[] = $page;
}
}
// $chkd = in_array('all', $sel_pages) ? 'checked' : '';
// $pages_html = '<label><input type="checkbox" name="wpages_all" ' . $chkd . '> ' . qa_lang_html('admin/widget_all_pages') . '</label><br><br>';
$pages_html = '';
foreach ($this->templatelangkeys as $tmpl => $langkey) {
$chkd = in_array($tmpl, $sel_pages) ? 'checked' : '';
$pages_html .= '<label><input type="checkbox" name="wpages_' . $tmpl . '" ' . $chkd . '> ' . qa_lang_html($langkey) . '</label><br>';
}
$qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'ok' => $saved_msg, 'fields' => array('title' => array('label' => 'Title', 'tags' => 'NAME="wtitle"', 'value' => qa_html($widget['title'])), 'position' => array('type' => 'select', 'label' => 'Position', 'tags' => 'NAME="wposition"', 'options' => $this->positionlangs, 'value' => $sel_position), 'all_pages' => array('type' => 'checkbox', 'id' => 'tb_pages_all', 'label' => qa_lang_html('admin/widget_all_pages'), 'tags' => 'NAME="wpages_all" ID="wpages_all"', 'value' => in_array('all', $sel_pages)), 'pages' => array('type' => 'custom', 'id' => 'tb_pages_list', 'label' => qa_lang_html('admin/widget_pages_explanation'), 'html' => $pages_html), 'show_custom_pages' => array('type' => 'checkbox', 'id' => 'tb_show_custom_pages', 'label' => 'Show on custom page(s)', 'tags' => 'NAME="cb_custom_pages" ID="cb_custom_pages"', 'value' => count($custom_pages) > 0), 'custom_pages' => array('id' => 'tb_custom_pages', 'label' => 'Page slugs', 'tags' => 'NAME="wpages_custom"', 'value' => qa_html(implode(',', $custom_pages)), 'note' => 'Separate multiple page slugs (URL fragments) with commas, e.g. <code>custom-page,other-page</code>'), 'ordering' => array('type' => 'number', 'label' => 'Order', 'tags' => 'NAME="wordering"', 'value' => qa_html($widget['ordering'])), 'content' => array('type' => 'textarea', 'label' => 'Content (HTML)', 'tags' => 'NAME="wcontent"', 'value' => qa_html($widget['content']), 'rows' => 12)), 'hidden' => array('wid' => $widget['id']), 'buttons' => array('save' => array('tags' => 'NAME="save_button"', 'label' => 'Save widget', 'value' => '1'), 'cancel' => array('tags' => 'NAME="docancel"', 'label' => qa_lang_html('main/cancel_button'))));
if ($widget['id'] > 0) {
$qa_content['form']['fields']['delete'] = array('tags' => 'NAME="dodelete"', 'label' => 'Delete widget', 'value' => 0, 'type' => 'checkbox');
}
qa_set_display_rules($qa_content, array('tb_pages_list' => '!wpages_all', 'tb_show_custom_pages' => '!wpages_all', 'tb_custom_pages' => 'cb_custom_pages && !wpages_all'));
return $qa_content;
}
示例4: process_request
public function process_request($request)
{
$qa_content = qa_content_prepare(true);
$qa_content['title'] = qa_opt('site_title') . ' Chat Logs';
$qa_content['custom'] = '<iframe src="' . $this->urltoroot . 'chat/?view=logs" width="100%" height="600"></iframe>';
$qa_content['custom_2'] = '<script type="text/javascript"> $( document ).ready(function() { $("#settingsContainer").hide(); }); </script>';
return $qa_content;
}
示例5: process_request
public function process_request($request)
{
$qa_content = qa_content_prepare(true);
$qa_content['title'] = qa_opt('site_title') . ' Chat';
$qa_content['custom'] = '<iframe src="' . $this->urltoroot . 'chat" width="100%" height="800"></iframe>';
$qa_content['custom_2'] = '<script type="text/javascript"> $( document ).ready(function() { $("#adchat").hide(); createCookieAdChat("none");}); </script>';
return $qa_content;
}
示例6: process_request
function process_request($request)
{
$qa_content = qa_content_prepare();
$qa_content['site_title'] = "Email Notifications";
$qa_content['error'] = "";
$qa_content['suggest_next'] = "";
$qa_content['custom'] = $this->opt_form();
return $qa_content;
}
示例7: 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;
}
示例8: 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;
}
示例9: qa_q_list_page_content
function qa_q_list_page_content($questions, $pagesize, $start, $count, $sometitle, $nonetitle, $navcategories, $categoryid, $categoryqcount, $categorypathprefix, $feedpathprefix, $suggest, $pagelinkparams = null, $categoryparams = null, $dummy = null)
{
if (qa_to_override(__FUNCTION__)) {
$args = func_get_args();
return qa_call_override(__FUNCTION__, $args);
}
require_once QA_INCLUDE_DIR . 'app/format.php';
require_once QA_INCLUDE_DIR . 'app/updates.php';
$userid = qa_get_logged_in_userid();
// Chop down to size, get user information for display
if (isset($pagesize)) {
$questions = array_slice($questions, 0, $pagesize);
}
$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));
// Prepare content for theme
$qa_content = qa_content_prepare(true, array_keys(qa_category_path($navcategories, $categoryid)));
$qa_content['q_list']['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'hidden' => array('code' => qa_get_form_security_code('vote')));
$qa_content['q_list']['qs'] = array();
if (count($questions)) {
$qa_content['title'] = $sometitle;
$defaults = qa_post_html_defaults('Q');
if (isset($categorypathprefix)) {
$defaults['categorypathprefix'] = $categorypathprefix;
}
foreach ($questions as $question) {
$fields = qa_any_to_q_html_fields($question, $userid, qa_cookie_get(), $usershtml, null, qa_post_html_options($question, $defaults));
if (!empty($fields['raw']['closedbyid'])) {
$fields['closed'] = array('state' => qa_lang_html('main/closed'));
}
$qa_content['q_list']['qs'][] = $fields;
}
} else {
$qa_content['title'] = $nonetitle;
}
if (isset($userid) && isset($categoryid)) {
$favoritemap = qa_get_favorite_non_qs_map();
$categoryisfavorite = @$favoritemap['category'][$navcategories[$categoryid]['backpath']];
$qa_content['favorite'] = qa_favorite_form(QA_ENTITY_CATEGORY, $categoryid, $categoryisfavorite, qa_lang_sub($categoryisfavorite ? 'main/remove_x_favorites' : 'main/add_category_x_favorites', $navcategories[$categoryid]['title']));
}
if (isset($count) && isset($pagesize)) {
$qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $count, qa_opt('pages_prev_next'), $pagelinkparams);
}
if (empty($qa_content['page_links'])) {
$qa_content['suggest_next'] = $suggest;
}
if (qa_using_categories() && count($navcategories) && isset($categorypathprefix)) {
$qa_content['navigation']['cat'] = qa_category_navigation($navcategories, $categoryid, $categorypathprefix, $categoryqcount, $categoryparams);
}
if (isset($feedpathprefix) && (qa_opt('feed_per_category') || !isset($categoryid))) {
$qa_content['feed'] = array('url' => qa_path_html(qa_feed_request($feedpathprefix . (isset($categoryid) ? '/' . qa_category_path_request($navcategories, $categoryid) : ''))), 'label' => strip_tags($sometitle));
}
return $qa_content;
}
示例10: process_request
function process_request($request)
{
$rqsts = explode('_', strtolower($request));
$qa_content = qa_content_prepare();
//$qa_content['title']=qa_lang_html('example_page/page_title');
//$qa_content['error']='An example error'."\n";
$qa_content['title'] = ' 资料下载';
$qa_content['custom'] = '<link href="' . $this->urltoroot . 'downpage.css" rel="stylesheet" type="text/css" />' . "\n";
//$qa_content['custom'].='Some <B>custom html</B>'."\n";
//
/*
$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>';
require_once $this->urltoroot . 'downloadhtml.php';
$qa_content['custom_2'] = setDownloadHtml($rqsts, $this->urltoroot);
//$qa_content['custom_2']=$this->urltoroot;
return $qa_content;
}
示例11: process_request
function process_request($request)
{
if (qa_get_logged_in_level() < QA_USER_LEVEL_ADMIN) {
$qa_content = qa_content_prepare();
$qa_content['error'] = "You don't have permission to access this page.";
return $qa_content;
}
$qa_content = qa_content_prepare();
$qa_content['site_title'] = "Infinity Theme";
$qa_content['title'] = "Theme Option";
$qa_content['error'] = "";
$qa_content['suggest_next'] = "";
$qa_content['custom'] = $this->page_form();
$qa_content['sidepanel'] = '';
return $qa_content;
}
示例12: qa_admin_check_privileges
function qa_admin_check_privileges(&$qa_content)
{
if (!qa_is_logged_in()) {
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/admin_title');
$qa_content['error'] = qa_insert_login_links(qa_lang_html('admin/not_logged_in'), qa_request());
return false;
} elseif (qa_get_logged_in_level() < QA_USER_LEVEL_ADMIN) {
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/admin_title');
$qa_content['error'] = qa_lang_html('admin/no_privileges');
return false;
}
return true;
}
示例13: process_request
function process_request($request)
{
$parts = explode('/', $request);
$tag = $parts[1];
$qa_content = qa_content_prepare();
$qa_content['title'] = 'Edit the description for Fture test ' . qa_html($tag);
require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
$qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'fields' => array(array('type' => 'text', 'rows' => 4, 'tags' => 'NAME="tagdesc" ID="tagdesc"', 'value' => qa_html(qa_db_tagmeta_get($tag, 'description')))), 'buttons' => array(array('tags' => 'NAME="dosave"', 'label' => 'Save Description')));
if (qa_clicked('dosave')) {
require_once QA_INCLUDE_DIR . 'qa-util-string.php';
$taglc = qa_strtolower($tag);
qa_db_tagmeta_set($taglc, 'description', qa_post_text('tagdesc'));
qa_redirect('tag/' . $tag);
}
$qa_content['focusid'] = 'tagdesc';
return $qa_content;
}
示例14: process_request
function process_request($request)
{
// perform userinfuser registration
$ui = new UserInfuser("ezegarra@yahoo.com", "0658a511-d890-4e51-ba9e-126d6c0a12f2");
$ui->update_user(qa_get_logged_in_email(), qa_get_logged_in_userid(), "", "");
$ui->award_points(qa_get_logged_in_email(), 1000);
$pw = $ui->get_widget(qa_get_logged_in_email(), "points", 100, 100);
$lw = $ui->get_widget(qa_get_logged_in_email(), "leaderboard", 600, 300);
$qa_content = qa_content_prepare();
$qa_content['title'] = 'Example plugin page';
$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' . qa_get_logged_in_userid(), '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>';
$qa_content['custom_3'] = $pw . $lw;
return $qa_content;
}
示例15: process_request
function process_request($request)
{
$qa_content = qa_content_prepare();
$qa_content['head_lines'][] = '<style>' . qa_opt('faq_css') . '</style>';
$qa_content['title'] = qa_opt('faq_page_title');
$qa_content['custom_0'] = $this->filter_subs(qa_opt('faq_pre_html')) . '<' . (qa_opt('faq_list_type') ? 'o' : 'u') . 'l class="qa-faq-list">';
$idx = 0;
while (qa_opt('faq_section_' . $idx)) {
$title = $this->filter_subs(qa_opt('faq_section_' . $idx . '_title'));
$text = $this->filter_subs(qa_opt('faq_section_' . $idx));
$qa_content['custom_' . ($idx + 1) . '_title'] = '<li class="qa-faq-list-item"><div id="custom_' . $idx . '_title" onclick="jQuery(\'#custom_' . $idx . '_text\').toggle(\'fast\')" class="qa-faq-section-title">' . $title . '</div>';
$qa_content['custom_' . ($idx + 1) . '_text'] = '<div id="custom_' . $idx . '_text" class="qa-faq-section-text">' . $text . '</div></li>';
$idx++;
}
$qa_content['custom_' . ++$idx] = '</' . (qa_opt('faq_list_type') ? 'o' : 'u') . 'l>';
$qa_content['custom_' . ++$idx] = $this->filter_subs(qa_opt('faq_post_html'));
return $qa_content;
}