Welcome Guest, Not a member yet? Register   Sign In
Set Posts activ/inactiv
#5

[eluser]Zimooon[/eluser]
Allright thank you that could work.
Now until now i had the view like this:
Code:
<?php if (isset($posts) ) : foreach ($posts as $p):      ?>
          
  
          <h1 id="news">&lt;?php echo $p['title']; ?&gt;</h1>
        
          
          &lt;?php echo $p['content']; ?&gt;
          <br />
          &lt;?php echo $p['date']; ?&gt;
      
          

          &lt;?php endforeach; else: ?&gt;
          

           <h1 id="news">Keine aktuellen News.</h1>
            
          &lt;?php endif; ?&gt;
          
          </article>

My controller calls the method :

Code:
function index()
    {
    
      $data = array(
      'title'           => 'Aktuell'.$this->config->item('pageTitle'),
      'metaDescription' => 'Aktuell',
      'metaKeywords'    => 'Aktuell, '.$this->config->item('pageMetaKeywords'),
      'mainnav'         => 'aktuell',
      'subnav'          => '',
      'subsubnav'       => '',
      'hasSubnav'       => true
    );
    
    
    
    $data['posts'] = $this->posts_model->getactivePosts();
      $this->load->view('v-aktuell', $data);
    }

and the modell looks like the code you posted above.
Now still nonactive posts are shown Sad
don get it why..

best regards


Messages In This Thread
Set Posts activ/inactiv - by El Forum - 04-15-2011, 01:52 AM
Set Posts activ/inactiv - by El Forum - 04-15-2011, 04:31 AM
Set Posts activ/inactiv - by El Forum - 04-15-2011, 08:34 AM
Set Posts activ/inactiv - by El Forum - 04-15-2011, 12:06 PM
Set Posts activ/inactiv - by El Forum - 04-18-2011, 09:43 AM
Set Posts activ/inactiv - by El Forum - 04-18-2011, 10:48 AM
Set Posts activ/inactiv - by El Forum - 04-19-2011, 01:11 AM
Set Posts activ/inactiv - by El Forum - 04-19-2011, 03:55 AM
Set Posts activ/inactiv - by El Forum - 04-19-2011, 01:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB