Functions

Adds a news entry to the database, and send out the news to any RSS cloud listeners.

add_news(\SHORT_TEXT $title, \LONG_TEXT $news, \?ID_TEXT $author, \BINARY $validated, \BINARY $allow_rating, \SHORT_INTEGER $allow_comments, \BINARY $allow_trackbacks, \LONG_TEXT $notes, \LONG_TEXT $news_article, \?AUTO_LINK $main_news_category, \?array $news_category, \?TIME $time, \?MEMBER $submitter, integer $views, \?TIME $edit_date, \?AUTO_LINK $id, \URLPATH $image) : \AUTO_LINK

Parameters

$title

\SHORT_TEXT

The news title

$news

\LONG_TEXT

The news summary (or if not an article, the full news)

$author

\?ID_TEXT

The news author (possibly, a link to an existing author in the system, but does not need to be) (NULL: current username)

$validated

\BINARY

Whether the news has been validated

$allow_rating

\BINARY

Whether the news may be rated

$allow_comments

\SHORT_INTEGER

Whether comments are allowed (0=no, 1=yes, 2=review style)

$allow_trackbacks

\BINARY

Whether the news may have trackbacks

$notes

\LONG_TEXT

Notes for the news

$news_article

\LONG_TEXT

The news entry (blank means no entry)

$main_news_category

\?AUTO_LINK

The primary news category (NULL: personal)

$news_category

\?array

The IDs of the news categories that this is in (NULL: none)

$time

\?TIME

The time of submission (NULL: now)

$submitter

\?MEMBER

The news submitter (NULL: current member)

$views

integer

The number of views the article has had

$edit_date

\?TIME

The edit date (NULL: never)

$id

\?AUTO_LINK

Force an ID (NULL: don't force an ID)

$image

\URLPATH

URL to the image for the news entry (blank: use cat image)

Returns

\AUTO_LINKThe ID of the news just added

Add a news category of the specified details.

add_news_category(\SHORT_TEXT $title, \ID_TEXT $img, \LONG_TEXT $notes, \?MEMBER $owner, \?AUTO_LINK $id) : \AUTO_LINK

Parameters

$title

\SHORT_TEXT

The news category title

$img

\ID_TEXT

The theme image ID of the picture to use for the news category

$notes

\LONG_TEXT

Notes for the news category

$owner

\?MEMBER

The owner (NULL: public)

$id

\?AUTO_LINK

Force an ID (NULL: don't force an ID)

Returns

\AUTO_LINKThe ID of our new news category

Delete a news entry.

delete_news(\AUTO_LINK $id) 

Parameters

$id

\AUTO_LINK

The ID of the news to edit

Delete a news category.

delete_news_category(\AUTO_LINK $id) 

Parameters

$id

\AUTO_LINK

The news category to delete

Send out a notification of some new news.

dispatch_news_notification(\AUTO_LINK $id, \SHORT_TEXT $title, \AUTO_LINK $main_news_category) 

Parameters

$id

\AUTO_LINK

The ID of the news

$title

\SHORT_TEXT

The title

$main_news_category

\AUTO_LINK

The main news category

Edit a news entry.

edit_news(\AUTO_LINK $id, \SHORT_TEXT $title, \LONG_TEXT $news, \ID_TEXT $author, \BINARY $validated, \BINARY $allow_rating, \SHORT_INTEGER $allow_comments, \BINARY $allow_trackbacks, \LONG_TEXT $notes, \LONG_TEXT $news_article, \AUTO_LINK $main_news_category, \?array $news_category, \SHORT_TEXT $meta_keywords, \LONG_TEXT $meta_description, \?URLPATH $image, \?TIME $time) 

Parameters

$id

\AUTO_LINK

The ID of the news to edit

$title

\SHORT_TEXT

The news title

$news

\LONG_TEXT

The news summary (or if not an article, the full news)

$author

\ID_TEXT

The news author (possibly, a link to an existing author in the system, but does not need to be)

$validated

\BINARY

Whether the news has been validated

$allow_rating

\BINARY

Whether the news may be rated

$allow_comments

\SHORT_INTEGER

Whether comments are allowed (0=no, 1=yes, 2=review style)

$allow_trackbacks

\BINARY

Whether the news may have trackbacks

$notes

\LONG_TEXT

Notes for the news

$news_article

\LONG_TEXT

The news entry (blank means no entry)

$main_news_category

\AUTO_LINK

The primary news category (NULL: personal)

$news_category

\?array

The IDs of the news categories that this is in (NULL: do not change)

$meta_keywords

\SHORT_TEXT

Meta keywords

$meta_description

\LONG_TEXT

Meta description

$image

\?URLPATH

URL to the image for the news entry (blank: use cat image) (NULL: don't delete existing)

$time

\?TIME

Recorded add time (NULL: leave alone)

Edit a news category.

edit_news_category(\AUTO_LINK $id, \?SHORT_TEXT $title, \?SHORT_TEXT $img, \?LONG_TEXT $notes, \?MEMBER $owner) 

Parameters

$id

\AUTO_LINK

The news category to edit

$title

\?SHORT_TEXT

The title (NULL: keep as-is)

$img

\?SHORT_TEXT

The image (NULL: keep as-is)

$notes

\?LONG_TEXT

The notes (NULL: keep as-is)

$owner

\?MEMBER

The owner (NULL: public)

Get data from wordpress db

get_wordpress_data() : array

Returns

arrayResult array

Import wordpress db

import_wordpress_db() 

Get a nice formatted XHTML list of news.

nice_get_news(\?AUTO_LINK $it, \?MEMBER $only_owned, boolean $editable_filter, boolean $only_in_blog) : \tempcode

Parameters

$it

\?AUTO_LINK

The selected news entry (NULL: none)

$only_owned

\?MEMBER

Limit news to those submitted by this member (NULL: show all)

$editable_filter

boolean

Whether to only show for what may be edited by the current member

$only_in_blog

boolean

Whether to only show blog posts

Returns

\tempcodeThe list

Get a nice formatted XHTML list of news categories.

nice_get_news_categories(\?mixed $it, boolean $show_all_personal_categories, boolean $addable_filter, boolean $only_existing, \?boolean $only_blogs, boolean $prefer_not_blog_selected) : \tempcode

Parameters

$it

\?mixed

The selected news category. Array or AUTO_LINK (NULL: personal)

$show_all_personal_categories

boolean

Whether to add all personal categories into the list (for things like the adminzone, where all categories must be shown, regardless of permissions)

$addable_filter

boolean

Whether to only show for what may be added to by the current member

$only_existing

boolean

Whether to limit to only existing cats (otherwise we dynamically add unstarted blogs)

$only_blogs

\?boolean

Whether to limit to only show blog categories (NULL: don't care, true: blogs only, false: no blogs)

$prefer_not_blog_selected

boolean

Whether to prefer to choose a non-blog category as the default

Returns

\tempcodeThe tempcode for the news category select list

Show a news entry box.

render_news_box(array $row, \ID_TEXT $zone) : \tempcode

Parameters

$row

array

The news row

$zone

\ID_TEXT

The zone our news module is in

Returns

\tempcodeThe box