Changeset 101
- Timestamp:
- 31/05/05 01:26:16 (4 years ago)
- Files:
-
- admin.lib.php (modified) (3 diffs)
- blog.css (modified) (3 diffs)
- blog.lib.php (modified) (4 diffs)
- index.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
admin.lib.php
r100 r101 127 127 function menu() { 128 128 echo "<ul class=\"side-menu\">\n"; 129 echo "<li><a href=\"".$this->adminPath."newentry"."\">Write new entry</a></li>\n"; 130 echo "<li><a href=\"".$this->adminPath."showentries\">Edit entries</a></li>\n"; 131 echo "<li><a href=\"",$this->adminPath."settings"."\">Settings</a></li>\n"; 129 echo "<li><a href=\"".$this->adminPath."newentry\">"._("Write new entry")."</a></li>\n"; 130 echo "<li><a href=\"".$this->adminPath."showentries\">"._("Edit entries")."</a></li>\n"; 131 echo "<li><a href=\"".$this->adminPath."settings\">"._("Settings")."</a></li>\n"; 132 if ($this->userName) { 133 echo "<li><a href=\"".$this->httpPath."index.php/".$this->userName."\">"._("My blog")."</a></li>\n"; //index.php will need removing when we fix that 134 } 132 135 echo "</ul>\n"; 133 136 } … … 142 145 function printLoginForm() 143 146 { 144 echo "<div class=\"login\"> \n";147 echo "<div class=\"login\"><h3>"._("Not logged in")."</h3>\n"; 145 148 echo "<h2>"._("Login")."</h2>\n"; 146 149 echo "<div class=\"td\">\n"; … … 196 199 // need to check if there are any short titles like this one already 197 200 $sql = db_query("SELECT shortsubject FROM entries WHERE user_id = {$this->id} AND shortsubject ~ '{$shortsubject}(_[0-9]{1,3}$|$)' ORDER BY char_length(shortsubject) DESC, shortsubject DESC;"); 198 $sqlNum = db_num_rows($sql);199 200 //if so we grab the last one, and add 1 to it..201 if ($sqlNum != 0) {202 $sqlRow = db_getrow($sql);203 // Put the matched _number into $matches[0] if there is one204 if (preg_match("/\_[0-9]{1,3}$/",$sqlRow['shortsubject'],$matches)) {205 // Remove the _ to get the number, add 1 and append206 $shortsubject .= '_' . ((int)substr($matches[0],1) + 1);207 } else {208 $shortsubject .= '_1';209 }210 }201 $sqlNum = db_num_rows($sql); 202 203 //if so we grab the last one, and add 1 to it.. 204 if ($sqlNum != 0) { 205 $sqlRow = db_getrow($sql); 206 // Put the matched _number into $matches[0] if there is one 207 if (preg_match("/\_[0-9]{1,3}$/",$sqlRow['shortsubject'],$matches)) { 208 // Remove the _ to get the number, add 1 and append 209 $shortsubject .= '_' . ((int)substr($matches[0],1) + 1); 210 } else { 211 $shortsubject .= '_1'; 212 } 213 } 211 214 //shortsubject is now safe.. 212 215 //insert our new entry blog.css
r85 r101 66 66 #maincontent { 67 67 margin: 0; 68 padding: 0 1.5em ;68 padding: 0 1.5em 2em 1.5em; 69 69 margin-left: 10em; 70 70 background-color: #FFF; … … 82 82 83 83 #listofblogs { 84 font-size: 12px; 85 padding: 1em 0; 84 font-size: 14px; 85 padding: 1em; 86 border: 1px #AFAFAF dotted; 86 87 } 87 88 … … 213 214 214 215 .bname, .btitle, .bupdated { 215 font-weight: bold; 216 color: #258; 217 border-bottom: 1px #69E solid; 216 color: #FFF; 217 background-color: #258; 218 218 padding: 0.1em; 219 } 220 221 #listofblogs td { 222 padding: 0.1em 0.5em; 219 223 } 220 224 blog.lib.php
r99 r101 302 302 } 303 303 } 304 305 // Blog menu306 function menu()304 305 // Blog menu 306 function menu() 307 307 { 308 308 echo "<ul class=\"side-menu\">\n"; 309 echo "<li><a href=\"{$this->httpPath}\">"._("Blog list")."</a></li>\n"; 309 echo "<li><a href=\"{$this->httpPath}\">"._("Blogs home")."</a></li>\n"; 310 echo "<li><a href=\"{$this->httpPath}admin.php\">"._("Log in")."</a></li>\n"; 310 311 echo "</ul>\n"; 311 312 } … … 339 340 function bloglist() 340 341 { 341 $this->title = " Bloggers";342 $this->description = " Listing of all users";342 $this->title = "SUCS Blogs"; 343 $this->description = "Swansea University Computer Society member web logs"; 343 344 $this->httpPath = dirname($_SERVER['SCRIPT_NAME'])."/"; 344 345 $this->cssFile = "blog.css"; … … 352 353 $sqlNum = db_num_rows($sql); 353 354 if ($sqlNum > 0) { 354 echo "<div id=\"listofblogs\">\n"; 355 echo "<table>\n"; 356 echo "<tr><td class=\"bname\">"._("Name")."</td><td class=\"btitle\">"._("Blog")."</td><td class=\"bupdated\">"._("Last Updated")."</td></tr>"; 355 echo "<div class=\"td\">\n"; 356 echo "<p>"._("Welcome to SUCS Blogs - The multi-user web log system created by SUCS members for SUCS members.")."</p>\n"; 357 echo "<p>"._("Browse the blogs below or use the links on the left to navigate the site. Happy blogging!")."</p>\n"; 358 echo "</div>\n"; 359 echo "<div id=\"listofblogs\">\n"; 360 echo "<table>\n"; 361 echo "<tr><td class=\"bname\">"._("Name")."</td><td class=\"btitle\">"._("Blog")."</td><td class=\"bupdated\">"._("Last Updated")."</td></tr>"; 357 362 while($row = db_getrow($sql)) { 358 363 echo "<tr>\n"; 359 echo " <td>".$row['name']."</td>\n";360 echo " <td><a href=\"".$baseurl.$row['username']."\" title=\"".$row['description']."\">".$row['title']."</a></td>\n";361 echo " <td>".$this->timeDiff(strtotime($row['ts']))." ago</td>\n";362 echo "</tr>\n";364 echo " <td>".$row['name']."</td>\n"; 365 echo " <td><a href=\"".$baseurl.$row['username']."\" title=\"".$row['description']."\">".$row['title']."</a></td>\n"; 366 echo " <td>".$this->timeDiff(strtotime($row['ts']))." ago</td>\n"; 367 echo "</tr>\n"; 363 368 } 364 echo "</table>\n"; 365 echo "</div>\n"; 369 370 echo "</table>\n"; 371 echo "</div>\n"; 366 372 } 367 373 else { … … 400 406 } 401 407 402 // Blog menu - links displayed when the blog list is displayed403 function menu() {408 // Blog menu - links displayed when the blog list is displayed 409 function menu() { 404 410 echo "<ul class=\"side-menu\">\n"; 405 // e.g. echo "<li><a href="foo">bar</a></li>\n";411 echo "<li><a href=\"{$this->httpPath}admin.php\">"._("Blog admin")."</a></li>\n"; 406 412 echo "</ul>\n"; 407 413 } index.php
r90 r101 29 29 <p class="sideblurb"> 30 30 <?php $blog->menu(); ?> 31 <br /> 31 32 <a href="http://sucs.org"><img src="<? echo $blog->httpPath."img/sucspow.png"; ?>" alt="<? echo _("Powered by SUCS"); ?>" height="13" width="80" /></a> 32 33 </p>
