Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class board
- {
- /**
- * state
- * + show home
- * + show topic
- * + show thread
- */
- private $con;
- private $admin;
- public function __construct() {
- $this->con = $GLOBALS['DB'];
- }
- public function board_show_home(){
- $qry = $this->con->prepare("SELECT * FROM feedback_cats ORDER BY cID ASC");
- /**
- * cID int AI
- * cName varchar(30)
- * active tinyint 1,0
- * admin tinyint 1,0
- **/
- if ($qry->execute()){
- if ($qry->rowCount() != 0){
- $cat_cnt = $qry->rowCount();
- $cat_arr = array_combine(range(1, $cat_cnt), array_values($qry->fetchAll(PDO::FETCH_ASSOC)));
- $ret = "";
- foreach($cat_arr as $cat){
- if($cat['admin'] == 1 && $this->admin == 'yes' && $cat['active'] == 1 || $cat['admin'] == 0 && $cat['active'] == 1){
- $ret .= "<div><a style=\"display:block\" onfocus=\"this.blur()\" href=\"indexInternal.es?action=internalBoard&subaction=view&cat=" . $cat['cID'] . "\">" . $cat['cName'] . "</a></div>"; // category name + Link
- }
- }
- return $ret;
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement