示例#1
0
','<?php 
        echo $row->id;
        ?>
');">
									<span><?php 
        echo JText::_('COM_EASYBLOG_SUBSCRIBE_TEAM');
        ?>
</span>
								</a>
							</li>
						<?php 
    }
    ?>

						<?php 
    if (($row->access != EBLOG_TEAMBLOG_ACCESS_MEMBER || $row->isMember || EasyBloghelper::isSiteAdmin()) && $system->config->get('main_rss')) {
        ?>
							<li>
								<a class="link-rss" href="<?php 
        echo EasyBlogHelper::getHelper('Feeds')->getFeedURL('index.php?option=com_easyblog&view=teamblog&id=' . $row->id);
        ?>
" title="<?php 
        echo JText::_('COM_EASYBLOG_SUBSCRIBE_FEEDS');
        ?>
">
									<span><?php 
        echo JText::_('COM_EASYBLOG_SUBSCRIBE_FEEDS');
        ?>
</span>
								</a>
							</li>
示例#2
0
 public function updateComment()
 {
     $mainframe = JFactory::getApplication();
     $my = JFactory::getUser();
     $acl = EasyBlogACLHelper::getRuleSet();
     $redirect = EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard&layout=comments', false);
     $id = JRequest::getInt('id');
     $post = JRequest::get('POST');
     array_walk($post, array($this, '_trim'));
     //add here so that other component with the same comment.php jtable file will not get reference.
     JTable::addIncludePath(EBLOG_TABLES);
     $comment = EasyBlogHelper::getTable('Comment', 'Table');
     $comment->bindPost($post);
     $blog = EasyBlogHelper::getTable('Blog', 'Table');
     $blog->load($comment->post_id);
     // @rule: Test if the current browser is allowed to do this or not.
     if ($blog->created_by != $my->id && !EasyBloghelper::isSiteAdmin() && empty($acl->rules->edit_comment)) {
         EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_NO_PERMISSION_TO_UPDATE_COMMENT'), 'error');
         $mainframe->redirect($redirect);
         $mainframe->close();
     }
     if (!$comment->validate('title')) {
         EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_COMMENT_TITLE_IS_EMPTY'), 'error');
         $mainframe->redirect($redirect);
         $mainframe->close();
     }
     if (!$comment->validate('name')) {
         EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_COMMENT_NAME_IS_EMPTY'), 'error');
         $mainframe->redirect($redirect);
         $mainframe->close();
     }
     if (!$comment->validate('email')) {
         EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_COMMENT_EMAIL_IS_EMPTY'), 'error');
         $mainframe->redirect($redirect);
         $mainframe->close();
     }
     if (!$comment->validate('comment')) {
         EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_COMMENT_IS_EMPTY'), 'error');
         $mainframe->redirect($redirect);
         $mainframe->close();
     }
     $comment->modified = EasyBlogHelper::getDate()->toMySQL();
     if (!$comment->store()) {
         EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_COMMENT_FAILED_TO_SAVE'), 'error');
         $mainframe->redirect($redirect);
         $mainframe->close();
     }
     EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_DASHBOARD_BOMMENTS_COMMENT_UPDATED_SUCCESS'), 'success');
     $mainframe->redirect($redirect);
     $mainframe->close();
 }