Changeset 205

Show
Ignore:
Timestamp:
07/02/07 22:19:45 (2 years ago)
Author:
dez
Message:

Resolves conflict in blog.lib.php
Applies updates made to the live copy that weren't in SVN

Files:

Legend:

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

    r204 r205  
    4646                $this->shortDateFormat = "Y-m-d"; 
    4747                $this->longDateFormat = "r"; 
    48                 //setup the paths 
    49                 $this->httpPath = dirname($_SERVER['SCRIPT_NAME']); 
     48                $this->httpPath = "/blog/"; 
     49                $this->adminPath = $this->httpPath."admin/"; 
     50                $this->basePath = "/blogs/"; 
    5051                if($this->httpPath[strlen($this->httpPath)-1]!="/") { 
    5152                        $this->httpPath .= "/"; 
    5253                } 
    53                 $this->adminPath = $this->httpPath."admin.php/"; 
    54                 $this->basePath = $this->httpPath."index.php/"; 
    5554                //if we are logged in start a blog instance, and setup the blog path 
    5655                if ($this->userName) { 
     
    6463        { 
    6564                //set the session time out in seconds 
    66                 $maxSessionAge = 3600; //1 hour 
     65                $maxSessionAge = 10800; //1 hour 
    6766                //setup the session stuff 
    6867                session_name("BlogSession"); 
  • blog.lib.php

    r203 r205  
    44 * blogs class - provides functions for blogs 
    55 */ 
     6 
     7// PHP Notices are fun, but we don't really want to see them right now 
     8error_reporting(E_ALL ^ E_NOTICE); 
    69 
    710// Initialise the database 
     
    98101                                $this->longDateFormat = "%c"; 
    99102                                //set path for all http stuff.. ie images, css and so on 
    100                                 $this->httpPath = dirname($_SERVER['SCRIPT_NAME'])
     103                                $this->httpPath = "/blog/"
    101104                                //make the httpPath work nicely if we're not in a subdir 
    102                                 if(substr($this->httpPath, -1)!="/") { 
    103                                       $this->httpPath .= "/"; 
    104                                
     105                                //if(substr($this->httpPath, -1)!="/") { 
     106                                //    $this->httpPath .= "/"; 
     107                                //
    105108                                //path for the blog viewer with no user 
    106                                 $this->basePath = $this->httpPath."index.php/"; 
     109                                $this->basePath = "/blogs/"; 
    107110                                //path to this blog 
    108111                                $this->blogPath = $this->basePath.$this->userName."/"; 
    109112                                //path to the admin bits 
    110                                 $this->adminPath = $this->httpPath."admin.php/"; 
     113                                $this->adminPath = $this->httpPath."admin/"; 
    111114                                $this->comment_moderation = ($sql[0]['moderate']=='t') ? TRUE : FALSE; 
    112115                                $this->editor = ($sql[0]['editor']=='t') ? TRUE : FALSE; 
     
    742745                $this->title = _("SUCS Blogs"); 
    743746                $this->description = _("Swansea University Computer Society member web logs"); 
    744                 $this->httpPath = dirname($_SERVER['SCRIPT_NAME'])
    745                 if(substr($this->httpPath, -1)!="/") { 
    746                       $this->httpPath .= "/"; 
    747                
    748                 $this->basePath = $this->httpPath."index.php/"; 
    749                 $this->adminPath = $this->httpPath."admin.php/"; 
     747                $this->httpPath = "/blog/"
     748                //if(substr($this->httpPath, -1)!="/") { 
     749                //    $this->httpPath .= "/"; 
     750                //
     751                $this->basePath = "/blogs/"; 
     752                $this->adminPath = $this->httpPath."admin/"; 
    750753                $this->cssFile = "blog.css"; 
    751754                $this->svnRevision = getSVNRevision(); 
  • feed.php

    r203 r205  
    2929        $user = $row; 
    3030        if(substr(dirname($_SERVER['SCRIPT_NAME']), -1)=="/"){ 
    31                 $user['link'] = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])."index.php/".$user['username']."/"; 
    32                 $user['feed'] = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])."feed.php/".$feedtype."/".$user['username'].""; 
     31                $user['link'] = "http://".$_SERVER['HTTP_HOST']."/blogs/".$user['username']."/"; 
     32                $user['feed'] = "http://".$_SERVER['HTTP_HOST']."/blog/feed/".$feedtype."/".$user['username'].""; 
    3333        } 
    3434        else { 
    35                 $user['link'] = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])."/index.php/".$user['username']."/"; 
    36                 $user['feed'] = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])."/feed.php/".$feedtype."/".$user['username'].""; 
     35                $user['link'] = "http://".$_SERVER['HTTP_HOST']."/blogs/".$user['username']."/"; 
     36                $user['feed'] = "http://".$_SERVER['HTTP_HOST']."/blog/feed/".$feedtype."/".$user['username'].""; 
    3737        } 
    3838} 
  • index.php

    r184 r205  
    33        include("blog.lib.php"); 
    44        //make our command list 
    5         $request=explode('/',substr($_SERVER[PATH_INFO], 1)); 
     5        $request=explode('/',substr($_SERVER['PATH_INFO'], 1)); 
    66        //if we have something which might be a username start a blogs instance 
    77        if($request[0] != "" and $request[0] != "list"){ 
     
    2424        //check we have a valid username before offering a RSS feed 
    2525        if($blog->userName) { 
    26                 $rss_url = "http://{$_SERVER['HTTP_HOST']}{$blog->httpPath}feed.php/rss/{$blog->userName}".(($request[0]=="category")?"/category/".(int)$request[1]:""); 
    27                 $atom_url = "http://{$_SERVER['HTTP_HOST']}{$blog->httpPath}feed.php/atom/{$blog->userName}".(($request[0]=="category")?"/category/".(int)$request[1]:""); 
     26                $rss_url = "http://{$_SERVER['HTTP_HOST']}{$blog->httpPath}feed/rss/{$blog->userName}".(($request[0]=="category")?"/category/".(int)$request[1]:""); 
     27                $atom_url = "http://{$_SERVER['HTTP_HOST']}{$blog->httpPath}feed/atom/{$blog->userName}".(($request[0]=="category")?"/category/".(int)$request[1]:""); 
    2828                echo "    <link rel=\"alternate\" type=\"application/rss+xml\" title=\"{$blog->title}\" href=\"$rss_url\"/>\n"; 
    2929                echo "    <link rel=\"alternate\" type=\"application/atom+xml\" title=\"{$blog->title}\" href=\"$atom_url\"/>\n"; 
  • miscfunctions.lib.php

    r197 r205  
    8181        } 
    8282        //pull in list of two level tlds, make an array from them. from http://spamcheck.freeapp.net/two-level-tlds 
    83         $twoLevelTLD = file("./two-level-tlds"); 
     83        $twoLevelTLD = file("/var/www/blog/two-level-tlds"); 
    8484        foreach($twoLevelTLD as $TLD) { 
    8585                $two_level_tlds[trim($TLD)] = true;