Created
September 11, 2013 20:13
-
-
Save byronwade/6529140 to your computer and use it in GitHub Desktop.
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
<?php | |
$con=mysqli_connect("##########","thorbis","###############","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()) { | |
$p = $Row->BlogP; | |
$title = $p; | |
if (strlen($title)>200){ | |
$rtitle = substr($title,0,200)."..."; | |
}else { | |
$rtitle = $title; | |
} | |
echo"$rtitle"; | |
echo <<<END | |
<li class="show"> | |
<div class="spacer1"></div> | |
<div class="blogbackground background-style3"> | |
<div class="row"> | |
<article class="thinner"> | |
<section> | |
<div 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">$rtitle</p> | |
<i class="blogurl"><a href="$Row->BlogURL">ReadMore</a></i> | |
</div> | |
</section> | |
</article> | |
</div> | |
</div> | |
</li> | |
END; | |
} | |
} | |
mysqli_close($con); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment