> 'webdev' || Client_Url >> 'data.fairfield'); cache_empty(-name=Response_LocalPath); /if; Cache( -name=Response_LocalPath, -Expires=if_empty(var('cache_seconds'),600) ); ?> Fairfield University Students 411

Mac. Packed for college. Special student pricing available.


Submit a Story Submit a story or event you want to see on Students 411 More...

CIT Quarterfinals

'; /if; ?> Student Notices
> 'data.fairfield.edu' || client_url !>> 'webdev'); // no, not for you! // should really use the INSERT ON DUPLICATE KEY UPDATE command for this part // but as of this writing, the version of MySQL on blog.fairfield didn't support it // so instead we get to do this the hard way // first, check if there already exists a record for today inline($db_info,-table='traffic', -sql='SELECT COUNT(*) AS found FROM traffic WHERE date = CURRENT_DATE;'); if( integer(field('found')) > 0 ); // if the record exists do an update inline($db_info,-table='traffic', -sql='UPDATE traffic SET hits = hits + 1 WHERE date = CURRENT_DATE'); /inline; else; // and if it doesn't, do an add inline($db_info,-table='traffic', -sql='INSERT INTO traffic (date,hits) VALUES (CURRENT_DATE,1)'); /inline; // while we're at it, we might as well clear out the old records inline($db_info,-table='traffic', -sql='DELETE FROM traffic WHERE (TO_DAYS(NOW()) - TO_DAYS(date))>=15;' ); /inline; /if; /inline; /if; // fix image paths (only makes a difference on webdev) content_body->replace('http://www2.fairfield.edu/students/img/headings/','img/'); ?>