예제 #1
0
 /**
  * Generates a list of RSS feed items.
  *
  * @return    void
  */
 function display()
 {
     $app = JFactory::getApplication();
     $doc = JFactory::getDocument();
     $params = $app->getParams();
     $doc->link = htmlspecialchars(JFactory::getURI()->toString());
     $feed_email = $app->getCfg('feed_email') == '' ? 'site' : $app->getCfg('feed_email');
     $site_email = $app->getCfg('mailfrom');
     // Set the query limit to the feed setting
     JRequest::setVar('limit', (int) $app->getCfg('feed_limit', 20));
     // Get model data
     $rows = $this->get('Items');
     foreach ($rows as $row) {
         // Load individual item creator class
         $item = new JFeedItem();
         $item->title = html_entity_decode($this->escape($row->title), ENT_COMPAT, 'UTF-8');
         $item->link = JRoute::_(PFforumHelperRoute::getTopicRoute($row->slug, $row->project_slug));
         $item->description = $row->description;
         $item->date = $row->created ? date('r', strtotime($row->created)) : '';
         $item->author = $row->author_name;
         $item->authorEmail = $feed_email == 'site' ? $site_email : $row->author_email;
         // Categorize the item
         if (!empty($row->project_title)) {
             $item->category = array(html_entity_decode($this->escape($row->project_title), ENT_COMPAT, 'UTF-8'));
         }
         // Loads item info into the RSS array
         $doc->addItem($item);
     }
 }
예제 #2
0
파일: pfforum.php 프로젝트: MrJookie/pm
 protected function getTitleLink()
 {
     if ($this->client_id) {
         $link = 'index.php?option=' . $this->item->extension . '&task=' . $this->item->name . '.edit' . '&id=' . (int) $this->item->item_id;
     } else {
         $meta =& $this->item->metadata;
         if ($this->item->name == 'topic') {
             $item_slug = $this->item->item_id . ':' . $meta->get('alias');
             $p_slug = $this->item->xref_id . ':' . $meta->get('p_alias');
             $link = PFforumHelperRoute::getTopicRoute($item_slug, $p_slug);
         }
         if ($this->item->name == 'reply') {
             $t_slug = $meta->get('t_id') . ':' . $meta->get('t_alias');
             $p_slug = $this->item->xref_id . ':' . $meta->get('p_alias');
             $link = PFforumHelperRoute::getTopicRoute($t_slug, $p_slug);
         }
     }
     return JRoute::_($link);
 }
 /**
  * Method to generate the email message
  *
  * @param     object     $lang         Instance of the default user language
  * @param     object     $receiveer    Instance of the the receiving user
  * @param     object     $user         Instance of the user who made the change
  * @param     object     $after        Instance of the item table after it was updated
  * @param     object     $before       Instance of the item table before it was updated
  * @param     boolean    $is_new       True if the item is new ($before will be null)
  *
  * @return    string
  */
 public static function getReplyMessage($lang, $receiver, $user, $after, $before, $is_new)
 {
     if (!$is_new) {
         return false;
     }
     $txt_prefix = 'COM_PROJECTFORK_REPLY_EMAIL_' . ($is_new ? 'NEW' : 'UPD');
     $format = $lang->_($txt_prefix . '_MESSAGE');
     $footer = sprintf($lang->_('COM_PROJECTFORK_EMAIL_FOOTER'), JURI::root());
     $link = JRoute::_(JURI::root() . PFforumHelperRoute::getTopicRoute($after->topic_id, $after->project_id));
     $txt = sprintf($format, $receiver->name, $user->name, strip_tags($after->description), $link);
     $txt = str_replace('\\n', "\n", $txt . "\n\n" . $footer);
     return $txt;
 }
예제 #4
0
    	    	    			<div class="btn-group">
    	    	    			    <a class="btn btn-mini" href="<?php 
        echo JRoute::_('index.php?option=com_pfforum&task=topicform.edit&id=' . $item->id);
        ?>
">
    	    	    			        <span aria-hidden="true" class="icon-pencil"></span> <?php 
        echo JText::_('COM_PROJECTFORK_ACTION_EDIT');
        ?>
    	    	    			    </a>
    	    	    			</div>
	    	    			<?php 
    }
    ?>
    	    				<div class="btn-group">
    	    					<a class="btn btn-mini" href="<?php 
    echo JRoute::_(PFforumHelperRoute::getTopicRoute($item->slug, $item->project_slug));
    ?>
">
    	    			       	    <span aria-hidden="true" class="icon-comment"></span> <?php 
    echo JText::plural('COM_PROJECTFORK_N_REPLIES', (int) $item->replies);
    ?>
    	    			        </a>
    	    			    </div>

                			<?php 
    echo $watch;
    ?>
                		</div>
    				</div>
    			</div>
    			<!-- End Topic -->