Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.DS_Store
index.html
data.json
tweetstream/cache/cctweets.txt
36 changes: 36 additions & 0 deletions data/info-update.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

// Check_URL function checks if a URL is valid
function check_url($url) {
$headers = @get_headers($url);
$headers = (is_array($headers)) ? implode( "\n ", $headers) : $headers;
return (bool)preg_match('#^HTTP/.*\s+[(200|301|302)]+\s#i', $headers);
}

// Get timestamp
$nextDate = strtotime('Last wednesday of this month');

// If it's still the same month, but past the date of this months meet, get the next months meet
if(($nextDate < time()) && (date('m') == date('m', $nextDate)))
$nextDate = strtotime('Last wednesday of next month');

// time as a string for <time> element.
$timeNextDate = date("c", strtotime('7pm'));

// date as human readable, 29th Oct
$showNextDate = date("jS M",$nextDate);
$attendingDate = date("My", $nextDate);

// Constrcut attending link
$attendlink = "http://attending.io/events/cc-".$attendingDate;

$link = (check_url($attendlink)) ? $attendlink : false;

$data = array(
'showNextDate' => $showNextDate,
'timeNextDate' => $timeNextDate,
'attendingDate' => $attendingDate,
'link' => $link
);

file_put_contents('data.json', json_encode($data));
111 changes: 13 additions & 98 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,56 +1,6 @@
<?php
// sadly now a defunct list of those who attended. We did show avatars of those who turned up but twitter changed their API.
$attendees = array('crcreatives', 'mrqwest', 'simianstudios', 'alexjsexton', 'simoncox', 'fulljames', 'rchasteauneuf', 'mikestreety', 'clivewalker', 'dynamic50', 'kevin_davies', 'standardistas', 'pauladamdavis', 'paulmist', 'weshuk', 'bossingtonimage', 'steverydz', 'tarunhari', 'danblundell', 'mkstix6', 'blinkbrian', 'ayoungh', 'amberweinberg', 'jamieknight', 'dkewal', 'laurakalbag', 'mrgeorgegray', 'epixelstudio', 'khamiltonuk', 'dean_faulkner', 'locombia25', 'smartin_hazel', 'mikesimmonds', 'jef_lau', 'eightmadefour', 'philwareham', 'shanegriffiths', 'wstn', 'designsbylexi', 'kulor', 'englishtom', 'martingoldie', 'rglepper', 'linglau64', 'sparrwhawk', 'juanfernandes', 'matthillco', 'hollandben', 'tcbarrett', 'jack_franklin', 'croydn', 'rjw1', '98rosjon', 'polevaultweb', 'chatters79', 'hazeljmaclaurin', 'allaboutcroydon', 'matthewsyard', 'onishiweb', 'sanjaypoyzer', 'futureofcroydon', 'damianwalsh', 'skillshive', 'DegasGuruve', 'frohican', 'ceiga', 'duncanmacweb' );



// the current date & time
$now = date(DATE_ATOM);

// Here's the array of dates for the event
$dates = array(
date(DATE_ATOM, mktime(19, 30, 0, 09, 24, 2014)),
date(DATE_ATOM, mktime(19, 30, 0, 08, 31, 2014)),
date(DATE_ATOM, mktime(19, 30, 0, 10, 29, 2014)),
date(DATE_ATOM, mktime(19, 30, 0, 11, 26, 2014)),
date(DATE_ATOM, mktime(19, 30, 0, 12, 17, 2014)),
date(DATE_ATOM, mktime(19, 30, 0, 01, 28, 2015)),
date(DATE_ATOM, mktime(19, 30, 0, 02, 25, 2015)),
date(DATE_ATOM, mktime(19, 30, 0, 03, 25, 2015)),
date(DATE_ATOM, mktime(19, 30, 0, 04, 29, 2015)),
date(DATE_ATOM, mktime(19, 30, 0, 05, 27, 2015)),
date(DATE_ATOM, mktime(19, 30, 0, 06, 24, 2015))
);

// initialise empty array for future events
$futuredates = array();

// the foreach
foreach($dates as $date){
// if the date from the $dates array is older than today...
if ($date < $now ){
// donothing
} else {
// if it's a future event, push the date into $futuredates
array_push($futuredates, $date);
};
};

// and bosh, convert the first line from the array as a string, ie: the next event.
$nextDate = strtotime($futuredates[0]);

// time as a string for <time> element.
$timeNextDate = date("c",$nextDate);

// date as human readable, 29th Oct
$showNextDate = date("jS M",$nextDate);

$attendingDate = date("My", $nextDate);

$attendlink = "http://attending.io/events/cc-".$attendingDate;

$data = json_decode(file_get_contents('data/data.json'));
?>

<!DOCTYPE HTML>

<!--[if IEMobile 7 ]><html class="no-js iem7" manifest="default.appcache?v=1"><![endif]-->
Expand All @@ -69,7 +19,7 @@
<meta name="description" content="An open and informal community of designers, developers and digital creatives from in and around Croydon who fancy a break from the screen and to chat about the web, print, typography and design.">
<meta name="author" content="MrQwest and Croydon Creatives">

<!-- We are a friendly bunch, why not come down and say hello? Claim your free drink for reading the source! -->
<!-- We are a friendly bunch, why not come down and say hello? Claim your free drink for reading the source! -->

<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
Expand Down Expand Up @@ -102,15 +52,20 @@
<li><a href="#about" title="About Croydon Creatives">About</a></li>
<li><a href="#where" title="Where in Croydon do we meet?">Where</a></li>
<li><a href="#jointhelist" title="Join the Croydon Creatives mailing list and get notified about our upcoming meetups">Join the list</a></li>
<!--<li><a href="#attendees" title="Who else attends the local meet up?">Attendees</a></li>-->
<li><a href="<?php echo $attendlink; ?>" title="Attending?">Attend</a></li>
<?php if($data->link) : ?><li><a href="<?php echo $data->link; ?>" title="Attending?">Attend</a></li><?php endif; ?>
<li><a href="http://twitter.com/crcreatives" title="Follow us on twitter" rel="nofollow">@CrCreatives</a></li>
</ul>
</nav>
</header>

<section id="next">
<h1>Next: <time datetime="<?php echo $timeNextDate; ?>"><a href="<?php echo $attendlink; ?>" data-old="http://lanyrd.com/series/croydoncreatives/save-to-calendar/"><?php echo $showNextDate; ?> @ 7pm (ish)</a></time></h1>
<h1>Next:
<time datetime="<?php echo $data->timeNextDate; ?>">
<?php if($data->link) : ?><a href="<?php echo $data->link; ?>" data-old="http://lanyrd.com/series/croydoncreatives/save-to-calendar/"><?php endif; ?>
<?php echo $data->showNextDate; ?> @ 7pm (ish)
<?php if($data->link) : ?></a><?php endif; ?>
</time>
</h1>
</section>

<section id="about">
Expand All @@ -122,26 +77,8 @@
<section id="where">
<h1>Where?</h1>
<div id="map_canvas"></div>
<p>In our search for a regular venue, we’ve happened across two decent establishments so we’ll alternate between the two. This month, we’re meeting at

<!-- various locations are used and instead of repeating addresses etc, we'll just comment out the ones we're not using for that month -->

<!--<a href="http://www.porterandsorterpub.co.uk/" title="The Porter &amp; Sorter" rel="nofollow">The Porter &amp; Sorter</a>, Billington Road, Croydon, Surrey <a href="http://g.co/maps/kjzx6" title="Google maps" rel="nofollow">CR0 6BT</a>-->

<!--<a href="http://spreadeaglecroydon.co.uk/" title="The Spreadeagle" rel="nofollow">The Spreadeagle</a>, 39-41 Katharine St, Croydon CR0 1NX -->

<!--<a href="http://www.greendragoncroydon.co.uk/" title="The Green Dragon" rel="nofollow">The Green Dragon</a>, 58 High St, Croydon, CR0 1NA. It’s literally across the road from the Spread Eagle-->

<a href="http://matthewsyard.com/" title="Matthews Yard" rel="nofollow">Matthews Yard</a>, 1 Matthews Yard (off Surrey St), Croydon, <a href="http://goo.gl/maps/KRFhK" title="Directions from East Croydon">CR0 1FF</a>

.</p>
<p>If you’re traveling by train, aim for East Croydon station (20 minutes from Victoria/London Bridge rail stations), come out of the main entrance of the station,

<!--turn right and walk down George St towards Croydon Centre (follow the tram tracks). You’ll soon come upon the pedestrianised high street to your right. At this point, turn left and walk for two minutes, the Spread Eagle is on the left-->

turn right and walk down George St towards Croydon center (follow the tram tracks!). Walk past the pedestrianised high street on your right and down a small (but steep!) hill. Turn left after the KFC and walk up Surrey St. After 2 minutes, you’ll see a small pedestrianised lane on your right between two buildings called Matthews Yard. Walk down the lane and Matthews Yard is on your left

.</p>
<p>In our search for a regular venue, we’ve happened across two decent establishments so we’ll alternate between the two. This month, we’re meeting at <a href="http://matthewsyard.com/" title="Matthews Yard" rel="nofollow">Matthews Yard</a>, 1 Matthews Yard (off Surrey St), Croydon, <a href="http://goo.gl/maps/KRFhK" title="Directions from East Croydon">CR0 1FF</a>.</p>
<p>If you’re traveling by train, aim for East Croydon station (20 minutes from Victoria/London Bridge rail stations), come out of the main entrance of the station, turn right and walk down George St towards Croydon center (follow the tram tracks!). Walk past the pedestrianised high street on your right and down a small (but steep!) hill. Turn left after the KFC and walk up Surrey St. After 2 minutes, you’ll see a small pedestrianised lane on your right between two buildings called Matthews Yard. Walk down the lane and Matthews Yard is on your left.</p>
<p>If you’re coming by car, then the closest parking is Fairfield Halls Car Park. Take a look at <a href="http://g.co/maps/ctwpy" title="Parking Map" rel="nofollow">this map</a> for locations of the parking in the area and the meeting place.</p>
<p>Finally, if you’re coming via tram, you’ll want the George Street tram stop.</p>
</section>
Expand Down Expand Up @@ -182,36 +119,14 @@

</section>

<!-- Let's omit this whilst I fix the code because twitter through a strop and stopped API v1 ==
<section id="attendees">
<h1>Roll call</h1>
<p>A list of people who’ve attended previous Croydon Creatives gatherings:</p>

<ul id="attendence">
<?php foreach($attendees as $attendee) { ?>
<li class="attendee"><a href="http://twitter.com/<?= $attendee ?>" rel="nofollow" title="<?= $attendee ?>"><img src="https://api.twitter.com/1/users/profile_image?screen_name=<?= $attendee ?>&size=bigger" alt="<?= $attendee ?>"></a></li>
<?php } ?>
</ul>-->


</section>

<section id="attend">
<h1>Attending?</h1>
<p>We love <a href="http://attending.io" title="attending.io" rel="nofollow">Attending</a> here, it’s an awesome service for events.</p>
<p>We set up an event on Attending for every Croydon Creatives meet and we love it when new and old friends add their names to the list. If you’re planning on coming along to the next Croydon Creatives meet, please do pop your name down–all you need is your Twitter username!</p>
<p><a href="<?php echo $attendlink; ?>" title="The Next CroydonCreatives event" rel="nofollow">The next Croydon Creatives on Attending</a>.</p>
<?php if($data->link) : ?><p><a href="<?php echo $data->link; ?>" title="The Next CroydonCreatives event" rel="nofollow">The next Croydon Creatives on Attending</a>.</p><?php endif; ?>
</section>

<!-- alright alright, I need to re-build conftweets so that it works with the new API. I'm on it ok? jeeez. <3
<section id="stream">
<h1>Twitter stream</h1>
<p>We use Twitter–a lot. Read what is being said about Croydon Creatives:</p>
<ul id="tweetlist">
<?php require('tweetstream/cctweets.php') ?>
</ul>
</section> -->

<footer>
<p class="copyright" data-switch="yellowswitch">&copy; 2011-<?= date('Y') ?> CroydonCreativ.es, <a href="http://mrqwest.co.uk" title="MrQwest, a Croydon Web Designer" rel="nofollow">MrQwest</a> and <a href="http://steverydz.com" title="Steve Rydz" rel="nofollow">Steve Rydz</a>. Made by <a href="humans.txt" title="Made by Humans">Humans</a>.</p>
</footer>
Expand Down