Changeset 101

Show
Ignore:
Timestamp:
31/05/05 01:26:16 (4 years ago)
Author:
welshbyte
Message:

No longer using spaces to indent. Added a few extra links here and there for a more pleasant browsing experience. Some i18n (please remember to use _() when adding static text to pages!) and some style updating to reflect my changes. Added a nice welcome message on the blog listing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • admin.lib.php

    r100 r101  
    127127        function menu() { 
    128128                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                } 
    132135                echo "</ul>\n"; 
    133136        } 
     
    142145        function printLoginForm()  
    143146        { 
    144                 echo "<div class=\"login\">\n"; 
     147                echo "<div class=\"login\"><h3>"._("Not logged in")."</h3>\n"; 
    145148                echo "<h2>"._("Login")."</h2>\n"; 
    146149                echo "<div class=\"td\">\n"; 
     
    196199                        // need to check if there are any short titles like this one already 
    197200                        $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 one 
    204                 if (preg_match("/\_[0-9]{1,3}$/",$sqlRow['shortsubject'],$matches)) { 
    205                     // Remove the _ to get the number, add 1 and append 
    206                     $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                       
    211214                        //shortsubject is now safe.. 
    212215                        //insert our new entry 
  • blog.css

    r85 r101  
    6666#maincontent { 
    6767    margin: 0; 
    68     padding: 0 1.5em
     68    padding: 0 1.5em 2em 1.5em
    6969    margin-left: 10em; 
    7070    background-color: #FFF; 
     
    8282 
    8383#listofblogs { 
    84     font-size: 12px; 
    85     padding: 1em 0; 
     84    font-size: 14px; 
     85    padding: 1em; 
     86    border: 1px #AFAFAF dotted; 
    8687} 
    8788 
     
    213214 
    214215.bname, .btitle, .bupdated { 
    215     font-weight: bold; 
    216     color: #258; 
    217     border-bottom: 1px #69E solid; 
     216    color: #FFF; 
     217    background-color: #258; 
    218218    padding: 0.1em; 
     219} 
     220 
     221#listofblogs td { 
     222        padding: 0.1em 0.5em; 
    219223} 
    220224 
  • blog.lib.php

    r99 r101  
    302302                } 
    303303        } 
    304      
    305     // Blog menu 
    306     function menu() 
     304 
     305       // Blog menu 
     306       function menu() 
    307307        { 
    308308                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"; 
    310311                echo "</ul>\n"; 
    311312        } 
     
    339340        function bloglist()  
    340341        { 
    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"; 
    343344                $this->httpPath = dirname($_SERVER['SCRIPT_NAME'])."/"; 
    344345                $this->cssFile = "blog.css"; 
     
    352353                $sqlNum = db_num_rows($sql); 
    353354                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>"; 
    357362                        while($row = db_getrow($sql)) { 
    358363                                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"; 
    363368                        } 
    364             echo "</table>\n"; 
    365             echo "</div>\n"; 
     369                         
     370                        echo "</table>\n"; 
     371                        echo "</div>\n"; 
    366372                } 
    367373                else { 
     
    400406        } 
    401407 
    402     // Blog menu - links displayed when the blog list is displayed 
    403     function menu() { 
     408       // Blog menu - links displayed when the blog list is displayed 
     409       function menu() { 
    404410                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"; 
    406412                echo "</ul>\n"; 
    407413        } 
  • index.php

    r90 r101  
    2929            <p class="sideblurb"> 
    3030                <?php $blog->menu(); ?> 
     31                <br /> 
    3132                <a href="http://sucs.org"><img src="<? echo $blog->httpPath."img/sucspow.png"; ?>" alt="<? echo _("Powered by SUCS"); ?>" height="13" width="80" /></a> 
    3233            </p>