Example #1
0
 function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
 {
     require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
     $parts = explode('/', $request);
     $tag = $parts[1];
     $description = qa_db_tagmeta_get($tag, 'description');
     $editurlhtml = qa_path_html('tag-edit/' . $tag);
     if (strlen($description)) {
         echo qa_html($description);
         echo ' - <A HREF="' . $editurlhtml . '">edit</A>';
     } else {
         echo '<A HREF="' . $editurlhtml . '">Create tag description</A>';
     }
 }
Example #2
0
 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;
 }
 function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
 {
     require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
     $parts = explode('/', $request);
     $tag = $parts[1];
     $description = qa_db_tagmeta_get($tag, 'description');
     if (!qa_opt('useo_tag_desc_sidebar_html')) {
         $description = qa_html($description);
     }
     $editurlhtml = qa_path_html('tag-edit/' . $tag);
     $allowediting = !qa_user_permit_error('useo_tag_desc_permit_edit');
     if (strlen($description)) {
         echo '<SPAN CLASS="entry-content qa-tag-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>';
     }
 }
 function process_request($request)
 {
     $parts = explode('/', $request);
     $tag = $parts[1];
     $qa_content = qa_content_prepare();
     $qa_content['title'] = qa_lang_html_sub('useo/edit_desc_for_x', qa_html($tag));
     if (qa_user_permit_error('useo_tag_desc_permit_edit')) {
         $qa_content['error'] = qa_lang_html('users/no_permission');
         return $qa_content;
     }
     require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
     if (qa_clicked('dosave')) {
         require_once QA_INCLUDE_DIR . 'qa-util-string.php';
         $taglc = qa_strtolower($tag);
         qa_db_tagmeta_set($taglc, 'title', qa_post_text('tagtitle'));
         qa_db_tagmeta_set($taglc, 'description', qa_post_text('tagdesc'));
         qa_db_tagmeta_set($taglc, 'icon', qa_post_text('tagicon'));
         qa_redirect('tag/' . $tag);
     }
     $qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'fields' => array(array('label' => 'Title:', 'type' => 'text', 'rows' => 2, 'tags' => 'NAME="tagtitle" ID="tagtitle"', 'value' => qa_html(qa_db_tagmeta_get($tag, 'title'))), array('label' => 'Description:', 'type' => 'text', 'rows' => 4, 'tags' => 'NAME="tagdesc" ID="tagdesc"', 'value' => qa_html(qa_db_tagmeta_get($tag, 'description'))), array('label' => 'Icon image:', 'type' => 'text', 'rows' => 1, 'tags' => 'NAME="tagicon" ID="tagicon"', 'value' => qa_html(qa_db_tagmeta_get($tag, 'icon')))), 'buttons' => array(array('tags' => 'NAME="dosave"', 'label' => qa_lang_html('useo/save_desc_button'))));
     $qa_content['focusid'] = 'tagdesc';
     return $qa_content;
 }