Advertisement
Guest User

Untitled

a guest
Apr 16th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.48 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('BASEPATH')) exit('No direct script access allowed');
  4.  
  5. class Allies extends CI_Controller
  6. {
  7.  
  8.     public function __construct()
  9.     {
  10.         parent::__construct();
  11.         $this->load->model('kowauth/pmmodel');
  12.         $this->load->model('bios');
  13.         $this->load->library('kowauth');
  14.        
  15.     }
  16.  
  17.     public function index()
  18.     {
  19.         //Config Defaults Start
  20.         $msgBoxMsgs = array(); //msgType = dl, info, warn, note, msg
  21.         $cssPageAddons = ''; //If you have extra CSS for this view append it here
  22.         $jsPageAddons = ''; //If you have extra JS for this view append it here
  23.         $metaAddons = ''; //Sometimes there is a need for additional Meta Data such in the case of Facebook addon's
  24.         $siteTitle = ''; //alter only if you need something other than the default for this view.
  25.         //Config Defaults Start
  26.  
  27.  
  28.         //examples of how to use the message box system (css not included).
  29.         //$msgBoxMsgs[] = array('msgType' => 'dl', 'theMsg' => 'This is a Blank Message Box...');
  30.  
  31.         /**********************************************************Your Coding Logic Here, Start*/
  32.  
  33.         // Checks to see if a session is active for user and shows corresponding view page
  34.         if ($this->kowauth->isLoggedIn())
  35.         {
  36.             $bodyContent = "allies"; //which view file
  37.         }
  38.         else
  39.         {
  40.             redirect('login', 'refresh');
  41.         }
  42.         $bodyType = "full"; //type of template
  43.         $userData = $this->users->getUserByUserID($this->session->userdata('userID'));
  44.         $roster = $this->kowauth->getRosterList($userData->usersRolesID);
  45.         $userRoster = array();
  46.         foreach ($roster AS $member)
  47.         {
  48.             $userRoster[$member->id] = $member->rosterName;
  49.         }
  50.         //Get member's allies
  51.         $alliesList = $this->bios->getRosterAlliesByRosterID($this->session->userdata('defaultRosterListID'));
  52.         // Get list of members
  53.         $rosterList = $this->bios->getAllRoster();
  54.         $allies = array();
  55.         if (empty($rosterList)) {
  56.             $allies[] = 'No Wrestlers In Database';
  57.         }
  58.         else
  59.         {
  60.             $allies[] = 'Please Select An Option';
  61.             foreach ($rosterList AS $ally)
  62.             {
  63.                 $allies[$ally->id] = $ally->rosterName;
  64.             }
  65.         }
  66.  
  67.         /***********************************************************Your Coding Logic Here, End*/
  68.  
  69.         //Double checks if any default variables have been changed, Start.
  70.         //If msgBoxMsgs array has anything in it, if so displays it in view, else does nothing.
  71.         if (count($msgBoxMsgs) !== 0)
  72.         {
  73.             $msgBoxes = $this->msgboxes->buildMsgBoxesOutput(array('display' => 'show',
  74.                 'msgs' => $msgBoxMsgs));
  75.         }
  76.         else
  77.         {
  78.             $msgBoxes = array('display' => 'none');
  79.         }
  80.  
  81.         if ($siteTitle == '')
  82.         {
  83.             $siteTitle = $this->metatags->SiteTitle(); //reads
  84.         }
  85.  
  86.         //Double checks if any default variables have been changed, End.
  87.  
  88.         $this->data['msgBoxes'] = $msgBoxes;
  89.         $this->data['cssPageAddons'] = $cssPageAddons; //if there is any additional CSS to add from above Variable this will send it to the view.
  90.         $this->data['jsPageAddons'] = $jsPageAddons; //if there is any addictional JS to add from the above variable this will send it to the view.
  91.         $this->data['metaAddons'] = $metaAddons; //if there is any addictional meta data to add from the above variable this will send it to the view.
  92.         $this->data['pageMetaTags'] = $this->metatags->MetaTags(); //defaults can be changed via models/metatags.php
  93.         $this->data['siteTitle'] = $siteTitle; //defaults can be changed via models/metatags.php
  94.         $this->data['bodyType'] = $bodyType;
  95.         $this->data['bodyContent'] = $bodyContent;
  96.         $this->data['userData'] = $userData;
  97.         $this->data['userRoster'] = $userRoster;
  98.         $this->data['allies'] = $allies;
  99.         $this->data['personalMessages'] = array($this->pmmodel->
  100.             getInboxUnreadMessagesCount($this->session->userdata('userID')), $this->pmmodel->
  101.             getInboxMessagesCount($this->session->userdata('userID')), $this->pmmodel->
  102.             getLast5Messages($this->session->userdata('userID')));
  103.         $this->load->view('cpanel/index', $this->data);
  104.     }
  105. }
  106.  
  107. /* End of file allies.php */
  108. /* Location: ./application/modules/bios/controllers/allies.php */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement