tylermenezes
Forum Replies Created
-
Forum: Plugins
In reply to: How to get Current User ID outside of WP Blog.You’ll probably need to work with the cookie and database manually.
The cookie wordpress sets is named wordpress_md5(site_url). In it you will find:
username|expiration|validation_code
Username is just the user’s username. Expiration is the time in seconds since the UNIX epoch, you can see if it’s expired in PHP with if(time() > expiration). Validation code is an hmac-hashed string. You can validate it with this function:
function wp_validate_auth_cookie($cookie) { $secret = YOUR_WORDPRESS_SECRET_KEY; $salt = YOUR_WORDPRESS_SALT; @list($username, $expiration, $hmac) = explode('|', $cookie); if(!$username || !$expiration || !$hmac) return false; if ( $expiration < time() ) return false; $key = $username . $expiration . $secret . $salt; $hash = hash_hmac('md5', $username . $expiration, $key); if ( $hmac != $hash ) return false; return true; }I wrote a plugin for Vanilla to work with WordPress yesterday, :D.
The secret key and salt should be defined in wp-config.php.
Forum: Plugins
In reply to: FFFFound.com Plug-in DevelopementLook online for a PHP script that does what you want. Open your template for the sidebar and add <?php include(“http://www.yoursite.com/path/to/script/you/downloaded.php”); ?>. I’m using this to include random quotes at tylerm.info.
Forum: Fixing WordPress
In reply to: How 2 Protect Files In Page SourceThere’s no real way to protect this. You could ‘encrypt’ your pages with Javascript if you wrote a plugin, but it doesn’t matter. Anyone with the free program Wireshark can see exactly what they’re requesting from the server with very little effort.
Honestly you’re better off sticking a small watermark in the corner of your videos so if they download them and repost them on their site you’ll at least get some extra visitors.
Forum: Everything else WordPress
In reply to: What happened to the WordPress RSS page?Did you set your RSS reader to be Google Personalized Home?
Forum: Fixing WordPress
In reply to: need advice on hacking attemptThey’re script-kiddie attacks, they’re trying old exploits. As long as you’re running the latest version, you should be fine. But be sure to back up your database regularly if you don’t already.
Forum: Everything else WordPress
In reply to: What forum software powers these forums?Wow, this is awesome! Way better than Vanilla!
Forum: Requests and Feedback
In reply to: Gallery Plugin from ma.ttJudging from his footer, Gallery.
Forum: Installing WordPress
In reply to: whoah. did i screw that up?Your database information is incorrect. Ensure the host is correct and the username/password are correct.
Yes! Use WPMU!
Forum: Installing WordPress
In reply to: Login page redirecting to Error pageCould you give your actual site URL or some more information.
Forum: Installing WordPress
In reply to: CGI Error“Do a search for CGI application misbehaved. ” That’s going to give you incredibly vague results. Then again the error is rather generic, too.
How exactly did you resolve these errors, that may be the problem.
Forum: Installing WordPress
In reply to: fatal error when installingMake sure you uploaded all files (and didn’t delete anything)! There’s a file called wp-settings.php that’s missing from your blog folder.
Forum: Installing WordPress
In reply to: Integratting WP Blog into a new web site I am designing@fortinsvisit: This really should be in a seperate post.
You need a database server, if you don’t have one talk to the person providing your hosting and ask them.
Forum: Themes and Templates
In reply to: Help – crazy nav bar and crooked right side barYou may want to fix the background now. It needs to be wider. If you need help let me know and I can edit it for you.
Forum: Themes and Templates
In reply to: Need help with get_posts on index.php!Okay, finished with my code. Because WordPress apparently doesn’t have a function for what I needed, I hacked one with SQL. Here’s my final code if it helps anyone:
<?php $posts2 = get_posts( "numberposts=1&orderby=post_date&category=7" ); ?> <?php if( $posts2 ) : ?> <?php foreach( $posts2 as $post2 ) : setup_postdata( $post2 ); ?> <h2><a href="<?php echo get_permalink($GLOBALS['post2']->ID) ?>" title="Permanent Link to <?php echo $GLOBALS['wpdb']->get_var("SELECT <code>post_title</code> FROM <code>" . $GLOBALS['wpdb']->prefix . "posts</code> WHERE id=" . $GLOBALS['post2']->ID); ?>"><?php echo $GLOBALS['wpdb']->get_var("SELECT <code>post_title</code> FROM <code>" . $GLOBALS['wpdb']->prefix . "posts</code> WHERE id=" . $GLOBALS['post2']->ID); ?></a></h2> <?php $args = array( 'post_type' => 'attachment', 'numberposts' => null, 'post_status' => null, 'post_parent' => $GLOBALS['post2']->ID ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $attachment) { echo apply_filters('the_title', $attachment->post_title); the_attachment_link($attachment->ID, true, array(250,200)); break; } } ?> <?php the_excerpt(); ?> <hr /> <div style="text-align: right"><strong><a href="<?php echo get_permalink($GLOBALS['post2']->ID) ?>">Continue reading '<?php echo $GLOBALS['wpdb']->get_var("SELECT <code>post_title</code> FROM <code>" . $GLOBALS['wpdb']->prefix . "posts</code> WHERE id=" . $GLOBALS['post2']->ID); ?>' »</a></strong></div> <?php endforeach; ?> <?php endif; ?>Forum: Themes and Templates
In reply to: Need help with get_posts on index.php!More Thoughts: I’m able to get
get_permalink($GLOBALS['post2']->ID)to work, does anyone know of a similar tag for title? That’s all I’m missing now.