-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
48 lines (46 loc) · 3.08 KB
/
single.php
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
<?php define( "DONOTCACHEPAGE", true ); ?>
<?php get_header(); ?>
<div id="container">
<div id="main">
<div id="postpage">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="pp_post">
<div id="pp_title"><?php esc_html(the_title()); ?></div>
<div id="pp_content"><a href="<?php the_permalink(); ?>"><?php apply_filters( 'the_content', the_content() ); ?></a></div>
<div id="pp_data">
<div id="stats"><a id=<?php echo '"score ' . get_the_ID() . '"'; ?>><?php $scored=get_post_meta(get_the_ID(),'postscore',true);if($scored==""){echo 0;}else{echo $scored;} ?></a> points - <?php comments_number( 'No comments', 'One comment', '% comments' ); ?>
<div id="tags"> <?php the_tags( 'Tags: ', ', ', '' ); ?> </div>
</div>
<div class="vote">
<?php if (is_user_logged_in()) {
$theId = get_the_ID();
$hasivote = checkvote($theId);
if ($hasivote == 1) {
echo "<li><a id='upvoteicon {$theId}' class='voteupactive' href='javascript:void(0);' onclick='vote({$theId}, 0);'></a></li>";
} else {
echo "<li><a id='upvoteicon {$theId}' class='voteup' href='javascript:void(0);'onclick='vote({$theId}, 1);'></a></li>";
}
if ($hasivote == 0) {
echo "<li><a id='downvoteicon {$theId}' class='votedownactive' href='javascript:void(0);' onclick='vote({$theId}, 0);'></a></li>";
} else {
echo "<li><a id='downvoteicon {$theId}' class='votedown' href='javascript:void(0);' onclick='vote({$theId}, 2);'></a></li>";
}
}else{ ?>
<li><a id=<?php echo '"upvoteicon ' . get_the_ID() . '" '; ?>class="voteup" href="javascript:void(0);" onclick="jQuery('#show_login').click();"></a></li>
<li><a id=<?php echo '"downvoteicon ' . get_the_ID() . '" '; ?>class="votedown" href="javascript:void(0);" onclick="jQuery('#show_login').click();"></a></li>
<?php } ?>
</div>
<div id="postedby">Posted by <?php echo '<a href="';echo get_author_posts_url(get_the_author_meta( 'ID' )); echo '">';echo get_the_author_meta('display_name');echo'(';$scor=get_the_author_meta('user_score');if($scor[0]==""){echo 0;}else{echo $scor;} echo ')</a>';?></div>
</div>
<div id="pp_comments">
<?php comments_template( '', true ); ?>
</div>
</div>
<?php endwhile; /* end loop */ ?>
</div>
<div id="sidebar-container">
<div id="sidebar-dummy"></div>
<?php get_sidebar(); ?>
</div>
</div>
<?php get_footer(); ?>