echstudios
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Count only a user’s first commentsGot it. Just use count(DISTINCT comment_post_id) in the SQL query.
Forum: Fixing WordPress
In reply to: small problem with select queryThanks shane, but I’m really looking to do this without a plugin. What I’m doing is actually more complicated than my example and I really prefer having full control with my own functions.
I really just need to know how to run an sql count query of a specific array of post ids?
Thanks, again!
Forum: Fixing WordPress
In reply to: if/else inside foreach loop problemalchymyth, new or not, you are absolutely right! I did indeed accidentally leave a space in my variable. Problem solved. Thanks so much. And thanks MichaelH for allowing him to find it. Really appreciate it guys!
Forum: Fixing WordPress
In reply to: if/else inside foreach loop problemNow I take it this is just for testing purposes? This is what it prints on a single loop iteration:
stdClass Object ( [user_id] => 2 [post_id] => 131 [action_type] => vote [action_time] => 2009-07-15 13:32:06 )
Each loop is returning the proper values.
Forum: Fixing WordPress
In reply to: if/else inside foreach loop problemMy apologies. Here’s what I’m looking to do. I have a custom table with a specific field “action_type” that has 5 or so different possible values, example: ‘vote’, ‘favorite’, ‘comment’, etc. I’m listing out the actions taken by users chronologically by time.
For example, if the action_type is ‘vote’ then write “Username has voted on Post 17”,
or if action_type is ‘favorite’, then write “Username has added Post 17 to his favorites” etc.The problem that I’m having is setting up a conditional statement to handle the output phrases within the foreach loop. When I test the current iteration for the action_type == ‘vote’, it seems to return true if ANY value in my array is ‘vote’. Because of this, each and every loop iteration returns the same phrase as the first value that in the array returned trued.
However, like I said, if I simply echo out the action_type, each loop iteration will write the appropriate type: ie, ‘vote’ ‘vote’ ‘favorite’ ‘vote’ ‘comment’ ect.
Please let me know if if that makes sense or if I can clarify any part. Thanks again!
Forum: Fixing WordPress
In reply to: if/else inside foreach loop problemYa that was my first though but that too is not working. Its seems that the if/else is searching the entire array and returns true if the value is anywhere in there instead of just on its current loop. But again, like I said, if I simply echo out the value, it echo the individual value of that loop.
[moderated–bump removed. Please refrain from bumping as per Forum Rules]
Forum: Fixing WordPress
In reply to: if/else inside foreach loop problemThanks for the quick reply but that did not work. In fact that just made nothing show up.
I have this same problem. I’m in PHPMyAdmin and have found an empty field in the usermeta table. How do I delete the blank entry?
Forum: Fixing WordPress
In reply to: Run PHP on clickHey thanks.
What’s the markup look like to call that file? Ideally the hyperlink takes you nowhere, just runs the function, so how to I have it direct back to the same page?
Forum: Fixing WordPress
In reply to: is category child?I figured I should just post my code so you can see what I mean if that will help.
<ul class="nav-bar"> <li <?php if ( is_home() ) { echo ' class="current"'; } ?>><a href="<?php echo get_option('home'); ?>">HOME</a></li> <li <?php if ( is_category('questions') ) { echo ' class="current"'; } ?>><a href="/rathers">QUESTIONS</a></li> <li <?php if ( is_page('tags') ) { echo ' class="current"'; } ?>><a href="/tags">TAGS</a></li> <li <?php if ( is_page('store') ) { echo ' class="current"'; } ?>><a href="/store">STORE</a></li> <li <?php if ( is_page('submit') ) { echo ' class="current"'; } ?>><a href="/submit">SUBMIT</a></li> <li <?php if ( is_page('about') ) { echo ' class="current"'; } ?>><a href="/about">ABOUT</a></li> <li <?php if ( is_category('blog') ) { echo ' class="current"'; } ?>><a href="/blog">BLOG</a></li> </ul>
It basically just changes the css class based on which page its on. So it works when I view the “Questions” category archive, but not when I view an actual post within the subcategories. I know I could just manually add all my subcategories as a conditional statement, but I have many so I’d like to find a cleaner way to handle this. Also, my blog is set up as its own category which also has the same problem.
Thanks again!
Forum: Fixing WordPress
In reply to: is category child?I need to use it in the header.php file to handle the active page highlight for my navigation bar.
Thanks!
Forum: Plugins
In reply to: [Plugin: GD Star Rating] Rollover effect not working properlyProblem solved. My CSS was importing another un-needed css that included these styles:
.aligncenter { display:block; margin:0 auto }
.alignleft { float:left }
.alignright { float:right }
.wp-caption { border:1px solid #666; text-align:center; background:#ccc; padding:10px; margin:10px }Deleted that and it works great. Thanks for your help!
Forum: Plugins
In reply to: [Plugin: GD Star Rating] Rollover effect not working properlyI’ve looked through my css and played around with a few things but can’t seem to find the problem. But I also don’t know what I should be looking for because I’m not sure how the ratings are generated. Any ideas?
Forum: Plugins
In reply to: [Plugin: GD Star Rating] Rollover effect not working properlyOkay, thanks for the quick reply. I will look into it and get back with you shortly.
Forum: Themes and Templates
In reply to: numbered navigation linksInstead of just “Next” and “Previous” you often see:
1 2 3 4 5 . . . 25 Next >
Is there a simple way to achieve this or will I have to make it from scratch?