-
Notifications
You must be signed in to change notification settings - Fork 11
/
tag-widget.php
39 lines (29 loc) · 938 Bytes
/
tag-widget.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
class useo_tag_widget {
function allow_template($template)
{
return ($template=='tag');
}
function allow_region($region)
{
return true;
}
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>';
}
}