-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattending.php
More file actions
65 lines (65 loc) · 2.41 KB
/
attending.php
File metadata and controls
65 lines (65 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/*
Plugin Name: Liste des participants
Plugin URI: http://jihais.se
Description: yeah
Version: 1.0
Author: Jihaisse
Author URI: http://jihais.se
*/
function userlisting_func( $atts ){
extract( shortcode_atts( array(
'logins' => '',
), $atts ) );
$logins = array_map( 'trim', explode( ',', $atts['logins'] ) );
ob_start();
?>
<ul class="participants">
<?php
foreach ($logins as $login) {
$user = get_user_by( 'login', $login );
?>
<li>
<span>
<?php echo get_avatar(get_the_author_meta('user_email', $user->ID), 80); ?>
</span>
<strong><?php echo $user->display_name?></strong>
<?php if(get_the_author_meta('profession', $user->ID)): ?>
<br /><?php the_author_meta('profession', $user->ID); ?>
<?php endif ?>
<?php if(get_the_author_meta('entreprise', $user->ID)): ?>
<br />Entreprise : <a href="<?php the_author_meta('sitewebentreprise', $user->ID); ?>"><?php the_author_meta('entreprise', $user->ID); ?></a>
<?php endif ?>
<?php if(get_the_author_meta('url', $user->ID)):
$url_name = str_replace("http://", '',get_the_author_meta('url', $user->ID));
$url_name = str_replace('www.', '', $url_name);
$url_name = str_replace('/', '', $url_name);
?>
<br />Site web : <a href="<?php the_author_meta('url', $user->ID); ?>" target="_blank"><?php echo $url_name; ?></a>
<?php endif ?>
<br />
<?php if(get_the_author_meta('linkedin', $user->ID)): ?>
<a href="<?php the_author_meta('linkedin', $user->ID); ?>">
<img class="alignleft size-full wp-image-931" title="linkedin" src="http://www.chambe-carnet.com/wp-content/uploads/2011/01/linkedin.png" alt="linkedin" width="20" height="18" />
</a>
<?php endif ?>
<?php if(get_the_author_meta('viadeo', $user->ID)): ?>
<a href="<?php the_author_meta('viadeo', $user->ID); ?>">
<img class="alignleft size-full wp-image-934" title="viadeo" src="http://www.chambe-carnet.com/wp-content/uploads/2011/01/viadeo.png" alt="viadeo" width="20" height="18" />
</a>
<?php endif ?>
<?php if(get_the_author_meta('twitter', $user->ID)): ?>
<a href="<?php the_author_meta('twitter', $user->ID); ?>">
<img class="alignleft size-full wp-image-933" title="twitter" src="http://www.chambe-carnet.com/wp-content/uploads/2011/01/twitter.png" alt="twitter" width="18" height="18" />
</a>
<?php endif ?>
</li>
<?php
}
?>
</ul>
<?php
return ob_get_clean();
}
add_shortcode( 'participants', 'userlisting_func' );
?>