Skip to content

Commit

Permalink
Coverting v4 to master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Mall committed Feb 28, 2017
1 parent e2436b6 commit d7971f3
Show file tree
Hide file tree
Showing 9,964 changed files with 828,876 additions and 74,501 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added -/.DS_Store
Binary file not shown.
5 changes: 0 additions & 5 deletions -/_inc/carbon.php

This file was deleted.

42 changes: 1 addition & 41 deletions -/_inc/close.php
Original file line number Diff line number Diff line change
@@ -1,44 +1,4 @@
<!-- asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet -->
<script>
var _gaq = [['_setAccount', 'UA-6227622-1'], ['_trackPageview']];
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.async = true;
g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
s.parentNode.insertBefore(g, s);
})(document, 'script');
</script>

<?php /* ?>
<div id="clicky" class="real-hide">
<a title="Google Analytics Alternative" href="http://getclicky.com/66439102"><img alt="Google Analytics Alternative" src="//static.getclicky.com/media/links/badge.gif" border="0" /></a>
<script src="//static.getclicky.com/js"></script>
<script type="text/javascript">try{ clicky.init(66439102); }catch(e){}</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/66439102ns.gif" /></p></noscript>
</div><!-- #clicky -->
<!-- Chartbeat -->
<script type="text/javascript">
var _sf_async_config = { uid: 40863, domain: 'danielmall.com' };
(function() {
function loadChartbeat() {
window._sf_endpt = (new Date()).getTime();
var e = document.createElement('script');
e.setAttribute('language', 'javascript');
e.setAttribute('type', 'text/javascript');
e.setAttribute('src',
(("https:" == document.location.protocol) ? "https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/" : "http://static.chartbeat.com/") +
"js/chartbeat.js");
document.body.appendChild(e);
};
var oldonload = window.onload;
window.onload = (typeof window.onload != 'function') ?
loadChartbeat : function() { oldonload(); loadChartbeat(); };
})();
</script>
<?php */ ?>
<?php require($_SERVER["DOCUMENT_ROOT"]."/-/_inc/jsReference.php"); echo "\n"; ?>

</body>
</html>
27 changes: 24 additions & 3 deletions -/_inc/cssReference.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
<link href="/-/c/danielmall.v3.1.css?v=20140109063000" rel="stylesheet" media="screen, projection" />
<!-- http://particletree.com/notebook/automatically-version-your-css-and-javascript-files/ -->
<?php
if ( isset($_COOKIE['full-css']) ) {

echo '<link rel="stylesheet" href="' . autoVer('/-/c/main.css') . '" />';

} else {
?>
<style type="text/css"><?php require($_SERVER["DOCUMENT_ROOT"]."/-/c/critical.css"); ?></style>
<script>
document.write('<link href="/-/c/enhanced.css?v=20140109063000" rel="stylesheet" media="screen, projection" />');
</script>
function loadCSS(e,n,o,t){"use strict";var d=window.document.createElement("link"),i=n||window.document.getElementsByTagName("script")[0],r=window.document.styleSheets;return d.rel="stylesheet",d.href=e,d.media="only x",t&&(d.onload=t),i.parentNode.insertBefore(d,i),d.onloadcssdefined=function(e){for(var n,o=0;o<r.length;o++)r[o].href&&r[o].href===d.href&&(n=!0);n?e():setTimeout(function(){d.onloadcssdefined(e)})},d.onloadcssdefined(function(){d.media=o||"all"}),d} function cookie(e,i,o){if(void 0===i){var t="; "+window.document.cookie,n=t.split("; "+e+"=");return 2===n.length?n.pop().split(";").shift():null}i===!1&&(o=-1);var r;if(o){var c=new Date;c.setTime(c.getTime()+24*o*60*60*1e3),r="; expires="+c.toGMTString()}else r="";window.document.cookie=e+"="+i+r+"; path=/"}
if( ! cookie( 'full-css' ) ) {
loadCSS( "/-/c/main.css" );
cookie( 'full-css', true, 7 );
}
</script>
<noscript><link rel="stylesheet" href="<?php echo autoVer('/-/c/main.css'); ?>" /></noscript>

<?php
}
?>


<!-- Mint -->
<script src="http://stats.danielmall.com/mint/?js"></script>
7 changes: 5 additions & 2 deletions -/_inc/doctype.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
31 changes: 15 additions & 16 deletions -/_inc/footer.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<footer class="site-footer">

<ul class="no-marker clearfix">
<li>&copy; 2005&ndash;<?php echo date('Y'); ?> Dan Mall. Proudly made in Brooklyn and Philly. Thou shalt not steal.</li>
<li>Powered by Hand Coding&trade;. Check out <a rel="source" href="https://github.com/danielmall/danielmallcom">this site&rsquo;s code on GitHub</a>.</li>
<li>Graciously hosted by <a href="http://www.mediatemple.net/go/order/?refdom=danielmall.com">Media Temple</a></li>
<li class="twitter-enhance">Follow <a href="http://twitter.com/danielmall">@danielmall</a></li>
<li class="site-footer-rss"><a href="http://feeds.feedburner.com/danielmall-articles">RSS</a></li>
</ul>

<script>
document.write('<section id="twitter-follow"><a href="http://twitter.com/danielmall" class="twitter-follow-button">Follow @danielmall</a></section>');
</script>
<script src="http://platform.twitter.com/widgets.js"></script>
<footer role="complementary" class="dm-c-siteFooter">

<?php require($_SERVER["DOCUMENT_ROOT"]."/-/_inc/jsReferenceFooter.php"); echo "\n"; ?>
<div class="dm-c-siteFooter_copyright">
<p>&copy; 2005 &ndash; <?php echo date('Y'); ?> Dan Mall, a Philly jawn.Thou shalt not steal.</p>
<p class="">Powered by Hand Coding&trade;. Check out this site&rsquo;s code on <a href="https://github.com/danielmall/danielmallcom">Github</a>.</p>
<p class="">Graciously hosted by <a href="http://www.mediatemple.net/go/order/?refdom=danielmall.com">Media Temple</a></p>
<?php /* ?><p class=""><a href="http://feeds.feedburner.com/danielmall-articles">RSS</a></p><?php */ ?>
</div>

</footer><!-- .site-footer -->
<div class="dm-c-siteFooter_twitter">
<script>
document.write('<section id="twitter-follow"><a href="http://twitter.com/danmall" class="twitter-follow-button">Follow @danmall</a></section>');
</script>
<script src="http://platform.twitter.com/widgets.js"></script>
</div>

</footer>
184 changes: 178 additions & 6 deletions -/_inc/functions.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,188 @@
}
segmentURL($_SERVER['REQUEST_URI']);*/

function getTotalItems($file){
$items = json_decode(file_get_contents($file), true);
return sizeof($items);
}

function parseList($file, $num, $type, $displayStyle){

function readNext($title, $url){
// $type = 'full' or 'abridged'

$output = '<footer id="read-next" class="read-next wrap">';
$output .= '<small class="read-next-caption">Read this next</small>';
$output .= '<h1 class="read-next-headline"><a href="' . $url . '">' . $title . '&nbsp;&rarr;</a></h1>';
$output .= '</footer>';
// $displayStyle = 'small' or 'large'

return $output;
$articles = json_decode(file_get_contents($file), true);

if($num == 'all'){
$articlesLength = sizeof($articles);
}else{
$articlesLength = $num;
}

$ARTICLES_DIRECTORY = '/articles/';

for($i = 0; $i < $articlesLength; $i++){

// convert tags to array
if(!empty($articles[$i]['tags'])){
$tags = $articles[$i]['tags'];
}

// Open entry
if(isset($displayStyle)){
if($displayStyle == 'small'){
if(!empty($articles[$i]['audio']) || !empty($articles[$i]['video'])){
if(isset($articles[$i]['audio'])){
echo "\t" . '<article class="hentry dm-dp-textBlurb dm-dp-textBlurb--audio dm-dp-textBlurb--small">'. "\n\t\t";
}else if($articles[$i]['video']){
echo "\t" . '<article class="hentry dm-dp-textBlurb dm-dp-textBlurb--video dm-dp-textBlurb--small">'. "\n\t\t";
}
}else{
echo "\t" . '<article class="hentry dm-dp-textBlurb dm-dp-textBlurb--small">'. "\n\t\t";
}
}else{
echo "\t" . '<article class="hentry dm-dp-textBlurb">'. "\n\t\t";
}
}

// coming up badge
if($displayStyle == 'small'){
if(!empty($articles[$i]['date'])){
$date_now = new DateTime();
$date2 = new DateTime($articles[$i]['date']);

if ($date_now < $date2) {
echo '<div class="dm-dp-textBlurb_badge">Coming Up</div>';
}
}
}

// create article header
echo '<header class="dm-dp-textBlurb_header">' . "\n\t\t\t";

// print headline link to slug
if(!empty($articles[$i]['slug'])){
if((strpos($articles[$i]['slug'], 'http://') !== false) || (strpos($articles[$i]['slug'], 'https://') !== false)){
echo '<h1 class="entry-title dm-dp-textBlurb_title"><a href="' . $articles[$i]['slug'] .'">' . $articles[$i]['title'] . '</a></h1>'. "\n\t\t\t";
}else{
echo '<h1 class="entry-title dm-dp-textBlurb_title"><a href="' . $ARTICLES_DIRECTORY . $articles[$i]['slug'] .'/">' . $articles[$i]['title'] . '</a></h1>'. "\n\t\t\t";
}
}else{
echo '<h1 class="entry-title dm-dp-textBlurb_title">' . $articles[$i]['title'] . '</h1>'. "\n\t\t\t";
}

// print timestamp
if(!empty($articles[$i]['date'])){
echo '<time class="published dm-dp-textBlurb_time" datetime="' . $articles[$i]['date'] . '">' . date('M d, Y' , strtotime($articles[$i]['date'])) . '</time>' . "\n\t\t";
}

// close article header
echo '</header>' . "\n\t\t";

/// print location
if(!empty($articles[$i]['location'])){
echo '<div class="dm-dp-textBlurb_location">' . $articles[$i]['location'] . '</div>' . "\n\t\t";
}

/// print source
if(!empty($articles[$i]['source'])){
echo '<div class="dm-dp-textBlurb_source">' . $articles[$i]['source'] . '</div>' . "\n\t\t";
}

/// print type
if(!empty($articles[$i]['type'])){
echo '<div class="dm-dp-textBlurb_type">' . $articles[$i]['type'] . '</div>' . "\n\t\t";
}

if($type == 'full'){

if(!empty($articles[$i]['dek'])){

// print dek
echo '<div class="entry-summary dm-dp-textBlurb_dek">' . $articles[$i]['dek'] . '</div>' . "\n\t\t";

}

// print tags
if(isset($tags)){

echo '<ul class="tags dm-dp-textBlurb_tags">' . "\n\t\t";

for($j=0; $j < sizeof($tags); $j++){
echo "\t" . '<li class="dm-dp-textBlurb_tags_item">' . $tags[$j] . "</li>\n\t\t";
}
echo '</ul>';

}

}

// close entry
echo "\n\t" . '</article>' . "\n\n";

}

}


function parseQuotes($file, $num) {

$quotes = json_decode(file_get_contents($file), true);
if($num == 'all'){
$quotesLength = sizeof($quotes);
}else{
$quotesLength = $num;
}

// generate random array
$randomQuotes = array_rand($quotes, $quotesLength);

for($i = 0; $i < sizeof($randomQuotes); $i++){

/*if(($i == 0) || ($i == 2)) {
echo "\t" . '<div class="dm-l-col--50">'. "\n\t\t";
}*/

// Open entry
echo "\t" . '<blockquote class="dm-dp-quote">'. "\n\t\t";

// print quote
if(!empty($quotes[$randomQuotes[$i]]['quote'])){
echo '<p>' . $quotes[$randomQuotes[$i]]['quote'] . '</p>' . "\n\t\t";
}

// print attribution
if(!empty($quotes[$randomQuotes[$i]]['person']) && !empty($quotes[$randomQuotes[$i]]['role'])){
echo '<address class="dm-dp-quote_attribution"><strong>' . $quotes[$randomQuotes[$i]]['person'] . '</strong>, ' . $quotes[$randomQuotes[$i]]['role'] . "</address>" . "\n\t\t";
}

// close article header
echo '</blockquote>' . "\n\t\t";

/*if(($i == 1) || ($i == 3)) {
echo '</div>' . "\n\t\t";
}*/

}

}

function getArticleSlug(){

// taken from http://stackoverflow.com/questions/19541080/url-get-last-part-in-php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$folder = sizeof($link_array);
return $link_array[$folder-2];
}


// modified from http://particletree.com/notebook/automatically-version-your-css-and-javascript-files/
function autoVer($url){
$path = pathinfo($url);
$ver = '.'.filemtime($_SERVER['DOCUMENT_ROOT'].$url).'.';
return $path['dirname'].'/'.str_replace('.', $ver, $path['basename']);
}

?>
8 changes: 0 additions & 8 deletions -/_inc/fusion.php

This file was deleted.

Loading

0 comments on commit d7971f3

Please sign in to comment.