Title: deko's Replies | WordPress.org

---

# deko

  [  ](https://wordpress.org/support/users/deko/)

 *   [Profile](https://wordpress.org/support/users/deko/)
 *   [Topics Started](https://wordpress.org/support/users/deko/topics/)
 *   [Replies Created](https://wordpress.org/support/users/deko/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/deko/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/deko/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/deko/engagements/)
 *   [Favorites](https://wordpress.org/support/users/deko/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 196 total)

1 [2](https://wordpress.org/support/users/deko/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/deko/replies/page/3/?output_format=md) …
[12](https://wordpress.org/support/users/deko/replies/page/12/?output_format=md)
[13](https://wordpress.org/support/users/deko/replies/page/13/?output_format=md)
[14](https://wordpress.org/support/users/deko/replies/page/14/?output_format=md)
[→](https://wordpress.org/support/users/deko/replies/page/2/?output_format=md)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wordpress affecting time() function](https://wordpress.org/support/topic/wordpress-affecting-time-function/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wordpress-affecting-time-function/#post-2769296)
 * I revised the first lines of my script to this:
 *     ```
       date_default_timezone_set('America/Los_Angeles');
       $timestamp = time();
       ```
   
 * This fixed whatever WordPress did that made the PHP `time()` function return 
   a value different from what `time()` would get from non-wp pages.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wordpress affecting time() function](https://wordpress.org/support/topic/wordpress-affecting-time-function/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wordpress-affecting-time-function/#post-2769288)
 * `<?php get_the_time( $d, $post ); ?>`
 * _Returns the time of the current post **for use in PHP**. It does not display
   the time._
 * [get_the_time](http://codex.wordpress.org/Function_Reference/get_the_time)
 * So do I have to unravel whatever `get_the_time` is doing? Is there some function
   I can run, before my script runs, that will reset PHP so it will return the expected
   value from `time()`?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [protecting wordpress with htaccess](https://wordpress.org/support/topic/protecting-wordpress-with-htaccess/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [14 years ago](https://wordpress.org/support/topic/protecting-wordpress-with-htaccess/#post-2746538)
 * Thanks for the reply. The WordPress Firewall 2 plugin looks interesting, but 
   I was more interested in how the default wordpress htaccess file is any better
   than using a simple ErrorDocument, and also thoughts on that htaccess file form
   wprecipies.com.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [How to display Day of Week with get_the_date?](https://wordpress.org/support/topic/how-to-display-day-of-week-with-get_the_date/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [14 years ago](https://wordpress.org/support/topic/how-to-display-day-of-week-with-get_the_date/#post-2736797)
 * ugh. it may not look like it, but there’s a lot of difference between `1` and`
   l`
 * solution: `esc_attr( get_the_date('l') )`
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [SQL to get cat ids of posts](https://wordpress.org/support/topic/sql-to-get-cat-ids-of-posts/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/sql-to-get-cat-ids-of-posts/#post-2194580)
 * corrected…
 * `$thispost = $_GET["p"];`
    `SELECT term_taxonomy.term_id FROM term_taxonomy INNER
   JOIN term_relationships ON term_taxonomy.term_taxonomy_id = term_relationships.
   term_taxonomy_id INNER JOIN posts ON posts.ID = term_relationships.object_id 
   WHERE (posts.ID = ".$thispost.");`
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to remove hyperlink from comment date?](https://wordpress.org/support/topic/how-to-remove-hyperlink-from-comment-date/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/how-to-remove-hyperlink-from-comment-date/#post-2197558)
 * thanks esmi. after reading that page, my impression is that the wp developers
   hardcoded hyperlinked comment dates in order to provide permalinks to comments.
 * reasonable enough. perhaps I should simply style the link so it doesn’t look 
   like a link.
 * for those who *really* don’t want hyperlinked comment dates, line 1362 to line
   1637 of wp-includes/comment-template.php can be modified to this:
 *     ```
       <div class="comment-meta commentmetadata">
         <?php printf( __('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?>
         <?php edit_comment_link(__('Edit'),'  ','' ); ?>
       </div>
       ```
   
 * which removes the following line of code:
 * `<a href="<?php //echo htmlspecialchars( get_comment_link( $comment->comment_ID))?
   >">`
 * along with the closing `</a>` in the following line.
 * this will prevent comment dates from being hyperlinked.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [SQL to get cat ids of posts](https://wordpress.org/support/topic/sql-to-get-cat-ids-of-posts/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/sql-to-get-cat-ids-of-posts/#post-2194518)
 * actually, 1 join shd do it…
 * `$thispost = $_GET["p"];`
    `SELECT term_relationships.term_taxonomy_id FROM term_relationships
   INNER JOIN posts ON posts.ID = term_relationships.object_id WHERE (posts.ID =".
   $thispost.");`
 * assuming the post is in only one category
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [SQL to get cat ids of posts](https://wordpress.org/support/topic/sql-to-get-cat-ids-of-posts/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/sql-to-get-cat-ids-of-posts/#post-2194384)
 * Yes, I do 3 joins…
 *     ```
       $thispost = $_GET["p"];
       ```
   
 * `"SELECT term_relationships.term_taxonomy_id FROM terms INNER JOIN (term_taxonomy
   INNER JOIN (term_relationships INNER JOIN posts ON posts.ID = term_relationships.
   object_id) ON term_relationships.term_taxonomy_id = term_relationships.term_taxonomy_id)
   ON terms.term_id = term_taxonomy.term_id WHERE (posts.ID = ".$thispost.") LIMIT
   1;"`
 * isn’t normalization great?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [SQL to get cat ids of posts](https://wordpress.org/support/topic/sql-to-get-cat-ids-of-posts/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/sql-to-get-cat-ids-of-posts/#post-2194379)
 * Actually, that query DOES work. All it needs to a WHERE clause. Still, it’s ugly.
   Is there a better way?
 * Remember, NOT in the loop…
 * What if I grab the post ID like this: `$postid = $_Get["p"]`
 * I want to discover what the corresponding category ID is for that $postid.
 * Do I have to run a query with 3 joins to find it?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Permalink Settings Demystified](https://wordpress.org/support/topic/permalink-settings-demystified/)
 *  [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/permalink-settings-demystified/#post-2187863)
 * got it working. can’t use $_GET in my scripts anymore. and if I switch back at
   a later date, bookmarks break.
 * staying ugly for now…
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Permalink Settings Demystified](https://wordpress.org/support/topic/permalink-settings-demystified/)
 *  [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/permalink-settings-demystified/#post-2187681)
 * I guess I should take that as encouragement to give it a shot. thx for the reply.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Permalink Settings Demystified](https://wordpress.org/support/topic/permalink-settings-demystified/)
 *  [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/permalink-settings-demystified/#post-2187550)
 * I see. I’m curious what changes are made in the database.
 * But those changes, in addition to adding to my htaccess file, is pushing the 
   complexity price a little too high… even though I do think URL structure is an
   important part of the interface for any website.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to get post/page name?](https://wordpress.org/support/topic/how-to-get-postpage-name/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/how-to-get-postpage-name/#post-1715751)
 * While `$post->post_title` certainly does return the post title, the problem is
   passing it to my script.
 * This code doesn’t work:
 *     ```
       <?php
       $viewed = $post->post_title;
       @ include '/home/user/public_html/cgi-bin/myscript.php?id=$viewed';
       ?>
       ```
   
 * It would work if I called it like this:
 *     ```
       $viewed = $post->post_title;
       @ include 'http://www.myblog.org/myscript.php?id=$viewed';
       ?>
       ```
   
 * but I don’t want my myscript.php publicly accessible.
 * There must be an easy way to log post_title on each page view…
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to get post/page name?](https://wordpress.org/support/topic/how-to-get-postpage-name/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/how-to-get-postpage-name/#post-1715733)
 * Thanks MichaelH. I’ll give it a toss and let you know.
 * I’ve looked at a number of wp plug-ins but all I really want are the top 5 pages,
   sorted by page views, and the ability to insert these stats wherever I want on
   my blog.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [searchform in front page returns fatal error](https://wordpress.org/support/topic/searchform-in-front-page-fails-php-fatal-error/)
 *  Thread Starter [deko](https://wordpress.org/support/users/deko/)
 * (@deko)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/searchform-in-front-page-fails-php-fatal-error/#post-1231194)
 * no one would – unless they’re looking for some security vulnerability.
 * Here’s the fix:
 *     ```
       <?php if (@constant('WP_USE_THEMES')) : ?>
       <form id="searchform" method="get" action="<?php bloginfo('home'); ?>">
       <input type="text" name="s" id="s" size="25" />&nbsp;&nbsp;
       <input type="submit" value="<?php esc_attr_e('Search'); ?>" />
       </form>
       <?php endif; ?>
       ```
   

Viewing 15 replies - 1 through 15 (of 196 total)

1 [2](https://wordpress.org/support/users/deko/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/deko/replies/page/3/?output_format=md) …
[12](https://wordpress.org/support/users/deko/replies/page/12/?output_format=md)
[13](https://wordpress.org/support/users/deko/replies/page/13/?output_format=md)
[14](https://wordpress.org/support/users/deko/replies/page/14/?output_format=md)
[→](https://wordpress.org/support/users/deko/replies/page/2/?output_format=md)