Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <p>
- <strong>Debut:</strong>
- <?php
- global $wpdb;
- global $post;
- $querystr = "
- SELECT DISTINCT p.*
- FROM $wpdb->posts p
- INNER JOIN $wpdb->postmeta pm ON pm.post_id = p ON p.ID
- INNER JOIN $wpdb->postmeta pm2 ON pm2.post_id = p ON p.ID
- WHERE pm.meta_key = ('PL1','PL2','PL3','PL4','PL5','PL6','PL7','PL8','PL9','PL10','PL11')
- OR ((
- pm.meta_key IN ('PL12', 'PL13', 'PL14', 'PL15', 'PL16', 'PL17', 'PL18')
- AND pm.meta_value = %d
- )
- AND (
- pm2.meta_key IN ('si12','si13','si14','si15','si16','si17','si18')
- AND ( SUBSTR(pm2.meta_key, 3) = SUBSTR(pm.meta_key, 3) )
- AND pm2.meta_value+0 > 0
- ))
- AND pm.meta_value = $playerID
- AND p.post_type = 'match'
- ORDER BY p.post_date ASC
- LIMIT 1
- ";
- $debut = $wpdb->get_results($querystr, OBJECT);
- if ($pageposts):
- global $post;
- foreach ($pageposts as $post):
- setup_postdata($post);
- ?>
- vs. <?php $opposition = get_field('club'); if($opposition) echo $opposition->post_title;?> (<?php the_field('venue'); ?>, <a href="<?php the_permalink(); ?>"><?php the_field('score'); ?></a>), <?php echo get_the_date('d-m-Y'); ?>
- <?php endforeach; else: ?>
- No Debut
- <?php endif; wp_reset_postdata(); ?>
- </p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement