[pLog-svn] r1707 - in plog/branches/plog-1.1-ben/class/dao: .
customfields
ork at devel.plogworld.net
ork at devel.plogworld.net
Mon Apr 4 17:42:19 GMT 2005
Author: ork
Date: 2005-04-04 17:42:19 +0000 (Mon, 04 Apr 2005)
New Revision: 1707
Modified:
plog/branches/plog-1.1-ben/class/dao/article.class.php
plog/branches/plog-1.1-ben/class/dao/articles.class.php
plog/branches/plog-1.1-ben/class/dao/blogs.class.php
plog/branches/plog-1.1-ben/class/dao/customfields/customfieldcheckboxvalue.class.php
plog/branches/plog-1.1-ben/class/dao/customfields/customfielddatevalue.class.php
plog/branches/plog-1.1-ben/class/dao/model.class.php
plog/branches/plog-1.1-ben/class/dao/mylinkscategory.class.php
plog/branches/plog-1.1-ben/class/dao/referer.class.php
plog/branches/plog-1.1-ben/class/dao/usercomment.class.php
Log:
reorganized includes
Modified: plog/branches/plog-1.1-ben/class/dao/article.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/article.class.php 2005-04-04 17:37:52 UTC (rev 1706)
+++ plog/branches/plog-1.1-ben/class/dao/article.class.php 2005-04-04 17:42:19 UTC (rev 1707)
@@ -2,7 +2,6 @@
include_once( PLOG_CLASS_PATH.'class/dao/articles.class.php' );
include_once( PLOG_CLASS_PATH.'class/object/object.class.php' );
- include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
include_once( PLOG_CLASS_PATH.'class/dao/userinfo.class.php' );
include_once( PLOG_CLASS_PATH.'class/dao/bloginfo.class.php' );
include_once( PLOG_CLASS_PATH.'class/dao/articlecategory.class.php' );
@@ -67,6 +66,8 @@
*/
function Article( $topic, $text, $categories, $user, $blog, $status, $numReads, $properties = Array(), $slug = "", $id = -1 )
{
+ include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
+
$this->_topic = $topic;
$this->_text = $text;
$this->_categoryIds = $categories;
@@ -574,6 +575,8 @@
*/
function setDate( $newDate )
{
+ include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
+
$this->_date = $newDate;
$this->_timestamp = new Timestamp( $newDate );
Modified: plog/branches/plog-1.1-ben/class/dao/articles.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/articles.class.php 2005-04-04 17:37:52 UTC (rev 1706)
+++ plog/branches/plog-1.1-ben/class/dao/articles.class.php 2005-04-04 17:42:19 UTC (rev 1707)
@@ -8,7 +8,6 @@
include_once( PLOG_CLASS_PATH.'class/dao/articlecommentstatus.class.php' );
include_once( PLOG_CLASS_PATH.'class/dao/users.class.php' );
include_once( PLOG_CLASS_PATH.'class/dao/trackbacks.class.php' );
- include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
include_once( PLOG_CLASS_PATH.'class/config/config.class.php' );
include_once( PLOG_CLASS_PATH.'class/dao/blogs.class.php' );
include_once( PLOG_CLASS_PATH.'class/data/textfilter.class.php' );
@@ -41,7 +40,7 @@
{
$this->Model();
$this->categories = new ArticleCategories();
- $this->comments = new ArticleComments();
+ $this->comments = new ArticleComments();
$this->trackbacks = new Trackbacks();
$this->users = new Users();
$this->blogs = new Blogs();
@@ -180,6 +179,8 @@
*/
function getBlogNextArticle( $article )
{
+ include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
+
// we need to keep the timestamp in mind
$date = $article->getDateObject();
$articleCorrectedDate = Timestamp::getDateWithOffset( $article->getDate(), -($article->getTimeOffset()));
@@ -201,6 +202,8 @@
*/
function getBlogPrevArticle( $article )
{
+ include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
+
// we need to keep the timestamp in mind
$date = $article->getDateObject();
$articleCorrectedDate = Timestamp::getDateWithOffset( $article->getDate(), -($article->getTimeOffset()));
@@ -340,6 +343,7 @@
function getBlogArticles( $blogid, $date = -1, $amount = -1, $categoryId = 0, $status = 0, $userId = 0,
$maxDate = 0, $searchTerms = "", $page = -1 )
{
+ // $this->log->info("getBlogArticles $blogid, $date, $amount, $categoryId, $status, $userId, $maxDate, $searchTerms, $page");
// build the query
// the query gets quite complicated to build because we have to take care of plenty
// of conditions, such as the maximum date, the amount, the category,
@@ -547,6 +551,7 @@
*/
function getNumberPostsPerDay( $blogId, $year = null , $month = null )
{
+ include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
// if month and/or year are empty, get the current ones
if( $year == null ) {
$t = new Timestamp();
@@ -758,6 +763,8 @@
*/
function updateArticle( $article )
{
+ include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
+
// we have to build up the query, which will be pretty long...
$articleDate = Timestamp::getDateWithOffset( $article->getDate(), -($article->getTimeOffset()));
$filter = new Textfilter();
@@ -1054,6 +1061,8 @@
*/
function _fillArticleInformation( $query_result, $includeHiddenFields = true )
{
+ include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
+
$id = $query_result['id'];
if( isset($this->cache[$id])) {
return($this->cache[$id]);
Modified: plog/branches/plog-1.1-ben/class/dao/blogs.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/blogs.class.php 2005-04-04 17:37:52 UTC (rev 1706)
+++ plog/branches/plog-1.1-ben/class/dao/blogs.class.php 2005-04-04 17:42:19 UTC (rev 1707)
@@ -1,16 +1,8 @@
<?php
include_once( PLOG_CLASS_PATH."class/dao/model.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/bloginfo.class.php" );
include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
- include_once( PLOG_CLASS_PATH."class/net/xmlrpcclient.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/mylinks.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/mylinkscategories.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/bayesianfilterinfos.class.php" );
include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
- include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
include_once( PLOG_CLASS_PATH."class/file/file.class.php" );
include_once( PLOG_CLASS_PATH."class/dao/blogstatus.class.php" );
@@ -32,7 +24,9 @@
{
$query = "SELECT * FROM ".$this->getPrefix()."blogs WHERE id = '".Db::qstr($blogId)."'";
- return $this->_getBlogInfoFromQuery( $query, $extendedInfo );
+ $blogInfo = $this->_getBlogInfoFromQuery( $query, $extendedInfo );
+
+ return $blogInfo;
}
/**
@@ -78,6 +72,10 @@
*/
function _fillBlogInformation( $query_result, $extended = false )
{
+ // source class
+ include_once( PLOG_CLASS_PATH."class/dao/bloginfo.class.php" );
+
+ // create new BlogInfo
$blogInfo = new BlogInfo( stripslashes($query_result["blog"]),
$query_result["owner_id"],
stripslashes($query_result["about"]),
@@ -274,6 +272,10 @@
*/
function updateBlog( $blogId, $blogInfo )
{
+ // source classes
+ include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+
+ // include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
$query = "UPDATE ".$this->getPrefix()."blogs SET
blog = '".Db::qstr($blogInfo->getBlog()).
"', about = '".Db::qstr($blogInfo->getAbout()).
@@ -312,6 +314,9 @@
*/
function updateNotify( $blogInfo )
{
+ // source classes
+ include_once( PLOG_CLASS_PATH."class/net/xmlrpcclient.class.php" );
+
// if this feature is not enabled, we quit
$config =& Config::getConfig();
if( !$config->getValue( "xmlrpc_ping_enabled" ))
@@ -353,6 +358,10 @@
*/
function addBlog( &$blog )
{
+ // source classes
+ include_once( PLOG_CLASS_PATH."class/dao/bayesianfilterinfos.class.php" );
+ include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+
$blogSettings = $blog->getSettings();
if( !$blogSettings )
$blogSettings = new BlogSettings();
@@ -458,6 +467,12 @@
*/
function deleteBlog( $blogId )
{
+ // source classes
+ include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
+ include_once( PLOG_CLASS_PATH."class/dao/mylinks.class.php" );
+ include_once( PLOG_CLASS_PATH."class/dao/mylinkscategories.class.php" );
+ include_once( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
+
// first of all, delete the posts
$articles = new Articles();
$articles->deleteBlogPosts( $blogId );
Modified: plog/branches/plog-1.1-ben/class/dao/customfields/customfieldcheckboxvalue.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/customfields/customfieldcheckboxvalue.class.php 2005-04-04 17:37:52 UTC (rev 1706)
+++ plog/branches/plog-1.1-ben/class/dao/customfields/customfieldcheckboxvalue.class.php 2005-04-04 17:42:19 UTC (rev 1707)
@@ -1,7 +1,6 @@
<?php
include_once( PLOG_CLASS_PATH."class/dao/customfields/customfieldvalue.class.php" );
- include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
/**
* offers methods for dealing with checkboxes
@@ -32,4 +31,4 @@
return( $this->getValue() == "1" );
}
}
-?>
\ No newline at end of file
+?>
Modified: plog/branches/plog-1.1-ben/class/dao/customfields/customfielddatevalue.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/customfields/customfielddatevalue.class.php 2005-04-04 17:37:52 UTC (rev 1706)
+++ plog/branches/plog-1.1-ben/class/dao/customfields/customfielddatevalue.class.php 2005-04-04 17:42:19 UTC (rev 1707)
@@ -1,7 +1,6 @@
<?php
include_once( PLOG_CLASS_PATH."class/dao/customfields/customfieldvalue.class.php" );
- include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
/**
* offers methods for dealing with custom fields that represent dates
@@ -42,6 +41,8 @@
*/
function setValue( $value )
{
+ include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+
$this->_timestamp = new Timestamp();
$dateTimeParts = explode(" ", $value );
$dateParts = explode( "/", $dateTimeParts[0] );
@@ -80,8 +81,10 @@
*/
function getDefaultValue()
{
+ include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+
return( new Timestamp());
}
}
-?>
\ No newline at end of file
+?>
Modified: plog/branches/plog-1.1-ben/class/dao/model.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/model.class.php 2005-04-04 17:37:52 UTC (rev 1706)
+++ plog/branches/plog-1.1-ben/class/dao/model.class.php 2005-04-04 17:42:19 UTC (rev 1707)
@@ -30,8 +30,6 @@
*/
include_once( PLOG_CLASS_PATH."class/object/object.class.php" );
- include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
- include_once( PLOG_CLASS_PATH."class/database/db.class.php" );
/**
* default database prefix, if none other specified
@@ -70,6 +68,8 @@
*/
function Model()
{
+ include_once( PLOG_CLASS_PATH."class/database/db.class.php" );
+
$this->Object();
$this->_db =& Db::getDb();
@@ -102,6 +102,8 @@
// if the query generated an error, write a message to the sql error log file
if( !$result ) {
+ include_once( PLOG_CLASS_PATH."class/logger/loggermanager.class.php" );
+
$log =& LoggerManager::getLogger( "sqlerr" );
$error = $this->DbError();
$log->error( "The following query = \n{$query}\ngenerated the following error message = \n{$error}" );
Modified: plog/branches/plog-1.1-ben/class/dao/mylinkscategory.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/mylinkscategory.class.php 2005-04-04 17:37:52 UTC (rev 1706)
+++ plog/branches/plog-1.1-ben/class/dao/mylinkscategory.class.php 2005-04-04 17:42:19 UTC (rev 1707)
@@ -1,7 +1,6 @@
<?php
include_once( PLOG_CLASS_PATH."class/database/dbobject.class.php" );
- include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
/**
* \ingroup DAO
@@ -28,6 +27,8 @@
*/
function MyLinksCategory( $name, $blogId, $numLinks = 0, $properties = Array(), $id = -1 )
{
+ include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+
$this->DbObject();
$this->_name = $name;
Modified: plog/branches/plog-1.1-ben/class/dao/referer.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/referer.class.php 2005-04-04 17:37:52 UTC (rev 1706)
+++ plog/branches/plog-1.1-ben/class/dao/referer.class.php 2005-04-04 17:42:19 UTC (rev 1707)
@@ -1,7 +1,6 @@
<?php
include_once( PLOG_CLASS_PATH."class/database/dbobject.class.php" );
- include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
/**
* \ingroup DAO
@@ -32,6 +31,8 @@
*/
function Referer( $url, $articleId, $blogId, $date, $count = 0, $id = 0 )
{
+ include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+
$this->DbObject();
$this->_url = $url;
$this->_articleId = $articleId;
Modified: plog/branches/plog-1.1-ben/class/dao/usercomment.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/usercomment.class.php 2005-04-04 17:37:52 UTC (rev 1706)
+++ plog/branches/plog-1.1-ben/class/dao/usercomment.class.php 2005-04-04 17:42:19 UTC (rev 1707)
@@ -1,7 +1,6 @@
<?php
include_once( PLOG_CLASS_PATH."class/database/dbobject.class.php" );
- include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
include_once( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
include_once( PLOG_CLASS_PATH."class/dao/article.class.php" );
@@ -108,6 +107,9 @@
$this->_status = $status;
if( $date == null ) {
+ // source necessary source
+ include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+
$t = new Timestamp();
$date = $t->getTimestamp();
}
@@ -273,6 +275,9 @@
*/
function setDate( $newdate )
{
+ // source necessary source
+ include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+
$this->_date = $newdate;
// update the Timestamp object so that we can have more information
@@ -286,7 +291,7 @@
* @preturn A Timestamp object representing the date.
*/
function getDateObject()
- {
+ {
return $this->_timeStamp;
}
More information about the pLog-svn
mailing list