Slashblog
[ class tree: Slashblog ] [ index: Slashblog ] [ all elements ]

Class: Blog

Source Location: /classes/blog.class.php

Class Overview


Holds and handles settings and posts. Also takes care of saving data to file.


Methods



Class Details

[line 15]
Holds and handles settings and posts. Also takes care of saving data to file.



[ Top ]


Class Methods


constructor __construct [line 550]

Blog __construct( )

Loads all blog settings by default, but no post data, and checks which page we are likely to want to display, by looking at available $_GET variables. We also check if user is logged in as author.



[ Top ]

method Authenticate [line 473]

bool Authenticate( [string $password = ""])

Authenticates user if password is supplied. If not, checks if user is logged in or redirects him to login page. Sets login variable to true on success.



Tags:

return:  True if user is authenticated or authentication was successful, false otherwise.
access:  public


Parameters:

string   $password   Password for login attempt.

[ Top ]

method BlogTitle [line 381]

void BlogTitle( )

Prints the blog title.



Tags:

access:  public


[ Top ]

method CurrentAuthor [line 365]

void CurrentAuthor( )

Prints author of post currently being displayed.



Tags:

access:  public


[ Top ]

method CurrentContent [line 389]

void CurrentContent( )

Prints content of post currently being displayed.



Tags:

access:  public


[ Top ]

method CurrentDate [line 397]

void CurrentDate( )

Prints date of post currently being displayed.



Tags:

access:  public


[ Top ]

method CurrentPage [line 602]

string CurrentPage( )

Returns current page file to include.



Tags:

return:  Page that is currently to be included if we are to show posts.
access:  public


[ Top ]

method CurrentTags [line 405]

void CurrentTags( )

Prints tags of post currently being displayed.



Tags:

access:  public


[ Top ]

method CurrentTitle [line 373]

void CurrentTitle( )

Prints title of post currently being displayed.



Tags:

access:  public


[ Top ]

method DebugDumpPosts [line 646]

void DebugDumpPosts( )

Debug function that outputs the array of posts.



Tags:

access:  public


[ Top ]

method DebugDumpSettings [line 638]

void DebugDumpSettings( )

Debug function that outputs the array of settings.



Tags:

access:  public


[ Top ]

method DeletePost [line 334]

void DeletePost( $id)

Deletes the post with the specified ID.

This assumes there are only one post with that ID, which we make sure of by giving the posts new unique IDs every time we save them to file.




Tags:

access:  public


Parameters:

   $id  

[ Top ]

method Error [line 526]

string Error( )

Returns error message if one is specified in URL.



Tags:

return:  Error message, is such exists.
access:  public


[ Top ]

method GetPostByID [line 321]

void &GetPostByID( $id)

Returns reference to the post with the specified ID.



Tags:

access:  public


Parameters:

   $id  

[ Top ]

method GetSetting [line 622]

string GetSetting( string $setting)

Returns value of specified setting. If this fails, an Exception is thrown.



Tags:

return:  Value of setting.
access:  public


Parameters:

string   $setting   Key of setting to return, e.g. TITLE or URL.

[ Top ]

method IsIndex [line 539]

bool IsIndex( )

Checks if we are currently viewing the loop/index page.



Tags:

return:  True if we are vewing the loop/index, false otherwise.
access:  public


[ Top ]

method IsSingle [line 516]

bool IsSingle( )

Checks if we are currently viewing a single post.



Tags:

return:  True if we are vewing a single post, false otherwise.
access:  public


[ Top ]

method LoadPosts [line 183]

void LoadPosts( [ $number = 0])

Loads post depending on what source we specify in config.php.



Tags:

access:  public


Parameters:

   $number  

[ Top ]

method LoadSingle [line 167]

void LoadSingle( integer $id)

Loads a single post from source defined in config.php



Tags:

access:  public


Parameters:

integer   $id   ID of post to load.

[ Top ]

method LoggedIn [line 506]

bool LoggedIn( )

Checks if we are currently logged in as owner.



Tags:

return:  True if we are logged in, false otherwise.
access:  public


[ Top ]

method MorePosts [line 431]

bool MorePosts( )

Checks if there are more posts to display after the current one.



Tags:

return:  True if there are more posts, false otherwise.
access:  public


[ Top ]

method NewerPages [line 459]

bool NewerPages( )

Checks if there are newer pages to display before the current one.



Tags:

return:  True if there are more newer pages, false otherwise.
access:  public


[ Top ]

method NextPage [line 592]

void NextPage( )

Prints next page number.



Tags:

access:  public


[ Top ]

method NextPost [line 413]

void NextPost( )

Set post being displayed to next one in order.



Tags:

access:  public


[ Top ]

method OlderPages [line 444]

bool OlderPages( )

Checks if there are more posts to display after the current one.



Tags:

return:  True if there are more pages, false otherwise.
access:  public


[ Top ]

method PreviousPage [line 610]

void PreviousPage( )

Prints previous page number.



Tags:

access:  public


[ Top ]

method PrintRSS [line 293]

void PrintRSS( )

Prints the RSS feed.



Tags:

access:  public


[ Top ]

method PublishPost [line 201]

void PublishPost( Post &$post)

Publishes a new post to the storage file specified in config.php. Differs from the AddPost function in the way that it actually loads and saves posts to and from file, thus also rebuilding the ID structure.



Tags:

access:  public


Parameters:

Post   &$post   Reference to object containing the post we're adding.

[ Top ]

method SavePosts [line 242]

void SavePosts( )

Writes currently loaded posts to file using the storage method specified in config.php



Tags:

access:  public


[ Top ]


Documentation generated on Mon, 26 May 2008 19:59:41 +0100 by phpDocumentor 1.4.0