Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

page tops page is done

country and top favs section is done.
  • Loading branch information...
commit 4b97992efa47d21418a1c5fd6252b37d3b8cabd5 1 parent f32aac3
Zakir authored May 19, 2012

Showing 2 changed files with 109 additions and 15 deletions. Show diff stats Hide diff stats

  1. 88  page-tops.php
  2. 36  style.css
88  page-tops.php
@@ -34,24 +34,17 @@
34 34
   
35 35
   			<div class="top_middle">
36 36
 				<div class="top_left">
37  
-					<div class="top_right"><ul><li>Top Posts Fan</li></ul></div>
  37
+					<div class="top_right"><ul><li>Top Posts Fav</li></ul></div>
38 38
 				</div>
39 39
 			</div>
40 40
 			
41 41
 			<div class="box1">
42 42
 			
43  
-			    <ul class="listnav4">
44  
-					<!--
45  
-<li><span class="numrc">1</span><a href="#">Sample Hot Posts</a><span class="right"><a href="#">View</a></span></li>
46  
-					<li><span class="numrc">2</span><a href="#">Another Post</a><span class="right"><a href="#">View</a></span></li>
47  
-					<li><span class="numrc">3</span><a href="#">Title Posts</a><span class="right"><a href="#">View</a></span></li>
48  
-					<li><span class="numrc">4</span><a href="#">All Posts</a><span class="right"><a href="#">View</a></span></li>	
49  
-					<li><span class="numrc">5</span><a href="#">Sample Hot Posts</a><span class="right"><a href="#">View</a></span></li>
50  
-					<li><span class="numrc">6</span><a href="#">Another Post</a><span class="right"><a href="#">View</a></span></li>
51  
-					<li><span class="numrc">7</span><a href="#">Title Posts</a><span class="right"><a href="#">View</a></span></li>
52  
-					<li><span class="numrc">8</span><a href="#">All Posts</a><span class="right"><a href="#">View</a></span></li>
53  
--->														
54  
-				</ul>
  43
+			    	<?php if ( is_active_sidebar( 'sidebar_top_post' ) ) : ?>
  44
+							<?php dynamic_sidebar( 'sidebar_top_post' ); ?>
  45
+					<?php else: ?>
  46
+						<?//php echo hot_posts();?>
  47
+					<?php endif;?>
55 48
 			
56 49
 			</div>  
57 50
   
@@ -101,7 +94,74 @@ function onCatChange() {
101 94
 		<div style="clear:both">&nbsp;</div>
102 95
 		<h2>Country</h2>
103 96
 		<div class="filter-cat">
104  
-			<p><select><option>Under construction</option></select></p>	
  97
+		
  98
+			<?php
  99
+			
  100
+			global $wpdb;
  101
+				
  102
+				$querystr = "SELECT DISTINCT meta_value 
  103
+							FROM $wpdb->usermeta
  104
+							WHERE meta_key = 'country'
  105
+							";
  106
+				$pageposts = $wpdb->get_results($querystr);
  107
+				?>
  108
+				
  109
+				
  110
+			<form name="prd-qry" method="post" action="">
  111
+				<p><select name="showresults" id="showresults" onChange="this.form.submit();">
  112
+						
  113
+						<?php 
  114
+						if(isset($_POST['showresults'])){
  115
+								
  116
+								$results = $_POST['showresults'];
  117
+								update_option('current_country', $results);
  118
+								$results = get_option('current_country', $results);
  119
+						} 
  120
+						?>
  121
+						
  122
+						
  123
+				<option value="">Select Country</option>		
  124
+				<?php foreach($pageposts as $post):?>
  125
+						
  126
+						<option value="<?php echo $post->meta_value;?>"><?php echo $post->meta_value;?></option>
  127
+				<?php endforeach;?>			
  128
+				</select></p>
  129
+				<input type="hidden" value="Go" id="cat-submit">				
  130
+			</form>
  131
+		
  132
+		 
  133
+	<?php if(isset($results)) {?>
  134
+			<p class="sel-country"> Selected country:
  135
+				<?php echo $results;?>
  136
+			</p>
  137
+			
  138
+			
  139
+			<?php
  140
+			
  141
+				$querystr = "SELECT DISTINCT $wpdb->posts.post_title, $wpdb->posts.ID, $wpdb->posts.post_author  
  142
+							FROM $wpdb->posts, $wpdb->usermeta, $wpdb->users
  143
+							WHERE $wpdb->usermeta.meta_key = 'country'
  144
+							AND $wpdb->usermeta.meta_value= '$results'
  145
+							AND $wpdb->usermeta.user_id=$wpdb->posts.post_author
  146
+							AND $wpdb->posts.post_type='post'
  147
+							";
  148
+				$pageposts = $wpdb->get_results($querystr);
  149
+				?>
  150
+				
  151
+				<ul class="listnav5">
  152
+							
  153
+					<?//php echo '<li class="auth"> '.the_author_meta('display_name', $the_author).' </li>';?>
  154
+					
  155
+				<?php 
  156
+				$i=1;
  157
+				foreach($pageposts as $post):
  158
+				echo '<li class="num">'.$i.' &nbsp; <a href="'.get_permalink($post->ID).'">'.$post->post_title.'</a> </li>';				
  159
+				$i++;		
  160
+				endforeach;?>
  161
+				</ul>
  162
+	<?php } ?>		
  163
+		
  164
+				
105 165
 		</div>
106 166
 		<div style="clear:both">&nbsp;</div>
107 167
 		
36  style.css
@@ -416,6 +416,40 @@ ul.listnav3 li a img{float: none; margin: 0 0 -34px 15px;} /*0 0 -34px 15px*/
416 416
 
417 417
 
418 418
 
  419
+
  420
+/*For country*/
  421
+ul.listnav5 {
  422
+	padding: 5px 30px 10px 20px;
  423
+	margin: 0px;
  424
+	font-family: Verdana, Arial, Helvetica, sans-serif;
  425
+	font-size: 18px;
  426
+	font-weight: bold;	
  427
+}
  428
+
  429
+ul.listnav5 li {
  430
+	padding:10px 0 10px; 
  431
+	border-bottom: #c2c2c2 1px solid;
  432
+	display: block;
  433
+}
  434
+
  435
+ul.listnav5 li:last-child {border-bottom: 0;}
  436
+
  437
+ul.listnav5 li a{
  438
+	width:180px;
  439
+}
  440
+
  441
+
  442
+ul.listnav5 li a, ul.listnav5 li a:link, ul.listnav5 li a:visited {
  443
+	font-size:12px;
  444
+	color: #000;
  445
+	text-decoration: none;
  446
+}  
  447
+
  448
+ul.listnav5 li a:hover {
  449
+	color: #2985DD;
  450
+}
  451
+
  452
+
419 453
 ul.listnav3 li a, ul.listnav3 li a:link, ul.listnav3 li a:visited {
420 454
 	font-size:12px;
421 455
 	color: #000;
@@ -488,7 +522,7 @@ ul.listnav4 li:last-child{border-bottom: 0;}
488 522
 
489 523
 
490 524
 
491  
-
  525
+p.sel-country{padding: 10px 0 0; color: #2985DD; font-weight: bold;}
492 526
 
493 527
 
494 528
 

0 notes on commit 4b97992

Please sign in to comment.
Something went wrong with that request. Please try again.