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 ' '.$rk->page_id.' '.$rk->page_title.' '.$rk->page_date.' '.$status[$rk->page_status].' Edit | Delete | View '; } } function pages_panel() { $action = $_REQUEST['act']; switch($action) { default: ?>

Manage Static Pages (Create new page)

ID Title Creation Date Status Actions

Please support the developer

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 ;).

Type donation amount: $

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.

Add new page

Page slug will be created automatically (don't worry, it's not useful for anything yet).

prefix . "pages"; $query = "UPDATE ".$table_name." SET page_content='".$page_content."', page_title='".$page_title."', page_status='".$page_status."', page_order='".$page_order."' WHERE page_id='".$page_id."'"; $bbdb->query($query); ?>

Page updated...

prefix . "pages"; $query = $bbdb->get_results("SELECT * FROM $table_name WHERE page_id=".$_GET['id'].""); foreach ($query as $rk) { $id = $rk->page_id; $title = $rk->page_title; $content = $rk->page_content; $order = $rk->page_order; $status = $rk->page_status; } ?>

Edit page

" />

Page slug will be created automatically (don't worry, it's not useful for anything yet).

" size="10" />
prefix . "pages"; $query = $bbdb->get_results("DELETE FROM $table_name WHERE page_id=".$_GET['id'].""); $bbdb->query($query); ?>

Page deleted...

prefix . "pages"; $bbdb->query("CREATE TABLE IF NOT EXISTS $table_name ( page_id mediumint(9) NOT NULL AUTO_INCREMENT, page_date datetime, page_content text, page_title varchar(255), page_status int(1), page_slug varchar(255), page_order int(11), PRIMARY KEY (page_id) )"); } bb_register_activation_hook( __FILE__, 'bbpages_install'); add_action( 'bb_admin_menu_generator', 'pages_admin_menu' ); ?>