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

Class: Manual_Notes

Source Location: /pearweb_manual-1.2.3/include/notes/ManualNotes.class.php

Class Overview


Manual Notes


Author(s):

Version:

  • 1.0

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 32]
Manual Notes

This class will be handling most of the manual notes adding, deleting, approving, etc



[ Top ]


Class Variables

$dbc =

[line 44]

Database Connection

This variables holds the database connection into a variable.

  • Var: Database Connection
  • Access: protected

Type:   Object


[ Top ]

$notesTableName =  'manual_notes'

[line 55]

Notes table

This is the variable that holds the name of the manual notes table.

  • Var: The notes table name
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 59]

Manual_Notes __construct( )


[ Top ]

addComment   [line 78]

void addComment( string $pageUrl, string $userName, string $note, [string $approved = 'pending'])

Add a comment

This function will add a comment to the database using the credentials passed to it.

  • Access: public

Parameters:

string   $pageUrl   —  The page url
string   $userName   —  The user adding the comment
string   $note   —  The note to add
string   $approved   —  Is it approved ? "Default: pending"

[ Top ]

deleteComments   [line 335]

Mixed deleteComments( Array $note_ids)

Delete Comments

This function will delete a comment by it's note_id This function will mainly be used by administrators and people with enough karma to manage comments.

  • Return: An error object if query was erroneous, bool if it was successful
  • Access: public

Parameters:

Array   $note_ids   —  The array of the notes to delete

[ Top ]

deleteSingleComment   [line 373]

Mixed deleteSingleComment( Integer $note_id)

Delete a single comment

This function will delete a single comment by it's id.

  • Return: Error object if query is an error otherwise return a bool on success
  • Access: public

Parameters:

Integer   $note_id   —  The note id to delete

[ Top ]

display   [line 384]

void display( $comment)


Parameters:

   $comment   — 

[ Top ]

getPageComments   [line 183]

mixed getPageComments( string $url, [string|bool $status = '1'], [bool $all = false])

Get Page Comments

This function will get the comments depending on whether a method will need approved, unapproved pending comments, etc. (Per manual page)

  • Return: It returns an error object if there was an error executing the query, will return an empty array if there was nothing returned from the query, or this will return an associative array of the comments per page.
  • Access: public

Parameters:

string   $url   —  The url of the comments
string|bool   $status   —  The status of the comment.. whether it's approved, unapproved, pending. If a boolean is passed in, determine whether to display approved/pending, or just approved
bool   $all   —  if true, return all comments matching this status

[ Top ]

getSingleCommentById   [line 145]

mixed getSingleCommentById( integer $noteId)

Get a single comment by id

This function will retrieve the single comment's information by note_id.

  • Return: Error on query fail and associative array on success.
  • Access: public

Parameters:

integer   $noteId   —  The note id to retrieve

[ Top ]

obfuscateAnonLink   [line 424]

string obfuscateAnonLink( string $text)

Obfuscate Anonymous link

This function will take a parameter and make it obfuscated in a manner that no script can find @ . , etc. This is the same method used for bugs and all mailto_links on the site (site-wide)

  • Return: The text obfuscated
  • Access: public

Parameters:

string   $text   —  The text to obfuscate

[ Top ]

updateComment   [line 302]

mixed updateComment( integer $noteId, string $url, string $userName, string $approved)

Update Comment

This function will update a current comment (status, note text, url, username, etc)

  • Return: An error if an error object occured with the query
  • Access: public

Parameters:

integer   $noteId   —  The id of the note to update
string   $url   —  The url of the page that the note belongs to.
string   $userName   —  The user[name|address] of the author of the note.
string   $approved   —  The status of the note, default = 'pending'

[ Top ]

updateCommentList   [line 257]

mixed updateCommentList( $noteIds, string $status, integer $noteId)

Update Comment List

This function will update a current comment (status, note text, url, username, etc)

  • Return: An error if an error object occured with the query
  • Access: public

Parameters:

integer   $noteId   —  The id of the note to update
string   $status   —  The status of the note, default = 'pending'
   $noteIds   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 16:04:25 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.