Exemple #1
0
 public function __construct()
 {
     parent::__construct();
 }
Exemple #2
0
 /**
  * Constructor
  *
  * @param void
  */
 public function __construct($data = false)
 {
     parent::__construct($data);
 }
 public function __construct()
 {
     parent::__construct();
     $this->groupId = $this->getGroupId();
 }
Exemple #4
0
 public function __construct()
 {
     parent::__construct();
     $langarr = explode('-', $_SESSION['lang']);
     $this->lang = $langarr[0];
 }
Exemple #5
0
 /**
  * Constructor
  *
  * @param void
  */
 public function __construct()
 {
     parent::__construct();
     $this->bootstrap();
 }
Exemple #6
0
 public function __construct()
 {
     parent::__construct();
     $this->THREADS_PER_PAGE = Forums::CV_THREADS_PER_PAGE;
     //Variable because it can change wether the user is logged or no
     $this->POSTS_PER_PAGE = Forums::CV_POSTS_PER_PAGE;
     //Variable because it can change wether the user is logged or no
     $layoutbits = new MOD_layoutbits();
     switch ($layoutbits->GetPreference("PreferenceForumFirstPage")) {
         case "Pref_ForumFirstPageLastPost":
             $this->setTopMode(Forums::CV_TOPMODE_FORUM);
             break;
         case "Pref_ForumFirstPageCategory":
             $this->setTopMode(Forums::CV_TOPMODE_CATEGORY);
             break;
         default:
             $this->setTopMode(Forums::CV_TOPMODE_LANDING);
             break;
     }
     if (!isset($_SESSION['IdMember'])) {
         $this->THREADS_PER_PAGE = 100;
         // Variable because it can change wether the user is logged or no
         $this->POSTS_PER_PAGE = 200;
         // Variable because it can change wether the user is logged or no
     }
     $MyGroups = array();
     $this->words = new MOD_words();
     $this->BW_Right = MOD_right::get();
     $this->IdGroup = 0;
     // By default no group
     $this->ByCategories = false;
     // toggle or not toglle the main view is TopCategories or TopLevel
     $this->ForumOrderList = $layoutbits->GetPreference("PreferenceForumOrderListAsc");
     //	Decide if it is an active LoggeMember or not
     if (empty($_SESSION["IdMember"]) or empty($_SESSION["MemberStatus"]) or $_SESSION["MemberStatus"] == 'Pending' or $_SESSION["MemberStatus"] == 'NeedMore') {
         $this->PublicThreadVisibility = " (ThreadVisibility = 'NoRestriction') AND (ThreadDeleted != 'Deleted')";
         $this->PublicPostVisibility = " (PostVisibility = 'NoRestriction') AND (PostDeleted != 'Deleted')";
         $this->ThreadGroupsRestriction = " (IdGroup = 0 OR ThreadVisibility = 'NoRestriction')";
         $this->PostGroupsRestriction = " (IdGroup = 0 OR PostVisibility = 'NoRestriction')";
     } else {
         $this->PublicThreadVisibility = "(ThreadVisibility != 'ModeratorOnly') AND (ThreadDeleted != 'Deleted')";
         $this->PublicPostVisibility = "(PostVisibility != 'ModeratorOnly') AND (PostDeleted !='Deleted')";
         $this->PostGroupsRestriction = " PostVisibility IN ('MembersOnly','NoRestriction') OR (PostVisibility='GroupOnly' AND IdGroup in(0";
         $this->ThreadGroupsRestriction = " ThreadVisibility IN ('MembersOnly','NoRestriction') OR (ThreadVisibility = 'GroupOnly' and IdGroup in(0";
         $qry = $this->dao->query("SELECT IdGroup FROM membersgroups WHERE IdMember = " . $_SESSION["IdMember"] . " AND Status = 'In'");
         if (!$qry) {
             throw new PException('Failed to retrieve groups for member id =#' . $_SESSION["IdMember"] . ' !');
         }
         while ($rr = $qry->fetch(PDB::FETCH_OBJ)) {
             $this->PostGroupsRestriction = $this->PostGroupsRestriction . "," . $rr->IdGroup;
             $this->ThreadGroupsRestriction = $this->ThreadGroupsRestriction . "," . $rr->IdGroup;
             array_push($MyGroups, $rr->IdGroup);
             // Save the group list
         }
         $this->ThreadGroupsRestriction .= "," . SuggestionsModel::getGroupId();
         $this->PostGroupsRestriction = $this->PostGroupsRestriction . "))";
         $this->ThreadGroupsRestriction = $this->ThreadGroupsRestriction . "))";
     }
     // Prepares additional visibility options for moderator
     if ($this->BW_Right->HasRight("ForumModerator")) {
         $this->PublicPostVisibility = " PostVisibility IN ('NoRestriction', 'MembersOnly','GroupOnly','ModeratorOnly')";
         $this->PublicThreadVisibility = " ThreadVisibility IN ('NoRestriction', 'MembersOnly','GroupOnly','ModeratorOnly')";
         if ($this->BW_Right->HasRight("ForumModerator", "AllGroups") or $this->BW_Right->HasRight("ForumModerator", "All")) {
             $this->PostGroupsRestriction = " (1=1)";
             $this->ThreadGroupsRestriction = " (1=1)";
         }
     }
     $this->MyGroups = $MyGroups;
 }