true, 'resize_over_bytes' => mbToBytes(setting('forum_image_resize_threshold_mb','1'), 1), 'image_max_width' => (int)setting('forum_image_max_width','1600'), 'image_quality' => (int)setting('forum_image_quality','82'), ] ); if (!$upload['ok']) $errors[] = $upload['error']; else $imagePath = (string)($upload['path'] ?? ''); } if(!$errors){ $status=setting('events_require_approval','1')==='1'?'pending':'approved'; qrun("INSERT INTO events(title,description,venue,address,event_date,event_time,end_date,end_time,cost,website,contact_name,contact_email,contact_phone,image_path,submitted_by,status)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", [$title,$desc,$venue,$addr,$date,$time,$edate?:null,$etime,$cost,$web,$cn,$ce,$cp,$imagePath,uid(),$status]); flash($status==='approved'?'Event submitted and published!':'Event submitted! It will appear after review.','success'); go('/events.php'); } $showForm=true; } $page=max(1,iget('page')); $perPage=10; $total=(int)qval("SELECT COUNT(*) FROM events WHERE status='approved' AND(event_date>=date('now') OR(end_date IS NOT NULL AND end_date>=date('now')))"); $pages=max(1,(int)ceil($total/$perPage)); $page=min($page,$pages); $offset=($page-1)*$perPage; $events=qall("SELECT e.*,u.username submitter FROM events e LEFT JOIN users u ON u.id=e.submitted_by WHERE e.status='approved' AND(e.event_date>=date('now') OR(e.end_date IS NOT NULL AND e.end_date>=date('now'))) ORDER BY e.is_featured DESC,e.event_date ASC LIMIT $perPage OFFSET $offset"); include __DIR__.'/includes/header.php'; ?>
Festivals, sports, community gatherings, arts, and more in Mineral County.
Please log in to submit an event.