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


PHP producthelper::getQuestionAnswer方法代码示例

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


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

示例1: display

 public function display($tpl = null)
 {
     $producthelper = new producthelper();
     $option = JRequest::getVar('option');
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSHOP_ANSWER'));
     $uri = JFactory::getURI();
     $lists = array();
     $model = $this->getModel();
     $detail = $this->get('data');
     $qdetail = $producthelper->getQuestionAnswer($detail->parent_id);
     if (count($qdetail) > 0) {
         $qdetail = $qdetail[0];
     }
     $isNew = $detail->question_id < 1;
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     JToolBarHelper::title(JText::_('COM_REDSHOP_ANSWER_DETAIL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_question48');
     JToolBarHelper::save();
     JToolBarHelper::custom('send', 'send.png', 'send.png', JText::_('COM_REDSHOP_SEND'), false);
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     $option = $model->getProduct();
     $optionsection = array();
     $optionsection[0]->product_id = 0;
     $optionsection[0]->product_name = JText::_('COM_REDSHOP_SELECT');
     if (count($option) > 0) {
         $optionsection = @array_merge($optionsection, $option);
     }
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published);
     $lists['product_id'] = JHTML::_('select.genericlist', $optionsection, 'product_id', 'class="inputbox" size="1" ', 'product_id', 'product_name', $detail->product_id);
     $this->assignRef('lists', $lists);
     $this->assignRef('detail', $detail);
     $this->assignRef('qdetail', $qdetail);
     $this->assignRef('request_url', $uri->toString());
     parent::display($tpl);
 }
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:39,代码来源:view.html.php

示例2: count

</th>
				<th width="5%">
					<?php 
echo JHTML::_('grid.sort', 'COM_REDSHOP_ID', 'question_id', $this->lists['order_Dir'], $this->lists['order']);
?>
</th>
			</tr>
			</thead>
			<?php 
$k = 0;
for ($i = 0, $n = count($this->question); $i < $n; $i++) {
    $row =& $this->question[$i];
    $row->id = $row->question_id;
    $link = JRoute::_('index.php?option=com_redshop&view=question_detail&task=edit&cid[]=' . $row->id);
    $anslink = JRoute::_('index.php?option=com_redshop&view=question_detail&task=edit&cid[]=' . $row->id . '#answerlists');
    $answer = $producthelper->getQuestionAnswer($row->id, 0, 1);
    $answer = count($answer);
    $published = JHtml::_('jgrid.published', $row->published, $i, '', 1);
    ?>
				<tr class="<?php 
    echo "row{$k}";
    ?>
">
					<td align="center"><?php 
    echo $this->pagination->getRowOffset($i);
    ?>
</td>
					<td align="center"><?php 
    echo JHTML::_('grid.id', $i, $row->id);
    ?>
</td>
开发者ID:,项目名称:,代码行数:31,代码来源:

示例3: sendAskQuestionMail

 public function sendAskQuestionMail($ansid)
 {
     $producthelper = new producthelper();
     $uri = JURI::getInstance();
     $url = $uri->root();
     $option = JRequest::getVar('option');
     $subject = "";
     $data_add = "";
     $mailbcc = null;
     $mailinfo = $this->getMailtemplate(0, "ask_question_mail");
     $ans = $producthelper->getQuestionAnswer($ansid);
     if (count($mailinfo) > 0) {
         $data_add = $mailinfo[0]->mail_body;
         $subject = $mailinfo[0]->mail_subject;
         $mailbcc = explode(",", $mailinfo[0]->mail_bcc);
     }
     if (count($ans) > 0) {
         $ans = $ans[0];
         $fromname = $ans->user_name;
         $from = $ans->user_email;
         $email = explode(",", trim(ADMINISTRATOR_EMAIL));
         $question = $ans->question;
         $answer = "";
         $telephone = "";
         $address = "";
         $product_id = $ans->product_id;
         if ($ans->parent_id) {
             $answer = $ans->question;
             $qdetail = $producthelper->getQuestionAnswer($ans->parent_id);
             if (count($qdetail) > 0) {
                 $config = JFactory::getConfig();
                 $from = $config->getValue('mailfrom');
                 $fromname = $config->getValue('fromname');
                 $qdetail = $qdetail[0];
                 $question = $qdetail->question;
                 $email = $qdetail->user_email;
                 $product_id = $qdetail->product_id;
                 $address = $qdetail->address;
                 $telephone = $qdetail->telephone;
             }
         }
         $product = $producthelper->getProductById($product_id);
         $link = JRoute::_($url . "index.php?option=" . $option . "&view=product&pid=" . $product_id);
         $data_add = str_replace("{product_name}", $product->product_name, $data_add);
         $data_add = str_replace("{product_desc}", $product->product_desc, $data_add);
         $product_url = "<a href=" . $link . ">" . $product->product_name . "</a>";
         $data_add = str_replace("{product_link}", $product_url, $data_add);
         $data_add = str_replace("{user_question}", $question, $data_add);
         $data_add = str_replace("{answer}", $answer, $data_add);
         $data_add = str_replace("{user_address}", $address, $data_add);
         $data_add = str_replace("{user_telephone}", $telephone, $data_add);
         $subject = str_replace("{user_question}", $question, $subject);
         $subject = str_replace("{shopname}", SHOP_NAME, $subject);
         $subject = str_replace("{product_name}", $product->product_name, $subject);
         if ($email) {
             if (JUtility::sendMail($from, $fromname, $email, $subject, $data_add, $mode = 1, null, $mailbcc)) {
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:62,代码来源:mail.php

示例4: explode

// Product subscription type ene here
// PRODUCT QUESTION START
if (strstr($template_desc, "{question_loop_start}") && strstr($template_desc, "{question_loop_end}")) {
    $qstart = $template_desc;
    $qmiddle = "";
    $qend = "";
    $question_start = explode("{question_loop_start}", $template_desc);
    if (count($question_start) > 0) {
        $qstart = $question_start[0];
        $question_end = explode("{question_loop_end}", $question_start[1]);
        if (count($question_end) > 1) {
            $qmiddle = $question_end[0];
            $qend = $question_end[1];
        }
    }
    $product_question = $producthelper->getQuestionAnswer(0, $this->data->product_id, 0, 1);
    $questionloop = "";
    if ($qmiddle != "") {
        for ($q = 0; $q < count($product_question); $q++) {
            $qloop = str_replace("{question}", $product_question[$q]->question, $qmiddle);
            $qloop = str_replace("{question_date}", $config->convertDateFormat($product_question[$q]->question_date), $qloop);
            $qloop = str_replace("{question_owner}", $product_question[$q]->user_name, $qloop);
            $astart = $qloop;
            $amiddle = "";
            $aend = "";
            $answer_start = explode("{answer_loop_start}", $qloop);
            if (count($answer_start) > 0) {
                $astart = $answer_start[0];
                $answer_end = explode("{answer_loop_end}", $answer_start[1]);
                if (count($answer_end) > 0) {
                    $amiddle = $answer_end[0];
开发者ID:,项目名称:,代码行数:31,代码来源:


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