NewsNewsFeaturesDownloadsDevelopmentSupportForumDocumentsAbout Us

BlogInfo 類別 參考文件
[DAO]

類別BlogInfo的繼承圖:

DbObject Object 全部成員列表

公開方法(Public Methods)

 BlogInfo ($blog, $owner, $about, $settings, $id=-1)
 getBlog ()
 getOwner ()
 getAbout ()
 getValue ($value)
 setValue ($key, $value)
 addProperties ($properties)
 setProperties ($properties)
 getCreateDateObject ()
 getUpdateDateObject ()
 getTotalPosts ()
 getTotalComments ()
 getTotalTrackbacks ()
 getViewedTotal ()
 getOwnerInfo ()
 getId ()
 getTemplate ()
 setTemplate ($template)
 getBlogRequestGenerator ()
 getTemplateSet ()
 setTemplateSet ($templateSet)
getLocale ()
 setLocale ($locale)
 getStatus ()
 setStatus ($status)
 getResourcesQuota ()
 setResourcesQuota ($quota)
 setMangledBlog ($mangledBlog)
 getMangledBlog ()

公開屬性

 $_blog
 $_owner
 $_about
 $_settings
 $_id
 $_createDate
 $_updateDate
 $_totalPosts
 $_totalComments
 $_totalTrackbacks
 $_viewedTotal
 $_ownerInfo
 $_usersInfo
 $_createTimestamp
 $_updateTimestamp
 $_mangledBlog
 $_templateSet
 $_locale
 $_status

私有方法(Private Methods)

 getSettings ()
 getUsersInfo ()
 setBlog ($blog)
 setOwner ($owner)
 setAbout ($about)
 setSettings ($settings)
 setCreateDate ($newCreateDate)
 setUpdateDate ($newUpdateDate)
 setTotalPosts ($newTotalPosts)
 setViewedTotal ($newViewedTotal)
 setOwnerInfo ($newOwnerInfo)
 setUsersInfo ($newUsersInfo)
 setId ($id)
 __sleep ()

詳細描述

This is the representation of a blog. It contains all the information we need to know, This is the representation of a blog. It contains all the information we need to know, such as the name of the blog, the owner, description, etc.

定義在 bloginfo.class.php 檔案之第 18 行.


建構子與解構子說明文件

BlogInfo::BlogInfo blog,
owner,
about,
settings,
id = -1
 

定義在 bloginfo.class.php 檔案之第 49 行.

參考 getBlog(), 及 setBlog().

00050         {
00051             $this->setBlog( $blog );
00052             $this->_owner = $owner;
00053             $this->_about = $about;
00054             $this->_settings = $settings;
00055             if( $this->_settings == "" )
00056                 $this->_settings = new BlogSettings();
00057 
00058             $this->_id = $id;
00059 
00060             $this->_createDate = "";
00061             $this->_updateDate = "";
00062             $this->_totalPosts = 0;
00063             $this->_viewedTotal = 0;
00064             $this->_usersInfo = array();
00065             $this->_createTimestamp = "";
00066             $this->_updateTimestamp = "";
00067 
00068             // no template set loaded
00069             $this->_templateSet = null;
00070 
00071             // default status is active
00072             $this->_status = BLOG_STATUS_ACTIVE;
00073 
00074             // values that are loaded on demand
00075             $this->_updateTimestamp = null;
00076             $this->_viewedTotal = null;
00077             $this->_totalPosts = null;
00078             $this->_createTimestamp = null;
00079             $this->_ownerInfo = null;
00080             
00081             $this->_mangledBlog = Textfilter::urlize( $this->getBlog());
00082         }


函式成員說明文件

BlogInfo::__sleep  )  [private]
 

Special method used for serialization where we avoid saving the Locale object to the session, which makes session size increase almost to 70kb in some situations! Instead of telling php not to serialize "_locale", we just set the reference to null and tell php to save everything. The Locale will need to be loaded later on but that's just fine.

定義在 bloginfo.class.php 檔案之第 549 行.

00550         {
00551             $this->_locale = null;
00552             return( array_keys( get_object_vars( $this )));
00553         }

BlogInfo::addProperties properties  ) 
 

implemented from DbObject. Merges a list of properties with the current settings

參數:
properties 

依據DbObject重新實作.

定義在 bloginfo.class.php 檔案之第 154 行.

參考 setProperties().

00155         {
00156             return $this->setProperties( $properties );
00157         }

BlogInfo::getAbout  ) 
 

Returns a longer and descriptive text about this blog. It can also be empty since it is configurable from within the "Blog Settings" in the administration interface.

傳回值:
A string containing the more descriptive text about the journal.

定義在 bloginfo.class.php 檔案之第 111 行.

00112         {
00113             return $this->_about;
00114         }

BlogInfo::getBlog  ) 
 

Returns the short name of the blog.

傳回值:
A string with the short name of the blog.

定義在 bloginfo.class.php 檔案之第 89 行.

被參考於 BlogInfo(), 及 getMangledBlog().

00090         {
00091             return $this->_blog;
00092         }

BlogInfo::getBlogRequestGenerator  ) 
 

this method is some kind of a shortcut for a very common operation: obtaining the correct RequestGenerator object so that we can generate urls based on the information from this blog. This is very handy for example in the summary page where we have to generate lots of different urls for lots of different blogs.

傳回值:
A RequestGenerator object

定義在 bloginfo.class.php 檔案之第 416 行.

00417         {
00418             return RequestGenerator::getRequestGenerator( $this );
00419         }

BlogInfo::getCreateDateObject  ) 
 

定義在 bloginfo.class.php 檔案之第 177 行.

參考 $blogs, getId(), 及 setCreateDate().

00178         {
00179             // if it hasn't been loaded yet...
00180             if( $this->_createTimestamp == null ) {
00181                 $blogs = new Blogs();
00182                 $this->setCreateDate( $blogs->getBlogCreateDate( $this->getId()));
00183             }
00184 
00185             return $this->_createTimestamp;
00186         }

BlogInfo::getId  ) 
 

Returns the identifier of this blog.

傳回值:
An integer value with the identifier of this blog.

定義在 bloginfo.class.php 檔案之第 282 行.

被參考於 getCreateDateObject(), getTemplateSet(), getTotalComments(), getTotalPosts(), getTotalTrackbacks(), getUpdateDateObject(), getUsersInfo(), 及 getViewedTotal().

00283         {
00284             return $this->_id;
00285         }

& BlogInfo::getLocale  ) 
 

returns the right locale object for the blog

參數:
a Locale object

定義在 bloginfo.class.php 檔案之第 462 行.

參考 Locales::getLocale().

00463         {
00464             if( $this->_locale == null ) {
00465                 include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
00466                 $this->_locale =& Locales::getLocale( $this->_settings->getValue( "locale" ), "en_UK" );
00467             }
00468 
00469             return $this->_locale;
00470         }

BlogInfo::getMangledBlog  ) 
 

定義在 bloginfo.class.php 檔案之第 560 行.

參考 getBlog().

00561         {
00562             // fill in the field if it hasn't been filled yet
00563             if( $this->_mangledBlog === null )
00564                 $this->_mangledBlog = Textfilter::urlize( $this->getBlog());
00565                 
00566             return( $this->_mangledBlog );   
00567         }

BlogInfo::getOwner  ) 
 

Returns the identifier of the user who owns this journal.

傳回值:
An integer value representing the identifier of the user who owns this blog.

定義在 bloginfo.class.php 檔案之第 100 行.

00101         {
00102             return $this->_owner;
00103         }

BlogInfo::getOwnerInfo  ) 
 

Gets information about the owner of this blog

傳回值:
return a UserInfo object which contains much more info about the owner of the blog

定義在 bloginfo.class.php 檔案之第 252 行.

參考 $users, 及 setOwnerInfo().

00253         {
00254             if( $this->_ownerInfo == null ) {
00255                 $users = new Users();
00256                 $ownerInfo = $users->getUserInfoFromId( $this->_owner );
00257                 $this->setOwnerInfo( $ownerInfo );
00258             }
00259 
00260             return $this->_ownerInfo;
00261         }

BlogInfo::getResourcesQuota  ) 
 

returns the quota for this blog, or the value of the global quota for blogs in case this blog has no quota assigned

傳回值:
the resources quota

定義在 bloginfo.class.php 檔案之第 515 行.

參考 $config, 及 Config::getConfig().

00516         {
00517             $quota = $this->_settings->getValue( "resources_quota" );
00518 
00519             // if there is no quota for this blog, then fetch it from the global
00520             // settings
00521             if( $quota == "" ) {
00522                 $config =& Config::getConfig();
00523                 $quota = $config->getValue( "resources_quota" );
00524             }
00525 
00526             return $quota;
00527         }

BlogInfo::getSettings  )  [private]
 

Returns a BlogSettings object with information about the settings of the journal.

定義在 bloginfo.class.php 檔案之第 120 行.

00121         {
00122             return $this->_settings;
00123         }

BlogInfo::getStatus  ) 
 

returns the status of the blog

傳回值:
the current status of the blog

定義在 bloginfo.class.php 檔案之第 491 行.

00492         {
00493             return $this->_status;
00494         }

BlogInfo::getTemplate  ) 
 

returns the name of the template used by this blog

參數:
the name of the template set used by this blog

定義在 bloginfo.class.php 檔案之第 386 行.

被參考於 getTemplateSet().

00387         {
00388             return $this->_settings->getValue( "template");
00389         }

BlogInfo::getTemplateSet  ) 
 

returns a TemplateSet object with the information about the template used by the blog

傳回值:
a TemplateSet object

定義在 bloginfo.class.php 檔案之第 427 行.

參考 getId(), 及 getTemplate().

00428         {
00429             // since including these files is quite a costly operation, let's do it only
00430             // whenever we have to instead of always and always always... :)
00431             if( $this->_templateSet == null ) {
00432                 include_once( PLOG_CLASS_PATH."class/template/templatesets/templatesets.class.php" );
00433                 $ts = new TemplateSets();
00434                 $this->_templateSet = $ts->getTemplateSet( $this->getTemplate(), $this->getId());
00435                 if( $this->_templateSet == null ) {
00436                     // what if the admin removes the current template set used by this blog???
00437                     $this->_templateSet = $ts->getDefaultTemplateSet();
00438                 }
00439             }
00440 
00441             return $this->_templateSet;
00442         }

BlogInfo::getTotalComments  ) 
 

定義在 bloginfo.class.php 檔案之第 214 行.

參考 $blogs, 及 getId().

00215         {
00216             if( $this->_totalComments == null ) {
00217                 $blogs = new Blogs();
00218                 $this->_totalComments = $blogs->getBlogTotalComments( $this->getId());
00219             }
00220 
00221             return $this->_totalComments;
00222         }

BlogInfo::getTotalPosts  ) 
 

定義在 bloginfo.class.php 檔案之第 202 行.

參考 $blogs, 及 getId().

00203         {
00204             if( $this->_totalPosts == null ) {
00205                 $blogs = new Blogs();
00206                 $this->_totalPosts = $blogs->getBlogTotalPosts( $this->getId());
00207             }
00208 
00209             return $this->_totalPosts;
00210         }

BlogInfo::getTotalTrackbacks  ) 
 

定義在 bloginfo.class.php 檔案之第 226 行.

參考 $blogs, 及 getId().

00227         {
00228             if( $this->_totalTrackbacks == null ) {
00229                 $blogs = new Blogs();
00230                 $this->_totalTrackbacks = $blogs->getBlogTotalTrackbacks( $this->getId());
00231             }
00232 
00233             return $this->_totalTrackbacks;
00234         }

BlogInfo::getUpdateDateObject  ) 
 

定義在 bloginfo.class.php 檔案之第 190 行.

參考 $blogs, getId(), 及 setUpdateDate().

00191         {
00192             if( $this->_updateTimestamp == null ) {
00193                 $blogs = new Blogs();
00194                 $this->setUpdateDate( $blogs->getBlogUpdateDate( $this->getId()));
00195             }
00196 
00197             return $this->_updateTimestamp;
00198         }

BlogInfo::getUsersInfo  )  [private]
 

定義在 bloginfo.class.php 檔案之第 266 行.

參考 getId(), 及 setUsersInfo().

00267         {
00268             if( $this->_usersInfo == null ) {
00269                 $userpermissions = new UserPermissions();
00270                 $blogUsers = $userpermissions->getBlogUsers( $this->getId());
00271                 $this->setUsersInfo( $blogUsers );
00272             }
00273 
00274             return $this->_usersInfo;
00275         }

BlogInfo::getValue value  ) 
 

returns a key from the blog settings

依據DbObject重新實作.

定義在 bloginfo.class.php 檔案之第 128 行.

00129         {
00130             if( !$this->_settings )
00131                 return "";
00132 
00133             return $this->_settings->getValue( $value );
00134         }

BlogInfo::getViewedTotal  ) 
 

定義在 bloginfo.class.php 檔案之第 238 行.

參考 $blogs, 及 getId().

00239         {
00240             if( $this->_viewedTotal == null ) {
00241                 $blogs = new Blogs();
00242                 $this->_viewedTotal = $blogs->getBlogViewedTotal( $this->getId());
00243             }
00244 
00245             return $this->_viewedTotal;
00246         }

BlogInfo::setAbout about  )  [private]
 

定義在 bloginfo.class.php 檔案之第 308 行.

00309         {
00310             $this->_about = $about;
00311         }

BlogInfo::setBlog blog  )  [private]
 

定義在 bloginfo.class.php 檔案之第 290 行.

參考 $tf.

被參考於 BlogInfo().

00291         {
00292             $tf = new Textfilter();
00293             $this->_blog = $tf->filterAllHTML($blog);
00294         }

BlogInfo::setCreateDate newCreateDate  )  [private]
 

定義在 bloginfo.class.php 檔案之第 324 行.

被參考於 getCreateDateObject().

00325         {
00326             $this->_createDate = $newCreateDate;
00327 
00328             $this->_createTimestamp = new Timestamp( $newCreateDate );
00329         }

BlogInfo::setId id  )  [private]
 

定義在 bloginfo.class.php 檔案之第 376 行.

00377         {
00378             $this->_id = $id;
00379         }

BlogInfo::setLocale locale  ) 
 

sets the new locale for the blog

參數:
a valid Locale object
傳回值:
Always true

定義在 bloginfo.class.php 檔案之第 478 行.

00479         {
00480             $this->_locale = $locale;
00481             $this->_settings->setValue( "locale", $locale->getLocaleCode());
00482 
00483             return true;
00484         }

BlogInfo::setMangledBlog mangledBlog  ) 
 

定義在 bloginfo.class.php 檔案之第 555 行.

00556         {
00557             $this->_mangledBlog = $mangledBlog;
00558         }

BlogInfo::setOwner owner  )  [private]
 

參數:
owner id

定義在 bloginfo.class.php 檔案之第 300 行.

00301         {
00302             $this->_owner = $owner;
00303         }

BlogInfo::setOwnerInfo newOwnerInfo  )  [private]
 

定義在 bloginfo.class.php 檔案之第 360 行.

被參考於 getOwnerInfo().

00361         {
00362             $this->_ownerInfo = $newOwnerInfo;
00363         }

BlogInfo::setProperties properties  ) 
 

adds an array of pairs (key,value) to the blog settings

依據DbObject重新實作.

定義在 bloginfo.class.php 檔案之第 162 行.

參考 setValue().

被參考於 addProperties().

00163         {
00164             // nothing to do if we don't get an array as parameters
00165             if( !is_array($properties))
00166                 return true;
00167 
00168             foreach( $properties as $key => $value ) {
00169                 $this->setValue( $key, $value );
00170             }
00171 
00172             return true;
00173         }

BlogInfo::setResourcesQuota quota  ) 
 

sets the quota

參數:
quota 

定義在 bloginfo.class.php 檔案之第 534 行.

00535         {
00536             $this->_settings->setValue( "resources_quota", $quota );
00537 
00538             return true;
00539         }

BlogInfo::setSettings settings  )  [private]
 

定義在 bloginfo.class.php 檔案之第 316 行.

00317         {
00318             $this->_settings = $settings;
00319         }

BlogInfo::setStatus status  ) 
 

sets the current status of the blog

參數:
status 
傳回值:
always true

定義在 bloginfo.class.php 檔案之第 502 行.

00503         {
00504             $this->_status = $status;
00505 
00506             return true;
00507         }

BlogInfo::setTemplate template  ) 
 

sets the template name

參數:
template The name of the template that we'd like to use
傳回值:
always true

定義在 bloginfo.class.php 檔案之第 397 行.

被參考於 setTemplateSet().

00398         {
00399             // save the template in the settings
00400             $this->_settings->setValue( "template", $template );
00401             // and reset the TemplateSet object so that it gets reloaded next time
00402             // somebody uses BlogInfo::getTemplateSet
00403             $this->_templateSet = null;
00404 
00405             return true;
00406         }

BlogInfo::setTemplateSet templateSet  ) 
 

changes the template set used by the blog

參數:
templateSet A TemplateSet object
傳回值:
always true

定義在 bloginfo.class.php 檔案之第 450 行.

參考 setTemplate().

00451         {
00452             $this->setTemplate( $templateSet->getName());
00453 
00454             return true;
00455         }

BlogInfo::setTotalPosts newTotalPosts  )  [private]
 

定義在 bloginfo.class.php 檔案之第 344 行.

00345         {
00346             $this->_totalPosts = $newTotalPosts;
00347         }

BlogInfo::setUpdateDate newUpdateDate  )  [private]
 

定義在 bloginfo.class.php 檔案之第 334 行.

被參考於 getUpdateDateObject().

00335         {
00336             $this->_updateDate = $newUpdateDate;
00337 
00338             $this->_updateTimestamp = new Timestamp( $newUpdateDate );
00339         }

BlogInfo::setUsersInfo newUsersInfo  )  [private]
 

定義在 bloginfo.class.php 檔案之第 368 行.

被參考於 getUsersInfo().

00369         {
00370             $this->_usersInfo = $newUsersInfo;
00371         }

BlogInfo::setValue key,
value
 

returns a key from the blog settings

依據DbObject重新實作.

定義在 bloginfo.class.php 檔案之第 139 行.

被參考於 setProperties().

00140         {
00141             if( !$this->_settings )
00142                 return true;
00143 
00144             $this->_settings->setValue( $key, $value );
00145 
00146             return true;
00147         }

BlogInfo::setViewedTotal newViewedTotal  )  [private]
 

定義在 bloginfo.class.php 檔案之第 352 行.

00353         {
00354             $this->_viewedTotal = $newViewedTotal;
00355         }


資料成員說明文件

BlogInfo::$_about
 

定義在 bloginfo.class.php 檔案之第 23 行.

BlogInfo::$_blog
 

定義在 bloginfo.class.php 檔案之第 21 行.

BlogInfo::$_createDate
 

定義在 bloginfo.class.php 檔案之第 28 行.

BlogInfo::$_createTimestamp
 

定義在 bloginfo.class.php 檔案之第 36 行.

BlogInfo::$_id
 

定義在 bloginfo.class.php 檔案之第 25 行.

BlogInfo::$_locale
 

定義在 bloginfo.class.php 檔案之第 44 行.

BlogInfo::$_mangledBlog
 

定義在 bloginfo.class.php 檔案之第 38 行.

BlogInfo::$_owner
 

定義在 bloginfo.class.php 檔案之第 22 行.

BlogInfo::$_ownerInfo
 

定義在 bloginfo.class.php 檔案之第 34 行.

BlogInfo::$_settings
 

定義在 bloginfo.class.php 檔案之第 24 行.

BlogInfo::$_status
 

定義在 bloginfo.class.php 檔案之第 47 行.

BlogInfo::$_templateSet
 

定義在 bloginfo.class.php 檔案之第 41 行.

BlogInfo::$_totalComments
 

定義在 bloginfo.class.php 檔案之第 31 行.

BlogInfo::$_totalPosts
 

定義在 bloginfo.class.php 檔案之第 30 行.

BlogInfo::$_totalTrackbacks
 

定義在 bloginfo.class.php 檔案之第 32 行.

BlogInfo::$_updateDate
 

定義在 bloginfo.class.php 檔案之第 29 行.

BlogInfo::$_updateTimestamp
 

定義在 bloginfo.class.php 檔案之第 37 行.

BlogInfo::$_usersInfo
 

定義在 bloginfo.class.php 檔案之第 35 行.

BlogInfo::$_viewedTotal
 

定義在 bloginfo.class.php 檔案之第 33 行.


此類別(class) 文件是由下列檔案中產生: