當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CKunenaLink::GetReportURL方法代碼示例

本文整理匯總了PHP中CKunenaLink::GetReportURL方法的典型用法代碼示例。如果您正苦於以下問題:PHP CKunenaLink::GetReportURL方法的具體用法?PHP CKunenaLink::GetReportURL怎麽用?PHP CKunenaLink::GetReportURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CKunenaLink的用法示例。


在下文中一共展示了CKunenaLink::GetReportURL方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _sendPrepareReport

 protected function _sendPrepareReport($type)
 {
     if (!$this->reportAllowed()) {
         return false;
     }
     if (!JRequest::checkToken()) {
         while (@ob_end_clean()) {
         }
         $this->app->redirect(CKunenaLink::GetThreadPageURL('view', $this->catid, $this->id, NULL, NULL, $this->id, false), COM_KUNENA_ERROR_TOKEN, 'error');
         return false;
     }
     if (!empty($this->reason) && !empty($this->text)) {
         if ($this->id) {
             $query = "SELECT a.id, a.thread, a.name AS nickname, a.catid, a.userid, a.subject, b.mesid, b.message AS msg_text, c.username, c.name, c.id AS userid\n\t\t\t\t\t\t\tFROM #__kunena_messages AS a\n\t\t\t\t\t\t\tINNER JOIN #__kunena_messages_text AS b ON b.mesid = a.id\n\t\t\t\t\t\t\tLEFT JOIN #__users AS c ON c.id = a.userid\n\t\t\t\t\t\t\tWHERE a.id={$this->_db->Quote($this->id)}";
             $this->_db->setQuery($query);
             $row = $this->_db->loadObject();
             if (KunenaError::checkDatabaseError()) {
                 return;
             }
             if ($row->userid && $row->username) {
                 $baduser = $this->config->username ? $row->username : $row->name;
             } else {
                 $baduser = $row->nickname;
             }
             if ($this->reason) {
                 $subject = "[" . $this->config->board_title . " " . JText::_('COM_KUNENA_GEN_FORUM') . "] " . JText::_('COM_KUNENA_REPORT_MSG') . ": " . $this->reason;
             } else {
                 $subject = "[" . $this->config->board_title . " " . JText::_('COM_KUNENA_GEN_FORUM') . "] " . JText::_('COM_KUNENA_REPORT_MSG') . ": " . $row->subject;
             }
             jimport('joomla.environment.uri');
             $uri =& JURI::getInstance(JURI::base());
             $msglink = $uri->toString(array('scheme', 'host', 'port')) . str_replace('&', '&', CKunenaLink::GetThreadPageURL('view', $row->catid, $row->id, NULL, NULL, $row->id));
             $message = "" . JText::_('COM_KUNENA_REPORT_RSENDER') . " " . $this->_getSenderName();
             $message .= "\n";
             $message .= "" . JText::_('COM_KUNENA_REPORT_RREASON') . " " . $this->reason;
             $message .= "\n";
             $message .= "" . JText::_('COM_KUNENA_REPORT_RMESSAGE') . " " . $this->text;
             $message .= "\n\n";
             $message .= "" . JText::_('COM_KUNENA_REPORT_POST_POSTER') . " " . $baduser;
             $message .= "\n";
             $message .= "" . JText::_('COM_KUNENA_REPORT_POST_SUBJECT') . " " . $row->subject;
             $message .= "\n";
             $message .= "" . JText::_('COM_KUNENA_REPORT_POST_MESSAGE') . "\n-----\n" . $row->msg_text;
             $message .= "\n-----\n\n";
             $message .= "" . JText::_('COM_KUNENA_REPORT_POST_LINK') . " " . $msglink;
             $message .= "\n\n\n\n** Powered by Kunena! - http://www.kunena.org **";
             $message = strtr($message, array(' ' => ''));
             $emailToList = CKunenaTools::getEMailToList($row->catid, $row->thread, false, true, true, $this->my->id);
             if ($type == '0') {
                 // send by mail
                 $this->_sendReportToMail($message, $subject, $emailToList);
             } else {
                 if ($type == '1') {
                     // send by PM
                     // Function not yet implemented
                 } else {
                     // send by PM and mail
                     // Function not yet implemented
                 }
             }
         }
     } else {
         // Do nothing empty subject or reason is empty
         $this->app->enqueueMessage(JText::_('COM_KUNENA_REPORT_FORG0T_SUB_MES'));
         while (@ob_end_clean()) {
         }
         $this->app->redirect(CKunenaLink::GetReportURL());
     }
 }
開發者ID:vuchannguyen,項目名稱:hoctap,代碼行數:69,代碼來源:kunena.report.class.php

示例2: intval

$this->id = JRequest::getInt('id', 0);
$this->catid = JRequest::getInt('catid', 0);
?>

<div class="kblock kreport">
	<div class="kheader">
		<h2><span><?php 
echo JText::_('COM_KUNENA_COM_A_REPORT');
?>
</span></h2>
	</div>
	<div class="kcontainer">
		<div class="kbody">
			<div id="kreport-container">
				<form method = "post" action = "<?php 
echo CKunenaLink::GetReportURL();
?>
" class="kform-report">
					<label for="kreport-reason"><?php 
echo JText::_('COM_KUNENA_REPORT_REASON');
?>
:</label>
					<input type = "text" name = "reason" class = "inputbox" size = "30" id="kreport-reason"/>
					<label for="kreport-msg"><?php 
echo JText::_('COM_KUNENA_REPORT_MESSAGE');
?>
:</label>
					<textarea id = "kreport-msg" name = "text" cols = "40" rows = "10" class = "inputbox"></textarea>
					<input type = "hidden" name = "id" value = "<?php 
echo intval($this->id);
?>
開發者ID:vuchannguyen,項目名稱:hoctap,代碼行數:31,代碼來源:report.php


注:本文中的CKunenaLink::GetReportURL方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。