|
| getPosts ($params=[], bool $count_only=false, ?dcSelectStatement $ext_sql=null) |
|
| getNextPost (dcRecord $post, int $dir, bool $restrict_to_category=false, bool $restrict_to_lang=false) |
|
| getLangs ($params=[]) |
|
| getDates ($params=[]) |
|
| addPost (cursor $cur) |
|
| updPost ($id, cursor $cur) |
|
| updPostStatus ($id, $status) |
|
| updPostsStatus ($ids, $status) |
|
| updPostSelected ($id, $selected) |
|
| updPostsSelected ($ids, $selected) |
|
| updPostCategory ($id, $cat_id) |
|
| updPostsCategory ($ids, $cat_id) |
|
| changePostsCategory ($old_cat_id, $new_cat_id) |
|
| delPost ($id) |
|
| delPosts ($ids) |
|
| publishScheduledEntries () |
|
| firstPublicationEntries ($ids) |
|
| getPostsUsers (string $post_type='post') |
|
| setPostContent ($post_id, $format, $lang, &$excerpt, &$excerpt_xhtml, &$content, &$content_xhtml) |
|
| getPostURL ($url, $post_dt, $post_title, $post_id) |
|
◆ __construct()
◆ getQmarkURL()
Returns blog URL ending with a question mark.
- Returns
- string The qmark url.
References $url.
Referenced by getPF(), and getVF().
◆ getJsJQuery()
◆ getPF()
getPF |
( |
string |
$pf, |
|
|
bool |
$strip_host = true |
|
) |
| |
Returns public URL of specified plugin file.
- Parameters
-
string | $pf | plugin file |
bool | $strip_host | Strip host in URL |
- Returns
- string
References $ret, getQmarkURL(), and html\stripHostURL().
◆ getVF()
getVF |
( |
string |
$vf, |
|
|
bool |
$strip_host = true |
|
) |
| |
◆ getPostStatus()
getPostStatus |
( |
int |
$status | ) |
|
Returns an entry status name given to a code. Status are translated, never use it for tests. If status code does not exist, returns unpublished.
- Parameters
-
int | $status | The status code |
- Returns
- string The post status.
References $status.
◆ getAllPostStatus()
Returns an array of available entry status codes and names.
- Returns
- array Simple array with codes in keys and names in value.
◆ getAllCommentStatus()
Returns an array of available comment status codes and names.
- Returns
- array Simple array with codes in keys and names in value
◆ withoutPassword()
withoutPassword |
( |
bool |
$value | ) |
|
Disallows entries password protection. You need to set it to false while serving a public blog.
- Parameters
-
◆ triggerBlog()
Updates blog last update date. Should be called every time you change an element related to the blog.
References dcCore\app().
Referenced by addCategory(), addComment(), changePostsCategory(), delCategory(), delComments(), delJunkComments(), delPosts(), publishScheduledEntries(), resetCategoriesOrder(), setCategoryParent(), setCategoryPosition(), updCategory(), updCategoryPosition(), updComment(), updCommentsStatus(), updPostsCategory(), updPostsSelected(), and updPostsStatus().
◆ triggerComment()
triggerComment |
( |
int |
$id, |
|
|
bool |
$del = false |
|
) |
| |
Updates comment and trackback counters in post table. Should be called every time a comment or trackback is added, removed or changed its status.
- Parameters
-
int | $id | The comment identifier |
bool | $del | If comment is deleted, set this to true |
References triggerComments().
Referenced by addComment(), and updComment().
◆ triggerComments()
triggerComments |
( |
|
$ids, |
|
|
bool |
$del = false , |
|
|
|
$affected_posts = null |
|
) |
| |
Updates comments and trackbacks counters in post table. Should be called every time comments or trackbacks are added, removed or changed their status.
- Parameters
-
mixed | $ids | The identifiers |
bool | $del | If comment is delete, set this to true |
mixed | $affected_posts | The affected posts IDs |
References dcUtils\cleanIds().
Referenced by delComments(), triggerComment(), and updCommentsStatus().
◆ categories()
Get dcCategories instance
- Returns
- dcCategories
References categories().
Referenced by addCategory(), categories(), delCategory(), getCategories(), getCategoryParent(), getCategoryParents(), resetCategoriesOrder(), setCategoryParent(), setCategoryPosition(), updCategory(), and updCategoryPosition().
◆ getCategories()
getCategories |
( |
|
$params = [] | ) |
|
◆ getCategory()
◆ getCategoryParents()
getCategoryParents |
( |
int |
$id | ) |
|
Gets the category parents.
- Parameters
-
int | $id | The category identifier |
- Returns
- dcRecord The category parents.
References categories().
◆ getCategoryParent()
getCategoryParent |
( |
int |
$id | ) |
|
Gets the category first parent.
- Parameters
-
int | $id | The category identifier |
- Returns
- dcRecord The category parent.
References categories().
◆ getCategoryFirstChildren()
getCategoryFirstChildren |
( |
int |
$id | ) |
|
Gets all category's first children.
- Parameters
-
int | $id | The category identifier |
- Returns
- dcRecord The category first children.
References $id, and getCategories().
◆ IsInCatSubtree()
IsInCatSubtree |
( |
string |
$cat_url, |
|
|
string |
$start_url |
|
) |
| |
Returns true if a given category if in a given category's subtree
- Parameters
-
string | $cat_url | The cat url |
string | $start_url | The top cat url |
- Returns
- bool true if cat_url is in given start_url cat subtree
References getCategories().
◆ addCategory()
addCategory |
( |
cursor |
$cur, |
|
|
int |
$parent = 0 |
|
) |
| |
◆ updCategory()
updCategory |
( |
int |
$id, |
|
|
cursor |
$cur |
|
) |
| |
◆ updCategoryPosition()
updCategoryPosition |
( |
int |
$id, |
|
|
int |
$left, |
|
|
int |
$right |
|
) |
| |
Set category position.
- Parameters
-
int | $id | The category ID |
int | $left | The category ID before |
int | $right | The category ID after |
References categories(), and triggerBlog().
◆ setCategoryParent()
setCategoryParent |
( |
int |
$id, |
|
|
int |
$parent |
|
) |
| |
Sets the category parent.
- Parameters
-
int | $id | The category ID |
int | $parent | The parent category ID |
References categories(), and triggerBlog().
◆ setCategoryPosition()
setCategoryPosition |
( |
int |
$id, |
|
|
int |
$sibling, |
|
|
string |
$move |
|
) |
| |
Sets the category position.
- Parameters
-
int | $id | The category ID |
int | $sibling | The sibling category ID |
string | $move | The move (before|after) |
References categories(), and triggerBlog().
◆ delCategory()
◆ resetCategoriesOrder()
◆ getPosts()
getPosts |
( |
|
$params = [] , |
|
|
bool |
$count_only = false , |
|
|
?dcSelectStatement |
$ext_sql = null |
|
) |
| |
Retrieves entries. $params is an array taking the following optionnal parameters:
- no_content: Don't retrieve entry content (excerpt and content)
- post_type: Get only entries with given type (default "post", array for many types and '' for no type)
- post_id: (integer or array) Get entry with given post_id
- post_url: Get entry with given post_url field
- user_id: (integer) Get entries belonging to given user ID
- cat_id: (string or array) Get entries belonging to given category ID
- cat_id_not: deprecated (use cat_id with "id ?not" instead)
- cat_url: (string or array) Get entries belonging to given category URL
- cat_url_not: deprecated (use cat_url with "url ?not" instead)
- post_status: (integer) Get entries with given post_status
- post_selected: (boolean) Get select flaged entries
- post_year: (integer) Get entries with given year
- post_month: (integer) Get entries with given month
- post_day: (integer) Get entries with given day
- post_lang: Get entries with given language code
- search: Get entries corresponding of the following search string
- columns: (array) More columns to retrieve
- join: Append a JOIN clause for the FROM statement in query
- sql: Append SQL string at the end of the query
- from: Append another FROM source in query
- order: Order of results (default "ORDER BY post_dt DES")
- limit: Limit parameter
- exclude_post_id : (integer or array) Exclude entries with given post_id
Please note that on every cat_id or cat_url, you can add ?not to exclude the category and ?sub to get subcategories.
- Parameters
-
- Returns
- dcRecord A record with some more capabilities
References dcCore\app(), dcCategories\CATEGORY_TABLE_NAME, dcAuth\PERMISSION_CONTENT_ADMIN, dcPostMedia\POST_MEDIA_TABLE_NAME, text\splitWords(), and dcAuth\USER_TABLE_NAME.
Referenced by firstPublicationEntries().
◆ getNextPost()
getNextPost |
( |
dcRecord |
$post, |
|
|
int |
$dir, |
|
|
bool |
$restrict_to_category = false , |
|
|
bool |
$restrict_to_lang = false |
|
) |
| |
Returns a dcRecord with post id, title and date for next or previous post according to the post ID. $dir could be 1 (next post) or -1 (previous post).
- Parameters
-
dcRecord | $post | The post ID |
int | $dir | The search direction |
bool | $restrict_to_category | Restrict to same category |
bool | $restrict_to_lang | Restrict to same language |
- Returns
- dcRecord|null The next post.
References if.
◆ getLangs()
Retrieves different languages and post count on blog, based on post_lang field. $params is an array taking the following optionnal parameters:
- post_type: Get only entries with given type (default "post", '' for no type)
- lang: retrieve post count for selected lang
- order: order statement (default post_lang DESC)
- Parameters
-
array | ArrayObject | $params | The parameters |
- Returns
- dcRecord The langs.
◆ getDates()
Returns a dcRecord with all distinct blog dates and post count. $params is an array taking the following optionnal parameters:
- type: (day|month|year) Get days, months or years
- year: (integer) Get dates for given year
- month: (integer) Get dates for given month
- day: (integer) Get dates for given day
- cat_id: (integer) Category ID filter
- cat_url: Category URL filter
- post_lang: lang of the posts
- next: Get date following match
- previous: Get date before match
- order: Sort by date "ASC" or "DESC"
- Parameters
-
array | ArrayObject | $params | The parameters |
- Returns
- dcRecord The dates.
◆ addPost()
Creates a new entry. Takes a cursor as input and returns the new entry ID.
- Parameters
-
cursor | $cur | The post cursor |
- Exceptions
-
- Returns
- int
◆ updPost()
Updates an existing post.
- Parameters
-
int | $id | The post identifier |
cursor | $cur | The post cursor |
- Exceptions
-
References $id, and dcCore\app().
◆ updPostStatus()
updPostStatus |
( |
|
$id, |
|
|
|
$status |
|
) |
| |
◆ updPostsStatus()
updPostsStatus |
( |
|
$ids, |
|
|
|
$status |
|
) |
| |
◆ updPostSelected()
updPostSelected |
( |
|
$id, |
|
|
|
$selected |
|
) |
| |
Updates post selection.
- Parameters
-
int | $id | The identifier |
mixed | $selected | The selected flag |
References $id, and updPostsSelected().
◆ updPostsSelected()
updPostsSelected |
( |
|
$ids, |
|
|
|
$selected |
|
) |
| |
◆ updPostCategory()
updPostCategory |
( |
|
$id, |
|
|
|
$cat_id |
|
) |
| |
Updates post category. $cat_id can be null.
- Parameters
-
int | $id | The identifier |
mixed | $cat_id | The cat identifier |
References $id, and updPostsCategory().
◆ updPostsCategory()
updPostsCategory |
( |
|
$ids, |
|
|
|
$cat_id |
|
) |
| |
◆ changePostsCategory()
changePostsCategory |
( |
|
$old_cat_id, |
|
|
|
$new_cat_id |
|
) |
| |
◆ delPost()
Deletes a post.
- Parameters
-
int | $id | The post identifier |
References $id, and delPosts().
◆ delPosts()
◆ publishScheduledEntries()
publishScheduledEntries |
( |
| ) |
|
◆ firstPublicationEntries()
firstPublicationEntries |
( |
|
$ids | ) |
|
◆ getPostsUsers()
getPostsUsers |
( |
string |
$post_type = 'post' | ) |
|
Retrieves all users having posts on current blog.
- Parameters
-
string | $post_type | post_type filter (post) |
- Returns
- dcRecord
References dcAuth\USER_TABLE_NAME.
◆ setPostContent()
setPostContent |
( |
|
$post_id, |
|
|
|
$format, |
|
|
|
$lang, |
|
|
& |
$excerpt, |
|
|
& |
$excerpt_xhtml, |
|
|
& |
$content, |
|
|
& |
$content_xhtml |
|
) |
| |
Creates post HTML content, taking format and lang into account.
- Parameters
-
int | $post_id | The post identifier |
string | $format | The format |
string | $lang | The language |
string | $excerpt | The excerpt |
string | $excerpt_xhtml | The excerpt HTML |
string | $content | The content |
string | $content_xhtml | The content HTML |
References dcCore\app().
◆ getPostURL()
getPostURL |
( |
|
$url, |
|
|
|
$post_dt, |
|
|
|
$post_title, |
|
|
|
$post_id |
|
) |
| |
Returns URL for a post according to blog setting post_url_format. It will try to guess URL and append some figures if needed.
- Parameters
-
string | $url | The url |
string | $post_dt | The post dt |
string | $post_title | The post title |
int | $post_id | The post identifier |
- Returns
- string The post url.
References $url, and text\tidyURL().
◆ getComments()
getComments |
( |
|
$params = [] , |
|
|
bool |
$count_only = false , |
|
|
?dcSelectStatement |
$ext_sql = null |
|
) |
| |
Retrieves comments. $params is an array taking the following optionnal parameters:
- no_content: Don't retrieve comment content
- post_type: Get only entries with given type (default no type, array for many types)
- post_id: (integer) Get comments belonging to given post_id
- cat_id: (integer or array) Get comments belonging to entries of given category ID
- comment_id: (integer or array) Get comment with given ID (or IDs)
- comment_site: (string) Get comments with given comment_site
- comment_status: (integer) Get comments with given comment_status
- comment_trackback: (integer) Get only comments (0) or trackbacks (1)
- comment_ip: (string) Get comments with given IP address
- post_url: Get entry with given post_url field
- user_id: (integer) Get entries belonging to given user ID
- q_author: Search comments by author
- sql: Append SQL string at the end of the query
- from: Append SQL string after "FROM" statement in query
- order: Order of results (default "ORDER BY comment_dt DES")
- limit: Limit parameter
- Parameters
-
- Returns
- dcRecord A record with some more capabilities
References dcCore\app(), dcAuth\PERMISSION_CONTENT_ADMIN, POST_PUBLISHED, text\splitWords(), and dcAuth\USER_TABLE_NAME.
Referenced by updComment().
◆ addComment()
◆ updComment()
updComment |
( |
|
$id, |
|
|
cursor |
$cur |
|
) |
| |
◆ updCommentStatus()
updCommentStatus |
( |
|
$id, |
|
|
|
$status |
|
) |
| |
◆ updCommentsStatus()
updCommentsStatus |
( |
|
$ids, |
|
|
|
$status |
|
) |
| |
◆ delComment()
Delete a comment.
- Parameters
-
int | $id | The comment identifier |
References $id, and delComments().
◆ delComments()
◆ delJunkComments()
◆ BLOG_TABLE_NAME
const BLOG_TABLE_NAME = 'blog' |
◆ POST_TABLE_NAME
const POST_TABLE_NAME = 'post' |
Referenced by dcCore\countAllComments(), dcCore\countBlogPosts(), dcAntispam\delAllSpam(), dcMeta\delMeta(), dcDefaultPostActions\doChangePostAuthor(), dcDefaultPostActions\doChangePostLang(), dcDefaultPageActions\doReorderPages(), dcMeta\getMetadata(), dcCore\getUsers(), dcImportDC1\importComments(), dcImportWP\importComments(), dcImportDC1\importPost(), dcImportWP\importPost(), dcImportDC1\importPosts(), dcImportWP\importPosts(), dcCore\indexAllPosts(), adminPost\process(), adminPage\process(), dcImportFeed\process(), dcRestMethods\quickPost(), dcMaintenanceSynchpostsmeta\synchronizeAllPostsmeta(), dcMeta\updateMeta(), and dcCore\updUser().
◆ COMMENT_TABLE_NAME
const COMMENT_TABLE_NAME = 'comment' |
◆ BLOG_ONLINE
◆ BLOG_OFFLINE
◆ BLOG_REMOVED
◆ POST_PENDING
Referenced by adminPostList\display(), dcDefaultPostActions\doChangePostStatus(), dcImportWP\importPost(), dcImportDC1\importUsers(), adminPost\init(), adminUser\init(), adminPage\init(), dcImportFeed\process(), adminIndex\render(), adminPost\render(), and adminPage\render().
◆ POST_SCHEDULED
const POST_SCHEDULED = -1 |
◆ POST_UNPUBLISHED
const POST_UNPUBLISHED = 0 |
◆ POST_PUBLISHED
◆ COMMENT_JUNK
◆ COMMENT_PENDING
const COMMENT_PENDING = -1 |
◆ COMMENT_UNPUBLISHED
const COMMENT_UNPUBLISHED = 0 |
◆ COMMENT_PUBLISHED
const COMMENT_PUBLISHED = 1 |
◆ $con
◆ $prefix
◆ $id
Referenced by __construct(), addCategory(), delCategory(), delComment(), delPost(), getCategoryFirstChildren(), updCategory(), updComment(), updCommentStatus(), updPost(), updPostCategory(), updPostSelected(), and updPostStatus().
◆ $uid
◆ $name
◆ $desc
◆ $url
◆ $host
◆ $creadt
◆ $upddt
◆ $status
◆ $settings
◆ $themes_path
◆ $public_path
◆ $without_password
The documentation for this class was generated from the following file: