本文整理汇总了PHP中qa_db_popular_tags_selectspec函数的典型用法代码示例。如果您正苦于以下问题:PHP qa_db_popular_tags_selectspec函数的具体用法?PHP qa_db_popular_tags_selectspec怎么用?PHP qa_db_popular_tags_selectspec使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qa_db_popular_tags_selectspec函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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>');
}
开发者ID:architbakliwal,项目名称:Q2A,代码行数:30,代码来源:qa-tag-cloud.php
示例2: output_widget
function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
$populartags = qa_db_single_select(qa_db_popular_tags_selectspec(0, (int) qa_opt('tag_cloud_count_tags')));
reset($populartags);
$maxcount = current($populartags);
$themeobject->output('<H2 STYLE="margin-top:0; padding-top:0;">', qa_lang_html('main/popular_tags'), '</H2>');
$themeobject->output('<DIV STYLE="font-size:10px;">');
$maxsize = qa_opt('tag_cloud_font_size');
$scale = qa_opt('tag_cloud_size_popular');
foreach ($populartags as $tag => $count) {
$size = number_format($scale ? $maxsize * $count / $maxcount : $maxsize, 1);
if ($size >= 5 || !$scale) {
$themeobject->output('<A HREF="' . qa_path_html('tag/' . $tag) . '" STYLE="font-size:' . $size . 'px; vertical-align:baseline;">' . qa_html($tag) . '</A>');
}
}
$themeobject->output('</DIV>');
}
开发者ID:ramo01,项目名称:1kapp,代码行数:18,代码来源:qa-tag-cloud.php
示例3: output_widget
function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
$widget_opt = @$themeobject->current_widget['param']['options'];
if (@$themeobject->current_widget['param']['locations']['show_title']) {
$themeobject->output('<h3 class="widget-title">' . qa_lang('cleanstrap/tags') . '<a href="' . qa_path_html('tags') . '">' . qa_lang('cleanstrap/view_all') . '</a></h3>');
}
$to_show = (int) $widget_opt['cs_tags_count'];
$populartags = qa_db_single_select(qa_db_popular_tags_selectspec(0, !empty($to_show) ? $to_show : 20));
reset($populartags);
$themeobject->output('<div class="ra-tags-widget clearfix">');
$blockwordspreg = qa_get_block_words_preg();
foreach ($populartags as $tag => $count) {
if (count(qa_block_words_match_all($tag, $blockwordspreg))) {
continue;
}
// skip censored tags
$themeobject->output('<a href="' . qa_path_html('tag/' . $tag) . '" class="widget-tag">' . qa_html($tag) . '<span>' . $count . '</span></a>');
}
$themeobject->output('</div>');
}
开发者ID:microbye,项目名称:CleanStrap,代码行数:21,代码来源:widget_tags.php
示例4: output_widget
function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
$populartags = qa_db_single_select(qa_db_popular_tags_selectspec(0, (int) qa_opt('tag_cloud_count_tags')));
reset($populartags);
$maxcount = current($populartags);
$themeobject->output('<h2 style="margin-top:0; padding-top:0;">', qa_lang_html('main/popular_tags'), '</h2>');
$themeobject->output('<div style="font-size:10px;">');
$maxsize = qa_opt('tag_cloud_font_size');
$scale = qa_opt('tag_cloud_size_popular');
$blockwordspreg = qa_get_block_words_preg();
foreach ($populartags as $tag => $count) {
if (count(qa_block_words_match_all($tag, $blockwordspreg))) {
continue;
}
// skip censored tags
$size = number_format($scale ? $maxsize * $count / $maxcount : $maxsize, 1);
if ($size >= 5 || !$scale) {
$themeobject->output('<a href="' . qa_path_html('tag/' . $tag) . '" style="font-size:' . $size . 'px; vertical-align:baseline;">' . qa_html($tag) . '</a>');
}
}
$themeobject->output('</div>');
}
开发者ID:gogupe,项目名称:question2answer-releases,代码行数:23,代码来源:qa-tag-cloud.php
示例5: header
header('Location: ../');
exit;
}
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
require_once QA_INCLUDE_DIR . 'qa-app-limits.php';
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-util-sort.php';
// Check whether this is a follow-on question and get some info we need from the database
$in = array();
$followpostid = qa_get('follow');
$in['categoryid'] = qa_get_category_field_value('category');
if (!isset($in['categoryid'])) {
$in['categoryid'] = qa_get('cat');
}
$userid = qa_get_logged_in_userid();
list($categories, $followanswer, $completetags) = qa_db_select_with_pending(qa_db_category_nav_selectspec($in['categoryid'], true), isset($followpostid) ? qa_db_full_post_selectspec($userid, $followpostid) : null, qa_db_popular_tags_selectspec(0, QA_DB_RETRIEVE_COMPLETE_TAGS));
if (!isset($categories[$in['categoryid']])) {
$in['categoryid'] = null;
}
if (@$followanswer['basetype'] != 'A') {
$followanswer = null;
}
// Check for permission error
$permiterror = qa_user_maximum_permit_error('permit_post_q', QA_LIMIT_QUESTIONS);
if ($permiterror) {
$qa_content = qa_content_prepare();
// The 'approve', 'login', 'confirm', 'limit', 'userblock', 'ipblock' permission errors are reported to the user here
// The other option ('level') prevents the menu option being shown, in qa_content_prepare(...)
switch ($permiterror) {
case 'login':
$qa_content['error'] = qa_insert_login_links(qa_lang_html('question/ask_must_login'), qa_request(), isset($followpostid) ? array('follow' => $followpostid) : null);
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:31,代码来源:qa-page-ask.php
示例6: qa_redirect
qa_redirect(qa_q_request($questionid, $qin['title']));
} else {
$formtype = 'q_edit';
// keep editing if an error
$pageerror = @$qerrors['page'];
// for security code failure
}
} else {
if ($pagestate == 'edit-' . $questionid && qa_page_q_permit_edit($question, 'permit_edit_q', $pageerror, 'permit_retag_cat')) {
$formtype = 'q_edit';
}
}
if ($formtype == 'q_edit') {
// get tags for auto-completion
if (qa_opt('do_complete_tags')) {
$completetags = array_keys(qa_db_select_with_pending(qa_db_popular_tags_selectspec(0, QA_DB_RETRIEVE_COMPLETE_TAGS)));
} else {
$completetags = array();
}
}
}
// Process adding a comment to question (shows form or processes it)
if ($question['commentbutton']) {
if (qa_clicked('q_docomment')) {
qa_page_q_refresh($pagestart, 'comment-' . $questionid);
}
if (qa_clicked('c' . $questionid . '_doadd') || $pagestate == 'comment-' . $questionid) {
qa_page_q_do_comment($question, $question, $commentsfollows, $pagestart, $usecaptcha, $cnewin, $cnewerrors, $formtype, $formpostid, $pageerror);
}
}
// Process clicked buttons for answers
开发者ID:netham91,项目名称:question2answer,代码行数:31,代码来源:qa-page-question-post.php
示例7: header
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
// don't allow this page to be requested directly from browser
header('Location: ../');
exit;
}
// report that we entered this page
qa_report_event('page_enter', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array('params' => $_SERVER['QUERY_STRING'], 'path' => $_SERVER['SCRIPT_NAME']));
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
// Get popular tags
$populartags = qa_db_select_with_pending(qa_db_popular_tags_selectspec($qa_start));
$tagcount = qa_opt('cache_tagcount');
$pagesize = qa_opt('page_size_tags');
// Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('main/popular_tags');
$qa_content['ranking'] = array('items' => array(), 'rows' => ceil($pagesize / qa_opt('columns_tags')), 'type' => 'tags');
if (count($populartags)) {
$output = 0;
foreach ($populartags as $word => $count) {
$qa_content['ranking']['items'][] = array('label' => qa_tag_html($word), 'count' => number_format($count));
if (++$output >= $pagesize) {
break;
}
}
} else {
开发者ID:TheProjecter,项目名称:microprobe,代码行数:31,代码来源:qa-page-tags.php
示例8: header
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
// don't allow this page to be requested directly from browser
header('Location: ../');
exit;
}
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
// Get popular tags
$start = qa_get_start();
$userid = qa_get_logged_in_userid();
$populartags = qa_db_select_with_pending(qa_db_popular_tags_selectspec($start, qa_opt_if_loaded('page_size_tags')));
$tagcount = qa_opt('cache_tagcount');
$pagesize = qa_opt('page_size_tags');
// Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('main/popular_tags');
$qa_content['ranking'] = array('items' => array(), 'rows' => ceil($pagesize / qa_opt('columns_tags')), 'type' => 'tags');
if (count($populartags)) {
$favoritemap = qa_get_favorite_non_qs_map();
$output = 0;
foreach ($populartags as $word => $count) {
$qa_content['ranking']['items'][] = array('label' => qa_tag_html($word, false, @$favoritemap['tag'][qa_strtolower($word)]), 'count' => number_format($count));
if (++$output >= $pagesize) {
break;
}
}
开发者ID:justblues,项目名称:LEMP-Q2A,代码行数:31,代码来源:qa-page-tags.php
示例9: cs_tag_list
function cs_tag_list($limit = 20)
{
$populartags = qa_db_single_select(qa_db_popular_tags_selectspec(0, $limit));
$i = 1;
foreach ($populartags as $tag => $count) {
echo '<li><a class="icon-tag" href="' . qa_path_html('tag/' . $tag) . '">' . qa_html($tag) . '<span>' . filter_var($count, FILTER_SANITIZE_NUMBER_INT) . '</span></a></li>';
}
}
开发者ID:microbye,项目名称:CleanStrap,代码行数:8,代码来源:functions.php
示例10: elseif
$categoryslug = $category['tags'];
} else {
$categoryslug = 'example-category';
}
if (qa_opt('feed_for_qa')) {
$feedrequest = 'qa';
} elseif (qa_opt('feed_for_questions')) {
$feedrequest = 'questions';
} else {
$feedrequest = 'activity';
}
$feedrequest .= '/' . $categoryslug;
$feedisexample = true;
break;
case 'feed_for_tag_qs':
$populartags = qa_db_select_with_pending(qa_db_popular_tags_selectspec(0, 1));
if (count($populartags)) {
reset($populartags);
$feedrequest = 'tag/' . key($populartags);
} else {
$feedrequest = 'tag/singing';
}
$feedisexample = true;
break;
case 'feed_for_search':
$feedrequest = 'search/why do birds sing';
$feedisexample = true;
break;
case 'moderate_users':
$optionfield['note'] = '<a href="' . qa_path_html('admin/users', null, null, null, 'profile_fields') . '">' . qa_lang_html('admin/registration_fields') . '</a>';
break;
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:31,代码来源:qa-page-admin-default.php
注:本文中的qa_db_popular_tags_selectspec函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论