Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clearer concatenation

  • Loading branch information...
commit 15e3f5eba3c268614b8fc44274372ec54d769034 1 parent fbe1666
@DHS authored
View
2  controllers/admin_controller.php
@@ -210,7 +210,7 @@ function invite() {
}
$to = $email;
- $link = $this->config->url . 'users/add/' . $id . '/?email='.urlencode($email);
+ $link = $this->config->url . 'users/add/' . $id . '/?email=' . urlencode($email);
// Load template into $body variable
$to = array('email' => $email);
View
2  controllers/items_controller.php
@@ -248,7 +248,7 @@ function remove($item_id) {
}
// Set message
- Application::flash('success', ucfirst($this->config->items['name']).' removed!');
+ Application::flash('success', ucfirst($this->config->items['name']) . ' removed!');
// Return from whence you came
header('Location: ' . $_SERVER['HTTP_REFERER']);
View
12 controllers/pages_controller.php
@@ -12,7 +12,7 @@ function show($name) {
foreach ($this->config->admin_users as $value) {
$author = User::get_by_id($value);
if ($this->config->private != TRUE || isset($_SESSION['user_id'])) {
- $authors .= $this->get_link_to($author->username, 'users', 'show', $author->id).', ';
+ $authors .= $this->get_link_to($author->username, 'users', 'show', $author->id) . ', ';
} else {
$authors .= $author->username . ', ';
}
@@ -20,7 +20,7 @@ function show($name) {
}
$authors = substr($authors, 0, -2);
- $content = '<p>' . $this->config->name . ' is a web app created by ' . $authors.' based on the <a href="http://github.com/DHS/rat">rat</a> framework. ';
+ $content = '<p>' . $this->config->name . ' is a web app created by ' . $authors . ' based on the <a href="http://github.com/DHS/rat">rat</a> framework. ';
if ($this->config->beta == TRUE) {
$content .= 'It is currently in beta.';
@@ -31,7 +31,7 @@ function show($name) {
$content .= '<p>It lets you create ' . $this->config->items['name_plural'];
if ($this->config->items['titles']['enabled'] == TRUE) {
- $content .= ' with '.strtolower($this->config->items['titles']['name_plural']);
+ $content .= ' with ' . strtolower($this->config->items['titles']['name_plural']);
}
if ($this->config->items['comments']['enabled'] == TRUE || $this->config->items['likes']['enabled'] == TRUE) {
@@ -39,7 +39,7 @@ function show($name) {
$content .= ' and then ';
if ($this->config->items['comments']['enabled'] == TRUE) {
- $content .= ' add '.strtolower($this->config->items['comments']['name_plural']).' ';
+ $content .= ' add ' . strtolower($this->config->items['comments']['name_plural']) . ' ';
}
if ($this->config->items['comments']['enabled'] == TRUE && $this->config->items['likes']['enabled'] == TRUE) {
@@ -47,7 +47,7 @@ function show($name) {
}
if ($this->config->items['likes']['enabled'] == TRUE) {
- $content .= ' \''.strtolower($this->config->items['likes']['name']).'\' ';
+ $content .= " '" . strtolower($this->config->items['likes']['name']) . "' ";
}
$content .= 'them';
@@ -73,7 +73,7 @@ function show($name) {
}
if (isset($this->plugins->gravatar)) {
- $content .= '<p>' . $this->config->name . ' is <a href="http://gravatar.com/">Gravatar</a>-enabled.</p>'."\n";
+ $content .= '<p>' . $this->config->name . ' is <a href="http://gravatar.com/">Gravatar</a>-enabled.</p>' . "\n";
}
}
View
2  controllers/sessions_controller.php
@@ -53,7 +53,7 @@ function add() {
} else {
- Application::flash('error', 'You are already logged in! ' . $this->get_link_to('Click here', 'sessions', 'remove').' to logout.');
+ Application::flash('error', 'You are already logged in! ' . $this->get_link_to('Click here', 'sessions', 'remove') . ' to logout.');
$this->loadView();
}
View
8 lib/application.php
@@ -23,7 +23,7 @@ public static function initialise() {
$uri = Routing::fetch_uri($config);
- $controller = ucfirst($uri['controller']).'Controller';
+ $controller = ucfirst($uri['controller']) . 'Controller';
@include "controllers/{$uri['controller']}_controller.php";
if (substr($uri['action'], 0, 1) == '?') {
@@ -43,7 +43,7 @@ public static function initialise() {
$uri = Routing::route();
- $controller = ucfirst($uri['controller']).'Controller';
+ $controller = ucfirst($uri['controller']) . 'Controller';
@include "controllers/{$uri['controller']}_controller.php";
$app = new $controller;
@@ -286,11 +286,11 @@ public function url_for_route($route, array $params) {
}
public function link_to($link_text, $controller, $action = '', $id = '', $params = array()) {
- echo '<a href="' . $this->url_for($controller, $action, $id, $params).'">' . $link_text.'</a>';
+ echo '<a href="' . $this->url_for($controller, $action, $id, $params) . '">' . $link_text . '</a>';
}
public function get_link_to($link_text, $controller, $action = '', $id = '', $params = array()) {
- return '<a href="' . $this->url_for($controller, $action, $id, $params).'">' . $link_text.'</a>';
+ return '<a href="' . $this->url_for($controller, $action, $id, $params) . '">' . $link_text . '</a>';
}
public function redirect_to($controller, $action = '', $id = '', $params = array()) {
View
2  models/admin.php
@@ -29,7 +29,7 @@ public static function list_users() {
if ($last_login == 0) {
$last_login = 'Today!';
} else {
- $last_login = $last_login.' days ago';
+ $last_login = $last_login . ' days ago';
}
} else {
View
6 plugins/gravatar.php
@@ -41,14 +41,14 @@ function show($email, $params = array()) {
// if style is set, add it in
if (isset($params['style'])) {
- $return .= ' style="' . $params['style'].'"';
+ $return .= ' style="' . $params['style'] . '"';
}
$return .= ' />';
// if user_id is set, make it a link
if (isset($params['link'])) {
- $return = '<a href="' . $params['link'].'">' . $return.'</a>';
+ $return = '<a href="' . $params['link'] . '">' . $return . '</a>';
}
return $return;
@@ -58,7 +58,7 @@ function show($email, $params = array()) {
function show_settings($email) {
echo '<h2>Picture</h2>
-' . $this->show($email).'
+' . $this->show($email) . '
<p>Visit <a href="http://gravatar.com/">Gravatar.com</a> to change your picture.</p>';
}
View
2  plugins/log.php
@@ -86,7 +86,7 @@ function view() {
$return .= $entry['params'];
}
- $return .= '</td><td>' . $entry['date'].'</td></tr>';
+ $return .= '</td><td>' . $entry['date'] . '</td></tr>';
}
View
12 plugins/points.php
@@ -16,7 +16,7 @@
* To display users's points:
*
* if (isset($this->plugins->points)) {
-* echo 'You have ' . $user->points.' ' . $this->plugins->points['name'];
+* echo 'You have ' . $user->points . ' ' . $this->plugins->points['name'];
* }
*
*/
@@ -46,12 +46,12 @@ function update($user_id, $points) {
function view() {
if ($id == $_SESSION['user_id']) {
- echo '<p>You have ' . $user['points'].' ' . $this->plugins->points['name'].'!</p>';
+ echo '<p>You have ' . $user['points'] . ' ' . $this->plugins->points['name'] . '!</p>';
if ($this->plugins->points['leaderboard'] == TRUE) {
echo '<p class="small">Where do you rank on the <a href="leaderboard.php">leaderboard</a>?</p>';
}
} else {
- echo '<p>' . $user['username'].' has ' . $user['points'].' ' . $this->plugins->points['name'].'!</p>';
+ echo '<p>' . $user['username'] . ' has ' . $user['points'] . ' ' . $this->plugins->points['name'] . '!</p>';
if ($this->plugins->points['leaderboard'] == TRUE) {
echo '<p class="small">See where they rank on the <a href="leaderboard.php">leaderboard</a>.</p>';
}
@@ -79,9 +79,9 @@ function view_leaderboard($limit = 10) {
foreach ($this->page['leaderboard'] as $row) {
echo '<tr>
- <td>' . $i.'.</td>
- <td><a href="/' . $row['username'].'">' . $row['username'].'</a></td>
- <td>' . $row['points'].'</td>
+ <td>' . $i . '.</td>
+ <td><a href="/' . $row['username'] . '">' . $row['username'] . '</a></td>
+ <td>' . $row['points'] . '</td>
</tr>';
$i++;
Please sign in to comment.
Something went wrong with that request. Please try again.