- Rebuilt the CLI importer to use the official Facebook Graph API instead of HTML scraping.
Main changes: Replaced [scripts/facebook-events-import.php](/Users/tyemeclifford/Documents/GH/MyKeyser/scripts/facebook-events-import.php) with a Graph API client. It now supports --page-id, --pages-file, --event-id, --events-file, and optional area discovery via --discover-pages --center=LAT,LNG --query=.... Uses FACEBOOK_GRAPH_ACCESS_TOKEN or --access-token. Pulls Graph fields for title, description, start/end time, place/location, ticket URI, and cover.source for the main photo. Keeps the existing staged review/import workflow in /admin/event_imports.php. - Implemented event detail pages and clickable event cards. What changed: Added [event.php](/Users/tyemeclifford/Documents/GH/MyKeyser/event.php) for individual event pages. Made event cards clickable from [events.php](/Users/tyemeclifford/Documents/GH/MyKeyser/events.php), [index.php](/Users/tyemeclifford/Documents/GH/MyKeyser/index.php), and legacy [2index.php](/Users/tyemeclifford/Documents/GH/MyKeyser/2index.php). Added large event photo display plus lightbox enlargement in [assets/css/style.css](/Users/tyemeclifford/Documents/GH/MyKeyser/assets/css/style.css) and [assets/js/app.js](/Users/tyemeclifford/Documents/GH/MyKeyser/assets/js/app.js). Added eventUrl() and externalHref() helpers in [includes/functions.php](/Users/tyemeclifford/Documents/GH/MyKeyser/includes/functions.php). Added copy-event-link support on event detail pages. Updated README to list the new route.
This commit is contained in:
@@ -29,3 +29,42 @@ document.querySelectorAll('.asl').forEach(l=>{
|
||||
l.classList.add('on');
|
||||
if(location.pathname===href)l.classList.add('on');
|
||||
});
|
||||
|
||||
// Event photo lightbox
|
||||
const lightboxTriggers=document.querySelectorAll('[data-lightbox-src]');
|
||||
let lightbox;
|
||||
const closeLightbox=()=>{
|
||||
lightbox?.classList.remove('open');
|
||||
document.body.style.overflow='';
|
||||
};
|
||||
if(lightboxTriggers.length){
|
||||
lightbox=document.createElement('div');
|
||||
lightbox.className='lightbox';
|
||||
lightbox.innerHTML='<button type="button" class="lightbox-close" aria-label="Close image">×</button><img alt="">';
|
||||
document.body.appendChild(lightbox);
|
||||
const img=lightbox.querySelector('img');
|
||||
lightboxTriggers.forEach(btn=>{
|
||||
btn.addEventListener('click',()=>{
|
||||
img.src=btn.dataset.lightboxSrc;
|
||||
img.alt=btn.dataset.lightboxAlt||'Event photo';
|
||||
lightbox.classList.add('open');
|
||||
document.body.style.overflow='hidden';
|
||||
});
|
||||
});
|
||||
lightbox.addEventListener('click',e=>{if(e.target===lightbox||e.target.closest('.lightbox-close'))closeLightbox();});
|
||||
document.addEventListener('keydown',e=>{if(e.key==='Escape')closeLightbox();});
|
||||
}
|
||||
|
||||
// Copy share links
|
||||
document.querySelectorAll('[data-copy-url]').forEach(btn=>{
|
||||
btn.addEventListener('click',async()=>{
|
||||
const label=btn.textContent;
|
||||
try{
|
||||
await navigator.clipboard.writeText(btn.dataset.copyUrl);
|
||||
btn.textContent='Copied';
|
||||
setTimeout(()=>btn.textContent=label,1400);
|
||||
}catch{
|
||||
prompt('Copy this link:',btn.dataset.copyUrl);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user