Changeset 205
- Timestamp:
- 07/02/07 22:19:45 (2 years ago)
- Files:
-
- admin.lib.php (modified) (2 diffs)
- blog.lib.php (modified) (3 diffs)
- feed.php (modified) (1 diff)
- index.php (modified) (2 diffs)
- miscfunctions.lib.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
admin.lib.php
r204 r205 46 46 $this->shortDateFormat = "Y-m-d"; 47 47 $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/"; 50 51 if($this->httpPath[strlen($this->httpPath)-1]!="/") { 51 52 $this->httpPath .= "/"; 52 53 } 53 $this->adminPath = $this->httpPath."admin.php/";54 $this->basePath = $this->httpPath."index.php/";55 54 //if we are logged in start a blog instance, and setup the blog path 56 55 if ($this->userName) { … … 64 63 { 65 64 //set the session time out in seconds 66 $maxSessionAge = 3600; //1 hour65 $maxSessionAge = 10800; //1 hour 67 66 //setup the session stuff 68 67 session_name("BlogSession"); blog.lib.php
r203 r205 4 4 * blogs class - provides functions for blogs 5 5 */ 6 7 // PHP Notices are fun, but we don't really want to see them right now 8 error_reporting(E_ALL ^ E_NOTICE); 6 9 7 10 // Initialise the database … … 98 101 $this->longDateFormat = "%c"; 99 102 //set path for all http stuff.. ie images, css and so on 100 $this->httpPath = dirname($_SERVER['SCRIPT_NAME']);103 $this->httpPath = "/blog/"; 101 104 //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 //} 105 108 //path for the blog viewer with no user 106 $this->basePath = $this->httpPath."index.php/";109 $this->basePath = "/blogs/"; 107 110 //path to this blog 108 111 $this->blogPath = $this->basePath.$this->userName."/"; 109 112 //path to the admin bits 110 $this->adminPath = $this->httpPath."admin .php/";113 $this->adminPath = $this->httpPath."admin/"; 111 114 $this->comment_moderation = ($sql[0]['moderate']=='t') ? TRUE : FALSE; 112 115 $this->editor = ($sql[0]['editor']=='t') ? TRUE : FALSE; … … 742 745 $this->title = _("SUCS Blogs"); 743 746 $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/"; 750 753 $this->cssFile = "blog.css"; 751 754 $this->svnRevision = getSVNRevision(); feed.php
r203 r205 29 29 $user = $row; 30 30 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'].""; 33 33 } 34 34 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'].""; 37 37 } 38 38 } index.php
r184 r205 3 3 include("blog.lib.php"); 4 4 //make our command list 5 $request=explode('/',substr($_SERVER[ PATH_INFO], 1));5 $request=explode('/',substr($_SERVER['PATH_INFO'], 1)); 6 6 //if we have something which might be a username start a blogs instance 7 7 if($request[0] != "" and $request[0] != "list"){ … … 24 24 //check we have a valid username before offering a RSS feed 25 25 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]:""); 28 28 echo " <link rel=\"alternate\" type=\"application/rss+xml\" title=\"{$blog->title}\" href=\"$rss_url\"/>\n"; 29 29 echo " <link rel=\"alternate\" type=\"application/atom+xml\" title=\"{$blog->title}\" href=\"$atom_url\"/>\n"; miscfunctions.lib.php
r197 r205 81 81 } 82 82 //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"); 84 84 foreach($twoLevelTLD as $TLD) { 85 85 $two_level_tlds[trim($TLD)] = true;
