public function setData(&$user)
 {
     $user['friendlydate'] = friendly_date($user['ctime']);
     $user['DOACTION'] = '<a href="' . U('User/Admin/editUser', array('id' => $user['uid'], 'tabHash' => 'editUser')) . '">' . L('ADMIN_EDIT') . '</a>';
     $user['DOACTION'] .= '|<a href="javascript:void(0);" onclick="user.del(' . $user['uid'] . ')">' . L('ADMIN_DEL') . '</a>';
     $user['DOACTION'] .= '|<a href="' . U('User/Admin/userPrivilege', array('uid' => $user['uid'], 'tabHash' => 'userPrivilege')) . '">' . L('ADMIN_USER_PRIVILEGE') . '</a>';
 }
 function get_meal($id)
 {
     $this->db->where('id', $id);
     $query = $this->db->get('meals');
     $meal = $query->row();
     $meal->friendly_date = friendly_date($meal->start, $meal->end);
     return $meal;
 }
Exemple #3
0
 /**
  * Access control: Friendly signin_at
  * @return string
  */
 public function getFriendlySigninAtAttribute()
 {
     if (is_null($this->signin_at)) {
         return '新账号尚未登录';
     } else {
         return friendly_date($this->signin_at);
     }
 }
 public function getUserGroupList($limit = 20, $map = array())
 {
     $listData = $this->where($map)->findPage($limit);
     foreach ($listData['data'] as $k => $v) {
         $listData['data'][$k]['friendlydate'] = friendly_date($v['ctime']);
         $listData['data'][$k]['DOACTION'] = '<a href="' . U('User/Admin/editUserGroup', array('id' => $v['gid'], 'tabHash' => 'editUserGroup')) . '">' . L('ADMIN_EDIT') . '</a>';
         $listData['data'][$k]['DOACTION'] .= '|<a href="javascript:void(0);" onclick="user.delGroup(' . $v['gid'] . ');" >' . L('ADMIN_DEL') . '</a>';
         $listData['data'][$k]['DOACTION'] .= '|<a href="' . U('User/Admin/groupPrivilege', array('gid' => $v['gid'], 'tabHash' => 'groupPrivilege')) . '">' . L('ADMIN_USER_GROUP_PRIVILEGE') . '</a>';
     }
     return $listData;
 }
 public function setData(&$app)
 {
     $app['friendlydate'] = friendly_date($app['ctime']);
     // TODO set the uninstall operation
     if ($app['app_type'] == 'sys') {
         $app['DOACTION'] = '<a href="' . U('Admin/Admin/unInstallSystemApp', array('name' => $app['app_name'])) . '">' . L('uninstall') . '</a>';
     } else {
         $app['DOACTION'] = '<a href="' . U('Admin/Admin/unInstallApp', array('name' => $app['app_name'])) . '">' . L('uninstall') . '</a>';
     }
     $app['DOACTION'] = $app['DOACTION'] . '|<a href="' . U('Admin/Admin/editAppInfo', array('id' => $app['app_id'])) . '">' . L('ADMIN_EDIT') . '</a>';
 }
function meal_to_english($meal)
{
    $mealtoenglish = clone $meal;
    if ($mealtoenglish->title) {
        $mealtoenglish->location = " at " . $mealtoenglish->location;
    }
    if ($mealtoenglish->intended) {
        $mealtoenglish->intended = " (for " . $mealtoenglish->intended . ")";
    }
    $mealtoenglish->date = friendly_date($mealtoenglish->start, $mealtoenglish->end);
    return $mealtoenglish->title . $mealtoenglish->location . " " . $mealtoenglish->date . $mealtoenglish->intended;
}
 /**
  * 
  * 
  */
 public function activity_feed()
 {
     ajx_set_no_back(true);
     require_javascript("og/modules/dashboardComments.js");
     require_javascript("jquery/jquery.scrollTo-min.js");
     $filesPerPage = config_option('files_per_page');
     $start = array_var($_GET, 'start') ? (int) array_var($_GET, 'start') : 0;
     $limit = array_var($_GET, 'limit') ? array_var($_GET, 'limit') : $filesPerPage;
     $order = array_var($_GET, 'sort');
     $orderdir = array_var($_GET, 'dir');
     $page = (int) ($start / $limit) + 1;
     $extra_conditions = " AND jt.type IN ('content_object', 'comment')";
     $trashed = array_var($_GET, 'trashed', false);
     $archived = array_var($_GET, 'archived', false);
     $pagination = ContentDataObjects::listing(array("start" => $start, "limit" => $limit, "order" => $order, "order_dir" => $orderdir, "trashed" => $trashed, "archived" => $archived, "count_results" => false, "extra_conditions" => $extra_conditions, "join_params" => array("jt_field" => "id", "e_field" => "object_type_id", "table" => TABLE_PREFIX . "object_types")));
     $result = $pagination->objects;
     $total_items = $pagination->total;
     if (!$result) {
         $result = array();
     }
     $info = array();
     foreach ($result as $obj) {
         $info_elem = $obj->getArrayInfo($trashed, $archived);
         $instance = Objects::instance()->findObject($info_elem['object_id']);
         $info_elem['url'] = $instance->getViewUrl();
         if (method_exists($instance, "getText")) {
             $info_elem['content'] = $instance->getText();
         }
         $info_elem['picture'] = $instance->getCreatedBy()->getPictureUrl();
         $info_elem['friendly_date'] = friendly_date($instance->getCreatedOn());
         $info_elem['comment'] = $instance->getComments();
         if ($instance instanceof Contact) {
             if ($instance->isCompany()) {
                 $info_elem['icon'] = 'ico-company';
                 $info_elem['type'] = 'company';
             }
         }
         $info_elem['isRead'] = $instance->getIsRead(logged_user()->getId());
         $info_elem['manager'] = get_class($instance->manager());
         $info[] = $info_elem;
     }
     $listing = array("totalCount" => $total_items, "start" => $start, "objects" => $info);
     tpl_assign("feeds", $listing);
 }
 /**
  * 根据条件获取评论列表
  * @author jry <*****@*****.**>
  */
 public function getCommentList($map)
 {
     $map['status'] = 1;
     $comments = $this->where($map)->order('sort desc,id asc')->select();
     foreach ($comments as $key => $val) {
         $comments[$key]['ctime'] = friendly_date($val['ctime']);
         $comments[$key]['username'] = D('User')->getFieldById($val['uid'], 'username');
         $comments[$key]['avatar'] = D('User')->getFieldById($val['uid'], 'avatar');
         if ($comments[$key]['pictures']) {
             $comments[$key]['pictures'] = explode(',', $comments[$key]['pictures']);
             //解析图片列表
         }
         if ($comments[$key]['pid'] > 0) {
             $parent_comment = $this->find($comments[$key]['pid']);
             $comments[$key]['parent_comment_username'] = D('User')->getFieldById($parent_comment['uid'], 'username');
         }
     }
     return $comments;
 }
            $url = get_url('person/workshops/' . $workshop->id);
            if ($flag) {
                $l_action = "<a href=\"{$url}/unsubscribe\" class=\"precaucion\">" . __('Dar de baja') . "</a>";
            } elseif ($workshops_limit <= $CFG->max_inscripcionTA) {
                $l_action = __('Dar de alta');
                $l_action = "<a href=\"{$url}/subscribe\" class=\"verde\">" . __('Dar de alta') . "</a>";
            } else {
                $l_action = '';
            }
        }
        if (Context == 'asistente') {
            // data
            $table_data[] = array($l_ponencia, $workshop->orientacion, $workshop->lugar, $time, $disp, $l_action);
        }
    }
    $human_date = friendly_date($last_date);
    ?>

<h2><?php 
    echo $human_date;
    ?>
</h2>
<h3><?php 
    echo $last_date_desc;
    ?>
</h2>

<?php 
    // do last table
    do_table($table_data, 'wide');
} else {
Exemple #10
0
					</div>
					<script>
						var crumbHtml = <?php 
    echo $crumbJs;
    ?>
 ;
						$("#document-<?php 
    echo $document->getId();
    ?>
 .breadcrumb").html(crumbHtml);
					</script>
					<?php 
    if ($document->getUpdatedBy() instanceof Contact) {
        ?>
					<div class="desc date-container"><?php 
        echo lang('last updated by') . ' ' . lang('user date', $document->getUpdatedBy()->getCardUserUrl(), clean($document->getUpdatedByDisplayName()), lcfirst(friendly_date($document->getUpdatedOn())), clean($document->getUpdatedByDisplayName()));
        ?>
</div>
					<?php 
    }
    ?>
				</li>
			<?php 
}
?>
		</ul>	
		<?php 
if (count($documents) < $total) {
    ?>
		<div class="view-all-container">
			<a href="#" onclick="og.openLink(og.getUrl('files','init'), {caller:'documents-panel'})"><?php 
Exemple #11
0
    function widget($args, $instance)
    {
        $instance = array_merge(self::get_default_options(), $instance);
        echo $args['before_widget'];
        $comments = get_comments(array('status' => 'approve', 'number' => isset($instance['number']) ? (int) $instance['number'] : 6, 'type' => 'comment'));
        if (!empty($instance['title'])) {
            echo $args['before_title'];
            ?>
			<i class="fa fa-comments-o"></i> 
			<?php 
            echo $instance['title'];
            echo $args['after_title'];
        }
        if (!empty($comments)) {
            global $comment;
            $comment_bak = $comment;
            ?>
			<ul class="list-group">
				<?php 
            foreach ($comments as $comment) {
                /**
                 * cache
                 */
                static $caches = [];
                /** author_name */
                if (!isset($caches['author_name'][$comment->comment_author])) {
                    $caches['author_name'][$comment->comment_author] = esc_html(get_comment_author());
                }
                /** avatar placeholder */
                if (!isset($caches['avatar_placeholder'])) {
                    $caches['avatar_placeholder'] = theme_functions::$avatar_placeholder;
                }
                /** comment text */
                $comment_text = str_sub(strip_tags(preg_replace('/<img[^>]+>/i', '[' . ___('Image') . ']', get_comment_text($comment->comment_ID))), 35);
                ?>
<li class="list-group-item">
	<a class="media tooltip top" href="<?php 
                echo theme_cache::get_permalink($comment->comment_post_ID);
                ?>
#comment-<?php 
                echo $comment->comment_ID;
                ?>
" title="<?php 
                echo theme_cache::get_the_title($comment->comment_post_ID);
                ?>
">
		<div class="media-left">
			<img class="avatar media-object" data-src="<?php 
                echo esc_url(theme_cache::get_avatar_url($comment));
                ?>
" src="<?php 
                echo $caches['avatar_placeholder'];
                ?>
" alt="<?php 
                echo $caches['author_name'][$comment->comment_author];
                ?>
" width="<?php 
                echo self::$avatar_size;
                ?>
" height="<?php 
                echo self::$avatar_size;
                ?>
"/>
		</div>
		<div class="media-body">
			<h4 class="media-heading">
				<span class="author"><?php 
                echo $caches['author_name'][$comment->comment_author];
                ?>
</span>
				<time datetime="<?php 
                echo get_comment_time('c');
                ?>
">
					<small><?php 
                echo friendly_date(get_comment_time('U'));
                ?>
</small>
				</time>
			</h4>
			<div class="text"><?php 
                echo $comment_text;
                ?>
</div>
		</div>
	</a>
</li>
				<?php 
            }
            ?>
			</ul>
			<?php 
            $comment = $comment_bak;
        } else {
            ?>
			<div class="content">
				<div class="page-tip"><?php 
            echo status_tip('info', ___('No any comment yet.'));
            ?>
</div>
			</div>
		<?php 
        }
        echo $args['after_widget'];
    }
Exemple #12
0
<div class="comment-unit">
	<a class="person" href="Javascript:;" onclick="og.openLink('<?php echo $comment->getCreatedBy()->getViewUrl(); ?>')"><?php echo $comment->getCreatedBy()->getObjectName();?></a> -
	<em class="feed-date"><?php echo friendly_date($comment->getCreatedOn());?></em> 
	<p><?php echo $comment->getText(); ?></p>
</div>
Exemple #13
0
        ?>
...</a>中</h4>
	                                <?php 
        if ($v['ntype'] == 0) {
            ?>
回复了你 <?php 
        }
        ?>
									<?php 
        if ($v['ntype'] == 1) {
            ?>
提到了@你 <?php 
        }
        ?>
                                    <?php 
        echo friendly_date($v['ntime']);
        ?>
                                    </blockquote>
                                </div>
                            </li>
                            <?php 
    }
    ?>
                        </ul>
                        <?php 
    if (@$pagination) {
        ?>
<ul class="pagination"><!--<?php 
        echo $pagination;
        ?>
--></ul><?php 
Exemple #14
0
<div class="comment-unit">
	<a class="person" href="Javascript:;" onclick="og.openLink('<?php 
echo $comment->getCreatedBy()->getViewUrl();
?>
')"><?php 
echo $comment->getCreatedBy()->getObjectName();
?>
</a> -
	<em class="feed-date"><?php 
echo friendly_date($comment->getCreatedOn());
?>
</em> 
	<p><?php 
echo $comment->getText();
?>
</p>
</div>
<div class="block"></div>
<?php 
                do_submit_cancel('', __('Continuar'), get_url('admin/schedule'));
            } else {
                $errmsg[] = __('Ocurrió un error al insertar los datos.');
                show_error($errmsg);
            }
            ?>

<div class="block"></div>

<?php 
        }
    } else {
        $values = array(__('Lugar') => $room->nombre_lug, __('Fecha') => friendly_date($date->fecha), __('Hora') => sprintf('%02d:00 hrs.', $hour));
        do_table_values($values, 'narrow');
        ?>

<h2 class="center"><?php 
        echo __('Ponencias disponibles');
        ?>
</h2>

<?php 
        include $CFG->comdir . 'prop_list.php';
        do_submit_cancel('', __('Regresar'), get_url('admin/schedule'));
    }
}
if (!empty($errmsg)) {
    do_submit_cancel('', __('Regresar'), get_url('admin/schedule'));
Exemple #16
0
    public static function archive_card_sm(array $args = [])
    {
        global $post;
        $args = array_merge(['classes' => 'g-tablet-1-4', 'lazyload' => true, 'category' => true, 'target' => theme_functions::$link_target], $args);
        $args['classes'] .= ' card sm ';
        $thumbnail_real_src = theme_functions::get_thumbnail_src($post->ID);
        $permalink = theme_cache::get_permalink($post->ID);
        $post_title = theme_cache::get_the_title($post->ID);
        $author_display_name = theme_cache::get_the_author_meta('display_name', $post->post_author);
        ?>
		<article <?php 
        post_class($args['classes']);
        ?>
>
			<div class="card-bg" >
				<?php 
        if (class_exists('theme_colorful_cats') && $args['category']) {
            ?>
					<div class="card-cat">
						<?php 
            /**
             * cats
             */
            foreach (get_the_category($post->ID) as $cat) {
                $color = theme_colorful_cats::get_cat_color($cat->term_id, true);
                ?>
							<span style="background-color:rgba(<?php 
                echo $color['r'];
                ?>
,<?php 
                echo $color['g'];
                ?>
,<?php 
                echo $color['b'];
                ?>
,.8);"><?php 
                echo $cat->name;
                ?>
</span>
						<?php 
            }
            ?>
					</div>
				<?php 
        }
        ?>
				<a 
					href="<?php 
        echo $permalink;
        ?>
" 
					title="<?php 
        echo $post_title;
        ?>
" 
					class="thumbnail-container" 
					target="<?php 
        echo $args['target'];
        ?>
" 
				>
					<?php 
        /**
         * lazyload img
         */
        if ($args['lazyload']) {
            ?>
						<img 
							class="thumbnail" 
							src="<?php 
            echo theme_functions::$thumbnail_placeholder;
            ?>
" 
							data-src="<?php 
            echo $thumbnail_real_src;
            ?>
" 
							alt="<?php 
            echo $post_title;
            ?>
" 
							width="<?php 
            echo self::$thumbnail_size[1];
            ?>
" 
							height="<?php 
            echo self::$thumbnail_size[2];
            ?>
" 
						>
					<?php 
        } else {
            ?>
						<img 
							class="thumbnail" 
							src="<?php 
            echo $thumbnail_real_src;
            ?>
" 
							alt="<?php 
            echo $post_title;
            ?>
" 
							width="<?php 
            echo self::$thumbnail_size[1];
            ?>
" 
							height="<?php 
            echo self::$thumbnail_size[2];
            ?>
" 
						>
					<?php 
        }
        ?>
				</a>
				
				<a 
					href="<?php 
        echo $permalink;
        ?>
" 
					title="<?php 
        echo $post_title;
        ?>
" 
					class="card-title" 
					target="<?php 
        echo $args['target'];
        ?>
" 
				>
					<h3><?php 
        echo $post_title;
        ?>
</h3>
				</a>
				<div class="card-meta">
					<a 
						href="<?php 
        echo theme_cache::get_author_posts_url($post->post_author);
        ?>
" 
						class="meta author" 
						title="<?php 
        echo $author_display_name;
        ?>
" 
						target="<?php 
        echo $args['target'];
        ?>
" 
					>
						<img width="32" height="32" src="<?php 
        echo theme_functions::$avatar_placeholder;
        ?>
" data-src="<?php 
        echo theme_cache::get_avatar_url($post->post_author);
        ?>
" alt="<?php 
        echo $author_display_name;
        ?>
" class="avatar"> <span class="tx"><?php 
        echo $author_display_name;
        ?>
</span>
					</a>
					<time class="meta time" datetime="<?php 
        echo get_the_time('Y-m-d H:i:s', $post->ID);
        ?>
" title="<?php 
        echo get_the_time(___('M j, Y'), $post->ID);
        ?>
">
						<?php 
        echo friendly_date(get_the_time('U', $post->ID));
        ?>
					</time>
				</div>
			</div>
		</article>
		<?php 
    }
Exemple #17
0
                                        <span><a href="<?php 
        echo url('node_show', $v['node_id']);
        ?>
"><?php 
        echo $v['cname'];
        ?>
</a></span>&nbsp;•&nbsp;
                                        <span><a href="<?php 
        echo site_url('user/profile/' . $v['uid']);
        ?>
"><?php 
        echo $v['username'];
        ?>
</a></span>&nbsp;•&nbsp;
                                        <span><?php 
        echo friendly_date($v['updatetime']);
        ?>
</span>&nbsp;•&nbsp;
                                        <?php 
        if ($v['rname'] != NULL) {
            ?>
                                            <span>最后回复来自 <a href="<?php 
            echo site_url('user/profile/' . $v['ruid']);
            ?>
"><?php 
            echo $v['rname'];
            ?>
</a></span>
                                        <?php 
        } else {
            ?>
Exemple #18
0
								<td>
									<a href="<?php 
        echo site_url('page/index/' . $v['pid']);
        ?>
" title="<?php 
        echo $v['title'];
        ?>
">
										<?php 
        echo $v['title'];
        ?>
									</a>
								</td>
								<td>
									<?php 
        echo friendly_date($v['add_time']);
        ?>
								</td>
								<td>
					<small><?php 
        if ($v['is_hidden'] == 0) {
            ?>
显示<?php 
        } else {
            ?>
隐藏<?php 
        }
        ?>
</small>
								</td>
								<td>
Exemple #19
0
    ?>
">
					<a href="<?php 
    echo $email->getViewUrl();
    ?>
">
						<div class="bold"><?php 
    echo clean($email->getSubject());
    ?>
: </div>
						<div class="breadcrumb"></div>
						<div style="float:left;"><?php 
    echo clean($email->getFrom());
    ?>
</div><div class="desc" style="float:right;"><?php 
    echo friendly_date($email->getSentDate());
    ?>
</div>
					</a>
					<div class="clear"></div>
					<script>
						var crumbHtml = <?php 
    echo $crumbJs;
    ?>
 ;
						$("#email-<?php 
    echo $email->getId();
    ?>
 .breadcrumb").html(crumbHtml);
					</script>
				</li>
    public static function theme_comment($comment, $args, $depth)
    {
        global $post;
        $GLOBALS['comment'] = $comment;
        switch ($comment->comment_type) {
            default:
                $classes = ['media'];
                if (!empty($args['has_children'])) {
                    $classes[] = 'parent';
                }
                if ($comment->comment_approved == '0') {
                    $classes[] = 'moderation';
                }
                /**
                 * post author checker
                 */
                if ($comment->user_id == $post->post_author) {
                    $is_post_author = true;
                    $classes[] = 'is-post-author';
                } else {
                    $is_post_author = false;
                }
                /**
                 * check is my comment
                 */
                if ($comment->user_id != 0) {
                    if (theme_cache::get_current_user_id() == $comment->user_id) {
                        $classes[] = 'is-me';
                    }
                }
                /**
                 * author url
                 */
                $author_url = get_comment_author_url();
                if (!empty($author_url) && stripos($author_url, theme_cache::home_url()) === false) {
                    $author_nofollow = ' rel="external nofollow" ';
                } else {
                    $author_nofollow = null;
                }
                ?>
<li <?php 
                comment_class($classes);
                ?>
 id="comment-<?php 
                echo $comment->comment_ID;
                ?>
">
	<div id="comment-body-<?php 
                echo $comment->comment_ID;
                ?>
" class="comment-body">
	
		<?php 
                if ($comment->comment_parent == 0) {
                    ?>
			<div class="media-left">
				<?php 
                    if ($author_url) {
                        ?>
					<a href="<?php 
                        echo esc_url($author_url);
                        ?>
" class="avatar-link" target="_blank" <?php 
                        echo $author_nofollow;
                        ?>
 >
						<?php 
                        echo theme_cache::get_avatar($comment, 50);
                        ?>
					</a>
				<?php 
                    } else {
                        echo theme_cache::get_avatar($comment, 50);
                    }
                    ?>
			</div><!-- /.media-left -->
		<?php 
                }
                ?>
		
		<div class="media-body">

			<div class="comment-content">
				<?php 
                comment_text();
                ?>
				<?php 
                if ($comment->comment_approved == '0') {
                    ?>
					<div class="comment-awaiting-moderation"><?php 
                    echo status_tip('info', ___('Your comment is awaiting moderation.'));
                    ?>
</div>
				<?php 
                }
                ?>
			</div>

			<h4 class="media-heading">
				<span class="comment-meta-data author">
					<?php 
                if ($comment->comment_parent != 0) {
                    echo theme_cache::get_avatar($comment, 50), '&nbsp;';
                }
                comment_author_link();
                ?>
				</span>
				<time class="comment-meta-data time" datetime="<?php 
                echo get_comment_time('c');
                ?>
">
					<a href="<?php 
                echo esc_url(get_comment_link($comment->comment_ID));
                ?>
"><?php 
                echo friendly_date(get_comment_time('U'));
                ?>
</a>
				</time>
				<?php 
                if (!theme_cache::is_user_logged_in()) {
                    /**
                     * if needs register to comment
                     */
                    if (theme_cache::get_option('comment_registration')) {
                        static $reply_link;
                        if (!$reply_link) {
                            $reply_link = '<a rel="nofollow" class="comment-reply-login quick-login-btn" href="' . wp_login_url(theme_cache::get_permalink($comment->comment_post_ID)) . '">' . ___('Reply') . '</a>';
                        }
                    } else {
                        $reply_link = get_comment_reply_link(['add_below' => 'comment-body', 'depth' => $depth, 'max_depth' => $args['max_depth']], $comment, $post->ID);
                    }
                } else {
                    $reply_link = get_comment_reply_link(['add_below' => 'comment-body', 'depth' => $depth, 'max_depth' => $args['max_depth']], $comment, $post->ID);
                }
                $reply_link = preg_replace('/(href=)[^\\s]+/', '$1"javascript:;"', $reply_link);
                if (!empty($reply_link)) {
                    ?>
					<span class="comment-meta-data comment-reply reply">
						<?php 
                    echo $reply_link;
                    ?>
					</span><!-- .reply -->
				<?php 
                }
                ?>
			</h4>
		</div><!-- /.media-body -->
	</div><!-- /.comment-body -->
		<?php 
        }
    }
Exemple #21
0
        }
        
        if($object || $member_deleted){
            $key = $activity->getRelObjectId() . "-" . $activity->getCreatedById();

            if(count($acts['data']) < ($limit*2)){
                if(!array_key_exists($key, $acts['data'])){
                    $acts['data'][$key] = $object;
                    $acts['created_by'][$key] = $user;
                    $acts['act_data'][$key] = $activity->getActivityDataView($user,$object);
                    $acts['date'][$key] = $activity->getCreatedOn() instanceof DateTimeValue ? friendly_date($activity->getCreatedOn()) : lang('n/a');
                }else{
                    $acts['data'][$key] = $object;
                    $acts['created_by'][$key] = $user;
                    $acts['act_data'][$key] = $activity->getActivityDataView($user,$object,true);
                    $acts['date'][$key] = $activity->getCreatedOn() instanceof DateTimeValue ? friendly_date($activity->getCreatedOn()) : lang('n/a');
                }            
            }else{
                break;
            }        
        }
    }
    $active_members = array();
    $context = active_context();
    foreach ($context as $selection) {
    	if ($selection instanceof Member) $active_members[] = $selection;
    }
    if (count($active_members) > 0) {
    	$mnames = array();
    	$allowed_contact_ids = array();
    	foreach ($active_members as $member) {
	/**
	 * Map parameters and make some grouping, orders limits not done in DB
	 * 
	 * @param unknown_type array of int 
	 * @param unknown_type $filtered_results
	 * @param unknown_type $total
	 */
	private function prepareResults($ids, &$filtered_results, $limit) {
		$return = array();
		foreach ($ids as $search_result_id) {
			$search_results = array();
			if (!$limit) break;
			if (!is_numeric($search_result_id)) continue;
			
			$obj = Objects::findObject($search_result_id);
			if (!$obj instanceof ContentDataObject) continue;
			/* @var $obj ContentDataObject */
			$search_result['id'] = $obj->getId();
			$search_result['otid'] = $obj->getObjectTypeId();
			$search_result['title'] = $this->prepareTitle($obj->getObjectName());
			$search_result['memPath'] = json_encode($obj->getMembersToDisplayPath());
			$search_result['url'] = $obj->getViewUrl();
			$search_result['created_by'] = $this->prepareCreatedBy($obj->getCreatedByDisplayName(), $obj->getCreatedById());
			$search_result['updated_by'] = $this->prepareCreatedBy($obj->getUpdatedByDisplayName(), $obj->getUpdatedById());
			$search_result['type'] = $obj->getObjectTypeName();
			$search_result['created_on'] = friendly_date($obj->getCreatedOn());
			$search_result['updated_on'] = friendly_date($obj->getObjectTypeName() == 'mail' ? $obj->getSentDate() : $obj->getUpdatedOn());
			$search_result['content'] = $this->highlightResult($obj->getSummary(array(
				"size" => $this->contentSize,
				"near" => $this->search_for
			)));
			hook::fire("search_result", $search_result, $search_result);
			$return[] = $search_result;
			$limit--;
		}
		return $return;
		
	} 	
if (!empty($events)) {
    $prop_query = '
        SELECT  P.id, P.nombre, PT.descr AS tipo,
        P.duracion,
        P.id_orientacion, SP.nombrep, SP.apellidos,
        E.id AS id_evento
        FROM ' . $CFG->prefix . 'propuesta P 
        LEFT JOIN ' . $CFG->prefix . 'ponente SP ON SP.id = P.id_ponente
        LEFT JOIN ' . $CFG->prefix . 'prop_tipo PT ON PT.id = P.id_prop_tipo
        LEFT JOIN ' . $CFG->prefix . 'evento E ON E.id_propuesta = P.id
        LEFT JOIN ' . $CFG->prefix . 'evento_ocupa EO ON EO.id_evento = E.id
        WHERE   EO.id_fecha = ? 
            AND EO.id_lugar = ?
            AND EO.hora = ?';
    foreach ($dates as $date) {
        $human_date = friendly_date($date->fecha);
        ?>

<h3 class="center"><?php 
        echo $human_date;
        ?>
</h3>

<?php 
        $table_data = array();
        $table_headers = array();
        $table_headers[] = __('Hora\\Lugar');
        foreach ($rooms as $room) {
            $table_headers[] = $room->nombre_lug;
        }
        $table_data[] = $table_headers;
Exemple #24
0
        $rowOdd ? $rowClass = ZEBRA : ($rowClass = '');
        ?>
	<tr class="<?php 
        echo $rowClass;
        ?>
">
		<td class="question"><?php 
        echo $marks[$i]['question'];
        ?>
</td>
		<td class "changed">
			<?php 
        if (@$marks[$i]['updated']) {
            ?>
				<?php 
            echo ucfirst(friendly_date(strtotime($marks[$i]['updated'])));
            ?>
			<?php 
        }
        ?>
		</td>
	</tr>			
<?php 
    }
    ?>
	<tr class="pageate">
		<td colspan="2" class="back">
		<?php 
    // don't want to link back to 1, remainder created by if we click back to starting page by additional 1
    if (@$startFrom && @$startFrom > $resultsPer) {
        $startFrom == $resultsPer + 1 ? $backNum = '' : ($backNum = $startFrom - $resultsPer);
Exemple #25
0
                                    <img class="img-rounded" src="<?php 
    echo base_url($v['avatar'] . 'normal.png');
    ?>
" alt="<?php 
    echo $v['username'] . '_avatar';
    ?>
">
                                </a></div>
                                    <div class="col-md-11 reply-body"><h5><span><a href="<?php 
    echo site_url('user/profile/' . $v['uid']);
    ?>
"><?php 
    echo $v['username'];
    ?>
</a>&nbsp;&nbsp;<?php 
    echo friendly_date($v['replytime']);
    ?>
</span><span class='pull-right' id="r<?php 
    echo ($page - 1) * 10 + $key + 1;
    ?>
">#<?php 
    echo ($page - 1) * 10 + $key + 1;
    ?>
 -<a href="#reply" class="clickable"  data-mention="<?php 
    echo $v['username'];
    ?>
">回复</a></span></h5>
                                    <p>
                                    <?php 
    echo $v['content'];
    ?>
Exemple #26
0
      <video controls="controls" style="width: 100%"><source src="<?php 
    echo $this->entry->video_url;
    ?>
" type="video/mp4"></video>
    </div>
  <?php 
}
?>

  <div class="meta">
    <ul>
      <li><a href="<?php 
echo $this->entry->url;
?>
"><?php 
echo friendly_date($this->entry->date_published, $this->entry->timezone_offset);
?>
</a></li>
      <?php 
foreach (['comment', 'like', 'repost', 'rsvp'] as $type) {
    if ($this->entry->{"num_" . $type . "s"}) {
        echo '<li>' . response_icon($type) . ' ' . $this->entry->{"num_" . $type . "s"} . ' ' . pluralize($type, $this->entry->{"num_" . $type . "s"}) . '</li>';
    }
}
?>
    </ul>
  </div>
</div>
<div class="entry-actions" id="entry-actions-<?php 
echo $this->entry->id;
?>
Exemple #27
0
    public static function recent_posts()
    {
        $posts_per_page = 5;
        ?>
		<div class="panel">
			<div class="heading">
				<i class="fa fa-clock-o"></i>
				<?php 
        echo ___('My recent posts');
        ?>
			</div>
			<?php 
        global $post;
        $query = new WP_Query(array('posts_per_page' => $posts_per_page, 'author' => theme_cache::get_current_user_id()));
        if ($query->have_posts()) {
            ?>
				<ul class="list-group">
				<?php 
            foreach ($query->posts as $post) {
                setup_postdata($post);
                ?>
					<li class="list-group-item">
						<a href="<?php 
                echo theme_cache::get_permalink($post->ID);
                ?>
"><?php 
                echo theme_cache::get_the_title($post->ID);
                ?>
 <small><?php 
                echo friendly_date(get_the_time('U'));
                ?>
</small></a>
						
					</li>
					<?php 
            }
            wp_reset_postdata();
            ?>
				</ul>
				<?php 
        } else {
            ?>
				<div class="content"><?php 
            echo status_tip('info', ___('No posts yet'));
            ?>
</div>
				<?php 
        }
        ?>
		</div>
		<?php 
    }
 /**
  * 
  * 
  */
 public function activity_feed()
 {
     ajx_set_no_back(true);
     require_javascript("og/modules/dashboardComments.js");
     require_javascript("jquery/jquery.scrollTo-min.js");
     /* get query parameters */
     $filesPerPage = config_option('files_per_page');
     $start = array_var($_GET, 'start') ? (int) array_var($_GET, 'start') : 0;
     $limit = array_var($_GET, 'limit') ? array_var($_GET, 'limit') : $filesPerPage;
     $order = array_var($_GET, 'sort');
     $orderdir = array_var($_GET, 'dir');
     $page = (int) ($start / $limit) + 1;
     $hide_private = !logged_user()->isMemberOfOwnerCompany();
     $typeCSV = array_var($_GET, 'type');
     $types = null;
     if ($typeCSV) {
         $types = explode(",", $typeCSV);
     }
     $name_filter = array_var($_GET, 'name');
     $linked_obj_filter = array_var($_GET, 'linkedobject');
     $object_ids_filter = '';
     if (!is_null($linked_obj_filter)) {
         $linkedObject = Objects::findObject($linked_obj_filter);
         $objs = $linkedObject->getLinkedObjects();
         foreach ($objs as $obj) {
             $object_ids_filter .= ($object_ids_filter == '' ? '' : ',') . $obj->getId();
         }
     }
     $filters = array();
     if (!is_null($types)) {
         $filters['types'] = $types;
     }
     if (!is_null($name_filter)) {
         $filters['name'] = $name_filter;
     }
     if ($object_ids_filter != '') {
         $filters['object_ids'] = $object_ids_filter;
     }
     $user = array_var($_GET, 'user');
     $trashed = array_var($_GET, 'trashed', false);
     $archived = array_var($_GET, 'archived', false);
     /* if there's an action to execute, do so */
     if (array_var($_GET, 'action') == 'delete') {
         $ids = explode(',', array_var($_GET, 'objects'));
         $result = Objects::getObjectsFromContext(active_context(), null, null, false, false, array('object_ids' => implode(",", $ids)));
         $objects = $result->objects;
         list($succ, $err) = $this->do_delete_objects($objects);
         if ($err > 0) {
             flash_error(lang('error delete objects', $err));
         } else {
             flash_success(lang('success delete objects', $succ));
         }
     } else {
         if (array_var($_GET, 'action') == 'delete_permanently') {
             $ids = explode(',', array_var($_GET, 'objects'));
             $result = Objects::getObjectsFromContext(active_context(), null, null, true, false, array('object_ids' => implode(",", $ids)));
             $objects = $result->objects;
             list($succ, $err) = $this->do_delete_objects($objects, true);
             if ($err > 0) {
                 flash_error(lang('error delete objects', $err));
             }
             if ($succ > 0) {
                 flash_success(lang('success delete objects', $succ));
             }
         } else {
             if (array_var($_GET, 'action') == 'markasread') {
                 $ids = explode(',', array_var($_GET, 'objects'));
                 list($succ, $err) = $this->do_mark_as_read_unread_objects($ids, true);
             } else {
                 if (array_var($_GET, 'action') == 'markasunread') {
                     $ids = explode(',', array_var($_GET, 'objects'));
                     list($succ, $err) = $this->do_mark_as_read_unread_objects($ids, false);
                 } else {
                     if (array_var($_GET, 'action') == 'empty_trash_can') {
                         $result = Objects::getObjectsFromContext(active_context(), 'trashed_on', 'desc', true);
                         $objects = $result->objects;
                         list($succ, $err) = $this->do_delete_objects($objects, true);
                         if ($err > 0) {
                             flash_error(lang('error delete objects', $err));
                         }
                         if ($succ > 0) {
                             flash_success(lang('success delete objects', $succ));
                         }
                     } else {
                         if (array_var($_GET, 'action') == 'archive') {
                             $ids = explode(',', array_var($_GET, 'objects'));
                             list($succ, $err) = $this->do_archive_unarchive_objects($ids, 'archive');
                             if ($err > 0) {
                                 flash_error(lang('error archive objects', $err));
                             } else {
                                 flash_success(lang('success archive objects', $succ));
                             }
                         } else {
                             if (array_var($_GET, 'action') == 'unarchive') {
                                 $ids = explode(',', array_var($_GET, 'objects'));
                                 list($succ, $err) = $this->do_archive_unarchive_objects($ids, 'unarchive');
                                 if ($err > 0) {
                                     flash_error(lang('error unarchive objects', $err));
                                 } else {
                                     flash_success(lang('success unarchive objects', $succ));
                                 }
                             } else {
                                 if (array_var($_GET, 'action') == 'unclassify') {
                                     $ids = explode(',', array_var($_GET, 'objects'));
                                     $err = 0;
                                     $succ = 0;
                                     foreach ($ids as $id) {
                                         $split = explode(":", $id);
                                         $type = $split[0];
                                         if ($type == 'MailContents') {
                                             $email = MailContents::findById($split[1]);
                                             if (isset($email) && !$email->isDeleted() && $email->canEdit(logged_user())) {
                                                 if (MailController::do_unclassify($email)) {
                                                     $succ++;
                                                 } else {
                                                     $err++;
                                                 }
                                             } else {
                                                 $err++;
                                             }
                                         }
                                     }
                                     if ($err > 0) {
                                         flash_error(lang('error unclassify emails', $err));
                                     } else {
                                         flash_success(lang('success unclassify emails', $succ));
                                     }
                                 } else {
                                     if (array_var($_GET, 'action') == 'restore') {
                                         $errorMessage = null;
                                         $ids = explode(',', array_var($_GET, 'objects'));
                                         $success = 0;
                                         $error = 0;
                                         foreach ($ids as $id) {
                                             $obj = Objects::findObject($id);
                                             if ($obj->canDelete(logged_user())) {
                                                 try {
                                                     $obj->untrash($errorMessage);
                                                     ApplicationLogs::createLog($obj, ApplicationLogs::ACTION_UNTRASH);
                                                     $success++;
                                                 } catch (Exception $e) {
                                                     $error++;
                                                 }
                                             } else {
                                                 $error++;
                                             }
                                         }
                                         if ($success > 0) {
                                             flash_success(lang("success untrash objects", $success));
                                         }
                                         if ($error > 0) {
                                             $errorString = is_null($errorMessage) ? lang("error untrash objects", $error) : $errorMessage;
                                             flash_error($errorString);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     /*FIXME else if (array_var($_GET, 'action') == 'move') {
     			$wsid = array_var($_GET, "moveTo");
     			$destination = Projects::findById($wsid);
     			if (!$destination instanceof Project) {
     				$resultMessage = lang('project dnx');
     				$resultCode = 1;
     			} else if (!can_add(logged_user(), $destination, 'ProjectMessages')) {
     				$resultMessage = lang('no access permissions');
     				$resultCode = 1;
     			} else {
     				$ids = explode(',', array_var($_GET, 'objects'));
     				$count = 0;
     				DB::beginWork();
     				foreach ($ids as $id) {
     					$split = explode(":", $id);
     					$type = $split[0];
     					$obj = Objects::findObject($split[1]);
     					$mantainWs = array_var($_GET, "mantainWs");
     					if ($type != 'Projects' && $obj->canEdit(logged_user())) {
     						if ($type == 'MailContents') {
     							$email = MailContents::findById($split[1]);
     							$conversation = MailContents::getMailsFromConversation($email);
     							foreach ($conversation as $conv_email) {
     								$count += MailController::addEmailToWorkspace($conv_email->getId(), $destination, $mantainWs);
     								if (array_var($_GET, 'classify_atts') && $conv_email->getHasAttachments()) {
     									MailUtilities::parseMail($conv_email->getContent(), $decoded, $parsedEmail, $warnings);
     									$classification_data = array();
     									for ($j=0; $j < count(array_var($parsedEmail, "Attachments", array())); $j++) {
     										$classification_data["att_".$j] = true;		
     									}
     									$tags = implode(",", $conv_email->getTagNames());
     									MailController::classifyFile($classification_data, $conv_email, $parsedEmail, array($destination), $mantainWs, $tags);
     								}								
     							}
     							$count++;
     						} else {
     							if (!$mantainWs || $type == 'ProjectTasks' || $type == 'ProjectMilestones') {
     								$removed = "";
     								$ws = $obj->getWorkspaces();
     								foreach ($ws as $w) {
     									if (can_add(logged_user(), $w, $type)) {
     										$obj->removeFromWorkspace($w);
     										$removed .= $w->getId() . ",";
     									}
     								}
     								$removed = substr($removed, 0, -1);
     								$log_action = ApplicationLogs::ACTION_MOVE;
     								$log_data = ($removed == "" ? "" : "from:$removed;") . "to:$wsid";
     							} else {
     								$log_action = ApplicationLogs::ACTION_COPY;
     								$log_data = "to:$wsid";
     							}
     							$obj->addToWorkspace($destination);
     							ApplicationLogs::createLog($obj, $log_action, false, null, true, $log_data);
     							$count++;
     						}
     					}
     				}
     				if ($count > 0) {
     					$reload = true;
     					DB::commit();
     					flash_success(lang("success move objects", $count));
     				} else {
     					DB::rollback();
     				}
     			}
     		}*/
     $filterName = array_var($_GET, 'name');
     $result = null;
     $context = active_context();
     $obj_type_types = array('content_object');
     if (array_var($_GET, 'include_comments')) {
         $obj_type_types[] = 'comment';
     }
     $pagination = Objects::getObjects($context, $start, $limit, $order, $orderdir, $trashed, $archived, $filters, $start, $limit, $obj_type_types);
     $result = $pagination->objects;
     $total_items = $pagination->total;
     if (!$result) {
         $result = array();
     }
     /* prepare response object */
     $info = array();
     foreach ($result as $obj) {
         $info_elem = $obj->getArrayInfo($trashed, $archived);
         $instance = Objects::instance()->findObject($info_elem['object_id']);
         $info_elem['url'] = $instance->getViewUrl();
         if (method_exists($instance, "getText")) {
             $info_elem['content'] = $instance->getText();
         }
         $info_elem['picture'] = $instance->getCreatedBy()->getPictureUrl();
         $info_elem['friendly_date'] = friendly_date($instance->getCreatedOn());
         $info_elem['comment'] = $instance->getComments();
         /* @var $instance Contact  */
         if ($instance instanceof Contact) {
             if ($instance->isCompany()) {
                 $info_elem['icon'] = 'ico-company';
                 $info_elem['type'] = 'company';
             }
         }
         $info_elem['isRead'] = $instance->getIsRead(logged_user()->getId());
         $info_elem['manager'] = get_class($instance->manager());
         $info[] = $info_elem;
     }
     $listing = array("totalCount" => $total_items, "start" => $start, "objects" => $info);
     tpl_assign("feeds", $listing);
 }
 /**
  * Access control: Friendly deleted_at
  * @return string
  */
 public function getFriendlyDeletedAtAttribute()
 {
     return friendly_date($this->deleted_at);
 }
Exemple #30
0
function get_info($where, $type = 'person', $limit = '', $order = '')
{
    global $CFG;
    $record = new StdClass();
    // hide deleted proposals to non admins
    if ($type == 'proposal' && Context != 'admin') {
        $where .= ' AND P.id_status != 7';
    }
    if (!empty($limit) && $limit != 1) {
        $where .= ' LIMIT ' . $limit;
    }
    if (empty($order)) {
        //default order
        if ($type == 'proposal') {
            $where .= ' ORDER BY P.id, P.reg_time';
        } elseif ($type == 'speaker') {
            $where .= ' ORDER BY SP.id, SP.reg_time';
        }
    } else {
        $where .= ' ORDER BY ' . $order;
    }
    // return admin details
    if ($type == 'admin') {
        $query = '
            SELECT ADM.*, T.descr AS tadmin, T.tareas
            FROM ' . $CFG->prefix . 'administrador ADM
            LEFT JOIN ' . $CFG->prefix . 'tadmin T ON ADM.id_tadmin = T.id
            WHERE ' . $where;
    } elseif ($type == 'speaker') {
        $query = '
            SELECT SP.*, E.descr AS estudios, ST.descr AS estado
            FROM ' . $CFG->prefix . 'ponente SP
            LEFT JOIN ' . $CFG->prefix . 'estudios E ON SP.id_estudios = E.id
            LEFT JOIN ' . $CFG->prefix . 'estado ST ON SP.id_estado = ST.id
            WHERE ' . $where;
    } elseif ($type == 'person') {
        $query = '
            SELECT P.*, E.descr AS estudios, ST.descr AS estado,
            T.descr AS tasistente
            FROM ' . $CFG->prefix . 'asistente P
            LEFT JOIN ' . $CFG->prefix . 'estudios E ON P.id_estudios = E.id
            LEFT JOIN ' . $CFG->prefix . 'estado ST ON P.id_estado = ST.id
            LEFT JOIN ' . $CFG->prefix . 'tasistente T ON P.id_tasistente = T.id
            WHERE ' . $where;
    } elseif ($type == 'proposal') {
        $query = '
            SELECT P.*, L.descr AS nivel, SP.login, SP.nombrep,
            SP.apellidos, SP.org, SP.resume, SP.mail,
            T.descr AS tipo,
            ADM.mail AS adminmail, ADM.login AS adminlogin,
            O.descr AS orientacion, S.descr AS status
            FROM ' . $CFG->prefix . 'propuesta P
            LEFT JOIN ' . $CFG->prefix . 'prop_nivel L ON L.id = P.id_nivel
            LEFT JOIN ' . $CFG->prefix . 'ponente SP ON SP.id = P.id_ponente
            LEFT JOIN ' . $CFG->prefix . 'prop_tipo T ON T.id = P.id_prop_tipo
            LEFT JOIN ' . $CFG->prefix . 'administrador ADM ON ADM.id = P.id_administrador
            LEFT JOIN ' . $CFG->prefix . 'orientacion O ON O.id = P.id_orientacion
            LEFT JOIN ' . $CFG->prefix . 'prop_status S ON S.id = P.id_status
            WHERE ' . $where;
    } elseif ($type == 'event') {
        $query = '
            SELECT P.*, SP.nombrep, SP.apellidos,
            PT.descr AS tipo, O.descr AS orientacion,
            L.cupo, L.nombre_lug AS lugar, L.ubicacion,
            FE.fecha, FE.descr AS date_desc,
            EO.hora, EO.id_evento
            FROM ' . $CFG->prefix . 'evento E
            LEFT JOIN ' . $CFG->prefix . 'propuesta P ON P.id = E.id_propuesta
            LEFT JOIN ' . $CFG->prefix . 'ponente SP ON SP.id = P.id_ponente
            LEFT JOIN ' . $CFG->prefix . 'prop_tipo PT ON PT.id = P.id_prop_tipo
            LEFT JOIN ' . $CFG->prefix . 'orientacion O ON O.id = P.id_orientacion
            LEFT JOIN ' . $CFG->prefix . 'evento_ocupa EO ON EO.id_evento = E.id
            LEFT JOIN ' . $CFG->prefix . 'lugar L ON L.id = EO.id_lugar
            LEFT JOIN ' . $CFG->prefix . 'fecha_evento FE ON FE.id = EO.id_fecha
            WHERE ' . $where;
    }
    // get only one record?
    if ($limit == 1) {
        $records = get_record_sql($query);
        //get event if programmed
        if (!empty($records) && $type == 'proposal' && $records->id_status == 8) {
            $query = '
                SELECT FE.fecha, R.nombre_lug AS lugar, EO.hora, EO.id_evento
                FROM ' . $CFG->prefix . 'evento E
                LEFT JOIN ' . $CFG->prefix . 'evento_ocupa EO ON EO.id_evento = E.id
                LEFT JOIN ' . $CFG->prefix . 'lugar R ON R.id = EO.id_lugar
                LEFT JOIN ' . $CFG->prefix . 'fecha_evento FE ON FE.id = EO.id_fecha
                WHERE E.id_propuesta=' . $records->id . ' GROUP BY EO.id_evento';
            $event = get_record_sql($query);
            $endhour = $event->hora + $records->duracion - 1;
            $records->id_evento = $event->id_evento;
            $records->fecha = $event->fecha;
            $records->human_date = friendly_date($event->fecha);
            $records->lugar = $event->lugar;
            $records->hora = $event->hora;
            $records->time = sprintf('%02d:00 - %02d:50', $event->hora, $endhour);
        }
    } else {
        $records = get_records_sql($query);
    }
    return $records;
}