Skip to content
This repository
Browse code

Clearer concatenation

  • Loading branch information...
commit 15e3f5eba3c268614b8fc44274372ec54d769034 1 parent fbe1666
David Haywood Smith authored
2  controllers/admin_controller.php
@@ -210,7 +210,7 @@ function invite() {
210 210 }
211 211
212 212 $to = $email;
213   - $link = $this->config->url . 'users/add/' . $id . '/?email='.urlencode($email);
  213 + $link = $this->config->url . 'users/add/' . $id . '/?email=' . urlencode($email);
214 214
215 215 // Load template into $body variable
216 216 $to = array('email' => $email);
2  controllers/items_controller.php
@@ -248,7 +248,7 @@ function remove($item_id) {
248 248 }
249 249
250 250 // Set message
251   - Application::flash('success', ucfirst($this->config->items['name']).' removed!');
  251 + Application::flash('success', ucfirst($this->config->items['name']) . ' removed!');
252 252
253 253 // Return from whence you came
254 254 header('Location: ' . $_SERVER['HTTP_REFERER']);
12 controllers/pages_controller.php
@@ -12,7 +12,7 @@ function show($name) {
12 12 foreach ($this->config->admin_users as $value) {
13 13 $author = User::get_by_id($value);
14 14 if ($this->config->private != TRUE || isset($_SESSION['user_id'])) {
15   - $authors .= $this->get_link_to($author->username, 'users', 'show', $author->id).', ';
  15 + $authors .= $this->get_link_to($author->username, 'users', 'show', $author->id) . ', ';
16 16 } else {
17 17 $authors .= $author->username . ', ';
18 18 }
@@ -20,7 +20,7 @@ function show($name) {
20 20 }
21 21 $authors = substr($authors, 0, -2);
22 22
23   - $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. ';
  23 + $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. ';
24 24
25 25 if ($this->config->beta == TRUE) {
26 26 $content .= 'It is currently in beta.';
@@ -31,7 +31,7 @@ function show($name) {
31 31 $content .= '<p>It lets you create ' . $this->config->items['name_plural'];
32 32
33 33 if ($this->config->items['titles']['enabled'] == TRUE) {
34   - $content .= ' with '.strtolower($this->config->items['titles']['name_plural']);
  34 + $content .= ' with ' . strtolower($this->config->items['titles']['name_plural']);
35 35 }
36 36
37 37 if ($this->config->items['comments']['enabled'] == TRUE || $this->config->items['likes']['enabled'] == TRUE) {
@@ -39,7 +39,7 @@ function show($name) {
39 39 $content .= ' and then ';
40 40
41 41 if ($this->config->items['comments']['enabled'] == TRUE) {
42   - $content .= ' add '.strtolower($this->config->items['comments']['name_plural']).' ';
  42 + $content .= ' add ' . strtolower($this->config->items['comments']['name_plural']) . ' ';
43 43 }
44 44
45 45 if ($this->config->items['comments']['enabled'] == TRUE && $this->config->items['likes']['enabled'] == TRUE) {
@@ -47,7 +47,7 @@ function show($name) {
47 47 }
48 48
49 49 if ($this->config->items['likes']['enabled'] == TRUE) {
50   - $content .= ' \''.strtolower($this->config->items['likes']['name']).'\' ';
  50 + $content .= " '" . strtolower($this->config->items['likes']['name']) . "' ";
51 51 }
52 52
53 53 $content .= 'them';
@@ -73,7 +73,7 @@ function show($name) {
73 73 }
74 74
75 75 if (isset($this->plugins->gravatar)) {
76   - $content .= '<p>' . $this->config->name . ' is <a href="http://gravatar.com/">Gravatar</a>-enabled.</p>'."\n";
  76 + $content .= '<p>' . $this->config->name . ' is <a href="http://gravatar.com/">Gravatar</a>-enabled.</p>' . "\n";
77 77 }
78 78
79 79 }
2  controllers/sessions_controller.php
@@ -53,7 +53,7 @@ function add() {
53 53
54 54 } else {
55 55
56   - Application::flash('error', 'You are already logged in! ' . $this->get_link_to('Click here', 'sessions', 'remove').' to logout.');
  56 + Application::flash('error', 'You are already logged in! ' . $this->get_link_to('Click here', 'sessions', 'remove') . ' to logout.');
57 57 $this->loadView();
58 58
59 59 }
8 lib/application.php
@@ -23,7 +23,7 @@ public static function initialise() {
23 23
24 24 $uri = Routing::fetch_uri($config);
25 25
26   - $controller = ucfirst($uri['controller']).'Controller';
  26 + $controller = ucfirst($uri['controller']) . 'Controller';
27 27 @include "controllers/{$uri['controller']}_controller.php";
28 28
29 29 if (substr($uri['action'], 0, 1) == '?') {
@@ -43,7 +43,7 @@ public static function initialise() {
43 43
44 44 $uri = Routing::route();
45 45
46   - $controller = ucfirst($uri['controller']).'Controller';
  46 + $controller = ucfirst($uri['controller']) . 'Controller';
47 47 @include "controllers/{$uri['controller']}_controller.php";
48 48
49 49 $app = new $controller;
@@ -286,11 +286,11 @@ public function url_for_route($route, array $params) {
286 286 }
287 287
288 288 public function link_to($link_text, $controller, $action = '', $id = '', $params = array()) {
289   - echo '<a href="' . $this->url_for($controller, $action, $id, $params).'">' . $link_text.'</a>';
  289 + echo '<a href="' . $this->url_for($controller, $action, $id, $params) . '">' . $link_text . '</a>';
290 290 }
291 291
292 292 public function get_link_to($link_text, $controller, $action = '', $id = '', $params = array()) {
293   - return '<a href="' . $this->url_for($controller, $action, $id, $params).'">' . $link_text.'</a>';
  293 + return '<a href="' . $this->url_for($controller, $action, $id, $params) . '">' . $link_text . '</a>';
294 294 }
295 295
296 296 public function redirect_to($controller, $action = '', $id = '', $params = array()) {
2  models/admin.php
@@ -29,7 +29,7 @@ public static function list_users() {
29 29 if ($last_login == 0) {
30 30 $last_login = 'Today!';
31 31 } else {
32   - $last_login = $last_login.' days ago';
  32 + $last_login = $last_login . ' days ago';
33 33 }
34 34
35 35 } else {
6 plugins/gravatar.php
@@ -41,14 +41,14 @@ function show($email, $params = array()) {
41 41
42 42 // if style is set, add it in
43 43 if (isset($params['style'])) {
44   - $return .= ' style="' . $params['style'].'"';
  44 + $return .= ' style="' . $params['style'] . '"';
45 45 }
46 46
47 47 $return .= ' />';
48 48
49 49 // if user_id is set, make it a link
50 50 if (isset($params['link'])) {
51   - $return = '<a href="' . $params['link'].'">' . $return.'</a>';
  51 + $return = '<a href="' . $params['link'] . '">' . $return . '</a>';
52 52 }
53 53
54 54 return $return;
@@ -58,7 +58,7 @@ function show($email, $params = array()) {
58 58 function show_settings($email) {
59 59
60 60 echo '<h2>Picture</h2>
61   -' . $this->show($email).'
  61 +' . $this->show($email) . '
62 62 <p>Visit <a href="http://gravatar.com/">Gravatar.com</a> to change your picture.</p>';
63 63
64 64 }
2  plugins/log.php
@@ -86,7 +86,7 @@ function view() {
86 86 $return .= $entry['params'];
87 87 }
88 88
89   - $return .= '</td><td>' . $entry['date'].'</td></tr>';
  89 + $return .= '</td><td>' . $entry['date'] . '</td></tr>';
90 90
91 91 }
92 92
12 plugins/points.php
@@ -16,7 +16,7 @@
16 16 * To display users's points:
17 17 *
18 18 * if (isset($this->plugins->points)) {
19   -* echo 'You have ' . $user->points.' ' . $this->plugins->points['name'];
  19 +* echo 'You have ' . $user->points . ' ' . $this->plugins->points['name'];
20 20 * }
21 21 *
22 22 */
@@ -46,12 +46,12 @@ function update($user_id, $points) {
46 46 function view() {
47 47
48 48 if ($id == $_SESSION['user_id']) {
49   - echo '<p>You have ' . $user['points'].' ' . $this->plugins->points['name'].'!</p>';
  49 + echo '<p>You have ' . $user['points'] . ' ' . $this->plugins->points['name'] . '!</p>';
50 50 if ($this->plugins->points['leaderboard'] == TRUE) {
51 51 echo '<p class="small">Where do you rank on the <a href="leaderboard.php">leaderboard</a>?</p>';
52 52 }
53 53 } else {
54   - echo '<p>' . $user['username'].' has ' . $user['points'].' ' . $this->plugins->points['name'].'!</p>';
  54 + echo '<p>' . $user['username'] . ' has ' . $user['points'] . ' ' . $this->plugins->points['name'] . '!</p>';
55 55 if ($this->plugins->points['leaderboard'] == TRUE) {
56 56 echo '<p class="small">See where they rank on the <a href="leaderboard.php">leaderboard</a>.</p>';
57 57 }
@@ -79,9 +79,9 @@ function view_leaderboard($limit = 10) {
79 79 foreach ($this->page['leaderboard'] as $row) {
80 80
81 81 echo '<tr>
82   - <td>' . $i.'.</td>
83   - <td><a href="/' . $row['username'].'">' . $row['username'].'</a></td>
84   - <td>' . $row['points'].'</td>
  82 + <td>' . $i . '.</td>
  83 + <td><a href="/' . $row['username'] . '">' . $row['username'] . '</a></td>
  84 + <td>' . $row['points'] . '</td>
85 85 </tr>';
86 86
87 87 $i++;

0 comments on commit 15e3f5e

Please sign in to comment.
Something went wrong with that request. Please try again.