@ 2014-06-30T23:04:51Z <?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
session_start();
function tokenTruncate($string, $your_desired_width) {
$parts = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$parts_count = count($parts);
$length = 0;
$last_part = 0;
for (; $last_part < $parts_count; ++$last_part) {
$length += strlen($parts[$last_part]);
if ($length > $your_desired_width) { break; }
}
return implode(array_slice($parts, 0, $last_part));
}
include 'connect.php';
$noBlogPostsFound = FALSE;
// Connect to MySQLi
$sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die("Error: ".mysqli_error($sqli));
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || ($_GET['page'] < 0))
{
$page = 0;
}
else
{
$page = (int)$_GET['page'];
}
$limit = 3;
$start = $page * $limit;
$query = mysqli_query($sqli, "SELECT * FROM blog ORDER BY timestamp DESC LIMIT $start, $limit") or die("Error: ".mysqli_error($sqli));
$checknumblogs = mysqli_num_rows($query);
// Check if any blog posts exists
if($checknumblogs == 0)
{
$noBlogPostsFound = TRUE;
}
else
{
$blogposts = array();
while ($row = mysqli_fetch_array($query))
{
$userid = $row['userid'];
$userquery = mysqli_query($sqli, "SELECT * FROM members WHERE id='$userid'") or die("Error: ".mysqli_error($sqli));
$userexists = mysqli_num_rows($userquery);
if ($userexists == 0)
{
$username = "<deleted user>";
}
else
{
$userrow = mysqli_fetch_assoc($userquery);
$username = $userrow['username'];
}
$blogposts[] = array(
"id" => $row['id'],
"headline" => $row['headline'],
"story" => $row['story'],
"timestamp" => $row['timestamp'],
"userid" => $row['userid'],
"username" => $username
);
}
}
$totalquery = mysqli_query($sqli, "SELECT * FROM blog") or die("Error: ".mysqli_error($sqli));
$totalblogposts = mysqli_num_rows($totalquery);
//TOPINFOTEXT
$textquery = mysqli_query($sqli, "SELECT * FROM toptext ORDER BY id") or die("Error: ".mysqli_error($sqli));
$textresult = mysqli_fetch_assoc($textquery);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>indiehjaerta.com ♥ Blog</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Font's -->
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,300,400' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto:300,300italic' rel='stylesheet' type='text/css'>
<link href="stylesheet/style.css" rel="stylesheet" type="text/css" />
<link href="stylesheet/blog.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript">
$(function() {
$('#TopBarLogin').click(function() {
$('#LoginPopUp').show();
return false;
});
});
</script>
<script type="text/javascript">
$(document).mouseup(function (e)
{
var container = $("#LoginPopUp");
if (!container.is(e.target) && container.has(e.target).length === 0)
{
container.hide();
}
});
</script>
<script type="text/javascript">
$(function() {
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
var intervalId = 0;
$(window).load(function() {
intervalId = setInterval(function () { // << somehow this does the trick!
if ($('input:-webkit-autofill').length > 0) {
clearInterval(intervalId);
$('input:-webkit-autofill').each(function () {
var text = $(this).val();
var name = $(this).attr('name');
$(this).after(this.outerHTML).remove();
$('input[name=' + name + ']').val(text);
});
}
}, 1);
});
}
});
</script>
<div id="TopBarImageContainer">
<div id="TopBarImage"></div>
</div>
<div id="MainContent">
<!-- NOT LOGGED IN HERE -->
<a href="#">
<span class="DivLink">
<div id="TopBarLogin">
<span class="TopBarText">LOGIN
<div id="TopBarTriangleDown"></div>
</span>
</div>
</span>
</a>
<a href="register.php">
<span class="DivLink">
<div id="TopBarCreateAccount">
<span class="TopBarText">CREATE AN ACCOUNT</span>
</div>
</span>
</a>
<div id="TopBarUserMenu">
<div id="TopBarUserMenuProfile">
<a href="profile.php">
<span class="TopBarText">
<div id="TopBarUserMenuProfileImage"></div>
<span class="DivLink">
PROFILE
</span>
</span>
</a>
</div>
<div id="TopBarUserMenuMessages">
<a href="messages.php">
<span class="TopBarText">
<div id="TopBarUserMenuMessagesImage"></div>
<span class="DivLink">
MESSAGES
</span>
</span>
</a>
</div>
<div id="TopBarUserMenuSupport">
<a href="support.php">
<span class="TopBarText">
<div id="TopBarUserMenuSupportImage"></div>
<span class="DivLink">
SUPPORT
</span>
</span>
</a>
</div>
</div>
<div id="LoginPopUp">
<form method="post" action="">
<input name="username" type="text" id="username" placeholder="Username" style="display: none" />
<input name="password" type="password" id="password" placeholder="Password" style="display: none" />
<input class="LoginInput" name="username" type="text" id="username" placeholder="Username" /><br />
<input class="LoginInput" name="password" type="password" id="password" placeholder="Password" /><br />
<input class="LoginButton" type="submit" name="login" value="">
</form>
</div>
<div id="LogoMenu">
<div id="SocialTopLinks">
<div id="SocialTopTwitterLink">
<a href="http://www.twitter.com/indiehjaerta">
<span class="DivLink"></span>
</a>
</div>
<div id="SocialTopFacebookLink">
<a href="http://www.facebook.com/indiehjaerta">
<span class="DivLink"></span>
</a>
</div>
<div id="SocialTopInstagramLink">
<a href="http://www.instagram.com/indiehjaerta">
<span class="DivLink"></span>
</a>
</div>
<div id="SocialTopTwitchLink">
<a href="http://www.twitch.tv/indiehjaerta">
<span class="DivLink"></span>
</a>
</div>
</div>
<div id="TopLogo">
<a href="#"><span class="DivLink"></span></a>
</div>
<div id="MenuLinkSeparator"></div>
<div id="MenuLinks">
<a href="" class="Menu">HOME</a>
<a href="news.php" class="Menu">NEWS</a>
<a href="blog.php" class="Menu">BLOG</a>
<a href="events.php" class="Menu">EVENTS</a>
<a href="forums.php" class="Menu">FORUMS</a>
<a href="" class="Menu">CONTACT</a>
</div>
</div>
<div id="Container">
<div id="InfoHeader"></div>
<div id="Content">
<div id="BlogContent">
<?php
//WRITE OUT IF NO BLOG POSTS FOUND!
$counter = 0;
foreach ($blogposts as $post)
{
$counter++;
?>
<a href="?id=<?php echo $post['id'] ?>" class="BlogPostHeadlineList"><?php echo strtoupper($post['headline']) ?></a><br />
<span class="BlogPostInfoList">posted by <a href="profile.php?id=<?php echo $post['userid'] ?>"><?php echo $post['username'] ?></a> at <?php echo $post['timestamp'] ?></span><br />
<div id="BlogContentText">
<span class="BlogPostTextList"><?php echo tokenTruncate($post['story'], 550); if (strlen($post['story']) > 550) { echo '...'; } ?></span><br />
</div>
<div class="BlogButtonContainer">
<?php
if (strlen($post['story']) > 550)
{
?>
<a href="<?php echo $_SERVER['PHP_SELF'].'?id='.$post['id'] ?>"><img src="images/buttonreadmore.png" class="ButtonReadMore" /></a>
<?php
}
?>
<a href="<?php echo $_SERVER['PHP_SELF'].'?id='.$post['id']. '#comments' ?>"><img src="images/buttoncomments.png" class="ButtonComment" /></a>
</div>
<?php
if ($counter < $limit)
{
//RENAME BELOW
?>
<img src="images/separator-horizontal-long.png" id="BlogSeparatorHorizontal" /><br />
<?php
}
}
?>
</div>
<div id="BlogLinks">
<span class="BlogNavigationLink">
<?php
if ($page > 0)
{
$prev = $start - $limit;
echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$prev.'" class="BlogNavigationLink">« Newer posts</a> ';
}
else
{
echo '« Newer posts ';
}
$maxpages = floor($totalblogposts/$limit);
echo '<span class="BlogNavigationLink">';
for ($i = 0; $i <= $maxpages; $i++)
{
echo '<a href=".$_SERVER['PHP_SELF'] .'?page=' .$i. '" class="BlogNavigationLink">' .($i+1). '</a> ';
}
echo '</span>';
if ($page < $maxpages)
{
$nextpage = $page+1;
echo ' <a href="'.$_SERVER['PHP_SELF'].'?page='.$nextpage.'" class="BlogNavigationLink">Older Posts »</a>';
}
else
{
echo ' Older Posts »';
}
?>
</span>
</div>
<div id="NewsLetterBanner">
</div>
</div>
<div id="Bot">
<div id="BotLogo">
<a href="#"><span class="DivLink"></span></a>
</div>
</div>
</div>
</body>
</html>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.4.30 0.006 0.038 12.59 5.4.29 0.007 0.042 12.58 5.4.28 0.008 0.040 12.48 5.4.27 0.024 0.072 12.48 5.4.26 0.027 0.139 12.48 5.4.25 0.006 0.054 12.48 5.4.24 0.016 0.044 12.48 5.4.23 0.006 0.053 12.47 5.4.22 0.013 0.092 12.47 5.4.21 0.010 0.043 12.47 5.4.20 0.010 0.045 12.47 5.4.19 0.005 0.037 12.47 5.4.18 0.008 0.036 12.46 5.4.17 0.007 0.034 12.47 5.4.16 0.006 0.035 12.47 5.4.15 0.009 0.033 12.46 5.4.14 0.005 0.037 12.16 5.4.13 0.006 0.036 12.13 5.4.12 0.008 0.032 12.11 5.4.11 0.005 0.036 12.09 5.4.10 0.009 0.031 12.10 5.4.9 0.006 0.041 12.09 5.4.8 0.015 0.039 12.10 5.4.7 0.007 0.033 12.10 5.4.6 0.006 0.034 12.09 5.4.5 0.004 0.038 12.09 5.4.4 0.006 0.039 12.08 5.4.3 0.006 0.041 12.08 5.4.2 0.001 0.040 12.07 5.4.1 0.003 0.039 12.08 5.4.0 0.010 0.044 11.57 5.3.28 0.009 0.058 12.73 5.3.27 0.006 0.039 12.74 5.3.26 0.009 0.035 12.73 5.3.25 0.006 0.036 12.73 5.3.24 0.006 0.036 12.73 5.3.23 0.006 0.040 12.72 5.3.22 0.004 0.038 12.69 5.3.21 0.009 0.057 12.70 5.3.20 0.011 0.032 12.69 5.3.19 0.008 0.034 12.69 5.3.18 0.005 0.039 12.69 5.3.17 0.009 0.045 12.69 5.3.16 0.010 0.038 12.69 5.3.15 0.005 0.037 12.69 5.3.14 0.007 0.041 12.68 5.3.13 0.006 0.044 12.67 5.3.12 0.006 0.045 12.67 5.3.11 0.008 0.048 12.67 5.3.10 0.001 0.040 12.16 5.3.9 0.009 0.041 12.14 5.3.8 0.006 0.036 12.13 5.3.7 0.004 0.038 12.14 5.3.6 0.006 0.042 12.12 5.3.5 0.005 0.036 12.07 5.3.4 0.006 0.036 12.07 5.3.3 0.008 0.032 12.02 5.3.2 0.004 0.038 11.81 5.3.1 0.008 0.046 11.77 5.3.0 0.008 0.034 11.76 5.2.17 0.006 0.041 9.28 5.2.16 0.008 0.030 9.28 5.2.15 0.004 0.030 9.28 5.2.14 0.008 0.029 9.27 5.2.13 0.004 0.029 9.23 5.2.12 0.003 0.031 9.23 5.2.11 0.005 0.031 9.24 5.2.10 0.005 0.032 9.23 5.2.9 0.006 0.039 9.24 5.2.8 0.007 0.042 9.23 5.2.7 0.005 0.031 9.23 5.2.6 0.008 0.039 9.18 5.2.5 0.003 0.032 9.15 5.2.4 0.005 0.040 9.13 5.2.3 0.006 0.029 9.11 5.2.2 0.006 0.029 9.11 5.2.1 0.008 0.026 9.01 5.2.0 0.006 0.039 8.87 5.1.6 0.005 0.024 8.17 5.1.5 0.005 0.026 8.17 5.1.4 0.009 0.029 8.15 5.1.3 0.004 0.031 8.50 5.1.2 0.007 0.034 8.53 5.1.1 0.006 0.024 8.25 5.1.0 0.006 0.030 8.25 5.0.5 0.005 0.021 6.72 5.0.4 0.001 0.022 6.58 5.0.3 0.002 0.032 6.40 5.0.2 0.002 0.020 6.37 5.0.1 0.004 0.021 6.34 5.0.0 0.001 0.032 6.34 4.4.9 0.001 0.018 4.78 4.4.8 0.002 0.017 4.75 4.4.7 0.002 0.017 4.75 4.4.6 0.003 0.015 4.76 4.4.5 0.005 0.015 4.77 4.4.4 0.002 0.026 4.71 4.4.3 0.003 0.015 4.76 4.4.2 0.003 0.016 4.84 4.4.1 0.006 0.012 4.85 4.4.0 0.003 0.025 4.76 4.3.11 0.004 0.015 4.67 4.3.10 0.003 0.016 4.67 4.3.9 0.003 0.016 4.63 4.3.8 0.003 0.025 4.61 4.3.7 0.004 0.023 4.63 4.3.6 0.003 0.016 4.63 4.3.5 0.010 0.030 4.63 4.3.4 0.005 0.033 4.57 4.3.3 0.014 0.030 3.38 4.3.2 0.004 0.020 3.36 4.3.1 0.004 0.019 3.31 4.3.0 0.017 0.013 7.25
preferences:dark mode live preview
142.09 ms | 1394 KiB | 7 Q