teknoledge
Forum Replies Created
-
Forum: Plugins
In reply to: [wp-Monalisa] Using multiple ID containers for Smilies?I think he refers to having option to use both on comment and bbpress input areas… would be really nice addition to have it work with bbpress as well 🙂
Cheers!
Forum: Plugins
In reply to: [Plugin: W3 Total Cache] NGINX support status?Any update on this? 🙂
Nginx is becoming extremely popular webserver (I moved completely to nginx on all my VPS’s and servers) so added support for it out of the box would be extremely useful.
Forum: Fixing WordPress
In reply to: page/2 redirects to 404Anyone?
Forum: Everything else WordPress
In reply to: Am I hacked or what?I figured out that this has nothing to do with wordpress, it’s server/hosting security flaw that need’s to be checked. The same peace of code I found on couple of .NET coded websites so it’s definitely hosting related issue.
Forum: Plugins
In reply to: post expire plugin issuebump 🙂
Forum: Plugins
In reply to: post expire plugin issueThis is the plugin code:
<?php /* Plugin Name: Posts Expire Description: Adds an expiry date to posts. Author: Michael O'Connell Version: 1.02 Author URI: http://wunder-ful.com/ This plugin is released under version 2 of the GPL: http://www.opensource.org/licenses/gpl-license.php */ class posts_expire { function posts_expire() { global $wpdb; if ( !get_settings('posts_have_end_date') ) { $wpdb->query("ALTER TABLE <code>$wpdb->posts</code> ADD <code>post_end_date</code> DATE AFTER <code>post_date</code>"); update_option('posts_have_end_date', 1); } add_filter('posts_where', array(&$this, 'add_where_clause')); add_filter('posts_orderby', array(&$this, 'add_orderby')); //bypass orderby safety check add_action('simple_edit_form', array(&$this, 'add_end_date_input')); add_action('edit_form_advanced', array(&$this, 'add_end_date_input')); add_action('edit_page_form', array(&$this, 'add_end_date_input')); add_action('save_post', array(&$this, 'add_update_statement')); } function add_where_clause($where) { if(get_settings('show_expired_posts') || is_admin() || is_single()) return $where; //exclude nulls when getting a list of posts that expire soon $include_nulls = !($_GET['orderby'] == 'post_end_date'); $now = date('Y-m-d') . ' 23:59:59'; //timezone not taken into consideration... $where = $where . " AND (post_end_date >= '$now'"; if($include_nulls) $where = $where . ' OR post_end_date IS NULL'; $where = $where . ')'; return $where; } function add_orderby($orderby) { if($_GET['orderby'] == 'post_end_date') return '<code>post_end_date</code> ASC'; else return $orderby; } function add_end_date_input() { $end_date = get_end_date(); echo "<div>Enter a end date (yyyy-mm-dd): <input type='text' name='end_date' value='$end_date'></input></div>"; } function add_update_statement($post_ID) { global $wpdb; $end_date = $_POST['end_date']; if($end_date) $wpdb->query("UPDATE <code>$wpdb->posts</code> SET <code>post_end_date</code> = '$end_date' WHERE <code>ID</code> =$post_ID LIMIT 1 ;"); else //remove existing end date if user blanks field $wpdb->query("UPDATE <code>$wpdb->posts</code> SET <code>post_end_date</code> = NULL WHERE <code>ID</code> =$post_ID LIMIT 1 ;"); } } $posts_expire =& new posts_expire(); function the_end_date($prefix = '') { $end_date = mysql2date(get_settings('date_format'),get_end_date()); if(!$prefix) $prefix = __('Expires '); if(function_exists('get_begin_date') && get_begin_date()) $prefix = ', ' . $prefix; if($end_date) echo $prefix . $end_date; else echo __('Expiration Unknown'); } function get_end_date() { global $post; return $post->post_end_date; } ?>I guess I should remove the filter “posts_where” for pages I want to show expired posts also, something like:
remove_filter(‘posts_where’, ‘add_where_clause’); ??
Forum: Everything else WordPress
In reply to: Am I hacked or what?I’m running 2.6.3. Thanks for the quick reply!
Forum: Plugins
In reply to: custom query based on custom fields – SQL relatedThis seems like it can solve the problem. Thanks! 🙂
Forum: Plugins
In reply to: custom query based on custom fields – SQL relatedI’m using Flutter plugin to add custom fields to posts and I introduced new field called “Type” for all new post entries. Type field is dropdown with 2 possible values “code” and “offer”. For all new entries “Type” is defined with one of the 2 possible values but for older entries it’s undefined and because I have around 1000+ entries it’s impossible to edit each one to add and define new custom field. I set if the “Type” is not defined I take it as “code”.
What I want to achieve is to have one query that will fetch all entries and have “Type” field values at the end:
1) if “Type” is not set return meta_value = NULL at the end of the recordset
2) if “Type” is “Code” return meta_value = Code at the end of the recordset
3) if “Type” is “Offer” return meta_value = Offer at the end of the recordsetThis way I can identify each entry and act accordingly. Hope this makes sense
Forum: Plugins
In reply to: get_post_meta in function.phpI used
get_post_custom($post_id)instead and it worksForum: Plugins
In reply to: [Plugin: NextGEN Gallery] How to prevent image hotlinking?@alexrabe
Ah, exactly what I was looking for. 🙂@williwaw
I was thinking more about permalinks for images e.g.wp-content/gallery/whatever/image-file-name-jpg/
instead of:
wp-content/gallery/whatever/image file name.jpg
Also it would be good to add replacement of spaces (‘ ‘) with hyphens for uploaded images in the feature versions of NGG, I’m sure it’s not a big job.
Cheers! 🙂
Forum: Developing with WordPress
In reply to: query by custom field but with tags in resultsetResolved as per this post:
http://wordpress.org/support/topic/138092?replies=5Forum: Plugins
In reply to: Custom Fields for CategoriesI was looking for a similar plugin but since I couldn’t find it decided to develop it 😉
http://www.flairpair.com/blog/wordpress/category-custom-fields
Supports WordPress 2.3+
Forum: Plugins
In reply to: Comments on category pageWorks! Again, thanks a lot!
Forum: Plugins
In reply to: Comments on category pageOne more thing :), I want to have 2 different comment templates, one for category.php and one for single.php page.
This is working:
<?php
$wp_query->is_single = true;
comments_template();
$wp_query->is_single = false;
?>But this is not working:
<?php
$wp_query->is_single = true;
include (TEMPLATEPATH . ‘/comments-slide.php’);
$wp_query->is_single = false;
?>Any tip?