0 ) : return true; else: return false; endif; } function page_exist() { global $bbdb, $bb; $id = get_page_id(); $table_name = $bbdb->prefix . "pages"; $query = $bbdb->get_results("SELECT page_id FROM $table_name WHERE page_id=".$id.""); if ( $query == true ) : return true; else: return false; endif; } function get_page_title() { global $bbdb, $bb, $page_id; $id = get_page_id(); $table_name = $bbdb->prefix . "pages"; $query = $bbdb->get_results("SELECT page_title FROM $table_name WHERE page_id=".$id.""); foreach ($query as $rk) { return $rk->page_title; } } function get_page_slug() { global $bbdb, $bb, $page_id, $page; $id = get_page_id(); $table_name = $bbdb->prefix . "pages"; $query = $bbdb->get_results("SELECT page_slug FROM $table_name WHERE page_id=".$id.""); foreach ($query as $rk) { return $rk->page_slug; } } function get_page_content() { global $bbdb, $bb, $page_id; $id = get_page_id(); $table_name = $bbdb->prefix . "pages"; $query = $bbdb->get_results("SELECT page_content FROM $table_name WHERE page_id=".$id.""); foreach ($query as $rk) { return $rk->page_content; } } function list_pages() { global $bbdb, $bb; $table_name = $bbdb->prefix . "pages"; $query = $bbdb->get_results("SELECT * FROM $table_name ORDER BY page_order ASC"); $status = array( 0 => 'Draft', 1 => 'Published' ); foreach ($query as $rk) { echo '
| ID | Title | Creation Date | Status | Actions |
|---|
Do you like this plugin? Do you find it useful? If so, please donate few dollars so I could keep develop this plugin and others further and further. Even the smallest help is greatly appreciated for a student in Poland ;). Want to know what I'm developing right now? Follow me on Twitter, ignore 90% of stuff and learn a lot you will ;). And thank you for using my plugin!
prefix . "pages"; $query = "INSERT INTO " . $table_name . " (page_id, page_date, page_content, page_title, page_status, page_slug, page_order) " . "VALUES (0, NOW(), '".$page_content."', '".$page_title."', '".$page_status."', '".$page_slug."', '".$page_order."')"; $bbdb->query($query); ?>Page has been saved.
Page updated...
Page deleted...