Example #1
0
function contact_info($contactid, $email, $name)
{
    global $strUnknown;
    //$info .= "<span style='float:right;'>".gravatar($email, 16) . '</span>';
    if (!empty($contactid)) {
        $info .= "<a href='contact.php?id={$contactid}'>";
        $info .= icon('contact', 16);
        $info .= "</a>";
    } else {
        $info .= icon('email', 16);
    }
    $info .= ' ';
    if (!empty($email)) {
        $info .= "<a href=\"mailto:{$email}\" class='info'>";
    }
    if (!empty($name)) {
        $info .= "{$name}";
    } elseif (!empty($email)) {
        $info .= "{$email}";
    } else {
        $info .= "{$strUnknown}";
    }
    if (!empty($email)) {
        $info .= "<span>" . gravatar($email, 50, FALSE);
        $info .= "{$email}";
        $info .= "</span>";
        $info .= "</a>";
    }
    if (!empty($contactid)) {
        $info .= " (" . contact_site($contactid) . ")";
    }
    return $info;
}
 /**
  * @param bool $size
  * @return mixed
  */
 public function getPicture($size = false)
 {
     if (!$size) {
         $size = config('gravatar.default.size');
     }
     return gravatar()->get($this->email, ['size' => $size]);
 }
Example #3
0
    /**
     * Set error reporting
     *
     * @access	public
     */
    public function latest_comments()
    {
        $this->_ci->load->model('comments/comments_model');
        if ($comments = $this->_ci->comments_model->get_new_comments($this->_ci->session->userdata('user_last_login'))) {
            $this->_ci->load->library('table');
            $table_template = array('table_open' => '<table class="main" id="grid" width="100%" border="0" cellspacing="0" cellpadding="0">', 'row_start' => '<tr class="second">', 'row_alt_start' => '<tr class="first">');
            $this->_ci->table->set_template($table_template);
            $this->_ci->table->set_heading(lang('lang_name'), lang('lang_comment'), lang('lang_article'), lang('lang_status'));
            foreach ($comments as $item) {
                if ($item['comment_approved'] == 'spam') {
                    $status = '<span class="spam">' . lang('lang_spam') . '</span>';
                } elseif ($item['comment_approved'] == 0) {
                    $status = '<span class="inactive">' . lang('lang_notactive') . '</span>';
                } else {
                    $status = '<span class="active">' . lang('lang_active') . '</span>';
                }
                $this->_ci->table->add_row('<div class="gravatar"><img class="gravatar" src="' . gravatar($item['comment_author_email'], "PG", "24", "wavatar") . '" /></div>
					<strong>
						' . $item['comment_author'] . '
					</strong>', word_limiter($item['comment_content'], 15) . '&nbsp;' . anchor('admin/comments/edit/' . $item['comment_ID'], lang('lang_edit')), anchor('article/' . $item['article_uri'] . '/#comment-' . $item['comment_ID'], $item['article_title']), $status);
            }
            echo '<h2>' . lang('lang_recent_comments') . '</h2>';
            echo $this->_ci->table->generate();
        }
    }
 function profile_image($user_id, $image, $email_hash = NULL, $size = 'medium')
 {
     $this->ci->load->helper('gravatar');
     $picture = base_url() . 'application/views/' . config_item('site_theme') . '/assets/images/' . $size . '_' . config_item('no_profile');
     // Does User Have Image
     if ($image) {
         $image_original = config_item('users_images_folder') . $user_id . '/' . $image;
         $image_file = config_item('users_images_folder') . $user_id . '/' . $size . '_' . $image;
         // If Thumbnail Exists
         if (file_exists($image_file)) {
             $picture = base_url() . $image_file;
         } elseif (!file_exists($image_file) and file_exists($image_original)) {
             $this->ci->load->model('image_model');
             $this->ci->image_model->make_thumbnail(config_item('users_images_folder') . $user_id, $image, 'users', $size);
             $picture = base_url() . $image_file;
         } else {
             if (config_item('services_gravatar_enabled') == 'TRUE') {
                 return gravatar($email_hash, "X", config_item('users_images_' . $size . '_width'), $picture);
             }
         }
         return $picture;
     }
     if (config_item('services_gravatar_enabled') == 'TRUE') {
         $picture = gravatar($email_hash, "X", config_item('users_images_' . $size . '_width'), $picture);
     }
     return $picture;
 }
Example #5
0
 /**
  * Gravatar
  * 
  * Provides for showing Gravatar images.
  * 
  * Usage:
  * {{ helper:gravatar email="*****@*****.**" size="50" rating="g" url-only="true" }}
  *
  * @return string An image element or the URL to the gravatar.
  */
 public function gravatar()
 {
     $email = $this->attribute('email', '');
     $size = $this->attribute('size', '50');
     $rating = $this->attribute('rating', 'g');
     $url_only = (bool) in_array($this->attribute('url-only', 'false'), array('1', 'y', 'yes', 'true'));
     return gravatar($email, $size, $rating, $url_only);
 }
Example #6
0
 /**
  * Generate a gravatar
  */
 function gravatar($data)
 {
     $defaults = array('email' => '', 'size' => 60, 'rating' => 'PG');
     $options = $this->_ci->settings->get_params($data['attributes'], $defaults);
     if ($options['email']) {
         return gravatar($options['email'], $options['rating'], $options['size']);
     }
     return FALSE;
 }
Example #7
0
 /**
  * @return mixed
  */
 public function getPictureAttribute()
 {
     /*
      * If user is logged in with a social account, use the avatar associated if available
      * Otherwise fallback to the gravatar associated with the social email
      */
     if (session('socialite_provider')) {
         if ($avatar = $this->providers()->where('provider', session('socialite_provider'))->first()->avatar) {
             return $avatar;
         }
     }
     /*
      * Otherwise get the gravatar of the users email account
      */
     return gravatar()->get($this->email, ['size' => 50]);
 }
 public function test_gravatar()
 {
     $avatar = gravatar('*****@*****.**');
     $expected = "https://www.gravatar.com/avatar/93942e96f5acd83e2e047ad8fe03114d?s=100&d=&r=g";
     $this->assertEquals($expected, $avatar);
     $avatar = gravatar('*****@*****.**', 200);
     $expected = "https://www.gravatar.com/avatar/93942e96f5acd83e2e047ad8fe03114d?s=200&d=&r=g";
     $this->assertEquals($expected, $avatar);
     $avatar = gravatar('*****@*****.**', 'not-a-valid-size');
     $expected = "https://www.gravatar.com/avatar/93942e96f5acd83e2e047ad8fe03114d?s=100&d=&r=g";
     $this->assertEquals($expected, $avatar);
     $avatar = gravatar('*****@*****.**', 100, '', 'pg');
     $expected = "https://www.gravatar.com/avatar/93942e96f5acd83e2e047ad8fe03114d?s=100&d=&r=pg";
     $this->assertEquals($expected, $avatar);
     $avatar = gravatar('*****@*****.**', 200, 'http://mysite.com/default.png', 'pg');
     $expected = "https://www.gravatar.com/avatar/93942e96f5acd83e2e047ad8fe03114d?s=200&d=http://mysite.com/default.png&r=pg";
     $this->assertEquals($expected, $avatar);
 }
Example #9
0
 function profile_image($user_id, $image, $email_hash = NULL, $size = 'medium')
 {
     $this->ci->load->helper('gravatar');
     $picture = base_url() . config_item('users_images_folder') . $size . '_' . config_item('profile_nopicture');
     if ($image) {
         $image_file = config_item('users_images_folder') . $user_id . '/' . $size . '_' . $image;
         if (file_exists($image_file)) {
             $picture = base_url() . $image_file;
         } else {
             if (config_item('services_gravatar_enabled') == 'TRUE') {
                 return gravatar($email_hash, "X", config_item('users_images_' . $size . '_width'), $picture);
             }
         }
         return $picture;
     }
     if (config_item('services_gravatar_enabled') == 'TRUE') {
         $picture = gravatar($email_hash, "X", config_item('users_images_' . $size . '_width'), $picture);
     }
     return $picture;
 }
Example #10
0
<h2 class="page-title"><?php 
echo sprintf(lang('profile_of_title'), $_user->display_name);
?>
</h2>

<!-- Container for the user's profile -->
<div id="user_profile_container">
	<?php 
echo gravatar($_user->email, 50);
?>
	<!-- Details about the user, such as role and when the user was registered -->
	<div id="user_details">
		<h3><?php 
echo lang('profile_user_details_label');
?>
</h3>
		<p><strong><?php 
echo lang('profile_role_label');
?>
:</strong> <?php 
echo $_user->group;
?>
</p>
		<p><strong><?php 
echo lang('profile_registred_on_label');
?>
:</strong> <?php 
echo format_date($_user->created_on);
?>
</p>
		<?php 
Example #11
0
					<div class="comment-wrapper">
                        <div class="comment-sets">
							<?php 
if ($commentmovies) {
    ?>
								<?php 
    foreach ($commentmovies as $item) {
        ?>
									<div class="comment">
										<div class="comment__images">
											<?php 
        echo gravatar($item->user_email, 60);
        ?>
										</div>

										<a href='#' class="comment__author"><span class="social-used fa fa-facebook"></span><?php 
        echo $item->user_name;
        ?>
</a>
										<p class="comment__date"><?php 
        echo format_date($item->created_on);
        ?>
</p>
											<?php 
        if (Settings::get('commentmovie_markdown') and $item->parsed) {
            ?>
												<p class="comment__message"><?php 
            echo $item->parsed;
            ?>
</p>
											<?php 
Example #12
0
	<h4 id="comment-header">Comments</h4>

	<ol class="commentlist">
		<?php 
    foreach ($comments as $comment) {
        ?>
			<li id="comment-<?php 
        comment_ID();
        ?>
" class="<?php 
        echo $oddcomment;
        ?>
">
				<p class="comment-metadata">
<img src="<?php 
        gravatar();
        ?>
" alt="Gravatar" class="gravatar"/>
<strong><?php 
        comment_author_link();
        ?>
</strong> | <?php 
        comment_date('d-M-y');
        ?>
 at <?php 
        comment_time('g:i a');
        ?>
 | <a href="#comment-<?php 
        comment_ID();
        ?>
" title="Permalink to this comment" rel="permalink">Permalink</a> <?php 
Example #13
0
?>
" /></p>
			
			<input type="hidden" name="user_id" value="<?php 
echo $row['user_id'];
?>
" />
		</div>
		
	</div>
	<div class="grid_7">
		<fieldset>
			<legend>Original Version</legend>
			<div class="user_box">
			<img width="48" height="48" src="<?php 
echo gravatar($row['user_email'], 'PG', 48);
?>
" class="user_gravatar" />
			<h3><?php 
echo $row['user_username'];
?>
</h3>
			<a href="mailto:<?php 
echo $row['user_email'];
?>
"><?php 
echo $row['user_email'];
?>
</a><br />
			<span class="date"><?php 
echo lang('lang_join_date');
Example #14
0
<h2 class="page-title" id="page_title"><?php echo sprintf(lang('profile_of_title'), $view_user->first_name.' '.$view_user->last_name);?></h2>
<!-- Container for the user's profile -->
<div id="user_profile_container">
	<?php echo gravatar($view_user->email, 50);?>
	<!-- Details about the user, such as role and when the user was registered -->
	<div id="user_details">
		<h3><?php echo lang('profile_user_details_label');?></h3>
		<p><strong><?php echo lang('profile_role_label');?>:</strong> <?php echo $view_user->group; ?></p>
		<p><strong><?php echo lang('profile_registred_on_label');?>:</strong> <?php echo format_date($view_user->created_on); ?></p>
		<?php if($view_user->last_login > 0): ?>
		<p><strong><?php echo lang('profile_last_login_label');?>:</strong> <?php echo format_date($view_user->last_login); ?></p>
		<?php endif; ?>
	</div>
<?php if($user_settings): ?>
	<?php if($user_settings->bio): ?>
	<!-- User's biography -->
	<div id="user_bio">
		<h3><?php echo lang('profile_bio'); ?></h3>
		<p><?php echo $user_settings->bio ?></p>
	</div>
	<?php endif; ?>
	<?php if($user_settings->gender || $user_settings->dob): ?>
	<!-- Personal user details -->
	<div id="user_personal">
		<h3><?php echo lang('profile_personal_section') ?></h3>	
		<?php if($user_settings->gender): ?><p><strong><?php echo lang('profile_gender'); ?>:</strong> <?php echo $user_settings->gender == 'm' ? lang('profile_male_label') : lang('profile_female_label') ?></p><?php endif; ?>
		<?php if($user_settings->dob): ?><p><strong><?php echo lang('profile_dob'); ?>:</strong> <?php echo format_date($user_settings->dob) ?></p><?php endif; ?>
	</div>
	<?php endif; ?>
	<?php if($user_settings->msn_handle || $user_settings->aim_handle || $user_settings->yim_handle || $user_settings->gtalk_handle): ?>
	<!-- Social corner -->
Example #15
0
<?php

//If user is not signed in redirect
if (!$user->isSigned()) {
    redirect("./login");
}
?>
<div class="row">
    <div class="col-xs-12">
        <?php 
echo gravatar($user->Email, 50);
?>
        <div class="btn-group pull-right2">
            <a class="btn btn-primary" href="account/update">Update Information</a>
            <a class="btn btn-primary" href="account/update/password">Change Password</a>
        </div>
        <table class="table">
            <?php 
foreach ($user->toArray() as $name => $value) {
    ?>
                <tr>
                    <th><?php 
    echo $name;
    ?>
</th>
                    <td><?php 
    echo $value;
    ?>
</td>
                </tr>
            <?php 
Example #16
0
 /**
  * Get a profile image.
  *
  * @param   integer $size     Size of the image to display.
  * @param   string  $default  Image to load if no gravatar available.
  *
  * @return  Brick
  */
 public function gravatar($size = 64, $default = 'mm')
 {
     $img = new Brick('img');
     $img->addClass('comment-avatar');
     $img->attr('src', gravatar($this->authorEmail(), $size, $default));
     $img->attr('width', $size);
     $img->attr('height', $size);
     $img->attr('alt', '');
     return $img;
 }
Example #17
0
File: admin.php Project: 68kb/68kb
 /**
  * Grid
  *
  * This is used by the data table js. 
  * 
  * @access	public
  * @return	string
  */
 public function grid()
 {
     $iTotal = $this->db->count_all('users');
     $this->db->start_cache();
     //$this->db->select('user_id, user_ip, user_first_name, user_last_name, user_email, user_username, user_group, user_join_date, user_last_login');
     $this->db->from('users')->join('user_groups', 'user_group = group_id', 'inner');
     /* Searching */
     if ($this->input->post('sSearch') != '') {
         $q = $this->input->post('sSearch', TRUE);
         $this->db->orlike('user_first_name', $q);
         $this->db->orlike('user_last_name', $q);
         $this->db->orlike('user_email', $q);
         $this->db->orlike('user_username', $q);
     }
     /* Sorting */
     if ($this->input->post('iSortCol_0')) {
         $sort_col = $this->input->post('iSortCol_0');
         for ($i = 0; $i < $sort_col; $i++) {
             $this->db->order_by($this->_column_to_field($this->input->post('iSortCol_' . $i)), $this->input->post('iSortDir_' . $i));
         }
     } else {
         $this->db->order_by('user_last_login', 'desc');
     }
     $this->db->stop_cache();
     $iFilteredTotal = $this->db->count_all_results();
     $this->db->start_cache();
     /* Limit */
     if ($this->input->post('iDisplayStart') && $this->input->post('iDisplayLength') != '-1') {
         $this->db->limit($this->input->post('iDisplayLength'), $this->input->post('iDisplayStart'));
     } elseif ($this->input->post('iDisplayLength')) {
         $this->db->limit($this->input->post('iDisplayLength'));
     }
     $query = $this->db->get();
     $output = '{';
     $output .= '"sEcho": ' . $this->input->post('sEcho') . ', ';
     $output .= '"iTotalRecords": ' . $iTotal . ', ';
     $output .= '"iTotalDisplayRecords": ' . $iFilteredTotal . ', ';
     $output .= '"aaData": [ ';
     foreach ($query->result() as $row) {
         $gravatar = '<img width="32" height="32" src="' . gravatar($row->user_email, 'PG', 32) . '" class="gravatar" alt="' . $row->user_username . '" />';
         $user_username = $gravatar . ' <strong><a href="' . site_url('admin/users/edit/' . $row->user_id) . '">' . $row->user_username . '</a></strong> <div class="ip"> ' . $row->user_ip . '</div>';
         $output .= "[";
         $output .= '"' . addslashes($user_username) . '",';
         $output .= '"' . addslashes(format_date($row->user_join_date)) . '",';
         $output .= '"' . addslashes(format_date($row->user_last_login)) . '",';
         $output .= '"' . addslashes($row->group_name) . '"';
         $output .= "],";
     }
     $output = substr_replace($output, "", -1);
     $output .= '] }';
     echo $output;
 }
Example #18
0
function custom_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    global $commentcount;
    if (!$commentcount) {
        $commentcount = 0;
    }
    ?>
	<li id="comment-<?php 
    comment_ID();
    ?>
" class="comment<?php 
    if ($comment->comment_type == 'pingback' || $comment->comment_type == 'trackback') {
        echo ' pingcomment';
    } else {
        if ($comment->comment_author_email == get_the_author_email()) {
            echo ' admincomment';
        } else {
            echo ' regularcomment';
        }
    }
    ?>
">

		<div class="info<?php 
    if ($comment->comment_type == 'pingback' || $comment->comment_type == 'trackback') {
        echo ' pinginfo';
    } else {
        if ($comment->comment_author_email == get_the_author_email()) {
            echo ' admininfo';
        } else {
            echo ' regularinfo';
        }
    }
    ?>
">
			<?php 
    if ($comment->comment_type != 'pingback' && $comment->comment_type != 'trackback') {
        // Support avatar for WordPress 2.5 or higher
        if (function_exists('get_avatar') && get_option('show_avatars')) {
            echo '<div class="pic">';
            echo get_avatar($comment, 24);
            echo '</div>';
            // Support Gravatar for WordPress 2.3.3 or lower
        } else {
            if (function_exists('gravatar')) {
                echo '<div class="pic"><img class="avatar" src="';
                gravatar("G", 24);
                echo '" alt="avatar" /></div>';
            }
        }
    }
    ?>
			<div class="author">
				<?php 
    if (get_comment_author_url()) {
        ?>
					<a class="authorname" id="commentauthor-<?php 
        comment_ID();
        ?>
" href="<?php 
        comment_author_url();
        ?>
" rel="external nofollow">
				<?php 
    } else {
        ?>
					<span class="authorname" id="commentauthor-<?php 
        comment_ID();
        ?>
">
				<?php 
    }
    ?>

				<?php 
    comment_author();
    ?>

				<?php 
    if (get_comment_author_url()) {
        ?>
					</a>
				<?php 
    } else {
        ?>
					</span>
				<?php 
    }
    ?>
				<div class="date"><?php 
    printf(__('%1$s at %2$s', 'blocks2'), get_comment_time(__('M jS, Y', 'blocks2')), get_comment_time(__('H:i', 'blocks2')));
    ?>
</div>
			</div>
			<div class="count">
				<?php 
    if ($comment->comment_type != 'pingback' && $comment->comment_type != 'trackback') {
        ?>
					<?php 
        if (!get_option('thread_comments')) {
            ?>
						<a href="javascript:void(0);" onclick="MGJS_CMT.reply('commentauthor-<?php 
            comment_ID();
            ?>
', 'comment-<?php 
            comment_ID();
            ?>
', 'comment');"><?php 
            _e('Reply', 'blocks2');
            ?>
</a> | 
					<?php 
        } else {
            ?>
						<?php 
            comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => __('Reply', 'blocks2'), 'after' => ' | '));
            ?>
					<?php 
        }
        ?>
					<a href="javascript:void(0);" onclick="MGJS_CMT.quote('commentauthor-<?php 
        comment_ID();
        ?>
', 'comment-<?php 
        comment_ID();
        ?>
', 'commentbody-<?php 
        comment_ID();
        ?>
', 'comment');"><?php 
        _e('Quote', 'blocks2');
        ?>
</a> | 
				<?php 
    }
    ?>
				<?php 
    edit_comment_link(__('Edit', 'blocks2'), '', ' | ');
    ?>
				<a href="#comment-<?php 
    comment_ID();
    ?>
"><?php 
    printf('#%1$s', ++$commentcount);
    ?>
</a>
			</div>
			<div class="fixed"></div>
		</div>

		<?php 
    if ($comment->comment_type != 'pingback' && $comment->comment_type != 'trackback') {
        ?>
			<div class="content">
				<?php 
        if ($comment->comment_approved == '0') {
            ?>
					<p><small>Your comment is awaiting moderation.</small></p>
				<?php 
        }
        ?>

				<div id="commentbody-<?php 
        comment_ID();
        ?>
">
					<?php 
        comment_text();
        ?>
				</div>
			</div>
		<?php 
    }
    ?>

		<div class="fixed"></div>

<?php 
}
Example #19
0
echo lang('comments.title');
?>
</h4>
	
<?php 
if ($comments) {
    ?>
	
	<?php 
    foreach ($comments as $item) {
        ?>
		
		<div class="comment">
			<div class="image">
				<?php 
        echo gravatar($item->email, 60);
        ?>
			</div>
			<div class="details">
				<div class="name">
					<p>
						<?php 
        echo $item->website ? anchor($item->website, $item->name, 'rel="external nofollow"') : $item->name;
        ?>
					</p>
				</div>
				<div class="date">
					<p><?php 
        echo format_date($item->created_on);
        ?>
</p>
Example #20
0
<p><small>Publicação: <?php 
echo formatar_datahora_exibicao($post->publicacao);
?>
</small></p>

<?php 
if (count($post->comentarios) > 0) {
    ?>
    <h3>Comentários</h3>
    
    <?php 
    foreach ($post->comentarios as $c) {
        ?>
        <div class="comentario">
            <?php 
        echo gravatar($c->email_autor, 50);
        ?>
            <p>Por: <?php 
        echo $c->autor;
        ?>
</p>
            <p>Quando: <?php 
        echo formatar_datahora_exibicao($c->publicacao);
        ?>
</p>
            <p>
                <?php 
        echo nl2br($c->texto);
        ?>
            </p>
        </div>
/**
 * Returns the recent reviews.
 *
 * @since 1.0.0
 * @package GeoDirectory
 * @param int $g_size Optional. Avatar size in pixels. Default 60.
 * @param int $no_comments Optional. Number of reviews you want to display. Default: 10.
 * @param int $comment_lenth Optional. Maximum number of characters you want to display. After that read more link will appear.
 * @param bool $show_pass_post Optional. Not yet implemented.
 * @global object $wpdb WordPress Database object.
 * @return string Returns the recent reviews html.
 */
function geodir_get_recent_reviews($g_size = 60, $no_comments = 10, $comment_lenth = 60, $show_pass_post = false)
{
    global $wpdb, $tablecomments, $tableposts, $rating_table_name;
    $tablecomments = $wpdb->comments;
    $tableposts = $wpdb->posts;
    $comments_echo = '';
    //print_r($_SESSION);
    $city_filter = '';
    $region_filter = '';
    $country_filter = '';
    if (isset($_SESSION['gd_multi_location'])) {
        if (isset($_SESSION['gd_country']) && $_SESSION['gd_country']) {
            $country_filter = $wpdb->prepare(" AND r.post_country=%s ", str_replace("-", " ", $_SESSION['gd_country']));
        }
        if (isset($_SESSION['gd_region']) && $_SESSION['gd_region']) {
            $region_filter = $wpdb->prepare(" AND r.post_region=%s ", str_replace("-", " ", $_SESSION['gd_region']));
        }
        if (isset($_SESSION['gd_city']) && $_SESSION['gd_city']) {
            $city_filter = $wpdb->prepare(" AND r.post_city=%s ", str_replace("-", " ", $_SESSION['gd_city']));
        }
    }
    /*if(isset($_SESSION['all_near_me'])){
    
            $mylat = $_SESSION['user_lat'];
            $mylon = $_SESSION['user_lon'];
    
            if(isset($_SESSION['near_me_range']) && is_numeric($_SESSION['near_me_range'])){$dist =$_SESSION['near_me_range']; }
            elseif(get_option('geodir_near_me_dist')!=''){$dist = get_option('geodir_near_me_dist');}
            else{ $dist = '200';  }
    
            $lon1 = $mylon- $dist/abs(cos(deg2rad($mylat))*69);
            $lon2 = $mylon+$dist/abs(cos(deg2rad($mylat))*69);
            $lat1 = $mylat-($dist/69);
            $lat2 = $mylat+($dist/69);
    
            $rlon1 = is_numeric(min($lon1,$lon2)) ? min($lon1,$lon2) : '';
            $rlon2 = is_numeric(max($lon1,$lon2)) ? max($lon1,$lon2) : '';
            $rlat1 = is_numeric(min($lat1,$lat2)) ? min($lat1,$lat2) : '';
            $rlat2 = is_numeric(max($lat1,$lat2)) ? max($lat1,$lat2) : '';
    
            $country_filter ='';
            $region_filter = '';
            $city_filter = " AND post_latitude between $rlat1 and $rlat2
            AND post_longitude between $rlon1 and $rlon2 ";
    
            $join =
    
        }*/
    $review_table = GEODIR_REVIEW_TABLE;
    $request = "SELECT r.id as ID, r.post_type, r.comment_id as comment_ID, r.post_date as comment_date,r.overall_rating, r.user_id, r.post_id FROM {$review_table} as r WHERE r.post_status = 1 AND r.status =1 AND r.overall_rating>=1 {$country_filter} {$region_filter} {$city_filter} ORDER BY r.post_date DESC, r.id DESC LIMIT {$no_comments}";
    //$request = "SELECT r.*,c.* FROM $review_table r JOIN $wpdb->comments c ON r.comment_ID=c.comment_ID WHERE r.post_status = 1 AND r.status =1 $country_filter $region_filter $city_filter ORDER BY r.post_date DESC, r.id DESC LIMIT $no_comments";
    //echo $request;
    $comments = $wpdb->get_results($request);
    foreach ($comments as $comment) {
        // Set the extra comment info needed.
        $comment_extra = $wpdb->get_row("SELECT * FROM {$wpdb->comments} WHERE comment_ID ={$comment->comment_ID}");
        //echo "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID";
        $comment->comment_content = $comment_extra->comment_content;
        $comment->comment_author = $comment_extra->comment_author;
        $comment->comment_author_email = $comment_extra->comment_author_email;
        $comment_id = '';
        $comment_id = $comment->comment_ID;
        $comment_content = strip_tags($comment->comment_content);
        $comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
        $permalink = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID;
        $comment_author_email = $comment->comment_author_email;
        $comment_post_ID = $comment->post_id;
        $na = true;
        if (function_exists('icl_object_id') && icl_object_id($comment_post_ID, $comment->post_type, true)) {
            $comment_post_ID2 = icl_object_id($comment_post_ID, $comment->post_type, false);
            if ($comment_post_ID == $comment_post_ID2) {
            } else {
                $na = false;
            }
        }
        $post_title = get_the_title($comment_post_ID);
        $permalink = get_permalink($comment_post_ID);
        $comment_permalink = $permalink . "#comment-" . $comment->comment_ID;
        $read_more = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __('Read more', 'geodirectory') . '</a>';
        $comment_content_length = strlen($comment_content);
        if ($comment_content_length > $comment_lenth) {
            $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth) . '... ' . $read_more;
        } else {
            $comment_excerpt = $comment_content;
        }
        if ($comment->user_id) {
            $user_profile_url = get_author_posts_url($comment->user_id);
        } else {
            $user_profile_url = '';
        }
        if ($comment_id && $na) {
            $comments_echo .= '<li class="clearfix">';
            $comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">";
            if (function_exists('get_avatar')) {
                if (!isset($comment->comment_type)) {
                    if ($user_profile_url) {
                        $comments_echo .= '<a href="' . $user_profile_url . '">';
                    }
                    $comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
                    if ($user_profile_url) {
                        $comments_echo .= '</a>';
                    }
                } elseif (isset($comment->comment_type) && $comment->comment_type == 'trackback' || isset($comment->comment_type) && $comment->comment_type == 'pingback') {
                    if ($user_profile_url) {
                        $comments_echo .= '<a href="' . $user_profile_url . '">';
                    }
                    $comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
                }
            } elseif (function_exists('gravatar')) {
                if ($user_profile_url) {
                    $comments_echo .= '<a href="' . $user_profile_url . '">';
                }
                $comments_echo .= "<img src=\"";
                if ('' == $comment->comment_type) {
                    $comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
                    if ($user_profile_url) {
                        $comments_echo .= '</a>';
                    }
                } elseif ('trackback' == $comment->comment_type || 'pingback' == $comment->comment_type) {
                    if ($user_profile_url) {
                        $comments_echo .= '<a href="' . $user_profile_url . '">';
                    }
                    $comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
                    if ($user_profile_url) {
                        $comments_echo .= '</a>';
                    }
                }
                $comments_echo .= "\" alt=\"\" class=\"avatar\" />";
            }
            $comments_echo .= "</span>\n";
            $comments_echo .= '<span class="geodir_reviewer_content">';
            if ($comment->user_id) {
                $comments_echo .= '<a href="' . get_author_posts_url($comment->user_id) . '">';
            }
            $comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> ';
            if ($comment->user_id) {
                $comments_echo .= '</a>';
            }
            $comments_echo .= '<span class="geodir_reviewer_reviewed">' . __('reviewed', 'geodirectory') . '</span> ';
            $comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>';
            $comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID);
            $comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . '';
            //echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
            $comments_echo .= '</p>';
            $comments_echo .= "</span>\n";
            $comments_echo .= '</li>';
        }
    }
    return $comments_echo;
}
Example #22
0
 /**
  * Gravatar
  *
  * Provides for showing Gravatar images.
  *
  * Usage:
  *
  *     {{ helper:gravatar email="*****@*****.**" size="50" rating="g" url-only="true" }}
  *
  * @return string An image element or the URL to the gravatar.
  */
 public function gravatar()
 {
     $email = $this->attribute('email', '');
     $size = $this->attribute('size', '50');
     $rating = $this->attribute('rating', 'g');
     $url_only = str_to_bool($this->attribute('url-only', false));
     return gravatar($email, $size, $rating, $url_only);
 }
/**
 * 获取当前用户的Gravatar头像或贴吧头像
 * http://en.gravatar.com/site/implement/images/
 * @return bool|string
 */
function getGravatar($s = 140, $d = 'mm', $g = 'g', $site = 'moefont')
{
    if (option::uget('face_img') == 1) {
        if (option::uget('face_url') != '') {
            return option::uget('face_url');
        } else {
            return 'http://tb.himg.baidu.com/sys/portrait/item/';
        }
    } else {
        return gravatar(EMAIL, $s, $d, $g, $site);
    }
}
Example #24
0
			<a class="tooltip-s toggle" title="Toggle this element"></a>
		</section>
		
		<section class="item">
			<div class="content">
				<ul id="widget-comments">

					<?php 
    if (count($recent_comments)) {
        ?>
						<?php 
        foreach ($recent_comments as $comment) {
            ?>
							<li>
								<div class="comments-gravatar"><?php 
            echo gravatar($comment->user_email);
            ?>
</div>
								<div class="comments-date"><?php 
            echo format_date($comment->created_on);
            ?>
</div>
								<p>
									<?php 
            echo sprintf(lang('comments:list_comment'), $comment->user_name, $comment->entry_title);
            ?>
 
									<span><?php 
            echo (Settings::get('comment_markdown') and $comment->parsed > '') ? strip_tags($comment->parsed) : $comment->comment;
            ?>
</span>
Example #25
0
 public function gravatar($size = 256)
 {
     return gravatar($this->email(), $size);
 }
Example #26
0
	<?php 
    foreach ($comments as $comment) {
        ?>



		<li class="<?php 
        echo $oddcomment;
        ?>
" id="comment-<?php 
        comment_ID();
        ?>
">

			<div><img src="<?php 
        gravatar("R", 40, "http://blog.phatboyg.com/blog/wp-content/themes/itheme-1-1/images/blank.gif");
        ?>
" alt="" /></div>

                        <cite><?php 
        comment_author_link();
        ?>
</cite> Says:

			<?php 
        if ($comment->comment_approved == '0') {
            ?>

			<em>Your comment is awaiting moderation.</em>

			<?php 
Example #27
0
 /**
  * @param integer $size
  * @return string
  */
 public function getAvatar($size = 80)
 {
     return gravatar($this->Model->email, $size);
 }
Example #28
0
        echo anchor('forums/posts/view_reply/' . $post->id, '# ' . $i, array('title' => 'Permalink to this post', 'name' => $post->id));
        ?>
 ]</td>
<?php 
    }
    ?>
  </tr>
 
  <tr>
    <td valign="top" class="authorinfo">
		<a href="<?php 
    echo site_url('user/' . $post->author->id);
    ?>
">
			<?php 
    echo gravatar($post->author->email);
    ?>
		</a>

		<p>
			Joined Date:
			<?php 
    echo date("m.d.y", $post->author->created_on);
    ?>
		</p>
		<p>
			Posts:
			<?php 
    echo $post->author->post_count;
    ?>
		</p>
Example #29
0
 /**
  * Get the `gravatar` attribute.
  *
  * @return string
  */
 public function getGravatarAttribute()
 {
     return gravatar()->setDefaultImage('mm')->setSize(160)->src($this->email);
 }
Example #30
0
<div id="comments_container">
	<h2><?php 
echo lang('comments.title');
?>
</h2>
	
	<?php 
$comments = $this->comments_m->get_by_module_item($module, $module_id);
if (!empty($comments)) {
    ?>
	<ul id="comment_list">
		<?php 
    foreach ($comments as $comment) {
        ?>
		<li class="comment">
			<?php 
        echo gravatar($comment->email, 40);
        ?>
			<p class="comment_heading"><strong><?php 
        echo anchor($comment->website, $comment->name);
        ?>
</strong></p>
			<p class="comment_date"><?php 
        echo date('M d, Y', $comment->created_on);
        ?>
</p>
			<p class="comment_body"><?php 
        echo nl2br(stripslashes($comment->comment));
        ?>
</p>
		</li>