Jump to content

lpmraven

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Everything posted by lpmraven

  1. Xcel is currently down for me, I've PMed you.
  2. The echo squads_menu is supposed to be in the header.php isnt it? What am I supposed to be doing, im lost?
  3. Ok, this is my header.php view <div id="squads"> <ul> <li><div id="topbutton3"><a href="#"></a></div> <?php echo $squad_menu(); ?> </li> </ul> </div> this is my squad_helper.php (in the helpers folder) <?php /** * Clan CMS squad menu Helper * * @package Clan CMS * @subpackage Helpers * @category Helpers * @author Xcel Gaming Development Team * @link http://www.xcelgaming.com */ // -------------------------------------------------------------------- /** * squad menu * * * * @access public * @param array * @return bool */ // helper function squad_menu() { // include model $this->load->model('Squads_model', 'squads'); //fetch squads $squads = $this->squads->get_squads(array('squad_status' => 1)); if($squads) { // create menu $menu = '<ul>'; foreach($squads as $squad) { // create a LI for each squad and ammend it to $menu $menu .= '<li>' . $squad->squad_title . '</li>'; } // close menu $menu .= '</ul>'; } // return the menu return $menu; } /* End of file squad_helper.php */ /* Location: ./clancms/helpers/squad_helper.php */ I have added to the autoload $autoload['helpers'] = array('squad_helper'); Its still not working, yet
  4. Ive entered into the autoload.php $autoload['helpers'] = array('squad_helper'); still getting that error, Message: Undefined variable: squad_menu
  5. A PHP Error was encountered Severity: Notice Message: Undefined variable: squad_menu Filename: gamingcorps/header.php Line Number: 110 <?php /** * Clan CMS squad menu Helper * * @package Clan CMS * @subpackage Helpers * @category Helpers * @author Xcel Gaming Development Team * @link http://www.xcelgaming.com */ // -------------------------------------------------------------------- /** * Squad menu * * * * @access public * @param array * @return bool */ // helper function squad_menu() { // include model $this->load->model('Squads_model', 'squads'); //fetch squads $squads = $this->squads->get_squads(array('squad_status' => 1)); // Build objects $this->data->squads =& $squads; if($squads) { // create menu $menu = '<ul>'; foreach($squads as $squad) { // create a LI for each squad and ammend it to $menu $menu .= '<li>' . $squad->squad_title . '</li>'; } // close menu $menu .= '</ul>'; } // return the menu return $menu; } /* End of file squad_helper.php */ /* Location: ./clancms/helpers/squad_helper.php */ <div id="squads"> <ul> <li><div id="topbutton3"><a href="#"></a></div> <?php echo $squad_menu(); ?> </li> </ul> </div> I've tried to make it work but its not happening, any suggestions on whats not right?
  6. Ok I have squad_helper.php in the helpers folder /** * Squad menu * * * * @access public * @param array * @return bool */ function squad_menu() { //fetch squads $squads = $this->squads->get_squads(array('squad_status' => 1)); // Build objects $this->data->squads =& $squads; // load out $this->load->view( THEME . 'dashboard', $this->data); } /* End of file squad_helper.php */ /* Location: ./clancms/helpers/squad_helper.php */ Then in the header.php view I have <?php echo squad_menu(); ?> <?php if($squads): ?> <?php foreach($squads as $squad): ?> <li><span class="left"></span><span class="middle"> <?php echo anchor('roster/squad/' . $squad->squad_slug, $squad->squad_title); ?> </span><span class="right"></span></li> <?php endforeach; ?> <?php endif; ?> I believe I have done something wrong
  7. Im not trying to add them on my dashboard though, Im trying to create a navigation dropdown list with all the squads in it. The list only works on the roster page because that page has the correct controller code, I am now trying to work out some code I can put in all controllers so that the squads navigation listing appears on each page of the site. *** Apologies codezyne, I understand now working
  8. I have this in my dashboard controller: /** * Index * * SQUAD NAVIGATION * * @access public * @return void */ function nav() { //fetch squads $squads = $this->squads->get_squads(array('squad_status' => 1)); // Build objects $this->data->squads =& $squads; // load out $this->load->view( THEME . 'dashboard', $this->data); } And this in my header view <?php if($squads): ?> <?php foreach($squads as $squad): ?> <li><span class="left"></span><span class="middle"> <?php echo anchor('roster/squad/' . $squad->squad_slug, $squad->squad_title); ?> </span><span class="right"></span></li> <?php endforeach; ?> <?php endif; ?> Doesn't work, am I missing something?
  9. Yeah that did cross my mind but I tried to simply put this into my dashboard.php controller to see if it would make the squads appear and it didnt, but when i put it in the view header with the list code, the squads appear, I really am terrible with Codeigniter, I dont totally get how it works. <?php $squads = $this->squads->get_squads(array('squad_status' => 1)); ?> I also tried to copy the entire roster controller and paste that into the dashboard controller, as the squads appear in the navigation bar only when your on the roster page... but that failed. I'm really not very good, I cant write MVC on my own. Do I just put the <?php $squads = $this->squads->get_squads(array('squad_status' => 1)); ?> into each controller so the squads navigation appears on all pages? Or is this what I do? /** * Index * * SQUAD NAVIGATION * * @access public * @return void */ function navigation() <<<<[b] NOT sure what function to put[/b] { // Retrieve the squads $squads = $this->squads->get_squads(array('squad_status' => 1)); // Load the squad navigation view $this->load->view(THEME . 'dashboard', $this->data); <<<<< [b]NOT sure what this should be[/b] }
  10. A PHP Error was encountered Severity: Notice Message: Undefined property: ClanCMS_Loader::$squads Filename: gamingcorps/header.php Line Number: 111 Fatal error: Call to a member function get_squads() on a non-object in B:\xampp2\htdocs\clancms\views\themes\gamingcorps\header.php on line 111 the line it refers to is <?php $squads = $this->squads->get_squads(array('squad_status' => 1)); ?>
  11. Hi everyone, I'm having problems with my drop down navigation bar, here is the coding for the section that the problem is occuring: <?php $squads = $this->squads->get_squads(array('squad_status' => 1)); ?> <?php if($squads): ?> <?php foreach($squads as $squad): ?> <li><span class="left"></span><span class="middle"> <?php echo anchor('roster/squad/' . $squad->squad_slug, $squad->squad_title); ?> </span><span class="right"></span></li> <?php endforeach; ?> <?php endif; ?> On pages after this, all the content disappears, its as if i'm not closing off the code correctly, i'm a rookie, please help I beleive the problem may be the top line, but I don't know what i'm doing.. haha
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.