示例#1
0
 function setIcs20($posts)
 {
     $events20 = PostHelper::getEvents($posts, EventData::$twenty);
     $email = array_key_exists('employee', $this->emails) ? $this->emails['employee'] : '';
     $icsgen = new IcsGenerator($events20, $email, EventData::$calendarNames[0]);
     $this->events['ev20'] = $icsgen->getString();
     //var_dump($this->events);
 }
示例#2
0
 /**
  * postMessages
  *
  * @return  void
  */
 public function publishPosts()
 {
     if ($this->cron_enabled) {
         if (AUTOTWEETNG_JOOCIAL) {
             $now = JFactory::getDate();
             if (VirtualManager::getInstance()->isWorking($now)) {
                 PostHelper::publishCronjobPosts($this->max_posts);
             } else {
                 $logger = AutotweetLogger::getInstance();
                 $logger->log(JLog::INFO, 'CronjobHelper::publishPosts - VM not working now ' . $now->toISO8601(true));
             }
         } else {
             PostHelper::publishCronjobPosts($this->max_posts);
         }
     }
 }
示例#3
0
    <div class="media-body well">
        <div class="forum-text-area">

            <?php 
if ($data['child_reply']) {
    ?>
                <?php 
    $childReply = Reply::model()->getChildReplyPosting($data['child_reply']);
    $this->widget('bootstrap.widgets.TbBox', array('title' => "In reply to <a href='#'>" . PostHelper::PrintPosterName($childReply['username'], $childReply['user_group_id']) . "</a>", 'headerIcon' => 'icon-arrow-left', 'content' => $childReply['is_active'] ? CHtml::decode($childReply['message']) : PostHelper::PrintDisabledMessage()));
    ?>
            <?php 
}
?>

            <?php 
echo $data['is_active'] ? CHtml::decode($data['message']) : PostHelper::PrintDisabledMessage();
?>
        </div>
        
        <?php 
if ($data['is_active']) {
    ?>
           
        <div class="forum-post-bottom-bar">
<?php 
    echo CHtml::link("<i class='icon-warning-sign'></i>" . Yii::t('forum', 'forum.view.report'), array('post/report', 'id' => $data['id']), array('class' => 'forum-report pull-right'));
    ?>
            <?php 
    echo CHtml::hiddenField('reply_id', $data['id']);
    echo CHtml::link(Yii::t('forum', 'forum.view.reply'), '#', array('class' => 'forum-reply pull-right'));
    ?>
示例#4
0
 /**
  * moveToState
  *
  * @param   int  $pubstate  Param
  *
  * @return	bool
  */
 public function moveToState($pubstate)
 {
     JLoader::register('PostHelper', JPATH_AUTOTWEET_HELPERS . '/post.php');
     if (is_array($this->id_list) && !empty($this->id_list)) {
         if (empty($user)) {
             $oUser = JFactory::getUser();
             $userid = $oUser->id;
         }
         if (!PostHelper::moveToState($this->id_list, $userid, $pubstate)) {
             $this->setError('moveToState - postMessages failed');
             return false;
         }
     }
     return true;
 }
示例#5
0
 /**
  * sharePost
  *
  * @param   object  &$channel  Param
  * @param   object  &$post     Param
  * @param   int     $userid    Param
  *
  * @return	array
  */
 protected function sharePost(&$channel, &$post, $userid = null)
 {
     // Check for duplicate post
     if ($this->dpcheck_enabled) {
         $isDuplicated = PostHelper::isDuplicatedPost($post->id, $post->ref_id, $post->plugin, $post->channel_id, $post->message, $this->dpcheck_time_intval);
         if ($isDuplicated) {
             $this->logger->log(JLog::INFO, 'sendPost: duplicate post detection - message is already posted, article id = ' . $post->ref_id . ', plugin = ' . $post->plugin . ', interval = ' . $this->dpcheck_time_intval);
             return array('state' => AutotweetPostHelper::POST_ERROR, 'result_msg' => 'COM_AUTOTWEET_ERROR_DUPLICATED');
         }
     }
     // Check for banned post
     if ($this->bannedwordscheck_enabled) {
         $isBanned = PostHelper::isBannedPost($post->message, $this->banned_words);
         if ($isBanned) {
             $this->logger->log(JLog::INFO, 'sendPost: banned post detection - message has banned words, article id = ' . $post->ref_id . ', plugin = ' . $post->plugin);
             return array('state' => AutotweetPostHelper::POST_ERROR, 'result_msg' => 'COM_AUTOTWEET_ERROR_BANNED');
         }
     }
     // Get short url one time and if needed only (better performance)
     if (AutotweetPostHelper::SHOWURL_OFF != $post->show_url && !empty($post->org_url) && !array_key_exists($post->org_url, $this->current_short_url)) {
         $shorturlHelper = ShorturlHelper::getInstance();
         $this->current_short_url[$post->org_url] = $shorturlHelper->getShortUrl($post->org_url);
     }
     $current_short_url = null;
     if (array_key_exists($post->org_url, $this->current_short_url)) {
         $current_short_url = $this->current_short_url[$post->org_url];
     }
     // Construct url and truncate message, if necessary
     $finalUrlMessage = TextUtil::getMessageWithUrl($channel, $post, $current_short_url, $this->shorturl_always);
     // Switch original url to short url to use short url also for all other links
     $post->url = $finalUrlMessage['url'];
     $message = $finalUrlMessage['message'];
     // Just in case we want to repeat the message
     // $post->message = $message;
     return $this->sharePostChannel($message, $channel, $post);
 }
示例#6
0
echo CHtml::encode($thread['title']);
?>
 
</legend>

<div class="media forum-post">
    <div class="media-object forum-id-box pull-left">
        <?php 
echo CHtml::hiddenField('user_id', $thread['user_id']);
?>
        <a href="#">
            <?php 
echo PostHelper::DrawUserAvatar($thread['profile_image']);
?>
            <h4><?php 
echo PostHelper::PrintPosterName($thread['username'], $thread['user_group_id']);
?>
</h4>  
        </a>  
        <p>Registered: <span><?php 
echo CHtml::encode($thread['register_date']);
?>
</span></p>
        <p>Posted: <span><?php 
echo CHtml::encode($thread['date_created']);
?>
</span></p>
    </div>

    <div class="media-body well">
        <div class="forum-text-area">