deko
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: wordpress affecting time() functionI 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 whattime()would get from non-wp pages.Forum: Fixing WordPress
In reply to: wordpress affecting time() function<?php get_the_time( $d, $post ); ?>Returns the time of the current post for use in PHP. It does not display the time.
So do I have to unravel whatever
get_the_timeis doing? Is there some function I can run, before my script runs, that will reset PHP so it will return the expected value fromtime()?Forum: Fixing WordPress
In reply to: protecting wordpress with htaccessThanks 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
In reply to: How to display Day of Week with get_the_date?ugh. it may not look like it, but there’s a lot of difference between
1andlsolution:
esc_attr( get_the_date('l') )Forum: Plugins
In reply to: SQL to get cat ids of postscorrected…
$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
In reply to: How to remove hyperlink from comment date?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
In reply to: SQL to get cat ids of postsactually, 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
In reply to: SQL to get cat ids of postsYes, 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
In reply to: SQL to get cat ids of postsActually, 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
In reply to: Permalink Settings Demystifiedgot 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
In reply to: Permalink Settings DemystifiedI guess I should take that as encouragement to give it a shot. thx for the reply.
Forum: Fixing WordPress
In reply to: Permalink Settings DemystifiedI 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
In reply to: How to get post/page name?While
$post->post_titlecertainly 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
In reply to: How to get post/page name?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
In reply to: searchform in front page returns fatal errorno 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" /> <input type="submit" value="<?php esc_attr_e('Search'); ?>" /> </form> <?php endif; ?>