Last active
December 22, 2015 19:09
-
-
Save byronwade/6518000 to your computer and use it in GitHub Desktop.
why is my list not sorting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--/*****************************************************************************/ | |
/*** Blog 1.0 by Byron Wade */ | |
/*** www.thorbis.com | bcw1995@gmail.com */ | |
/*** Follow Me On Twitter At @Thorbis */ | |
/*** NO modifications of this script can be done without consulting me first! */ | |
/*******************************************************************************--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title id="top">Blog | Thorbis Inc.</title> | |
<meta content="text/html; charset=utf-8" http-equiv="content-type"> | |
<meta content="We Create Everything From Websites To Logo Design" name="description"> | |
<link href="http://www.thorbis.com/favicon.ico" rel="icon" type="image/x-icon"> | |
<meta content="Thorbis Inc. | Blog" name="keywords"> | |
<link href="css/thorbis_fonts.css" rel="stylesheet" type="text/css"> | |
<link href="css/animation.css" rel="stylesheet" type="text/css"> | |
<link href="css/lightbox.css" rel="stylesheet" /> | |
<link href='http://fonts.googleapis.com/css?family=Ubuntu:700' rel='stylesheet' type='text/css'> | |
<link href='http://fonts.googleapis.com/css?family=Lato:300' rel='stylesheet' type='text/css'> | |
<link href='http://fonts.googleapis.com/css?family=Gilda+Display' rel='stylesheet' type='text/css'> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script src="js/jquery.mixitup.min.js"></script> | |
<script src="js/lightbox-2.6.min.js"></script> | |
<script src="js/jquery-scroll.js"></script> | |
<script type="text/javascript" src="js/parsley.js"></script> | |
<script src="js/skel.min.js"> | |
{ | |
prefix: 'css/thorbis', | |
preloadStyleSheets: true, | |
resetCSS: true, | |
boxModel: 'border', | |
grid: { gutters: 30 }, | |
breakpoints: { | |
wide: { range: '1200-', containers: 1140, grid: { gutters: 50 } }, | |
narrow: { range: '451-1199', containers: 960 }, | |
narrower: { range: '451-960', containers: 'fluid' }, | |
mobile: { range: '-450', containers: 'fluid', lockViewport: true, grid: { collapse: true } } | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<nav> | |
<div class="background background-style3"> | |
<div class="row"> | |
<form data-validate="parsley" action='subscribe.php' id='contact-form' method='post' name="contact-form"> | |
<div class="4u"><p style="line-height:200%;">Thorbis's Blog</p><p id="subscribe">Subscribe To Thorbis's Blog!</p></div> | |
<div class="6u"> | |
<input class="subscribe" name="email" placeholder="Email" type="email" data-trigger="change" data-required="true" data-type="email"> | |
</div> | |
<div class="2u"> | |
<button name="submit" type="submit" value="send">Send</button> | |
</div> | |
<div class="2u"></div> | |
</form> | |
<p style="display:inline"> | |
<button class="btn" id="asc_btn">Sort Ascending by title</button> | |
<button class="btn" id="desc_btn">Sort Descending by title</button> | |
<button class="btn" id="asc_btn_desc">Sort Ascending by description</button> | |
<button class="btn" id="desc_btn_desc">Sort Descending by description</button> | |
</p> | |
</div> | |
</div> | |
</nav> | |
<img class="image" src="img/thorbis.png"></img> | |
<div class="spacer2"></div>' | |
<ul> | |
<?php | |
$con=mysqli_connect("thorbis.db.11002043.hostedresource.com","thorbis","Byronwade1995!","thorbis"); | |
// Check connection | |
if (mysqli_connect_errno()) | |
{ | |
echo "Failed to connect to MySQL: " . mysqli_connect_error(); | |
} | |
date_default_timezone_set('America/New_York'); | |
?> | |
<?php | |
if ($Res = mysqli_query($con,'SELECT * FROM `Blog` ORDER BY `Date` DESC')) { | |
while($Row = $Res->fetch_object()) { | |
echo <<<END | |
<li class="sort" data-date="$Row->Date" data-sort="data-date"> | |
<div class="spacer1"></div> | |
<div class="blogbackground background-style3"> | |
<div class="row"> | |
<article class="thinner"> | |
<section> | |
<div class="demo-divs" class="12u"> | |
<a data-lightbox="image-1" href="$Row->upload_location"><img class="floatright blogimage" src="$Row->upload_location"></img></a> | |
<h1 class="blogh1">$Row->BlogTopic</h1> | |
<i id="$Row->Date" class="blogdate">$Row->Date</i> | |
<p class="blogp">$Row->BlogP</p> | |
</div> | |
</section> | |
</article> | |
</div> | |
</div> | |
</li> | |
END; | |
} | |
} | |
mysqli_close($con); | |
?> | |
</ul> | |
<div class="spacer"></div> | |
<div class="background7 background-style3"> | |
<p id="footer">© 2013 Thorbis Inc. | Design: <a class="color" href="http://www.thorbis.com">Byron Wade</a><br><a class="color" href="http://www.thorbis.com">Thorbis Inc.</a></p> | |
</div> | |
<!-- Piwik --> | |
<script type="text/javascript"> | |
var _paq = _paq || []; | |
_paq.push(['trackPageView']); | |
_paq.push(['enableLinkTracking']); | |
(function() { | |
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://www.thorbis.com/piwik//"; | |
_paq.push(['setTrackerUrl', u+'piwik.php']); | |
_paq.push(['setSiteId', 1]); | |
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; | |
g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); | |
})(); | |
</script> | |
<noscript><p><img src="http://www.thorbis.com/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript> | |
<!-- End Piwik Code --> | |
<script> | |
//Sort Ascending by title | |
$("#asc_btn").click(function(){ | |
$(".demo-divs").jSort({ | |
sort_by: 'h1.blogh1', | |
item: 'div', | |
order: 'asc' | |
}); | |
}); | |
//Sort Descending by title | |
$("#desc_btn").click(function(){ | |
$(".demo-divs").jSort({ | |
sort_by: 'h1.blogh1', | |
item: 'div', | |
order: 'desc' | |
}); | |
}); | |
//Sort Ascending by description | |
$("#asc_btn_desc").click(function(){ | |
$(".demo-divs").jSort({ | |
sort_by: 'p.blogp', | |
item: 'div', | |
order: 'asc' | |
}); | |
}); | |
//Sort Descending by description | |
$("#desc_btn_desc").click(function(){ | |
$(".demo-divs").jSort({ | |
sort_by: 'p.blogp', | |
item: 'div', | |
order: 'desc' | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment