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
2 changes: 1 addition & 1 deletion follow.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?
<?php
include("retwis.php");

$r = redisLink();
Expand Down
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
<div id="page">
<div id="header">
<a href="/"><img style="border:none" src="logo.png" width="192" height="85" alt="Retwis"></a>
<? include("navbar.php") ?>
<?php include("navbar.php") ?>
</div>
10 changes: 5 additions & 5 deletions home.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?
<?php
include("retwis.php");
if (!isLoggedIn()) {
header("Location: index.php");
Expand All @@ -9,19 +9,19 @@
?>
<div id="postform">
<form method="POST" action="post.php">
<?=utf8entities($User['username'])?>, what you are doing?
<?php echo utf8entities($User['username']) ?>, what you are doing?
<br>
<table>
<tr><td><textarea cols="70" rows="3" name="status"></textarea></td></tr>
<tr><td align="right"><input type="submit" name="doit" value="Update"></td></tr>
</table>
</form>
<div id="homeinfobox">
<?=$r->zcard("followers:".$User['id'])?> followers<br>
<?=$r->zcard("following:".$User['id'])?> following<br>
<?php echo $r->zcard("followers:".$User['id']) ?> followers<br>
<?php echo $r->zcard("following:".$User['id']) ?> following<br>
</div>
</div>
<?
<?php
$start = gt("start") === false ? 0 : intval(gt("start"));
showUserPostsWithPagination(false,$User['id'],$start,10);
include("footer.php")
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?
<?php
include("retwis.php");

if (!isLoggedIn()) {
Expand Down
2 changes: 1 addition & 1 deletion login.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?
<?php
include("retwis.php");

# Form sanity checks
Expand Down
2 changes: 1 addition & 1 deletion logout.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?
<?php
include("retwis.php");

if (!isLoggedIn()) {
Expand Down
4 changes: 2 additions & 2 deletions navbar.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="navbar">
<a href="index.php">home</a>
| <a href="timeline.php">timeline</a>
<?if(isLoggedIn()) {?>
<?php if(isLoggedIn()) { ?> <?php 'a' ?>
| <a href="logout.php">logout</a>
<?}?>
<?php } ?>
</div>
2 changes: 1 addition & 1 deletion post.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?
<?php
include("retwis.php");

if (!isLoggedIn() || !gt("status")) {
Expand Down
4 changes: 2 additions & 2 deletions profile.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?
<?php
include("retwis.php");
include("header.php");

Expand All @@ -17,7 +17,7 @@
}
}
?>
<?
<?php
$start = gt("start") === false ? 0 : intval(gt("start"));
showUserPostsWithPagination(gt("u"),$userid,$start,10);
include("footer.php")
Expand Down
6 changes: 3 additions & 3 deletions register.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?
<?php
include("retwis.php");

# Form sanity checks
Expand Down Expand Up @@ -32,7 +32,7 @@
include("header.php");
?>
<h2>Welcome aboard!</h2>
Hey <?=utf8entities($username)?>, now you have an account, <a href="index.php">a good start is to write your first message!</a>.
<?
Hey <?php echo utf8entities($username) ?>, now you have an account, <a href="index.php">a good start is to write your first message!</a>.
<?php
include("footer.php")
?>
5 changes: 3 additions & 2 deletions retwis.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?
<?php
require 'Predis/Autoloader.php';
Predis\Autoloader::register();

Expand Down Expand Up @@ -39,7 +39,8 @@ function redisLink() {
static $r = false;

if ($r) return $r;
$r = new Predis\Client();
$r = new Redis;
$r->connect('127.0.0.1');
return $r;
}

Expand Down
6 changes: 3 additions & 3 deletions timeline.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?
<?php
include("retwis.php");
include("header.php");
?>
<h2>Timeline</h2>
<i>Latest registered users (an example of sorted sets)</i><br>
<?
<?php
showLastUsers();
?>
<i>Latest 50 messages from users aroud the world!</i><br>
<?
<?php
showUserPosts(-1,0,50);
include("footer.php")
?>