An object for adding, viewing, editing and deleting a specific blog entry.
BlogEntry PHP Methods
add($postVals) v4.23Adds a new record. The $postVals is an array of the values for each column when adding the record. Returns 0 if fails, returns the id of the new record if success.
addComment($leadID, $comment, $approved = 0) v4.3
static convertDirectory($newDirectory, $beID = 0) v4.3
convertHTML($htmlContent = '') v4.23Converts ~~ variables in the $htmlContent that is provided and returns the converted content. The title of the ~~ variables are converted by the content from the column in the database with the matching title.
deleteThis($restoreQuery = '') v4.23Deletes the loaded record from the database. |
$restoreQuery = FOR INTERNAL USE. FOR TYPICAL USAGE LEAVE THIS BLANK. The restore query to pass along when deleting an object with dependencies.
duplicateThis($newValues = null) v4.92Creates a duplicate record in the database of the current object and returns the id of the new record.
getContentVar($aID = 1) v4.3
getDefaultTRHTML() v4.23Returns the default html code for a tr row with all of the fields from the database in it as ~~ vars
getValue($fieldName) v4.23Returns the value from a specific column for this record. |
$fieldName = The name of the column to get the value from.
hideAllFields() v4.23Hides all of the columns (fields) from the database table from being returned in the results.
hideField($fieldTitle) v4.23Hides a specific column (field) from the database table from being returned in the results.
loadValues($id) v4.23Loads values for the record with the id specified. Returns 0 if not found, 1 if success
loadValuesWhere($whereString = 'id=1') v4.23Loads values for the record matching the criteria specified by $whereString. If the there is more than one record returned from the query then only the first record is loaded. Returns 0 if not found, 1 if success. |
$whereString = The condition to use to filter the results. Should be mysql format.
save($postVals) v4.23Saves the record with the new values specified in the $postVals array. |
$postVals = An array containing the values to be stored. The key of the array is used for the column name and the value of the array is the value to be stored in that column.
showAllFields() v4.23Shows all the columns (fields) from the database table in the results that are returned.
showField($fieldTitle) v4.23Shows a specific column (field) from the database table in the results that are returned.
Columns in the blogentry Database Table:
id added title descr content blogid isactive
Use the code below to view
a record in an html
Use the code below to add
Use the code below to delete