Jump to content

Jim R

Members
  • Posts

    988
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Jim R

  1. I need to print one within the other. I'm not sure how to get that done.
  2. I didn't explain it as well as I should have. The query is echo'ing the Games based on the date of the Posts. I would also like it to echo the applicable Posts' titles underneath each Game title. I'm not sure how to use the query to use the Post information, in this case the title of each Post.
  3. I'm trying to echo Posts about basketball games (Games) on my home page. I'm using WordPress, and Games is a tag I use on my site. Game 1 Post 1 Post 2 Game 2 Post 1 Post 2 Post 3 Right now the code I'm working with, which I've had help on, just echos the Games in the order of its most recent post. $mf_query = <<<EOF SELECT t.*, tt.*, p.* FROM {$wpdb->posts} as p, {$wpdb->term_relationships} as tr, {$wpdb->terms} AS t, {$wpdb->term_taxonomy} AS tt WHERE tt.`taxonomy` = 'series' AND t.`term_id` = tt.`term_id` AND tr.`object_id` = p.`ID` AND tt.`term_taxonomy_id` = tr.`term_taxonomy_id` AND tt.`count` > 0 GROUP BY t.`term_id` ORDER BY p.`post_date` DESC LIMIT 5 EOF; $mf_terms = $wpdb->get_results( $mf_query ); if( !empty( $mf_terms ) ) { print "\n\t" . '<ul>'; foreach ( $mf_terms as $mf_term ) { print "\n\t\t" . '<li><a href="' . get_term_link( $mf_term, $mf_term->taxonomy ) . '">' . $mf_term->name . '</a></li>'; } print "\n\t" . '</ul>'; } I'm assuming I can use nested Foreach loops or a While within a Foreach. My question is, how do I use the same query? It's already querying all Post information. Thanks.
  4. Figured it out with help from this link: http://www.mydigitallife.info/2007/04/23/how-to-find-and-replace-text-in-mysql-database-using-sql/
  5. SELECT * FROM wp_1_posts WHERE post_content LIKE '[the-series before="<p>Read More About: " separator=" :: " after="</p>"]%' Basically, I want to delete everything between the LIKE and the % from my post_content column. It's a shortcode for WordPress, and I'd like to delete from the pages it's being use in. Is that possible?
  6. I appreciate the willingness. I decided to go back in, change all the file formats to .JPG, and just deal with the code that writes that part of it. It was about 80 files, and all of this likely took longer than changing all the file formats. IF (no pun intended) I have any other problems with conditional logic, I'll come back to this topic for it.
  7. I only work on one machine, but I know a browser on another computer saw the same results. I don't know enough about the code to know it should work. I understand the logic behind what all we tried, but syntax often gets in the way of logic, which is why I'm not a coder professionally.
  8. I certainly do appreciate everyone's effort.
  9. I just went through and changed all the formats. I probably have some pictures throughout the entirety of my site which now refer to missing images, but the main purpose of this folder is one I now just use on profile (Tag Archive) pages, which are generated with the code we've been messing with.
  10. $file_name = "/wp-content/uploads/". $line['nameLast'] . $line['nameFirst'] . ".jpg"; if ( (file_exists($file_name)) == TRUE) echo 'Hello'; That isn't working.
  11. I went into it thinking . jpg / .JPG...eh...to-may-to / to-mah-to, but Wordpress definitely sees the difference. But consider this. The IF condition NEVER sees the .jpg, just goes to the .JPG, so it's not really an issue of not telling the difference between .jpg and .JPG. The IF condition isn't working. Is it a syntax issue? I've tried braces around what follows the IF, but it didn't change anything. if (!file_exists($file_name)) {$file_name = "/wp-content/uploads/". $line['nameLast'] . $line['nameFirst'] . ".JPG"}; Perplexing.
  12. I'm using this now just to test it: $file_name = "/wp-content/uploads/". $line['nameLast'] . $line['nameFirst'] . ".jpg"; if (!file_exists($file_name)) echo 'hello'; No matter what, it prints hello. So it's not differentiating whether or not the .jpg file exists, which is what I expected.
  13. Linux centOS on the server.
  14. That's exactly what I want, and it looks so darn simple. Just doesn't seem to take. It seems to bypass recognition of the .jpg file when it exists.
  15. When I started the site, my pre-existing images were all .jpg files. The software I'm using with my new camera converts everything to .JPG files, and I can't change that setting to .jpg. Instead of changing all my previous files or altering all my new ones, I have both echo statements. Now we are trying to get it to just recognize the one that exists.
  16. I know the paths are correct because when I just have both echo statements, they work as they are written, either a placeholder then an image or an image then a placeholder. You can see that with these two players: If it's a .JPG file it goes placeholder then image: http://hoosierhoopsreport.com/tag/alexander-hutson/ If it's a .jpg file it goes image then placeholder: http://hoosierhoopsreport.com/tag/deshaun-thomas/
  17. No, that's a Wordpress feature, dealing with taxonomy, and I don't fully understand it. However, you can replace the 'tag' with any word, such as yucky. http://hoosierhoopsreport.com/yucky/wp-content/uploads/HutsonAlexander.JPG The file is in wp-content/uploads folder. That's a folder I use specifically for head shots, specifically for my wp-playerProfile.php. I tried it...same result.
  18. Nope. Again, the problem isn't with the path to right folder. It appears to get it all right until file format. It clearly prints the .JPG correctly.
  19. Not sure what you mean, but the file that actually produces that code within my Wordpress is: http://hoosierhoopsreport.com/resources/wp-playerProfile.php
  20. OK...here is the code I'm currently using, which doesn't work: $file_name = "/wp-content/uploads/". $line['nameLast'] . $line['nameFirst'] . ".jpg"; if (!file_exists($file_name)) $file_name = "/wp-content/uploads/". $line['nameLast'] . $line['nameFirst'] . ".JPG"; echo '<div><img src="' . $file_name .'" /></div>'; Here is an example where the image file is a .JPG: http://hoosierhoopsreport.com/tag/alexander-hutson/ Here is an example where the image file is a .jpg: (image holder is blue box just left of name) http://hoosierhoopsreport.com/tag/deshaun-thomas/
  21. The last version didn't even drill back to the root folder, so it's just adding the image URL to the end of the page URL I'm looking at.
  22. Not only does it not work, it's not even the right path.
  23. No, the path is otherwise fine. It's just showing the .JPG part, which in this case doesn't exist, when the .jpg file exists. That's why I keep saying, the code as we have it bypasses all .jpg line and just uses the .JPG line.
  24. Not working. When I click on the image properties of the one not showing, it shows a file format of .JPG. That's supposed to be a .jpg one, so it's not recognizing that there is a .jpg file there and echo'ing a .JPG.
  25. Still not working, same result. Doesn't see the .jpg file, and if there is a .JPG file it echo's that.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.