[Feed-collector-svn] SF.net SVN: feed-collector: [100] trunk
Status: Beta
Brought to you by:
c167
|
From: <c1...@us...> - 2007-01-12 23:46:14
|
Revision: 100
http://feed-collector.svn.sourceforge.net/feed-collector/?rev=100&view=rev
Author: c167
Date: 2007-01-12 15:46:14 -0800 (Fri, 12 Jan 2007)
Log Message:
-----------
big enhancements, reduced file-size by putting some parts into extra files, VERSION 100, YEAH
Modified Paths:
--------------
trunk/SQL/mysql.setup.php
trunk/class/Feed_manager.php
trunk/class/Tag_manager.php
trunk/class/User_manager.php
trunk/inc/config.php
trunk/inc/navigation.php
trunk/index.php
trunk/page_add_new_feed.php
trunk/page_add_tag.php
trunk/page_login.php
trunk/page_logout.php
trunk/page_main.php
trunk/page_personal.php
trunk/page_register.php
trunk/page_show_all_feeds.php
trunk/page_show_feed.php
trunk/page_show_feed_tag.php
trunk/statistics.php
trunk/styles/default/header-screen.css
trunk/styles/default/page_personal-screen.css
trunk/update_feeds.php
Added Paths:
-----------
trunk/inc/database.php
trunk/inc/footer.php
trunk/inc/language.php
trunk/inc/session.php
trunk/inc/upperBar.php
trunk/inc/userstatus_display.php
Modified: trunk/SQL/mysql.setup.php
===================================================================
--- trunk/SQL/mysql.setup.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/SQL/mysql.setup.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -1,55 +1,116 @@
<?php
+/**
+ * Created on 23.10.06
+ * This file contains the MySQL-Querys for preparing the database
+ * @since 49 - 23.10.06
+ * @author c167 <c1...@us...>
+ * @package feed-collector
+ */
+
/*
-* Creates the Database for the script
-* @rights root
-*/
-$sql_setup['database'] = 'CREATE DATABASE `news-collector`;';
+ * @database feed-collector
+ */
/*
-* Creates the User for the script
-* @rights root
-*/
+ * @table Dummy feed-table
+ */
+$dummyFeed = "CREATE TABLE `f_{feed_db_name}` (
+ `ID` bigint(20) unsigned NOT NULL auto_increment,
+ `title` varchar(255) collate utf8_bin NOT NULL,
+ `url` varchar(255) collate utf8_bin NOT NULL,
+ `summary` varchar(255) collate utf8_bin default NULL,
+ `hash` char(32) collate utf8_bin NOT NULL,
+ `updated` int(11) NOT NULL,
+ PRIMARY KEY (`ID`),
+ UNIQUE KEY `key` (`hash`),
+ KEY `title` (`title`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;";
/*
-* Grants privilegies to the user.
-* @rights root
-*/
-$sql_setup['grant'] = 'GRANT ALL PRIVILEGES ON `news-collector`.* TO \'news-collector\'@\'localhost\'WITH GRANT OPTION;';
+ * @table feeds
+ */
+$feeds = "CREATE TABLE `feeds` (
+ `ID` int(10) unsigned NOT NULL auto_increment,
+ `site_name` varchar(255) character set latin1 NOT NULL,
+ `site_url` varchar(255) character set latin1 NOT NULL,
+ `site_lang` varchar(255) character set latin1 NOT NULL,
+ `site_img` varchar(255) character set latin1 NOT NULL,
+ `feed_name` varchar(255) character set latin1 NOT NULL,
+ `feed_description` varchar(255) collate utf8_bin NOT NULL,
+ `feed_url` varchar(255) character set latin1 NOT NULL,
+ `feed_type` varchar(10) character set latin1 NOT NULL,
+ `feed_db_name` varchar(30) character set latin1 NOT NULL,
+ `feed_lang` varchar(6) character set latin1 NOT NULL,
+ `feed_img` varchar(255) character set latin1 NOT NULL,
+ `is_active` tinyint(1) NOT NULL default '0',
+ `last_change` int(11) NOT NULL default '0',
+ `added` int(10) NOT NULL,
+ `items` bigint(20) NOT NULL,
+ PRIMARY KEY (`ID`),
+ KEY `site_name` (`site_name`,`site_url`),
+ KEY `items` (`items`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;";
/*
-* Creates the Channels-Table, that will contain the basic information about the channels
-* @rights user
-*/
-$sql_setup['crate_channels'] = 'CREATE TABLE `feeds` (' . ' `ID` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ' . ' `site_name` VARCHAR(255) NOT NULL, ' . ' `site_url` VARCHAR(255) NOT NULL, ' . ' `site_lang` VARCHAR(255) NOT NULL, ' . ' `site_img` VARCHAR(255) NOT NULL, ' . ' `feed_name` VARCHAR(255) NOT NULL, ' . ' `feed_url` VARCHAR(255) NOT NULL, ' . ' `feed_type` VARCHAR(10) NOT NULL, ' . ' `feed_lang` VARCHAR(6) NOT NULL, ' . ' `feed_img` VARCHAR(255) NOT NULL, ' . ' `is_active` BOOL NOT NULL DEFAULT \'0\', ' . ' `last_change` INT NOT NULL DEFAULT \'0\',' . ' INDEX (`site_name`, `site_url`)' . ' )' . ' ENGINE = myisam;';
+ * @table news
+ */
+$news = "CREATE TABLE `news` (
+ `ID` int(10) unsigned NOT NULL auto_increment,
+ `headline` varchar(255) collate utf8_bin NOT NULL,
+ `summary` varchar(255) collate utf8_bin NOT NULL,
+ `content` text collate utf8_bin NOT NULL,
+ `published` int(11) NOT NULL,
+ PRIMARY KEY (`ID`),
+ KEY `headline` (`headline`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;";
/*
-CREATE TABLE `channels` (
-`ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
-`site_name` VARCHAR( 255 ) NOT NULL ,
-`site_url` VARCHAR( 255 ) NOT NULL ,
-`site_lang` VARCHAR( 255 ) NOT NULL ,
-`feed_name` VARCHAR( 255 ) NOT NULL ,
-`feed_url` VARCHAR( 255 ) NOT NULL ,
-`feed_type` VARCHAR( 10 ) NOT NULL ,
-`feed_lang` VARCHAR( 6 ) NOT NULL ,
-`is_active` BOOL NOT NULL ,
-`last_change` TIMESTAMP NOT NULL DEFAULT '1111111111',
-`encoding` VARCHAR( 20 ) NOT NULL ,
-`temp` VARCHAR( 255 ) NOT NULL ,
-INDEX ( `feed_name` )
-) ENGINE = MYISAM ;
-*/
+ * @table sessiondata
+ */
+$sessiondata = "CREATE TABLE `sessiondata` (
+ `id` char(32) NOT NULL,
+ `expiry` int(10) unsigned NOT NULL default '0',
+ `data` text NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
+
/*
-* Content of a "Dummy TABLE, that will be used every time a new feed is added.
-* @rights user
-*/
-$sql = 'CREATE TABLE `f_' . $feed_db_name . '` (' . ' `ID` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ' . ' `title` VARCHAR(255) NOT NULL, ' . ' `url` VARCHAR(255) NOT NULL, ' . ' `time` INT NOT NULL,' . ' INDEX (`title`, `url`)' . ' )' . ' ENGINE = myisam;';
-/* important:
- * ALTER TABLE `f_heise_security` ADD `summary` VARCHAR( 255 ) NOT NULL FIRST ;
+ * @table statistic
+ */
+$statistic = "CREATE TABLE `statistic` (
+ `number_of_feeds` int(10) unsigned NOT NULL,
+ `number_of_items` bigint(20) unsigned NOT NULL,
+ `fav_feed` varchar(255) character set utf8 collate utf8_bin NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
-ALTER TABLE `f_heise_security` ADD INDEX ( `summary` ) ;
+/*
+ * @table tags
*/
-$sql = 'ALTER TABLE `f_heise_security`' . ' DEFAULT CHARACTER SET utf8 COLLATE utf8_bin';
+$tags = "CREATE TABLE `tags` (
+ `id` bigint(20) unsigned NOT NULL auto_increment,
+ `setBy` varchar(25) collate utf8_bin NOT NULL,
+ `tag` varchar(25) collate utf8_bin NOT NULL,
+ `feed` varchar(255) collate utf8_bin NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `tag` (`tag`,`feed`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;";
+
+/*
+ * @table users
+ */
+$users = "CREATE TABLE `users` (
+ `ID` bigint(20) NOT NULL auto_increment,
+ `name` varchar(255) collate utf8_bin NOT NULL,
+ `email` varchar(255) collate utf8_bin NOT NULL,
+ `pass` char(32) collate utf8_bin NOT NULL,
+ `language` varchar(7) collate utf8_bin NOT NULL default 'en_EN',
+ `columns` text collate utf8_bin NOT NULL,
+ `state` varchar(20) collate utf8_bin NOT NULL,
+ `last_action` int(11) NOT NULL default '0',
+ PRIMARY KEY (`ID`),
+ UNIQUE KEY `email` (`email`),
+ KEY `name` (`name`,`pass`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;";
?>
\ No newline at end of file
Modified: trunk/class/Feed_manager.php
===================================================================
--- trunk/class/Feed_manager.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/class/Feed_manager.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,11 +3,11 @@
/**
* Created on 09.07.2006
- *
- * This file is used to
+ * This file contains the Feed-Manager
* @version 1.2
* @since 20 - 09.07.2006
* @author c167 <c1...@us...>
+ * @package feed-collector
*/
class Feed_Manager {
Modified: trunk/class/Tag_manager.php
===================================================================
--- trunk/class/Tag_manager.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/class/Tag_manager.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,10 +3,10 @@
/**
* Created on 11.12.2006
- *
- * This file is used to
+ * This file contains the Tag-Manager
* @since 74 - 11.12.2006
* @author c167 <c1...@us...>
+ * @package feed-collector
*/
class Tag_Manager {
Modified: trunk/class/User_manager.php
===================================================================
--- trunk/class/User_manager.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/class/User_manager.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,11 +3,10 @@
/**
* Created on 25.11.2006
- *
- * This file is used to
- * @version 1.2
+ * This file contains the User-Manager
* @since 58 - 25.11.2006
* @author c167 <c1...@us...>
+ * @package feed-collector
*/
/**
Modified: trunk/inc/config.php
===================================================================
--- trunk/inc/config.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/inc/config.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -13,12 +13,12 @@
*/
// Database-configuration
-$db['type'] = "mysql"; // SQL_DB-Type
-$db['host'] = "localhost"; // The hostname
-$db['port'] = ""; // The Port. Nomally, the default port is right.
-$db['user'] = "feed-collector"; // The User that has access to the DB
-$db['passwd'] = "feed-collector"; // The password of this user
-$db['database'] = "feed-collector"; // The name of the database
+$db['type'] = "mysql"; // SQL_DB-Type
+$db['host'] = "localhost"; // The hostname
+$db['port'] = ""; // The Port. Nomally, the default port is right.
+$db['user'] = "feed-collector"; // The User that has access to the DB
+$db['passwd'] = "feed-collector"; // The password of this user
+$db['database'] = "feed-collector"; // The name of the database
// Session-configuration
$session['time']['expire'] = 60 * 60 * 24;
Added: trunk/inc/database.php
===================================================================
--- trunk/inc/database.php (rev 0)
+++ trunk/inc/database.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Created on 12.01.2007
+ * Contains the main database-functions needed by any script
+ * @since 100 - 12.01.2007
+ * @author C167 <c1...@us...>
+ * @package feed-collector
+ */
+require_once "MDB2.php";
+$dsn = array (
+ 'phptype' => $db['type'],
+ 'username' => $db['user'],
+ 'password' => $db['passwd'],
+ 'hostspec' => $db['host'],
+ 'database' => $db['database']
+);
+$options = array (
+ 'debug' => 2,
+ 'result_buffering' => true,
+ 'portability' => MDB2_PORTABILITY_ALL
+);
+$db = & MDB2 :: factory($dsn, $options);
+if (PEAR :: isError($db)) {
+ echo $db->getMessage();
+ echo "<br />";
+ echo $db->getDebugInfo();
+} else {
+}
+$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+?>
Added: trunk/inc/footer.php
===================================================================
--- trunk/inc/footer.php (rev 0)
+++ trunk/inc/footer.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Created on 12.01.2007
+ * This file contains the footer
+ * @since 100 - 12.01.2007
+ * @author C167 <c1...@us...>
+ * @package feed-collector
+ */
+
+// footer
+$footer = sprintf(" <span class=\"doNotPrint\">\n" .
+ " For comments or questions about this website, please\n" .
+ " <a href=\"mailto:c1...@us...\" title=\"the developsers email adress\">email the Webmaster</a><br />\n" .
+ " </span>\n\n" .
+ " <!-- <strong>URI »</strong> http://domain.is.invalid/prosimii/index.html -->\n" .
+ " • <strong>Updated »</strong> 2006-Oct-25 18:42 +1000 •");
+?>
Added: trunk/inc/language.php
===================================================================
--- trunk/inc/language.php (rev 0)
+++ trunk/inc/language.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Created on 12.01.2007
+ * Contains the language-setter
+ * @since 100 - 12.01.2007
+ * @author C167 <c1...@us...>
+ * @package feed-collector
+ */
+
+if (true === HTTP_Session :: get("logged_in", false)) {
+ $user->setUserId(HTTP_Session :: get("uid"));
+ $language = $user->getUserLanguage();
+ if (!in_array($language, $langs)) {
+ $language = "en_EN";
+ }
+}
+elseif (isset ($_GET['lang']) and in_array($_GET['lang'], $langs)) {
+ $language = $_GET['lang'];
+}
+elseif (!is_null(HTTP_Session :: get("lang")) and in_array(HTTP_Session :: get("lang"), $langs)) {
+ $language = HTTP_Session :: get("lang");
+} else {
+ $language = "en_EN";
+}
+HTTP_Session :: set("lang", $language);
+putenv("LANG=$language");
+setlocale(LC_ALL, $language);
+bindtextdomain("page_main", "./i18n");
+bindtextdomain("navigation", "./i18n");
+bindtextdomain("userstatus_display", "./i18n");
+textdomain("page_main");
+?>
Modified: trunk/inc/navigation.php
===================================================================
--- trunk/inc/navigation.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/inc/navigation.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,9 +3,10 @@
/**
* Created on 05.01.2007
- *
- *
+ * Creates the navigation-bar
+ * @since 93 - 05.01.2007
* @author C167 <c1...@us...>
+ * @package feed-collector
*/
$hl = " class=\"highlight\"";
Added: trunk/inc/session.php
===================================================================
--- trunk/inc/session.php (rev 0)
+++ trunk/inc/session.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Created on 12.01.2007
+ * Contains the session-relatet stuff
+ * @since 100 - 12.01.2007
+ * @author C167 <c1...@us...>
+ * @package feed-collector
+ */
+require_once "HTTP/Session.php";
+$options = array (
+ 'dsn' => & $db,
+ 'table' => $session['container']['tablename'],
+ 'autooptimize' => $session['container']['autooptimize']
+);
+HTTP_Session :: setContainer('MDB2', $options);
+HTTP_Session :: start();
+HTTP_Session :: setExpire($session['time']['expire']);
+HTTP_Session :: setIdle($session['time']['idle']);
+
+if (true === HTTP_Session :: isNew()) {
+ HTTP_Session :: set("logged_in", false);
+}
+?>
Added: trunk/inc/upperBar.php
===================================================================
--- trunk/inc/upperBar.php (rev 0)
+++ trunk/inc/upperBar.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Created on 13.01.2007
+ * Contains the bar on top of the page
+ * @since 100 - 13.01.2007
+ * @author C167 <c1...@us...>
+ * @package feed-collector
+ */
+if (false === HTTP_Session :: get("logged_in", false)) {
+ $related_sites = sprintf(" <span>%s</span>\n" .
+ " <a href=\"http://www.oswd.org\" title=\"The host of this base design\">OSWD</a> |\n" .
+ " <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>\n", _("Related Sites:"));
+} else {
+ $related_sites = sprintf(" <span>%s</span>\n <a href=\"http://www.oswd.org\" title=\"The host of this base design\">OSWD</a> |\n <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
+}
+?>
Added: trunk/inc/userstatus_display.php
===================================================================
--- trunk/inc/userstatus_display.php (rev 0)
+++ trunk/inc/userstatus_display.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Created on 12.01.2007
+ * Contains the script to display the user-status
+ * @since 100 - 12.01.2007
+ * @author C167 <c1...@us...>
+ * @package feed-collector
+ */
+if (false === HTTP_Session :: get("logged_in", false)) {
+ $midHeader_title_right = sprintf(" <p>%s</p>", dgettext("userstatus_display", "You are not logged in"));
+} else {
+ if (HTTP_Session :: get("username", false) == false) {
+ $username = $user->getUsername();
+ } else {
+ $username = HTTP_Session :: get("username");
+ }
+ $midHeader_title_right = sprintf(" <p>%s %s</p>", dgettext("userstatus_display", "Hello"), $username);
+}
+?>
Modified: trunk/index.php
===================================================================
--- trunk/index.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/index.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -2,8 +2,11 @@
/**
- * Dummy Page
- * @author C167 <c1...@us...>
+ * Created on 30.08.2006
+ * Dummy page
+ * @since 56 - 17.11.2006
+ * @author c167 <c1...@us...>
+ * @package feed-collector
*/
require_once "HTTP.php";
Modified: trunk/page_add_new_feed.php
===================================================================
--- trunk/page_add_new_feed.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/page_add_new_feed.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,8 +3,7 @@
/**
* Created on 30.08.2006
- *
- * @version 1
+ * Lets a user add a new feed
* @since 56 - 17.11.2006
* @author c167 <c1...@us...>
* @package feed-collector
@@ -22,46 +21,13 @@
############
# DATABASE #
############
-require_once "MDB2.php";
-$dsn = array (
- 'phptype' => $db['type'],
- 'username' => $db['user'],
- 'password' => $db['passwd'],
- 'hostspec' => $db['host'],
- 'database' => $db['database']
-);
-$options = array (
- 'debug' => 2,
- 'result_buffering' => true,
- 'portability' => MDB2_PORTABILITY_ALL
-);
-$db = & MDB2 :: factory($dsn, $options);
-if (PEAR :: isError($db)) {
- echo $db->getMessage();
- echo "<br />";
- echo $db->getDebugInfo();
-} else {
-}
-$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+require_once "./inc/database.php";
###########
# SESSION #
###########
-require_once "HTTP/Session.php";
-$options = array (
- 'dsn' => & $db,
- 'table' => $session['container']['tablename'],
- 'autooptimize' => $session['container']['autooptimize']
-);
-HTTP_Session :: setContainer('MDB2', $options);
-HTTP_Session :: start();
-HTTP_Session :: setExpire($session['time']['expire']);
-HTTP_Session :: setIdle($session['time']['idle']);
+require_once "./inc/session.php";
-if (true === HTTP_Session :: isNew()) {
- HTTP_Session :: set("logged_in", false);
-}
-
################
# FEED-Manager #
################
@@ -80,35 +46,16 @@
$user = new User_manager($db);
if (false === HTTP_Session :: get("logged_in", false)) {
- HTTP :: redirect("./page_login.php");
+ HTTP :: redirect("./page_login.php?cameFrom=page_add_new_feed.php");
}
+$user->updateUserAction();
$page = "add_new_feed";
############
# LANGUAGE #
############
-if (true === HTTP_Session :: get("logged_in", false)) {
- $user->setUserId(HTTP_Session :: get("uid"));
- $language = $user->getUserLanguage();
- if (!in_array($language, $langs)) {
- $language = "en_EN";
- }
-}
-elseif (isset ($_GET['lang']) and in_array($_GET['lang'], $langs)) {
- $language = $_GET['lang'];
- HTTP_Session :: set("lang", $_GET['lang']);
-}
-elseif (!is_null(HTTP_Session :: get("lang")) and in_array(HTTP_Session :: get("lang"), $langs)) {
- $language = HTTP_Session :: get("lang");
-} else {
- $language = "en_EN";
-}
-putenv("LANG=$language");
-setlocale(LC_ALL, $language);
-bindtextdomain("page_main", "./i18n");
-bindtextdomain("navigation", "./i18n");
-textdomain("page_main");
+require_once "./inc/language.php";
#####################
# BUILD THE CONTENT #
@@ -122,7 +69,7 @@
$design = str_replace("<!-- title -->", $title, $design);
// related sites
-$related_sites = sprintf(" <span>%s</span>\n <a href=\"http://www.oswd.org\" title=\"The host of this design\">OSWD</a> |\n <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
+require_once "./inc/upperBar.php";
$design = str_replace("<!-- related sites -->", $related_sites, $design);
// midHeader title left
@@ -130,16 +77,7 @@
$design = str_replace("<!-- midHeader title left -->", $midHeader_title_left, $design);
// midHeader title right
-if (false === HTTP_Session :: get("logged_in", false)) {
- $midHeader_title_right = sprintf(" <p>%s</p>", _("You are not logged in"));
-} else {
- if (HTTP_Session :: get("username", false) == false) {
- $username = $user->getUsername();
- } else {
- $username = HTTP_Session :: get("username");
- }
- $midHeader_title_right = sprintf(" <p>%s %s</p>", _("Hello"), $username);
-}
+require_once "./inc/userstatus_display.php";
$design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design);
// navigation
@@ -192,8 +130,7 @@
$design = str_replace("<!-- main -->", $main, $design);
# footer
-// footer
-$footer = sprintf(" <span class=\"doNotPrint\">\n For comments or questions about this website, please\n <a href=\"mailto:c1...@us...\" title=\"the developsers email adress\">email the Webmaster</a><br />\n </span>\n\n <!-- <strong>URI »</strong> http://domain.is.invalid/prosimii/index.html -->\n • <strong>Updated »</strong> 2006-Oct-25 18:42 +1000 •");
+require_once "./inc/footer.php";
$design = str_replace("<!-- footer -->", $footer, $design);
echo $design;
Modified: trunk/page_add_tag.php
===================================================================
--- trunk/page_add_tag.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/page_add_tag.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,8 +3,7 @@
/**
* Created on 30.08.2006
- *
- * @version 1
+ * Lets a user add a tag to a feed
* @since 56 - 17.11.2006
* @author c167 <c1...@us...>
* @package feed-collector
@@ -15,43 +14,13 @@
############
# DATABASE #
############
-require_once "MDB2.php";
-$dsn = array (
- 'phptype' => $db['type'],
- 'username' => $db['user'],
- 'password' => $db['passwd'],
- 'hostspec' => $db['host'],
- 'database' => $db['database']
-);
-$options = array (
- 'debug' => 2,
- 'result_buffering' => true,
- 'portability' => MDB2_PORTABILITY_ALL
-);
-$db = & MDB2 :: factory($dsn, $options);
-if (PEAR :: isError($db)) {
+require_once "./inc/database.php";
-}
-$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
-
###########
# SESSION #
###########
-require_once "HTTP/Session.php";
-$options = array (
- 'dsn' => & $db,
- 'table' => $session['container']['tablename'],
- 'autooptimize' => $session['container']['autooptimize']
-);
-HTTP_Session :: setContainer('MDB2', $options);
-HTTP_Session :: start();
-HTTP_Session :: setExpire($session['time']['expire']);
-HTTP_Session :: setIdle($session['time']['idle']);
+require_once "./inc/session.php";
-if (true === HTTP_Session :: isNew()) {
- HTTP_Session :: set("logged_in", false);
-}
-
################
# FEED-Manager #
################
@@ -76,7 +45,7 @@
$user = new User_manager($db);
if (false === HTTP_Session :: get("logged_in", false)) {
- HTTP :: redirect("./page_login.php");
+ HTTP :: redirect("./page_login.php?cameFrom=page_add_tag.php");
}
$page = "add_tag";
@@ -84,27 +53,7 @@
############
# LANGUAGE #
############
-if (true === HTTP_Session :: get("logged_in", false)) {
- $user->setUserId(HTTP_Session :: get("uid"));
- $language = $user->getUserLanguage();
- if (!in_array($language, $langs)) {
- $language = "en_EN";
- }
-}
-elseif (isset ($_GET['lang']) and in_array($_GET['lang'], $langs)) {
- $language = $_GET['lang'];
- HTTP_Session :: set("lang", $_GET['lang']);
-}
-elseif (!is_null(HTTP_Session :: get("lang")) and in_array(HTTP_Session :: get("lang"), $langs)) {
- $language = HTTP_Session :: get("lang");
-} else {
- $language = "en_EN";
-}
-putenv("LANG=$language");
-setlocale(LC_ALL, $language);
-bindtextdomain("page_main", "./i18n");
-bindtextdomain("navigation", "./i18n");
-textdomain("page_main");
+require_once "./inc/language.php";
$main = "";
if (isset ($_POST['tag'])) {
@@ -143,7 +92,7 @@
$design = str_replace("<!-- title -->", $title, $design);
// related sites
-$related_sites = sprintf(" <span>%s</span>\n <a href=\"http://www.oswd.org\" title=\"The host of this design\">OSWD</a> |\n <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
+require_once "./inc/upperBar.php";
$design = str_replace("<!-- related sites -->", $related_sites, $design);
// midHeader title left
@@ -151,16 +100,7 @@
$design = str_replace("<!-- midHeader title left -->", $midHeader_title_left, $design);
// midHeader title right
-if (false === HTTP_Session :: get("logged_in", false)) {
- $midHeader_title_right = sprintf(" <p>%s</p>", _("You are not logged in"));
-} else {
- if(HTTP_Session :: get("username", false) == false) {
- $username = $user->getUsername();
- } else {
- $username = HTTP_Session :: get("username");
- }
- $midHeader_title_right = sprintf(" <p>%s %s</p>", _("Hello"), $username);
-}
+require_once "./inc/userstatus_display.php";
$design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design);
// navigation
@@ -171,8 +111,7 @@
$design = str_replace("<!-- main -->", $main, $design);
# footer
-// footer
-$footer = sprintf(" <span class=\"doNotPrint\">\n For comments or questions about this website, please\n <a href=\"mailto:c1...@us...\" title=\"the developsers email adress\">email the Webmaster</a><br />\n </span>\n\n <!-- <strong>URI »</strong> http://domain.is.invalid/prosimii/index.html -->\n • <strong>Updated »</strong> 2006-Oct-25 18:42 +1000 •");
+require_once "./inc/footer.php";
$design = str_replace("<!-- footer -->", $footer, $design);
echo $design;
Modified: trunk/page_login.php
===================================================================
--- trunk/page_login.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/page_login.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,8 +3,7 @@
/**
* Created on 30.08.2006
- *
- * @version 1
+ * Lets a user log in
* @since 56 - 17.11.2006
* @author c167 <c1...@us...>
* @package feed-collector
@@ -22,46 +21,13 @@
############
# DATABASE #
############
-require_once "MDB2.php";
-$dsn = array (
- 'phptype' => $db['type'],
- 'username' => $db['user'],
- 'password' => $db['passwd'],
- 'hostspec' => $db['host'],
- 'database' => $db['database']
-);
-$options = array (
- 'debug' => 2,
- 'result_buffering' => true,
- 'portability' => MDB2_PORTABILITY_ALL
-);
-$db = & MDB2 :: factory($dsn, $options);
-if (PEAR :: isError($db)) {
- /*echo $db->getMessage();
- echo "<br />";
- echo $db->getDebugInfo();*/
-}
-$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+require_once "./inc/database.php";
###########
# SESSION #
###########
-require_once "HTTP/Session.php";
-$options = array (
- 'dsn' => & $db,
- 'table' => $session['container']['tablename'],
- 'autooptimize' => $session['container']['autooptimize']
-);
-HTTP_Session :: setContainer('MDB2', $options);
-HTTP_Session :: start();
-HTTP_Session :: setExpire($session['time']['expire']);
-HTTP_Session :: setIdle($session['time']['idle']);
+require_once "./inc/session.php";
-if (true === HTTP_Session :: isNew()) {
- HTTP_Session :: set("logged_in", false);
-
-}
-
##############
# HTTP-Class #
##############
@@ -73,27 +39,7 @@
############
# LANGUAGE #
############
-if (true === HTTP_Session :: get("logged_in", false)) {
- $user->setUserId(HTTP_Session :: get("uid"));
- $language = $user->getUserLanguage();
- if (!in_array($language, $langs)) {
- $language = "en_EN";
- }
-}
-elseif (isset ($_GET['lang']) and in_array($_GET['lang'], $langs)) {
- $language = $_GET['lang'];
- HTTP_Session :: set("lang", $_GET['lang']);
-}
-elseif (!is_null(HTTP_Session :: get("lang")) and in_array(HTTP_Session :: get("lang"), $langs)) {
- $language = HTTP_Session :: get("lang");
-} else {
- $language = "en_EN";
-}
-putenv("LANG=$language");
-setlocale(LC_ALL, $language);
-bindtextdomain("page_main", "./i18n");
-bindtextdomain("navigation", "./i18n");
-textdomain("page_main");
+require_once "./inc/language.php";
################
# User-Manager #
@@ -154,7 +100,7 @@
$design = str_replace("<!-- title -->", $title, $design);
// related sites
-$related_sites = sprintf(" <span>%s</span>\n <a href=\"http://www.oswd.org\" title=\"The host of this design\">OSWD</a> |\n <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
+require_once "./inc/upperBar.php";
$design = str_replace("<!-- related sites -->", $related_sites, $design);
// midHeader title left
@@ -162,16 +108,7 @@
$design = str_replace("<!-- midHeader title left -->", $midHeader_title_left, $design);
// midHeader title right
-if (false === HTTP_Session :: get("logged_in", false)) {
- $midHeader_title_right = sprintf(" <p>%s</p>", _("You are not logged in"));
-} else {
- if (HTTP_Session :: get("username", false) == false) {
- $username = $user->getUsername();
- } else {
- $username = HTTP_Session :: get("username");
- }
- $midHeader_title_right = sprintf(" <p>%s %s</p>", _("Hello"), $username);
-}
+require_once "./inc/userstatus_display.php";
$design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design);
// navigation
@@ -182,8 +119,7 @@
$design = str_replace("<!-- main -->", $main, $design);
# footer
-// footer
-$footer = sprintf(" <span class=\"doNotPrint\">\n For comments or questions about this website, please\n <a href=\"mailto:c1...@us...\" title=\"the developsers email adress\">email the Webmaster</a><br />\n </span>\n\n <!-- <strong>URI »</strong> http://domain.is.invalid/prosimii/index.html -->\n • <strong>Updated »</strong> 2006-Oct-25 18:42 +1000 •");
+require_once "./inc/footer.php";
$design = str_replace("<!-- footer -->", $footer, $design);
echo $design;
@@ -223,8 +159,9 @@
" <td colspan=\"2\"><input type=\"submit\" value=\"%s\" name=\"submit\" /><input type=\"reset\" value=\"%s\" /></td>\n" .
" </tr>\n" .
" </table>\n" .
+ " <input type=\"hidden\" name=\"cameFrom\" value=\"%s\" />\n" .
" </form>\n" .
- " </div>\n", $_SERVER['PHP_SELF'], _("Login"), _("Username"), _("Password"), _("Submit!"), _("Reset!"));
+ " </div>\n", $_SERVER['PHP_SELF'], _("Login"), _("Username"), _("Password"), _("Submit!"), _("Reset!"), !empty($_GET['cameFrom']) ? $_GET['cameFrom'] : "");
return $form;
}
Modified: trunk/page_logout.php
===================================================================
--- trunk/page_logout.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/page_logout.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,49 +3,22 @@
/**
* Created on 29.12.2006
- *
- *
+ * Logs a user out
+ * @since 60 - 12.11.2006
* @author C167 <c1...@us...>
+ * @package feed-collector
*/
require_once "inc/config.php";
error_reporting(E_ALL);
############
# DATABASE #
############
-require_once "MDB2.php";
-$dsn = array (
- 'phptype' => $db['type'],
- 'username' => $db['user'],
- 'password' => $db['passwd'],
- 'hostspec' => $db['host'],
- 'database' => $db['database']
-);
-$options = array (
- 'debug' => 2,
- 'result_buffering' => true,
- 'portability' => MDB2_PORTABILITY_ALL
-);
-$db = & MDB2 :: factory($dsn, $options);
-if (PEAR :: isError($db)) {
- /*echo $db->getMessage();
- echo "<br />";
- echo $db->getDebugInfo();*/
-}
-$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+require_once "./inc/database.php";
###########
# SESSION #
###########
-require_once "HTTP/Session.php";
-$options = array (
- 'dsn' => & $db,
- 'table' => $session['container']['tablename'],
- 'autooptimize' => $session['container']['autooptimize']
-);
-HTTP_Session :: setContainer('MDB2', $options);
-HTTP_Session :: start();
-HTTP_Session :: setExpire($session['time']['expire']);
-HTTP_Session :: setIdle($session['time']['idle']);
+require_once "./inc/session.php";
##############
# HTTP-Class #
Modified: trunk/page_main.php
===================================================================
--- trunk/page_main.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/page_main.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -4,7 +4,6 @@
/**
* Created on 30.08.2006
* This file is called if someone wants the main page or doesn't select any page
- * @version 1
* @since 46 - 19.10.2006
* @author c167 <c1...@us...>
* @package feed-collector
@@ -15,40 +14,12 @@
############
# DATABASE #
############
-require_once "MDB2.php";
-$dsn = array (
- 'phptype' => $db['type'],
- 'username' => $db['user'],
- 'password' => $db['passwd'],
- 'hostspec' => $db['host'],
- 'database' => $db['database']
-);
-$options = array (
- 'debug' => 2,
- 'result_buffering' => true,
- 'portability' => MDB2_PORTABILITY_ALL
-);
-$db = & MDB2 :: factory($dsn, $options);
-if (PEAR :: isError($db)) {
- echo $db->getMessage();
- echo "<br />";
- echo $db->getDebugInfo();
-}
-$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+require_once "./inc/database.php";
###########
# SESSION #
###########
-require_once "HTTP/Session.php";
-$options = array (
- 'dsn' => & $db,
- 'table' => $session['container']['tablename'],
- 'autooptimize' => $session['container']['autooptimize']
-);
-HTTP_Session :: setContainer('MDB2', $options);
-HTTP_Session :: start();
-HTTP_Session :: setExpire($session['time']['expire']);
-HTTP_Session :: setIdle($session['time']['idle']);
+require_once "./inc/session.php";
#########
# FEEDS #
@@ -72,27 +43,7 @@
############
# LANGUAGE #
############
-if (true === HTTP_Session :: get("logged_in", false)) {
- $user->setUserId(HTTP_Session :: get("uid"));
- $language = $user->getUserLanguage();
- if (!in_array($language, $langs)) {
- $language = "en_EN";
- }
-}
-elseif (isset ($_GET['lang']) and in_array($_GET['lang'], $langs)) {
- $language = $_GET['lang'];
- HTTP_Session :: set("lang", $_GET['lang']);
-}
-elseif (!is_null(HTTP_Session :: get("lang")) and in_array(HTTP_Session :: get("lang"), $langs)) {
- $language = HTTP_Session :: get("lang");
-} else {
- $language = "en_EN";
-}
-putenv("LANG=$language");
-setlocale(LC_ALL, $language);
-bindtextdomain("page_main", "./i18n");
-bindtextdomain("navigation", "./i18n");
-textdomain("page_main");
+require_once "./inc/language.php";
//
// Now we're going to replace the placeholders in the template with the important content
@@ -108,13 +59,7 @@
# body
// related sites
-if (true === HTTP_Session :: get("logged_in", false)) {
- $related_sites = sprintf(" <span>%s</span>\n" .
- " <a href=\"http://www.oswd.org\" title=\"The host of this base design\">OSWD</a> |\n" .
- " <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
-} else {
- $related_sites = sprintf(" <span>%s</span>\n <a href=\"http://www.oswd.org\" title=\"The host of this base design\">OSWD</a> |\n <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
-}
+require_once "./inc/upperBar.php";
$design = str_replace("<!-- related sites -->", $related_sites, $design);
// midHeader title left
@@ -122,16 +67,7 @@
$design = str_replace("<!-- midHeader title left -->", $midHeader_title_left, $design);
// midHeader title right
-if (false === HTTP_Session :: get("logged_in", false)) {
- $midHeader_title_right = sprintf(" <p>%s</p>", _("You are not logged in"));
-} else {
- if (HTTP_Session :: get("username", false) == false) {
- $username = $user->getUsername();
- } else {
- $username = HTTP_Session :: get("username");
- }
- $midHeader_title_right = sprintf(" <p>%s %s</p>", _("Hello"), $username);
-}
+require_once "./inc/userstatus_display.php";
$design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design);
// navigation
@@ -194,8 +130,7 @@
$design = str_replace("<!-- box 4 -->", $box_4, $design);
# footer
-// footer
-$footer = " <span class=\"doNotPrint\">\n For comments or questions about this website, please\n <a href=\"mailto:c1...@us...\" title=\"the developsers email adress\">email the Webmaster</a><br />\n </span>\n\n <!-- <strong>URI »</strong> http://domain.is.invalid/prosimii/index.html -->\n • <strong>Updated »</strong> 2006-Oct-25 18:42 +1000 •";
+require_once "./inc/footer.php";
$design = str_replace("<!-- footer -->", $footer, $design);
echo $design;
Modified: trunk/page_personal.php
===================================================================
--- trunk/page_personal.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/page_personal.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,8 +3,7 @@
/**
* Created on 30.08.2006
- * This file is called if someone wants the main page or doesn't select any page
- * @version 1
+ * Display the users personal page
* @since 46 - 19.10.2006
* @author c167 <c1...@us...>
* @package feed-collector
@@ -15,26 +14,7 @@
############
# DATABASE #
############
-require_once "MDB2.php";
-$dsn = array (
- 'phptype' => $db['type'],
- 'username' => $db['user'],
- 'password' => $db['passwd'],
- 'hostspec' => $db['host'],
- 'database' => $db['database']
-);
-$options = array (
- 'debug' => 2,
- 'result_buffering' => true,
- 'portability' => MDB2_PORTABILITY_ALL
-);
-$db = & MDB2 :: factory($dsn, $options);
-if (PEAR :: isError($db)) {
- echo $db->getMessage();
- echo "<br />";
- echo $db->getDebugInfo();
-}
-$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+require_once "./inc/database.php";
########
# HTTP #
@@ -44,21 +24,8 @@
###########
# SESSION #
###########
-require_once "HTTP/Session.php";
-$options = array (
- 'dsn' => & $db,
- 'table' => $session['container']['tablename'],
- 'autooptimize' => $session['container']['autooptimize']
-);
-HTTP_Session :: setContainer('MDB2', $options);
-HTTP_Session :: start();
-HTTP_Session :: setExpire($session['time']['expire']);
-HTTP_Session :: setIdle($session['time']['idle']);
+require_once "./inc/session.php";
-if(false === HTTP_Session :: get("logged_in", false)) {
- HTTP :: redirect("./page_login.php");
-}
-
################
# Feed-Manager #
################
@@ -70,35 +37,15 @@
################
require_once "class/User_manager.php";
$user = new User_manager($db);
+$user->updateUserAction();
$page = "personal";
############
# LANGUAGE #
############
-if (true === HTTP_Session :: get("logged_in", false)) {
- $user->setUserId(HTTP_Session :: get("uid"));
- $language = $user->getUserLanguage();
- if (!in_array($language, $langs)) {
- $language = "en_EN";
- }
-}
-elseif (isset ($_GET['lang']) and in_array($_GET['lang'], $langs)) {
- $language = $_GET['lang'];
- HTTP_Session :: set("lang", $_GET['lang']);
-}
-elseif (!is_null(HTTP_Session :: get("lang")) and in_array(HTTP_Session :: get("lang"), $langs)) {
- $language = HTTP_Session :: get("lang");
-} else {
- $language = "en_EN";
-}
-putenv("LANG=$language");
-setlocale(LC_ALL, $language);
-bindtextdomain("page_main", "./i18n");
-bindtextdomain("navigation", "./i18n");
-textdomain("page_main");
+require_once "./inc/language.php";
-
//
// Now we're going to replace the placeholders in the template with the important content
//
@@ -113,7 +60,7 @@
$design = str_replace("<!-- title -->", $title, $design);
// related sites
-$related_sites = sprintf(" <span>%s</span>\n <a href=\"http://www.oswd.org\" title=\"The host of this design\">OSWD</a> |\n <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
+require_once "./inc/upperBar.php";
$design = str_replace("<!-- related sites -->", $related_sites, $design);
// midHeader title left
@@ -121,16 +68,7 @@
$design = str_replace("<!-- midHeader title left -->", $midHeader_title_left, $design);
// midHeader title right
-if (false === HTTP_Session :: get("logged_in", false)) {
- $midHeader_title_right = sprintf(" <p>%s</p>", _("You are not logged in"));
-} else {
- if(HTTP_Session :: get("username", false) == false) {
- $username = $user->getUsername();
- } else {
- $username = HTTP_Session :: get("username");
- }
- $midHeader_title_right = sprintf(" <p>%s %s</p>", _("Hello"), $username);
-}
+require_once "./inc/userstatus_display.php";
$design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design);
// navigation
@@ -179,8 +117,7 @@
$design = str_replace("<!-- main -->", $main, $design);
# footer
-// footer
-$footer = sprintf(" <span class=\"doNotPrint\">\n %s\n <a href=\"mailto:c1...@us...\" title=\"the developsers email adress\">email the Webmaster</a><br />\n </span>\n\n <!-- <strong>URI »</strong> http://domain.is.invalid/prosimii/index.html -->\n • <strong>Updated »</strong> 2006-Oct-25 18:42 +1000 •", _("For comments or questions about this website, please"));
+require_once "./inc/footer.php";
$design = str_replace("<!-- footer -->", $footer, $design);
echo $design;
@@ -193,7 +130,7 @@
$return .= sprintf(" <div class=\"feed_headline\">\n <a href=\"%s\">%s</a>\n </div>\n <ul>\n", $feed_info['site_url'], $feed_info['feed_name']);
$items = $feed->getNewestItems($col, 10);
for ($i = 0; $i < count($items); $i++) {
- $return .= sprintf(" <li><a href=\"%s\">%s</a></li>\n", $items[$i]['url'], $items[$i]['title']);
+ $return .= sprintf(" <li><a href=\"%s\">%s</a></li>\n", $items[$i]['url'], str_replace("&", "&", $items[$i]['title']));
}
$return .= " </ul>\n </div>\n";
}
Modified: trunk/page_register.php
===================================================================
--- trunk/page_register.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/page_register.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,8 +3,7 @@
/**
* Created on 30.08.2006
- *
- * @version 1
+ * Registers new users
* @since 56 - 17.11.2006
* @author c167 <c1...@us...>
* @package feed-collector
@@ -22,48 +21,13 @@
############
# DATABASE #
############
-require_once "MDB2.php";
-$dsn = array (
- 'phptype' => $db['type'],
- 'username' => $db['user'],
- 'password' => $db['passwd'],
- 'hostspec' => $db['host'],
- 'database' => $db['database']
-);
-$options = array (
- 'debug' => 2,
- 'result_buffering' => true,
- 'portability' => MDB2_PORTABILITY_ALL
-);
-$db = & MDB2 :: factory($dsn, $options);
-if (PEAR :: isError($db)) {
- echo $db->getMessage();
- echo "<br />";
- echo $db->getDebugInfo();
-} else {
-}
-$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+require_once "./inc/database.php";
###########
# SESSION #
###########
-require_once "HTTP/Session.php";
-$options = array (
- 'dsn' => & $db,
- 'table' => $session['container']['tablename'],
- 'autooptimize' => $session['container']['autooptimize']
-);
-HTTP_Session :: setContainer('MDB2', /*$session['container']['options']*/
-$options);
-HTTP_Session :: start();
-HTTP_Session :: setExpire($session['time']['expire']);
-HTTP_Session :: setIdle($session['time']['idle']);
+require_once "./inc/session.php";
-if (true === HTTP_Session :: isNew()) {
- HTTP_Session :: set("logged_in", false);
-
-}
-
################
# FEED-Manager #
################
@@ -86,29 +50,8 @@
############
# LANGUAGE #
############
-if (true === HTTP_Session :: get("logged_in", false)) {
- $user->setUserId(HTTP_Session :: get("uid"));
- $language = $user->getUserLanguage();
- if (!in_array($language, $langs)) {
- $language = "en_EN";
- }
-}
-elseif (isset ($_GET['lang']) and in_array($_GET['lang'], $langs)) {
- $language = $_GET['lang'];
- HTTP_Session :: set("lang", $_GET['lang']);
-}
-elseif (!is_null(HTTP_Session :: get("lang")) and in_array(HTTP_Session :: get("lang"), $langs)) {
- $language = HTTP_Session :: get("lang");
-} else {
- $language = "en_EN";
-}
-putenv("LANG=$language");
-setlocale(LC_ALL, $language);
-bindtextdomain("page_main", "./i18n");
-bindtextdomain("navigation", "./i18n");
-textdomain("page_main");
+require_once "./inc/language.php";
-
#####################
# BUILD THE CONTENT #
#####################
@@ -121,7 +64,7 @@
$design = str_replace("<!-- title -->", $title, $design);
// related sites
-$related_sites = sprintf(" <span>%s</span>\n <a href=\"http://www.oswd.org\" title=\"The host of this design\">OSWD</a> |\n <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
+require_once "./inc/upperBar.php";
$design = str_replace("<!-- related sites -->", $related_sites, $design);
// midHeader title left
@@ -153,8 +96,7 @@
$design = str_replace("<!-- main -->", $main, $design);
# footer
-// footer
-$footer = sprintf(" <span class=\"doNotPrint\">\n For comments or questions about this website, please\n <a href=\"mailto:c1...@us...\" title=\"the developsers email adress\">email the Webmaster</a><br />\n </span>\n\n <!-- <strong>URI »</strong> http://domain.is.invalid/prosimii/index.html -->\n • <strong>Updated »</strong> 2006-Oct-25 18:42 +1000 •");
+require_once "./inc/footer.php";
$design = str_replace("<!-- footer -->", $footer, $design);
echo $design;
Modified: trunk/page_show_all_feeds.php
===================================================================
--- trunk/page_show_all_feeds.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/page_show_all_feeds.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,8 +3,7 @@
/**
* Created on 30.08.2006
- * This file is called if someone wants the main page or doesn't select any page
- * @version 1
+ * Shows all the feeds
* @since 46 - 19.10.2006
* @author c167 <c1...@us...>
* @package feed-collector
@@ -15,40 +14,12 @@
############
# DATABASE #
############
-require_once "MDB2.php";
-$dsn = array (
- 'phptype' => $db['type'],
- 'username' => $db['user'],
- 'password' => $db['passwd'],
- 'hostspec' => $db['host'],
- 'database' => $db['database']
-);
-$options = array (
- 'debug' => 2,
- 'result_buffering' => true,
- 'portability' => MDB2_PORTABILITY_ALL
-);
-$db = & MDB2 :: factory($dsn, $options);
-if (PEAR :: isError($db)) {
- echo $db->getMessage();
- echo "<br />";
- echo $db->getDebugInfo();
-}
-$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+require_once "./inc/database.php";
###########
# SESSION #
###########
-require_once "HTTP/Session.php";
-$options = array (
- 'dsn' => & $db,
- 'table' => $session['container']['tablename'],
- 'autooptimize' => $session['container']['autooptimize']
-);
-HTTP_Session :: setContainer('MDB2', $options);
-HTTP_Session :: start();
-HTTP_Session :: setExpire($session['time']['expire']);
-HTTP_Session :: setIdle($session['time']['idle']);
+require_once "./inc/session.php";
#########
# FEEDS #
@@ -87,29 +58,8 @@
############
# LANGUAGE #
############
-if (true === HTTP_Session :: get("logged_in", false)) {
- $user->setUserId(HTTP_Session :: get("uid"));
- $language = $user->getUserLanguage();
- if (!in_array($language, $langs)) {
- $language = "en_EN";
- }
-}
-elseif (isset ($_GET['lang']) and in_array($_GET['lang'], $langs)) {
- $language = $_GET['lang'];
- HTTP_Session :: set("lang", $_GET['lang']);
-}
-elseif (!is_null(HTTP_Session :: get("lang")) and in_array(HTTP_Session :: get("lang"), $langs)) {
- $language = HTTP_Session :: get("lang");
-} else {
- $language = "en_EN";
-}
-putenv("LANG=$language");
-setlocale(LC_ALL, $language);
-bindtextdomain("page_main", "./i18n");
-bindtextdomain("navigation", "./i18n");
-textdomain("page_main");
+require_once "./inc/language.php";
-
//
// Now we're going to replace the placeholders in the template with the important content
//
@@ -124,7 +74,7 @@
# body
// related sites
-$related_sites = sprintf(" <span>%s</span>\n <a href=\"http://www.oswd.org\" title=\"The host of this base design\">OSWD</a> |\n <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
+require_once "./inc/upperBar.php";
$design = str_replace("<!-- related sites -->", $related_sites, $design);
// midHeader title left
@@ -132,16 +82,7 @@
$design = str_replace("<!-- midHeader title left -->", $midHeader_title_left, $design);
// midHeader title right
-if (false === HTTP_Session :: get("logged_in", false)) {
- $midHeader_title_right = sprintf(" <p>%s</p>", _("You are not logged in"));
-} else {
- if(HTTP_Session :: get("username", false) == false) {
- $username = $user->getUsername();
- } else {
- $username = HTTP_Session :: get("username");
- }
- $midHeader_title_right = sprintf(" <p>%s %s</p>", _("Hello"), $username);
-}
+require_once "./inc/userstatus_display.php";
$design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design);
// navigation
@@ -162,8 +103,7 @@
//$design = str_replace("<!-- page-navigation -->", $page_navigation, $design);
# footer
-// footer
-$footer = " <span class=\"doNotPrint\">\n For comments or questions about this website, please\n <a href=\"mailto:c1...@us...\" title=\"the developsers email adress\">email the Webmaster</a><br />\n </span>\n\n <!-- <strong>URI »</strong> http://domain.is.invalid/prosimii/index.html -->\n • <strong>Updated »</strong> 2006-Oct-25 18:42 +1000 •";
+require_once "./inc/footer.php";
$design = str_replace("<!-- footer -->", $footer, $design);
echo $design;
Modified: trunk/page_show_feed.php
===================================================================
--- trunk/page_show_feed.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/page_show_feed.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,8 +3,7 @@
/**
* Created on 30.08.2006
- * This file is called if someone wants the main page or doesn't select any page
- * @version 1
+ * Shows one specific feed
* @since 46 - 19.10.2006
* @author c167 <c1...@us...>
* @package feed-collector
@@ -15,40 +14,12 @@
############
# DATABASE #
############
-require_once "MDB2.php";
-$dsn = array (
- 'phptype' => $db['type'],
- 'username' => $db['user'],
- 'password' => $db['passwd'],
- 'hostspec' => $db['host'],
- 'database' => $db['database']
-);
-$options = array (
- 'debug' => 2,
- 'result_buffering' => true,
- 'portability' => MDB2_PORTABILITY_ALL
-);
-$db = & MDB2 :: factory($dsn, $options);
-if (PEAR :: isError($db)) {
- echo $db->getMessage();
- echo "<br />";
- echo $db->getDebugInfo();
-}
-$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+require_once "./inc/database.php";
###########
# SESSION #
###########
-require_once "HTTP/Session.php";
-$options = array (
- 'dsn' => & $db,
- 'table' => $session['container']['tablename'],
- 'autooptimize' => $session['container']['autooptimize']
-);
-HTTP_Session :: setContainer('MDB2', $options);
-HTTP_Session :: start();
-HTTP_Session :: setExpire($session['time']['expire']);
-HTTP_Session :: setIdle($session['time']['idle']);
+require_once "./inc/session.php";
################
# Feed-Manager #
@@ -78,29 +49,8 @@
############
# LANGUAGE #
############
-if (true === HTTP_Session :: get("logged_in", false)) {
- $user->setUserId(HTTP_Session :: get("uid"));
- $language = $user->getUserLanguage();
- if (!in_array($language, $langs)) {
- $language = "en_EN";
- }
-}
-elseif (isset ($_GET['lang']) and in_array($_GET['lang'], $langs)) {
- $language = $_GET['lang'];
- HTTP_Session :: set("lang", $_GET['lang']);
-}
-elseif (!is_null(HTTP_Session :: get("lang")) and in_array(HTTP_Session :: get("lang"), $langs)) {
- $language = HTTP_Session :: get("lang");
-} else {
- $language = "en_EN";
-}
-putenv("LANG=$language");
-setlocale(LC_ALL, $language);
-bindtextdomain("page_main", "./i18n");
-bindtextdomain("navigation", "./i18n");
-textdomain("page_main");
+require_once "./inc/language.php";
-
//
// Now we're going to replace the placeholders in the template with the important content
//
@@ -119,7 +69,7 @@
$design = str_replace("<!-- title -->", $title, $design);
// related sites
-$related_sites = sprintf(" <span>%s</span>\n <a href=\"http://www.oswd.org\" title=\"The host of this design\">OSWD</a> |\n <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
+require_once "./inc/upperBar.php";
$design = str_replace("<!-- related sites -->", $related_sites, $design);
// midHeader title left
@@ -127,16 +77,7 @@
$design = str_replace("<!-- midHeader title left -->", $midHeader_title_left, $design);
// midHeader title right
-if (false === HTTP_Session :: get("logged_in", false)) {
- $midHeader_title_right = sprintf(" <p>%s</p>", _("You are not logged in"));
-} else {
- if(HTTP_Session :: get("username", false) == false) {
- $username = $user->getUsername();
- } else {
- $username = HTTP_Session :: get("username");
- }
- $midHeader_title_right = sprintf(" <p>%s %s</p>", _("Hello"), $username);
-}
+require_once "./inc/userstatus_display.php";
$design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design);
// navigation
@@ -174,8 +115,7 @@
$design = str_replace("<!-- rightSideBar -->", $rightSideBar, $design);
# footer
-// footer
-$footer = sprintf(" <span class=\"doNotPrint\">\n %s\n <a href=\"mailto:c1...@us...\" title=\"the developsers email adress\">email the Webmaster</a><br />\n </span>\n\n <!-- <strong>URI »</strong> http://domain.is.invalid/prosimii/index.html -->\n • <strong>Updated »</strong> 2006-Oct-25 18:42 +1000 •", _("For comments or questions about this website, please"));
+require_once "./inc/footer.php";
$design = str_replace("<!-- footer -->", $footer, $design);
echo $design;
Modified: trunk/page_show_feed_tag.php
===================================================================
--- trunk/page_show_feed_tag.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/page_show_feed_tag.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -3,7 +3,7 @@
/**
* Created on 30.08.2006
- *
+ * Shows the feeds that have a specific tag
* @author c167 <c1...@us...>
* @package feed-collector
*/
@@ -13,42 +13,12 @@
############
# DATABASE #
############
-require_once "MDB2.php";
-$dsn = array (
- 'phptype' => $db['type'],
- 'username' => $db['user'],
- 'password' => $db['passwd'],
- 'hostspec' => $db['host'],
- 'database' => $db['database']
-);
-$options = array (
- 'debug' => 2,
- 'result_buffering' => true,
- 'portability' => MDB2_PORTABILITY_ALL
-);
-$db = & MDB2 :: factory($dsn, $options);
-if (PEAR :: isError($db)) {
- echo $db->getMessage();
- echo "<br />";if (isset ($_POST['tag'])) {
- $tag_manager->addTag($_POST['tag'], HTTP_Session :: get("username"), $_GET['feed']);
-}
- echo $db->getDebugInfo();
-}
-$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+require_once "./inc/database.php";
###########
# SESSION #
###########
-require_once "HTTP/Session.php";
-$options = array (
- 'dsn' => & $db,
- 'table' => $session['container']['tablename'],
- 'autooptimize' => $session['container']['autooptimize']
-);
-HTTP_Session :: setContainer('MDB2', $options);
-HTTP_Session :: start();
-HTTP_Session :: setExpire($session['time']['expire']);
-HTTP_Session :: setIdle($session['time']['idle']);
+require_once "./inc/session.php";
################
# Feed-Manager #
@@ -78,27 +48,7 @@
############
# LANGUAGE #
############
-if (true === HTTP_Session :: get("logged_in", false)) {
- $user->setUserId(HTTP_Session :: get("uid"));
- $language = $user->getUserLanguage();
- if (!in_array($language, $langs)) {
- $language = "en_EN";
- }
-}
-elseif (isset ($_GET['lang']) and in_array($_GET['lang'], $langs)) {
- $language = $_GET['lang'];
- HTTP_Session :: set("lang", $_GET['lang']);
-}
-elseif (!is_null(HTTP_Session :: get("lang")) and in_array(HTTP_Session :: get("lang"), $langs)) {
- $language = HTTP_Session :: get("lang");
-} else {
- $language = "en_EN";
-}
-putenv("LANG=$language");
-setlocale(LC_ALL, $language);
-bindtextdomain("page_main", "./i18n");
-bindtextdomain("navigation", "./i18n");
-textdomain("page_main");
+require_once "./inc/language.php";
// Now we're going to replace the placeholders in the template with the important content
//
@@ -119,7 +69,7 @@
$design = str_replace("<!-- title -->", $title, $design);
// related sites
-$related_sites = sprintf(" <span>%s</span>\n <a href=\"http://www.oswd.org\" title=\"The host of this design\">OSWD</a> |\n <a href=\"http://www.oswd.org/userinfo.phtml?user=haran\" title=\"Other designs by haran\">haran’s Designs</a>", _("Related Sites:"));
+require_once "./inc/upperBar.php";
$design = str_replace("<!-- related sites -->", $related_sites, $design);
// midHeader title left
@@ -127,16 +77,7 @@
$design = str_replace("<!-- midHeader title left -->", $midHeader_title_left, $design);
// midHeader title right
-if (false === HTTP_Session :: get("logged_in", false)) {
- $midHeader_title_right = sprintf(" <p>%s</p>", _("You are not logged in"));
-} else {
- if(HTTP_Session :: get("username", false) == false) {
- $username = $user->getUsername();
- } else {
- $username = HTTP_Session :: get("username");
- }
- $midHeader_title_right = sprintf(" <p>%s %s</p>", _("Hello"), $username);
-}
+require_once "./inc/userstatus_display.php";
$design = str_replace("<!-- midHeader title right -->", $midHeader_title_right, $design);
// navigation
@@ -152,8 +93,7 @@
$design = str_replace("<!-- rightSideBar -->", $form, $design);
# footer
-// footer
-$footer = sprintf(" <span class=\"doNotPrint\">\n %s\n <a href=\"mailto:c1...@us...\" title=\"the developsers email adress\">email the Webmaster</a><br />\n </span>\n\n <!-- <strong>URI »</strong> http://domain.is.invalid/prosimii/index.html -->\n • <strong>Updated »</strong> 2006-Oct-25 18:42 +1000 •", _("For comments or questions about this website, please"));
+require_once "./inc/footer.php";
$design = str_replace("<!-- footer -->", $footer, $design);
echo $design;
Modified: trunk/statistics.php
===================================================================
--- trunk/statistics.php 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/statistics.php 2007-01-12 23:46:14 UTC (rev 100)
@@ -5,13 +5,13 @@
* This file is the main-control for the statistics.
* It is optional, so there is no need to make it work ;)
*/
+echo date("d.m.y H:m:s", 1168190812);
require_once "MDB2.php";
require_once "Log.php"; // Logger
// some other stuff
require_once "inc/config.php";
-require_once "inc/definitions.php";
$conf = array (
'error_prepend' => "<tt>",
'error_append' => "</tt>",
@@ -87,4 +87,5 @@
}
echo $return;
echo "<br />";
+
?>
\ No newline at end of file
Modified: trunk/styles/default/header-screen.css
===================================================================
--- trunk/styles/default/header-screen.css 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/styles/default/header-screen.css 2007-01-12 23:46:14 UTC (rev 100)
@@ -14,6 +14,7 @@
padding: 0.5ex 10px;
}
+
.superHeader span {
color: rgb(195, 196, 210);
background-color: transparent;
Modified: trunk/styles/default/page_personal-screen.css
===================================================================
--- trunk/styles/default/page_personal-screen.css 2007-01-10 22:12:47 UTC (rev 99)
+++ trunk/styles/default/page_personal-screen.css 2007-01-12 23:46:14 UTC (rev 100)
@@ -18,7 +18,7 @@
border-right: 1px solid rgb(204, 204, 204);
}
-.column2 { /* Renders the column dividers */
+.column2 { /* Renders the column dividers *//*
border-left: 1px solid rgb(204, 204, 204);
border-right: 1px solid rgb(204, 204, 204);
}
Modified: trunk/update_feeds.php
===================================================================
--- trunk/update_feeds.php 2007-01...
[truncated message content] |