当前位置: 首页>>代码示例>>PHP>>正文


PHP Comments::check_for_topic方法代码示例

本文整理汇总了PHP中Comments::check_for_topic方法的典型用法代码示例。如果您正苦于以下问题:PHP Comments::check_for_topic方法的具体用法?PHP Comments::check_for_topic怎么用?PHP Comments::check_for_topic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Comments的用法示例。


在下文中一共展示了Comments::check_for_topic方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$smarty->assign('pdf_export', $prefs['print_pdf_from_url'] != 'none' ? 'y' : 'n');
// Display the Index Template
$pageRenderer->runSetups();
//TRANSLATING HTML
$page_content = (string) $smarty->getTemplateVars('parsed');
// convert from Tiki_Render_Lazy to string here
if (!empty($_REQUEST['machine_translate_to_lang'])) {
    $page_content = generate_machine_translated_content($page_content, $info, $_REQUEST['machine_translate_to_lang']);
    $smarty->assign('parsed', $page_content);
}
TikiLib::events()->trigger('tiki.wiki.view', array_merge(is_array($info) ? $info : array(), array('type' => 'wiki page', 'object' => $page, 'user' => $GLOBALS['user'])));
if ($prefs['feature_forums'] && $prefs['feature_wiki_discuss'] == 'y' && $prefs['wiki_discuss_visibility'] == 'above') {
    include_once 'lib/comments/commentslib.php';
    $commentslib = new Comments($dbTiki);
    $comments_data = tra('Use this thread to discuss the page:') . " [tiki-index.php?page=" . rawurlencode($page) . "|{$page}]";
    $threadId = $commentslib->check_for_topic($page, $comments_data);
    $comments_coms = $commentslib->get_forum_topics($prefs['wiki_forum_id'], 0, -1);
    $discuss_replies_cant = 0;
    foreach ($comments_coms as $topic) {
        if ($topic['threadId'] == $threadId) {
            $discuss_replies_cant = $topic['replies'];
            break;
        }
    }
    $smarty->assign('discuss_replies_cant', $discuss_replies_cant);
}
$smarty->assign('info', $info);
$smarty->assign('mid', 'tiki-show_page.tpl');
$smarty->display('tiki-show_page.tpl');
// xdebug_dump_function_profile(XDEBUG_PROFILER_CPU);
// debug: print all objects
开发者ID:rjsmelo,项目名称:tiki,代码行数:31,代码来源:tiki-index.php

示例2: urlencode

	$threadId = $commentslib->post_in_forum($forum_info, $_REQUEST, $feedbacks, $errors);
	if ($threadId && $prefs['feature_freetags'] == 'y') {
		$cat_type = 'forum post';
		$cat_objid = $threadId;
		include_once ('freetag_apply.php');	
	}
	$smarty->assign_by_ref('errors', $errors);
	$smarty->assign_by_ref('feedbacks', $feedbacks);
}

// Here we send the user to the right thread/topic if it already exists; this
// is used for the 'discuss' tab. This is done down here because the thread
// might have to be created, which happens above.
if (isset($_REQUEST['comments_postComment'])) {
	// Check if the thread/topic already existis
	$threadId = $commentslib->check_for_topic($_REQUEST['comments_title'], $_REQUEST['comments_data']);
	// If it does, send the user there with no delay.
	if ($threadId) {
		// If the samely titled comment already
		// exists, go straight to it.
		$url = 'tiki-view_forum_thread.php?comments_parentId=' . urlencode($threadId) . '&forumId=' . urlencode($_REQUEST["forumId"]);
		header('location: ' . $url);
		exit;
	}
}

if ($tiki_p_admin_forum == 'y' || $tiki_p_forum_vote == 'y') {
	// Process a vote here
	if (isset($_REQUEST['comments_vote']) && isset($_REQUEST['comments_threadId'])) {
		check_ticket('view-forum');
		$comments_show = 'y';
开发者ID:railfuture,项目名称:tiki-website,代码行数:31,代码来源:tiki-view_forum.php

示例3: sendForumEmailNotification

         $commentslib->add_thread_attachment($forum_info, $qId, $fp, '', $_FILES['userfile1']['name'], $_FILES['userfile1']['type'], $_FILES['userfile1']['size']);
     }
     //END ATTACHMENT PROCESSING
     // Now process attchement here (queued attachment)
 } else {
     $smarty->assign('was_queued', 'n');
     if ($_REQUEST["comments_threadId"] == 0) {
         if (!isset($_REQUEST['comment_topicsummary'])) {
             $_REQUEST['comment_topicsummary'] = '';
         }
         if (!isset($_REQUEST['comment_topicsmiley'])) {
             $_REQUEST['comment_topicsmiley'] = '';
         }
         $message_id = '';
         // Check if the thread/topic already exist
         $threadId = $commentslib->check_for_topic($_REQUEST["comments_title"], $_REQUEST["comments_data"]);
         // The thread/topic does not already exist
         if (!$threadId) {
             $threadId = $commentslib->post_new_comment($comments_objectId, 0, $user, $_REQUEST["comments_title"], $_REQUEST["comments_data"], $message_id, '', $_REQUEST["comment_topictype"], $_REQUEST["comment_topicsummary"], $_REQUEST['comment_topicsmiley']);
             // The thread *WAS* successfully created.
             if ($threadId) {
                 // Deal with mail notifications.
                 include_once 'lib/notifications/notificationemaillib.php';
                 sendForumEmailNotification('forum_post_topic', $_REQUEST['forumId'], $forum_info, $_REQUEST["comments_title"], $_REQUEST["comments_data"], $user, $_REQUEST["comments_title"], $message_id, '', $threadId);
             }
         }
         // PROCESS ATTACHMENT HERE
         if ($threadId && isset($_FILES['userfile1']) && is_uploaded_file($_FILES['userfile1']['tmp_name'])) {
             check_ticket('view-forum');
             $fp = fopen($_FILES['userfile1']['tmp_name'], "rb");
             $commentslib->add_thread_attachment($forum_info, $threadId, $fp, '', $_FILES['userfile1']['name'], $_FILES['userfile1']['type'], $_FILES['userfile1']['size']);
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:tiki-view_forum.php


注:本文中的Comments::check_for_topic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。