|
إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...
انضم الينا
#1
| ||
| ||
I am using this as a calendar of events widget. http://www.nccbmwcca.org Each thread title I want to find is formatted as MM/DD/YYYY - description of an event. These threads have a thread prefix tag of chapter_event or other. The threads are sorted by title and an extra is placed between titles each time the month changes. The problem is that I want to find thread titles that begin with today and the future. I thought if I formatted a variable $today that I could compare it to the first 10 characters of the title string. This does not work. I can find the first 2 characters to omit previous months. I could also omit last year. But when I look for posts that are after today's day, previous posts are omitted. PHP Code: ob_start(); $output_bits = ''; $today = date("m/d/Y"); $spacer = date("m"); $get_schedule = vB::$db->query_read(" SELECT * FROM ".TABLE_PREFIX."thread WHERE prefixid='Chapter_Event' OR prefixid ='other' AND LEFT(title, 10) >= $today ORDER BY title ASC"); while($schedule = vB::$db->fetch_array($get_schedule)) { $str = substr($schedule[title], 0, 2); /* get month of event */ /* separates posts by month */ if ( $str == $spacer ) { $output_bits .=''.$schedule[title].''; } else { $output_bits .=''.$schedule[title].''; } $spacer = $str; } /* done */ $output = $output_bits; ob_end_clean(); __DEFINE_LIKE_SHARE__ |
مواقع النشر (المفضلة) |
أدوات الموضوع | |
انواع عرض الموضوع | |
| |