Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi, Abhishek26

    I used code from ‘wp-ulike/admin/logs.php’ and wrote after processing to ‘function.php’ in my theme.

    function get_users_who_liked_post($postid) {
    		global $wpdb;
    		$get_ulike_logs = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."ulike WHERE post_id = ".$postid." ORDER BY date_time ASC ".$limit."");
    ?>
    		<table class="widefat">
    			<thead>
    				<tr>
    					<th>Ф.И.О</th>
    					<th width="10%">Статус</th>
    					<th width="12%">ID обращения</th>
    					<th width="20%">Дата и время</th>
    					<th width="10%">E-mail</th>
    					<th>Номер телефона</th>
    				</tr>
    			</thead>
    			<tbody class="wp_ulike_logs">
    				<?php
    				foreach ( $get_ulike_logs as $get_ulike_log ) 
    				{
    				?>
    				<tr <?php if ($alternate == true) echo 'class="alternate"';?>>
    				<td>
    				<?php
    				$user_info = get_userdata($get_ulike_log->user_id);
    				if($user_info)
    				echo '<em>' . $user_info->nickname . '</em>';
    				else
    				echo '<em> #Guest User</em>';
    				?>
    				</td>
    				<td>
    				<?php
    				$get_the_status = $get_ulike_log->status;
    				if($get_the_status == 'like')
    				echo '+';
    				else
    				echo '-';
    				?>
    				</td>
    				<td>
    				<?php echo $get_ulike_log->post_id; ?>
    				</td>
    				<td>
    				<?php
    				echo wp_ulike_date_i18n($get_ulike_log->date_time);
    				?> 
    				</td>
    				<td>
    				<?php echo ''.$user_info->user_email; ?> 
    				</td>
    				<td>
    				<?php echo '+'.$user_info->user_login; ?> 
    				</td>
    				<?php 
    				}
    				?>
    				</tr>
    			</tbody>
    		</table>
    <?		
    }	
    • This reply was modified 9 years, 9 months ago by gorsidge.
Viewing 1 replies (of 1 total)