Revision history for WikkaCore


Revision [22879]

Last edited on 2016-05-20 07:38:42 by BrianKoontz [Replaces old-style internal links with new pipe-split links.]
Additions:
This page can now be found on the [[Docs:WikkaCore | Wikka Documentation Server]].
An archive of [[http://wikkawiki.org/WikkaCore/revisions | old revisions of this page]] is still available for reference.<<
Deletions:
This page can now be found on the [[Docs:WikkaCore Wikka Documentation Server]].
An archive of [[http://wikkawiki.org/WikkaCore/revisions
old revisions of this page]] is still available for reference.<<


Revision [18088]

Edited on 2008-01-27 02:34:53 by BrianKoontz [Migrated to doc server]
Additions:
<<===This page has moved===
This page can now be found on the [[Docs:WikkaCore Wikka Documentation Server]].
Thanks for updating your bookmarks!
An archive of [[http://wikkawiki.org/WikkaCore/revisions
old revisions of this page]] is still available for reference.<<
::c::
CategoryMigratedDocs
Deletions:
[[WikkaDocumentation Wikka Documentation]]
=====The Wikka Engine=====
""<div style="float:right; width: 46%; padding: 4px 8px 2px 8px; background-color:#FEE; border:1px solid #EDD"><img src="images/icons/24x24/gnome-settings.png" title="todo" alt="todo icon" /> This page needs to be updated to match <strong>Wikka 1.1.6.3</strong></div><br style="clear:right"/>""
**[[UsingActions Actions]]** in WikkaWiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as **plugins**. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wikka core is using for accomodating its needs. By this not only will you save time but also help maintain a solid and coherent software package.
Below I try to descibe the functions of the Wikka core that Action writers may find useful. I would be pleased to see people filling the gaps in this page. Please help :). The description in most cases should mention received arguments, what the function does and what it returns.
----//Based on the WikkaWiki version 1.1.5.3 package ''(unless indicated otherwise)''//----
===Functions relating to the Database===
""Query($query)""
Generic function that receives an SQL Query as an argument and executes it on the database.
It returns the result.
""LoadSingle($query)""
Receives an SQL Query as an argument and executes it on the database.
It returns the first row of the result array.
""LoadAll""($query)
Receives an SQL Query as an argument and executes it on the database.
It returns the result of the SQL operation in the form of an array.
""CheckMySQLVersion""($major, $minor, $subminor)
As the function's name betrays it checks the string "$major.$minor.$subminor" against the MySQL version hosted on the particular machine PHP is running on. It returns :
**1** //if the version is newer or equal to the provided arguments.//
**0** //if the version is older than the provided arguments.//

===Miscellaneous Utility Functions===
""GetMicroTime()""
A utility function that is usefull to retrieve operation timing. It returns a number (float).
""IncludeBuffered($filename, $notfoundText = '', $vars = '', $path = '')""
The main Actions loading function. It may come in handy in bigger modding projects on Wakka but for basic to novice Actions I can hardly think of how it can be used. It executes the contents of a given filename ($filename) in a given path ($path) allowing for customising the error message in case of an error. Variables ($vars) are passed to the loaded file.
""ReturnSafeHTML($html)""
Receives any string (preferably HTML, hehe) and returns it filtered and comformed to the XHTML standards.
===Functions relating to Wakka Variables===
""GetPageTag()""
Returns the tag (""WikiPageName"") of the current page, a string.
""GetPageTime()""
Returns the creation date and time of the current page as a string in the form of: "2004-12-16 20:36:17".
""GetMethod()""
Returns the method (for example: WikiPage/edit) with which this page was called, as a string.
""GetConfigValue($name)""
Returns the value from a configuration field ($name). Configuration is defined inside the wakka.conf.php file inside the wakka installation folder. It reruns a string when $name mathces any field of the configuration file or //null// if the configuration file doesnt have a $name field.
""GetWakkaName()""
Is the same as doing : //$this->""GetConfigValue""('wakka_name')// (see above function).
""GetWakkaVersion()""
Returns the Wakka version (not from a configuration field, hard-coded on wikka.php beginning).
===Functions relating to ""WikiPages""===
""LoadPage($tag, $time = '', $cache = 1)""

Returns the content of the page identified by $tag. If $time set, it will return the page stored at this time, else it will return the latest one. If $cache set (and $time not set), it will return, if it exists, the cached content of the page.

""IsLatestPage()""
Returns a boolean (?, can't find where it is set in code) indicating whether or not the current page is the latest revision.

""GetCachedPage($tag)""
Returns the content of the page identified by $tag if it is available in cache. Else returns null.

""CachePage($page)""
Set the content of the cache with $page.

""SetPage($page)""

""LoadPageById($id)""

""LoadRevisions($page)""

""LoadPagesLinkingTo($tag)""

""LoadRecentlyChanged()""

""LoadWantedPages()""

""IsWantedPage($tag)""

""LoadOrphanedPages()""

""LoadPageTitles()""

""LoadAllPages()""

""FullTextSearch($phrase)""

""FullCategoryTextSearch($phrase)""

""SavePage($tag, $body, $note)""

""PageTitle()""

===COOKIES===
""SetSessionCookie($name, $value)""

""SetPersistentCookie($name, $value)""

""DeleteCookie($name)""

""GetCookie($name)""

===HTTP/REQUEST/LINK RELATED===
""SetMessage($message)""
Set a message to be used for the Redirect function. //''No longer necessary in 1.1.6.0 - See ""Redirect()"" below''//

""GetMessage()""

""Redirect($url = '', $message = '')"" //''1.1.6.0''//

""MiniHref($method = '', $tag = '')""

""Href($method = '', $tag = '', $params = '')""

""Link($tag, $method = '', $text = '', $track = 1, $escapeText = 1, $title = '')""

""IsWikiName($text)""

""TrackLinkTo($tag)""

""GetLinkTable()""

""ClearLinkTable()""

""StartLinkTracking()""

""StopLinkTracking()""

""WriteLinkTable()""

""Header()""

""Footer()""

===FORMS===
""FormOpen($method = '', $tag = '', $formMethod = 'post')""

""FormClose()""

===INTERWIKI STUFF===
""ReadInterWikiConfig()""

""AddInterWiki($name, $url)""

""GetInterWikiUrl($name, $tag)""

===REFERRERS===
""LogReferrer($tag = '', $referrer = '')""

""LoadReferrers($tag = '')""

===PLUGINS===
""Action($action, $forceLinkTracking = 0)""
Responsible for executing the Actions /Plugins that are found in the /wikka/actions/ directory. It receives a string ($action) that specifies which file to execute. It also is responsible for passing the $vars array to the executed php script. The file has to have a //.php// extension in order to be executed by this function.
""Method($method)""
Returns the method that the current page was called by. Known methods are /edit /create /delete ...
""Format($text, $formatter = 'wakka')""
Returns the parsed string ($text) after it has been parsed from the specified formatter ($formatter). If no $formatter is supplied then it assumes the default "wakka" formatter that is responsible for converting the wiki syntax to displayable HTML. The availble formatters are found under the /wikka/formatters/ directory.
===Functions relating to **Users**===
""LoadUser($name, $password = 0)""

""LoadUsers()""
Returns an, alphabetically sorted by name, array of the users table. This array contains numerical indexes that hold a associative array of all the fields the wakka_users table has, in the form of ["field_name"] = > "field_value" .
""GetUserName()""
Returns the result of ""GetUser""() (see below) or the hostname of the visitor's host.
""GetUser()""
Retreives the ""UserName"" of the visitor from the global php $_SESSION['user'] field. It is highly reccomended to use the ""GetUserName""() function instead of this one unless you have a special reason.
""SetUser($user)""
Used in the Run() function of the ""WakkaCore"". It fetches and sets the ""UserName"" (if found) from a cookie.
""LogoutUser()""
Removes any cookie send to the user using the ""DeleteCookie""() function, effectively forgetting the login of the particular user.
""UserWantsComments()""
Returns true if the user is logged in and has set his preferences to show any page's comments by default. It returns false in any other case.
===Functions related to Comments===
""LoadComments($tag)""
Returns an array of the comments on the received tag (""WikiPage""), sorted by time each comment record was made.
""LoadRecentComments($limit = 50)""
Returns an array of the most recent ( depenting on the limit ($limit) ) number of comments to the current ""WikiPage"". The default value for the array size is 50.
""LoadRecentlyCommented($limit = 50)""
Returns an array of the most recently commented ""WikiPages"" in an array. The size of the array maybe be specified ($limit). The default value for $limit is 50.
""SaveComment($page_tag, $comment)""
Saves a comment ($comment) on a ""WikiPage"" ($page_tag) to the database.
===Functions related to controling Access===
""UserIsOwner($tag = '')""
Returns true if logged in user is owner of the provided page ($tag). If no $tag is provided then it acts on the current page.
""IsAdmin()""
Returns //true// if user is listed in configuration list as admin, //false// if any other case.
""GetPageOwner($tag = '', $time = '')""
Returns the ""UserName"" of the page's ($tag) owner. If no $tag is provided when calling the function then it acts on the current page.
""SetPageOwner($tag, $user)""
Sets the page's ($tag) ownership to the specified ""UserName"" ($user). Both arguments need to be provided.
""LoadACL($tag, $privilege, $useDefaults = 1)""
Returns an array. The form of the array is as follows :
%%(php)array = {
["page_tag"] => $tag,
[$privilege."_acl"] => the_default_configuration_acl_for_this_privilege
}%%
""LoadAllACLs($tag, $useDefaults = 1)""

""SaveACL($tag, $privilege, $list)""

""TrimACLs($list)""

""HasAccess($privilege, $tag = '', $user = '')""
This returns true or 1 if the user ($user) can complete the requested action ($priviledge) on the page ($tag). If no $tag is provided then it acts on the displayed ""WikiPage"". If no $user is provided then it acts on the current ""UserName"".
CategoryDocumentation


Revision [16534]

Edited on 2007-05-07 18:49:35 by BrianKoontz [1.1.6.2->1.1.6.3]
Additions:
""<div style="float:right; width: 46%; padding: 4px 8px 2px 8px; background-color:#FEE; border:1px solid #EDD"><img src="images/icons/24x24/gnome-settings.png" title="todo" alt="todo icon" /> This page needs to be updated to match <strong>Wikka 1.1.6.3</strong></div><br style="clear:right"/>""
Deletions:
""<div style="float:right; width: 46%; padding: 4px 8px 2px 8px; background-color:#FEE; border:1px solid #EDD"><img src="images/icons/24x24/gnome-settings.png" title="todo" alt="todo icon" /> This page needs to be updated to match <strong>Wikka 1.1.6.2</strong></div><br style="clear:right"/>""


Revision [15574]

Edited on 2006-10-31 10:38:04 by RamWo [1.1.6.2->1.1.6.3]
Additions:
**[[UsingActions Actions]]** in WikkaWiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as **plugins**. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wikka core is using for accomodating its needs. By this not only will you save time but also help maintain a solid and coherent software package.
Deletions:
**[[UsingActions Actions]]** in WikkaWiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as **plugins**. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wikka core is using for accomodating its needs. By this not only you will save time but also help keeping a solid and coherent software package.


Revision [14593]

Edited on 2006-06-14 04:18:23 by DarTar [adding update request box]
Additions:
""<div style="float:right; width: 46%; padding: 4px 8px 2px 8px; background-color:#FEE; border:1px solid #EDD"><img src="images/icons/24x24/gnome-settings.png" title="todo" alt="todo icon" /> This page needs to be updated to match <strong>Wikka 1.1.6.2</strong></div><br style="clear:right"/>""
Deletions:
{{lastedit}}


Revision [13309]

Edited on 2006-02-26 09:20:49 by PivWan [Addition of non-documented pages. has to be verified.]
Additions:
Returns the Wakka version (not from a configuration field, hard-coded on wikka.php beginning).
Returns the content of the page identified by $tag. If $time set, it will return the page stored at this time, else it will return the latest one. If $cache set (and $time not set), it will return, if it exists, the cached content of the page.
Returns a boolean (?, can't find where it is set in code) indicating whether or not the current page is the latest revision.
Returns the content of the page identified by $tag if it is available in cache. Else returns null.
Set the content of the cache with $page.
Deletions:
Returns the Wakka version (not from a configuration field.


Revision [12390]

Edited on 2005-12-23 00:11:08 by RolandStens [Addition of non-documented pages. has to be verified.]
Additions:
The main Actions loading function. It may come in handy in bigger modding projects on Wakka but for basic to novice Actions I can hardly think of how it can be used. It executes the contents of a given filename ($filename) in a given path ($path) allowing for customising the error message in case of an error. Variables ($vars) are passed to the loaded file.
Deletions:
The main Actions loading function. It may come in handy in bigger modding projects on Wakka but for basic to novice Actions I can hardly thing of how it can be used. It executes the contents of a given filename ($filename) in a given path ($path) allowing for customising the error message in case of an error. Variables ($vars) are passed to the loaded file.


Revision [11566]

Edited on 2005-10-25 08:51:26 by DarTar [minor]
Additions:
=====The Wikka Engine=====
----//Based on the WikkaWiki version 1.1.5.3 package ''(unless indicated otherwise)''//----
Deletions:
===The API of Wikka for writing Actions===
----**//Based on the WikkaWiki version 1.1.5.3 package ''(unless indicated otherwise)''//**----
Here we go then! ...


Revision [8935]

Edited on 2005-06-07 20:08:46 by JavaWoman [minor]
Additions:
As the function's name betrays it checks the string "$major.$minor.$subminor" against the MySQL version hosted on the particular machine PHP is running on. It returns :
Deletions:
As the function's name betrays it checks the string "$major.$minor.$subminor" against the
MySQL version hosted on the particular machine PHP is running on. It returns :


Revision [7064]

Edited on 2005-04-01 18:10:55 by NilsLindenberg [it is an official doc]
Additions:
Below I try to descibe the functions of the Wikka core that Action writers may find useful. I would be pleased to see people filling the gaps in this page. Please help :). The description in most cases should mention received arguments, what the function does and what it returns.
Deletions:
Below I try to descibe the functions of the Wikka core that Action writers may find useful. I would be pleased to see people filling the gaps in this page. Please help :). The description in most cases should mention received arguments, what the function does and what it returns. __This is an unofficial documentation.__


Revision [7040]

Edited on 2005-04-01 07:40:15 by JavaWoman [mostly layout - easier readability & maintainability]
Additions:
[[WikkaDocumentation Wikka Documentation]]
----
===The API of Wikka for writing Actions===
{{lastedit}}

**[[UsingActions Actions]]** in WikkaWiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as **plugins**. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wikka core is using for accomodating its needs. By this not only you will save time but also help keeping a solid and coherent software package.

Below I try to descibe the functions of the Wikka core that Action writers may find useful. I would be pleased to see people filling the gaps in this page. Please help :). The description in most cases should mention received arguments, what the function does and what it returns. __This is an unofficial documentation.__

----**//Based on the WikkaWiki version 1.1.5.3 package ''(unless indicated otherwise)''//**----

Here we go then! ...

===Functions relating to the Database===

""Query($query)""

Generic function that receives an SQL Query as an argument and executes it on the database.
It returns the result.
----

""LoadSingle($query)""

Receives an SQL Query as an argument and executes it on the database.
It returns the first row of the result array.

----
""LoadAll""($query)

Receives an SQL Query as an argument and executes it on the database.
It returns the result of the SQL operation in the form of an array.

----
""CheckMySQLVersion""($major, $minor, $subminor)

As the function's name betrays it checks the string "$major.$minor.$subminor" against the
MySQL version hosted on the particular machine PHP is running on. It returns :
**1** //if the version is newer or equal to the provided arguments.//
**0** //if the version is older than the provided arguments.//
----


===Miscellaneous Utility Functions===

""GetMicroTime()""

A utility function that is usefull to retrieve operation timing. It returns a number (float).
----

""IncludeBuffered($filename, $notfoundText = '', $vars = '', $path = '')""

The main Actions loading function. It may come in handy in bigger modding projects on Wakka but for basic to novice Actions I can hardly thing of how it can be used. It executes the contents of a given filename ($filename) in a given path ($path) allowing for customising the error message in case of an error. Variables ($vars) are passed to the loaded file.
----

""ReturnSafeHTML($html)""

Receives any string (preferably HTML, hehe) and returns it filtered and comformed to the XHTML standards.
----


===Functions relating to Wakka Variables===

""GetPageTag()""

Returns the tag (""WikiPageName"") of the current page, a string.
----

""GetPageTime()""

Returns the creation date and time of the current page as a string in the form of: "2004-12-16 20:36:17".
----

""GetMethod()""

Returns the method (for example: WikiPage/edit) with which this page was called, as a string.
----

""GetConfigValue($name)""

Returns the value from a configuration field ($name). Configuration is defined inside the wakka.conf.php file inside the wakka installation folder. It reruns a string when $name mathces any field of the configuration file or //null// if the configuration file doesnt have a $name field.
----

""GetWakkaName()""

Is the same as doing : //$this->""GetConfigValue""('wakka_name')// (see above function).
----

""GetWakkaVersion()""

Returns the Wakka version (not from a configuration field.
----


===Functions relating to ""WikiPages""===

""LoadPage($tag, $time = '', $cache = 1)""
----

""IsLatestPage()""
----

""GetCachedPage($tag)""
----

""CachePage($page)""
----

""SetPage($page)""
----

""LoadPageById($id)""
----

""LoadRevisions($page)""
----

""LoadPagesLinkingTo($tag)""
----

""LoadRecentlyChanged()""
----

""LoadWantedPages()""
----

""IsWantedPage($tag)""
----

""LoadOrphanedPages()""
----

""LoadPageTitles()""
----

""LoadAllPages()""
----

""FullTextSearch($phrase)""
----

""FullCategoryTextSearch($phrase)""
----

""SavePage($tag, $body, $note)""
----

""PageTitle()""
----


===COOKIES===

""SetSessionCookie($name, $value)""
----

""SetPersistentCookie($name, $value)""
----

""DeleteCookie($name)""
----

""GetCookie($name)""
----


===HTTP/REQUEST/LINK RELATED===

""SetMessage($message)""

Set a message to be used for the Redirect function. //''No longer necessary in 1.1.6.0 - See ""Redirect()"" below''//
----

""GetMessage()""
----

""Redirect($url = '', $message = '')"" //''1.1.6.0''//
----

""MiniHref($method = '', $tag = '')""
----

""Href($method = '', $tag = '', $params = '')""
----

""Link($tag, $method = '', $text = '', $track = 1, $escapeText = 1, $title = '')""
----

""IsWikiName($text)""
----

""TrackLinkTo($tag)""
----

""GetLinkTable()""
----

""ClearLinkTable()""
----

""StartLinkTracking()""
----

""StopLinkTracking()""
----

""WriteLinkTable()""
----

""Header()""
----

""Footer()""
----


===FORMS===

""FormOpen($method = '', $tag = '', $formMethod = 'post')""
----

""FormClose()""
----


===INTERWIKI STUFF===

""ReadInterWikiConfig()""
----

""AddInterWiki($name, $url)""
----

""GetInterWikiUrl($name, $tag)""
----


===REFERRERS===

""LogReferrer($tag = '', $referrer = '')""
----

""LoadReferrers($tag = '')""
----



===PLUGINS===

""Action($action, $forceLinkTracking = 0)""

Responsible for executing the Actions /Plugins that are found in the /wikka/actions/ directory. It receives a string ($action) that specifies which file to execute. It also is responsible for passing the $vars array to the executed php script. The file has to have a //.php// extension in order to be executed by this function.
----

""Method($method)""
Returns the method that the current page was called by. Known methods are /edit /create /delete ...
----

""Format($text, $formatter = 'wakka')""

Returns the parsed string ($text) after it has been parsed from the specified formatter ($formatter). If no $formatter is supplied then it assumes the default "wakka" formatter that is responsible for converting the wiki syntax to displayable HTML. The availble formatters are found under the /wikka/formatters/ directory.
----


===Functions relating to **Users**===

""LoadUser($name, $password = 0)""
----

""LoadUsers()""

Returns an, alphabetically sorted by name, array of the users table. This array contains numerical indexes that hold a associative array of all the fields the wakka_users table has, in the form of ["field_name"] = > "field_value" .
----

""GetUserName()""

Returns the result of ""GetUser""() (see below) or the hostname of the visitor's host.
----

""GetUser()""

Retreives the ""UserName"" of the visitor from the global php $_SESSION['user'] field. It is highly reccomended to use the ""GetUserName""() function instead of this one unless you have a special reason.
----

""SetUser($user)""

Used in the Run() function of the ""WakkaCore"". It fetches and sets the ""UserName"" (if found) from a cookie.
----

""LogoutUser()""

Removes any cookie send to the user using the ""DeleteCookie""() function, effectively forgetting the login of the particular user.
----

""UserWantsComments()""

Returns true if the user is logged in and has set his preferences to show any page's comments by default. It returns false in any other case.
----


===Functions related to Comments===

""LoadComments($tag)""

Returns an array of the comments on the received tag (""WikiPage""), sorted by time each comment record was made.
----

""LoadRecentComments($limit = 50)""

Returns an array of the most recent ( depenting on the limit ($limit) ) number of comments to the current ""WikiPage"". The default value for the array size is 50.
----

""LoadRecentlyCommented($limit = 50)""

Returns an array of the most recently commented ""WikiPages"" in an array. The size of the array maybe be specified ($limit). The default value for $limit is 50.
----

""SaveComment($page_tag, $comment)""

Saves a comment ($comment) on a ""WikiPage"" ($page_tag) to the database.
----


===Functions related to controling Access===

""UserIsOwner($tag = '')""

Returns true if logged in user is owner of the provided page ($tag). If no $tag is provided then it acts on the current page.
----

""IsAdmin()""

Returns //true// if user is listed in configuration list as admin, //false// if any other case.
----

""GetPageOwner($tag = '', $time = '')""

Returns the ""UserName"" of the page's ($tag) owner. If no $tag is provided when calling the function then it acts on the current page.
----

""SetPageOwner($tag, $user)""

Sets the page's ($tag) ownership to the specified ""UserName"" ($user). Both arguments need to be provided.
----

""LoadACL($tag, $privilege, $useDefaults = 1)""

Returns an array. The form of the array is as follows :
%%(php)array = {
["page_tag"] => $tag,
[$privilege."_acl"] => the_default_configuration_acl_for_this_privilege
}%%
----

""LoadAllACLs($tag, $useDefaults = 1)""
----

""SaveACL($tag, $privilege, $list)""
----

""TrimACLs($list)""
----

""HasAccess($privilege, $tag = '', $user = '')""

This returns true or 1 if the user ($user) can complete the requested action ($priviledge) on the page ($tag). If no $tag is provided then it acts on the displayed ""WikiPage"". If no $user is provided then it acts on the current ""UserName"".
----

----
Deletions:
[[WikkaDocumentation Wikka Documentation]]
----
===The API of Wikka for writing Actions===
{{lastedit}}

**[[UsingActions Actions]]** in WikkaWiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as **plugins**. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wikka core is using for accomodating its needs. By this not only you will save time but also help keeping a solid and coherent software package.

Below I try to descibe the functions of the Wikka core that Action writers may find useful. I would be pleased to see people filling the gaps in this page. Please help :). The description in most cases should mention received arguments, what the function does and what it returns. __This is an unofficial documentation.__

----**//Based on the WikkaWiki version 1.1.5.3 package//**----

Here we go then! ...

===Functions relating to the Database===

Query($query)
----
Generic function that receives an SQL Query as an argument and executes it on the database.
It returns the result.

""LoadSingle""($query)
----
Receives an SQL Query as an argument and executes it on the database.
It returns the first row of the result array.

""LoadAll""($query)
----
Receives an SQL Query as an argument and executes it on the database.
It returns the result of the SQL operation in the form of an array.

""CheckMySQLVersion""($major, $minor, $subminor)
----
As the function's name betrays it checks the string "$major.$minor.$subminor" against the MySQL version hosted on the particular machine PHP is running on. It returns :
**1** //if the version is newer or equal to the provided arguments.//
**0** //if the version is older than the provided arguments.//


===Miscellaneous Utility Functions===

""GetMicroTime""()
----
A utility function that is usefull to retrieve operation timing. It returns a number (float).

""IncludeBuffered""($filename, $notfoundText = "", $vars = "", $path = "")
----
The main Actions loading function. It may come in handy in bigger modding projects on Wakka but for basic to novice Actions I can hardly thing of how it can be used. It executes the contents of a given filename ($filename) in a given path ($path) allowing for customising the error message in case of an error. Variables ($vars) are passed to the loaded file.

""ReturnSafeHTML""($html)
----
Receives any string (preferably HTML, hehe) and returns it filtered and comformed to the XHTML standards.


===Functions relating to Wakka Variables===

""GetPageTag""()
----
Returns the tag (""WikiPageName"") of the current page, a string.

""GetPageTime""()
----
Returns the creation date and time of the current page as a string in the form of : "2004-12-16 20:36:17".

""GetMethod""()
----
Returns the method (for example: WikiPage/edit) with which this page was called, as a string.

""GetConfigValue""($name)
----
Returns the value from a configuration field ($name). Configuration is defined inside the wakka.conf.php file inside the wakka installation folder. It reruns a string when $name mathces any field of the configuration file or //null// if the configuration file doesnt have a $name field.

""GetWakkaName""()
----
Is the same as doing : //$this->""GetConfigValue""("wakka_name")// (see above function).

""GetWakkaVersion""()
----
Returns the Wakka version (not from a configuration field.


===Functions relating to ""WikiPages""===

""LoadPage""($tag, $time = "", $cache = 1)
----

""IsLatestPage""()
----

""GetCachedPage""($tag)
----

""CachePage""($page)
----

""SetPage""($page)
----

""LoadPageById""($id)
----

""LoadRevisions""($page)
----

""LoadPagesLinkingTo""($tag)
----

""LoadRecentlyChanged""()
----

""LoadWantedPages""()
----

""IsWantedPage""($tag)
----

""LoadOrphanedPages""()
----

""LoadPageTitles""()
----

""LoadAllPages""()
----

""FullTextSearch""($phrase)
----

""FullCategoryTextSearch""($phrase)
----

""SavePage""($tag, $body, $note)
----

""PageTitle""()
----


===COOKIES===

""SetSessionCookie""($name, $value)
----

""SetPersistentCookie""($name, $value)
----

""DeleteCookie""($name)
----

""GetCookie""($name)
----


===HTTP/REQUEST/LINK RELATED===

""SetMessage""($message)
----

""GetMessage""()
----

Redirect($url)
----

""MiniHref""($method = "", $tag = "")
----

Href($method = "", $tag = "", $params = "")
----

Link($tag, $method = "", $text = "", $track = 1, $escapeText = 1, $title="")
----

""IsWikiName""($text)
----

""TrackLinkTo""($tag)
----

""GetLinkTable""()
----

""ClearLinkTable""()
----

""StartLinkTracking""()
----

""StopLinkTracking""()
----

""WriteLinkTable""()
----

Header()
----

Footer()
----


===FORMS===

""FormOpen""($method = "", $tag = "", $formMethod = "post")
----

""FormClose""()
----


===INTERWIKI STUFF===

""ReadInterWikiConfig""()
----

""AddInterWiki""($name, $url)
----

""GetInterWikiUrl""($name, $tag)
----


===REFERRERS===

""LogReferrer""($tag = "", $referrer = "")
----

""LoadReferrers""($tag = "")
----



===PLUGINS===

Action($action, $forceLinkTracking = 0)
----
Responsible for executing the Actions /Plugins that are found in the /wikka/actions/ directory. It receives a string ($action) that specifies which file to execute. It also is responsible for passing the $vars array to the executed php script. The file has to have a //.php// extension in order to be executed by this function.

Method($method)
----
Returns the method that the current page was called by. Known methods are /edit /create /delete ...

Format($text, $formatter = "wakka")
----
Returns the parsed string ($text) after it has been parsed from the specified formatter ($formatter). If no $formatter is supplied then it assumes the default "wakka" formatter that is responsible for converting the wiki syntax to displayable HTML. The availble formatters are found under the /wikka/formatters/ directory.


===Functions relating to **Users**===

""LoadUser""($name, $password = 0)
----

""LoadUsers""()
----
Returns an, alphabetically sorted by name, array of the users table. This array contains numerical indexes that hold a associative array of all the fields the wakka_users table has, in the form of ["field_name"] = > "field_value" .

""GetUserName""()
----
Returns the result of ""GetUser""() (see below) or the hostname of the visitor's host.

""GetUser""()
----
Retreives the ""UserName"" of the visitor from the global php $_SESSION['user'] field. It is highly reccomended to use the ""GetUserName""() function instead of this one unless you have a special reason.

""SetUser""($user)
----
Used in the Run() function of the ""WakkaCore"". It fetches and sets the ""UserName"" (if found) from a cookie.
""LogoutUser""()
----
Removes any cookie send to the user using the ""DeleteCookie""() function, effectively forgetting the login of the particular user.

""UserWantsComments""()
----
Returns true if the user is logged in and has set his preferences to show any page's comments by default. It returns false in any other case.


===Functions related to Comments===

""LoadComments""($tag)
----
Returns an array of the comments on the received tag (""WikiPage""), sorted by time each comment record was made.

""LoadRecentComments""($limit = 50)
----
Returns an array of the most recent ( depenting on the limit ($limit) ) number of comments to the current ""WikiPage"". The default value for the array size is 50.

""LoadRecentlyCommented""($limit = 50)
----
Returns an array of the most recently commented ""WikiPages"" in an array. The size of the array maybe be specified ($limit). The default value for $limit is 50.

""SaveComment""($page_tag, $comment)
----
Saves a comment($comment) on a ""WikiPage""($page_tag) to the database.


===Functions related to controling Access===

""UserIsOwner""($tag = "")
----
Returns true if logged in user is owner of the provided page ($tag). If no $tag is provided then it acts on the current page.

""IsAdmin""()
----
Returns //true// if user is listed in configuration list as admin, //false// if any other case.

""GetPageOwner""($tag = "", $time = "")
----
Returns the ""UserName"" of the page's ($tag) owner. If no $tag is provided when calling the function then it acts on the current page.

""SetPageOwner""($tag, $user)
----
Sets the page's ($tag) owneship to the specified ""UserName"" ($user). Both arguments need to be provided.

""LoadACL""($tag, $privilege, $useDefaults = 1)
----
Returns an array. The form of the array is as follows :
%%(php)array = {
["page_tag"] => $tag,
[$privilege."_acl"] => the_default_configuration_acl_for_this_privilege
}%%
""LoadAllACLs""($tag, $useDefaults = 1)
----

""SaveACL""($tag, $privilege, $list)
----

""TrimACLs""($list)
----

""HasAccess""($privilege, $tag = "", $user = "")
----
This returns true or 1 if the user ($user) can complete the requested action ($priviledge) on the page ($tag). If no $tag is provided then it acts the displayed ""WikiPage"". If no $user is provided then it acts on the current ""UserName"".

----


Revision [3405]

Edited on 2004-12-18 10:25:39 by DarTar [preg_replace("Wakka","Wikka",$WikkaCore) :)]
Additions:
**[[UsingActions Actions]]** in WikkaWiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as **plugins**. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wikka core is using for accomodating its needs. By this not only you will save time but also help keeping a solid and coherent software package.
Deletions:
[[UsingActions Actions]] in WikkaWiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as //plugins//. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wikka core is using for accomodating its needs. By this not only you will save time but also help keeping a solid and coherent software package.


Revision [3404]

Edited on 2004-12-18 10:24:44 by DarTar [preg_replace("Wakka", "Wikka", $WikkaCore) :)]
Additions:
{{lastedit}}
[[UsingActions Actions]] in WikkaWiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as //plugins//. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wikka core is using for accomodating its needs. By this not only you will save time but also help keeping a solid and coherent software package.
Below I try to descibe the functions of the Wikka core that Action writers may find useful. I would be pleased to see people filling the gaps in this page. Please help :). The description in most cases should mention received arguments, what the function does and what it returns. __This is an unofficial documentation.__
----**//Based on the WikkaWiki version 1.1.5.3 package//**----
Deletions:
Actions in WikkaWiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as plugins. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wikka core is using for accomodating its needs. By this not only you will save time but also help keeping a solid and coherent software package.
Below I try to descibe the functions of the Wikka core that Actions writers may find usefull. I would be pleased to see people filling the gaps in this page. Please help :). The description in most cases should mention received arguments, what the function does and what it returns. __This is an unofficial documentation.__
----**//Based on the Wikka Wakka Wiki version 1.1.5.3 package//**----


Revision [3403]

Edited on 2004-12-18 10:22:25 by DarTar [preg_replace("Wakka", "Wikka", $WikkaCore) :)]
Additions:
===The API of Wikka for writing Actions===
Actions in WikkaWiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as plugins. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wikka core is using for accomodating its needs. By this not only you will save time but also help keeping a solid and coherent software package.
Below I try to descibe the functions of the Wikka core that Actions writers may find usefull. I would be pleased to see people filling the gaps in this page. Please help :). The description in most cases should mention received arguments, what the function does and what it returns. __This is an unofficial documentation.__
Deletions:
===The API of Wakka for writing Actions===
Actions in Wakka Wiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as plugins. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wakka core is using for accomodating its needs. By this not only you will save time but also help keeping a solid and coherent software package.
Below I try to descibe the functions of the Wakka core that Actions writers may find usefull. I would be pleased to see people filling the gaps in this page. Please help :). The descritpion in most cases should mention received arguments, what the function does and what it returns. __This is an unofficial documentation.__


Revision [3399]

Edited on 2004-12-18 02:24:52 by GeorgePetsagourakis [replaced all wikkacore doc with a more coherent one.. input still needed ..]
Additions:
===The API of Wakka for writing Actions===
Actions in Wakka Wiki constitute a very flexible way to extend the functionality of your Wiki. They are also known as plugins. Instead of re-inventing the wheel when scripting those Actions/Plugins you are encouraged to use the functions that the Wakka core is using for accomodating its needs. By this not only you will save time but also help keeping a solid and coherent software package.
Below I try to descibe the functions of the Wakka core that Actions writers may find usefull. I would be pleased to see people filling the gaps in this page. Please help :). The descritpion in most cases should mention received arguments, what the function does and what it returns. __This is an unofficial documentation.__
----**//Based on the Wikka Wakka Wiki version 1.1.5.3 package//**----
Here we go then! ...
===Functions relating to the Database===
Query($query)
Generic function that receives an SQL Query as an argument and executes it on the database.
It returns the result.
""LoadSingle""($query)
Receives an SQL Query as an argument and executes it on the database.
It returns the first row of the result array.
""LoadAll""($query)
Receives an SQL Query as an argument and executes it on the database.
It returns the result of the SQL operation in the form of an array.
""CheckMySQLVersion""($major, $minor, $subminor)
As the function's name betrays it checks the string "$major.$minor.$subminor" against the MySQL version hosted on the particular machine PHP is running on. It returns :
**1** //if the version is newer or equal to the provided arguments.//
**0** //if the version is older than the provided arguments.//

===Miscellaneous Utility Functions===
""GetMicroTime""()
A utility function that is usefull to retrieve operation timing. It returns a number (float).
""IncludeBuffered""($filename, $notfoundText = "", $vars = "", $path = "")
The main Actions loading function. It may come in handy in bigger modding projects on Wakka but for basic to novice Actions I can hardly thing of how it can be used. It executes the contents of a given filename ($filename) in a given path ($path) allowing for customising the error message in case of an error. Variables ($vars) are passed to the loaded file.
""ReturnSafeHTML""($html)
Receives any string (preferably HTML, hehe) and returns it filtered and comformed to the XHTML standards.
===Functions relating to Wakka Variables===
""GetPageTag""()
Returns the tag (""WikiPageName"") of the current page, a string.
""GetPageTime""()
Returns the creation date and time of the current page as a string in the form of : "2004-12-16 20:36:17".
""GetMethod""()
Returns the method (for example: WikiPage/edit) with which this page was called, as a string.
""GetConfigValue""($name)
Returns the value from a configuration field ($name). Configuration is defined inside the wakka.conf.php file inside the wakka installation folder. It reruns a string when $name mathces any field of the configuration file or //null// if the configuration file doesnt have a $name field.
""GetWakkaName""()
Is the same as doing : //$this->""GetConfigValue""("wakka_name")// (see above function).
""GetWakkaVersion""()
Returns the Wakka version (not from a configuration field.
===Functions relating to ""WikiPages""===
""LoadPage""($tag, $time = "", $cache = 1)

""IsLatestPage""()

""GetCachedPage""($tag)

""CachePage""($page)

""SetPage""($page)

""LoadPageById""($id)

""LoadRevisions""($page)

""LoadPagesLinkingTo""($tag)

""LoadRecentlyChanged""()

""LoadWantedPages""()

""IsWantedPage""($tag)

""LoadOrphanedPages""()

""LoadPageTitles""()

""LoadAllPages""()

""FullTextSearch""($phrase)

""FullCategoryTextSearch""($phrase)

""SavePage""($tag, $body, $note)

""PageTitle""()

===COOKIES===
""SetSessionCookie""($name, $value)

""SetPersistentCookie""($name, $value)

""DeleteCookie""($name)

""GetCookie""($name)

===HTTP/REQUEST/LINK RELATED===
""SetMessage""($message)

""GetMessage""()

Redirect($url)

""MiniHref""($method = "", $tag = "")

Href($method = "", $tag = "", $params = "")

Link($tag, $method = "", $text = "", $track = 1, $escapeText = 1, $title="")

""IsWikiName""($text)

""TrackLinkTo""($tag)

""GetLinkTable""()

""ClearLinkTable""()

""StartLinkTracking""()

""StopLinkTracking""()

""WriteLinkTable""()

Header()

Footer()

===FORMS===
""FormOpen""($method = "", $tag = "", $formMethod = "post")

""FormClose""()

===INTERWIKI STUFF===
""ReadInterWikiConfig""()

""AddInterWiki""($name, $url)

""GetInterWikiUrl""($name, $tag)

===REFERRERS===
""LogReferrer""($tag = "", $referrer = "")

""LoadReferrers""($tag = "")

===PLUGINS===
Action($action, $forceLinkTracking = 0)
Responsible for executing the Actions /Plugins that are found in the /wikka/actions/ directory. It receives a string ($action) that specifies which file to execute. It also is responsible for passing the $vars array to the executed php script. The file has to have a //.php// extension in order to be executed by this function.
Method($method)
Returns the method that the current page was called by. Known methods are /edit /create /delete ...
Format($text, $formatter = "wakka")
Returns the parsed string ($text) after it has been parsed from the specified formatter ($formatter). If no $formatter is supplied then it assumes the default "wakka" formatter that is responsible for converting the wiki syntax to displayable HTML. The availble formatters are found under the /wikka/formatters/ directory.
===Functions relating to **Users**===
""LoadUser""($name, $password = 0)

""LoadUsers""()
Returns an, alphabetically sorted by name, array of the users table. This array contains numerical indexes that hold a associative array of all the fields the wakka_users table has, in the form of ["field_name"] = > "field_value" .
""GetUserName""()
Returns the result of ""GetUser""() (see below) or the hostname of the visitor's host.
""GetUser""()
Retreives the ""UserName"" of the visitor from the global php $_SESSION['user'] field. It is highly reccomended to use the ""GetUserName""() function instead of this one unless you have a special reason.
""SetUser""($user)
Used in the Run() function of the ""WakkaCore"". It fetches and sets the ""UserName"" (if found) from a cookie.
""LogoutUser""()
Removes any cookie send to the user using the ""DeleteCookie""() function, effectively forgetting the login of the particular user.
""UserWantsComments""()
Returns true if the user is logged in and has set his preferences to show any page's comments by default. It returns false in any other case.
===Functions related to Comments===
""LoadComments""($tag)
Returns an array of the comments on the received tag (""WikiPage""), sorted by time each comment record was made.
""LoadRecentComments""($limit = 50)
Returns an array of the most recent ( depenting on the limit ($limit) ) number of comments to the current ""WikiPage"". The default value for the array size is 50.
""LoadRecentlyCommented""($limit = 50)
Returns an array of the most recently commented ""WikiPages"" in an array. The size of the array maybe be specified ($limit). The default value for $limit is 50.
""SaveComment""($page_tag, $comment)
Saves a comment($comment) on a ""WikiPage""($page_tag) to the database.
===Functions related to controling Access===
""UserIsOwner""($tag = "")
Returns true if logged in user is owner of the provided page ($tag). If no $tag is provided then it acts on the current page.
""IsAdmin""()
Returns //true// if user is listed in configuration list as admin, //false// if any other case.
""GetPageOwner""($tag = "", $time = "")
Returns the ""UserName"" of the page's ($tag) owner. If no $tag is provided when calling the function then it acts on the current page.
""SetPageOwner""($tag, $user)
Sets the page's ($tag) owneship to the specified ""UserName"" ($user). Both arguments need to be provided.
""LoadACL""($tag, $privilege, $useDefaults = 1)
Returns an array. The form of the array is as follows :
%%(php)array = {
["page_tag"] => $tag,
[$privilege."_acl"] => the_default_configuration_acl_for_this_privilege
}%%
""LoadAllACLs""($tag, $useDefaults = 1)

""SaveACL""($tag, $privilege, $list)

""TrimACLs""($list)

""HasAccess""($privilege, $tag = "", $user = "")
This returns true or 1 if the user ($user) can complete the requested action ($priviledge) on the page ($tag). If no $tag is provided then it acts the displayed ""WikiPage"". If no $user is provided then it acts on the current ""UserName"".
Deletions:
=====Wikka Core - the structure of ##wikka.php##=====
##**wikka.php**## is the engine of WikkaWiki.
To understand, how Wikka works it is necessary to understand this file.
<<This page is under construction. Contributions are welcome<<::c::
====The functions====
The functions of ##wikka.php## in alphabetical order.
===##""CheckMySQLVersion""##===
//checks if the version-number of MySQL is at least equal or higher then the version-number given to the function//
class:wakka
parameters: $major, $minor, $subminor (contain a version-number in the form of maior.minor.subminorsubminor, i.e. 4.1.00)
uses
~functions: [[http://www.php.net/manual/en/function.explode.php explode]], [[http://www.php.net/manual/en/function.mysql-fetch-array.php mysql_fetch_array]], [[http://dev.mysql.com/doc/mysql/en/mysql_fetch_row.html mysql_fetch_row]], [[http://dev.mysql.com/doc/mysql/en/mysql_num_rows.html mysql_num_rows]], [[http://dev.mysql.com/doc/mysql/en/mysql_query.html mysql_query]]
~class variables: -
~local variables: $row, $match, $msqyl_major, $mysql_minor, $ mysql_subminor
is used by
~functions:
comments:
===##""LoadAll""##===
//sends a MySQL-query to Query, puts the result in an array and frees the memory with the results of the query//
class: Wakka
parameters: $query (a MySQL query)
uses
~functions: Query, [[http://www.php.net/mysql_fetch_assoc mysql_fetch_assoc]], [[http://dev.mysql.com/doc/mysql/en/mysql_free_result.html mysql_free_result]]
~class variables: -
~local variables: $data (array with every result of the query in one field), $r (stores the result of the query), $row (temporary stores one result of the query)
~config options: -
is used by
~functions: LoadSingle, ''?''
comments:
===##""LoadSingle""##===
//sends a MySQL-query to LoadAll and returns the first result of the results returned from LoadAll//
class: Wakka
paramters: $query (a MySQL query)
uses
~functions: LoadAll
~class variables: -
~local variables: $data (array with every result of the query in one field),
~config options: -
is used by
~functions: ''?''
comments:
~''If all you need is a single result this is a highly inefficient way of getting it; a sepaarte query would be more efficicient. -- JavaWoman''
===##Query##===
//Query sends a MySQL-query to MySQL, returns the result and (optional) infos on time and query.//
class: Wakka
parameters: $query (a MySQL query)
uses
~functions: GetMicroTime, GetConfigValue, [[http://dev.mysql.com/doc/mysql/en/mysql_query.html mysql_query]], [[http://www.php.net/ob_end_clean ob_end_clean]]
~class variables: $dblink (contains the connection to the database), queryLog (array with $query and $time)
~local variables: $start, (starting time of the query) $time (time MySQL needed for executing the query)
~config options: "sql_debugging" (if set to "1", queryLog is set)
is used by
~functions: LoadAll
comments:
===##Wakka##===
//The constructor for a Wakka object. Is called once when adding a new Wakka object and is used for initial purposes//
class: Wakka
parameters: $config (an array with the [[ConfigurationOptions config options of Wikka]])
uses
~functions: [[http://dev.mysql.com/doc/mysql/en/mysql_close.html mysql_close]], [[http://dev.mysql.com/doc/mysql/en/mysql_connect.html mysql_connect]], [[http://dev.mysql.com/doc/mysql/en/mysql_select_db.html mysql_select_db]],
~global variables: WAKKA_VERSION (constant with the version of Wikka)
~class variables: $config (an array with the [[ConfigurationOptions config options of Wikka]]), dblink (contains the connection to the database), VERSION (the version of Wikka),
~local variables: -
~config options: "mysql_database", "mysql_host", "mysql_password", "mqsql_user" (all for testting access to the database)
is used by
~is called once when adding a new Wakka object
comments:
~what does the @ before mysql commands do?
~mysql_connect is deprecated.
~''@ Suppresses error messages; not a good idea gererally, better to take care to code in such a way that no errors, warnings or even notices will be produced. -- JavaWoman''


Revision [2320]

Edited on 2004-11-18 16:52:34 by DarTar [Minor restyling to increase legibility]
Additions:
[[WikkaDocumentation Wikka Documentation]]
=====Wikka Core - the structure of ##wikka.php##=====
##**wikka.php**## is the engine of WikkaWiki.
To understand, how Wikka works it is necessary to understand this file.
<<This page is under construction. Contributions are welcome<<::c::
====The functions====
The functions of ##wikka.php## in alphabetical order.
===##""CheckMySQLVersion""##===
===##""LoadAll""##===
===##""LoadSingle""##===
===##Query##===
===##Wakka##===
Deletions:
[[HelpInfo Wikka Documentation]]
====Wikka Core - the structure of Wikka.php====
**Wikka.php** is the main file of WikkaWiki. To understand, how Wikka works it is necessary to understand this file.
===The functions===
The functions of Wikka.php in alphabetical order.
**CheckMySQLVersion**
**LoadAll**
**LoadSingle**
**Query**
**Wakka**


Revision [2315]

Edited on 2004-11-18 13:17:12 by NilsLindenberg [CheckMySQLVersion added]
Additions:
**CheckMySQLVersion**
//checks if the version-number of MySQL is at least equal or higher then the version-number given to the function//
class:wakka
parameters: $major, $minor, $subminor (contain a version-number in the form of maior.minor.subminorsubminor, i.e. 4.1.00)
~functions: [[http://www.php.net/manual/en/function.explode.php explode]], [[http://www.php.net/manual/en/function.mysql-fetch-array.php mysql_fetch_array]], [[http://dev.mysql.com/doc/mysql/en/mysql_fetch_row.html mysql_fetch_row]], [[http://dev.mysql.com/doc/mysql/en/mysql_num_rows.html mysql_num_rows]], [[http://dev.mysql.com/doc/mysql/en/mysql_query.html mysql_query]]
~class variables: -
~local variables: $row, $match, $msqyl_major, $mysql_minor, $ mysql_subminor
~functions:
~functions: GetMicroTime, GetConfigValue, [[http://dev.mysql.com/doc/mysql/en/mysql_query.html mysql_query]], [[http://www.php.net/ob_end_clean ob_end_clean]]
~what does the @ before mysql commands do?
~mysql_connect is deprecated.
Deletions:
~functions: GetMicroTime, GetConfigValue,[[http://dev.mysql.com/doc/mysql/en/mysql_query.html mysql_query]], [[http://www.php.net/ob_end_clean ob_end_clean]]
comments: what does the @ before mysql commands do? mysql_connect is deprecated.


Revision [2201]

Edited on 2004-11-15 15:14:36 by JavaWoman [two comments]
Additions:
~''If all you need is a single result this is a highly inefficient way of getting it; a sepaarte query would be more efficicient. -- JavaWoman''
~''@ Suppresses error messages; not a good idea gererally, better to take care to code in such a way that no errors, warnings or even notices will be produced. -- JavaWoman''


Revision [2195]

Edited on 2004-11-15 12:11:55 by NilsLindenberg [Wakka added]
Additions:
~functions: Query, [[http://www.php.net/mysql_fetch_assoc mysql_fetch_assoc]], [[http://dev.mysql.com/doc/mysql/en/mysql_free_result.html mysql_free_result]]
~class variables: -
~functions: LoadSingle, ''?''
comments:
**LoadSingle**
//sends a MySQL-query to LoadAll and returns the first result of the results returned from LoadAll//
paramters: $query (a MySQL query)
uses
~class variables: -
~local variables: $data (array with every result of the query in one field),
is used by
~functions: ''?''
comments:
~functions: GetMicroTime, GetConfigValue,[[http://dev.mysql.com/doc/mysql/en/mysql_query.html mysql_query]], [[http://www.php.net/ob_end_clean ob_end_clean]]
~class variables: $dblink (contains the connection to the database), queryLog (array with $query and $time)
~config options: "sql_debugging" (if set to "1", queryLog is set)
comments:
**Wakka**
//The constructor for a Wakka object. Is called once when adding a new Wakka object and is used for initial purposes//
parameters: $config (an array with the [[ConfigurationOptions config options of Wikka]])
~functions: [[http://dev.mysql.com/doc/mysql/en/mysql_close.html mysql_close]], [[http://dev.mysql.com/doc/mysql/en/mysql_connect.html mysql_connect]], [[http://dev.mysql.com/doc/mysql/en/mysql_select_db.html mysql_select_db]],
~global variables: WAKKA_VERSION (constant with the version of Wikka)
~class variables: $config (an array with the [[ConfigurationOptions config options of Wikka]]), dblink (contains the connection to the database), VERSION (the version of Wikka),
~local variables: -
~config options: "mysql_database", "mysql_host", "mysql_password", "mqsql_user" (all for testting access to the database)
is used by
~is called once when adding a new Wakka object
comments: what does the @ before mysql commands do? mysql_connect is deprecated.
Deletions:
~functions: Query, mysql_fetch_assoc, [[http://dev.mysql.com/doc/mysql/en/mysql_free_result.html mysql_free_result]]
~global variables: -
~functions: LoadSingle,...
comments: I couldn't find mysql_fetch_assoc. What does it do?
~functions: GetMicroTime, GetConfigValue,[[http://dev.mysql.com/doc/mysql/en/mysql_query.html mysql_query]], ob_end_clean
~global variables: $dblink (contains the connection to the database), queryLog (array with $query and $time)
~config options: sql_debugging (if set to "1", queryLog is set)
comments: Shouldn't be called directly, use LoadAll instead.


Revision [2194]

The oldest known version of this page was created on 2004-11-15 11:50:55 by NilsLindenberg [Wakka added]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki