[eluser]TWP Marketing[/eluser]
Zimoon,
Now you have two errors which do not work as you want them to do.
First, in your controller, pass the $active flag to the model function.
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
);
$active = TRUE; //<--- assign the value of $active
$data['posts'] = $this->posts_model->getactivePosts($active); //<--- PASS THE $active FLAG
$this->load->view('v-aktuell', $data);
}
Second, in your model file:
[quote author="Zimooon" date="1303224924"]ok got the error..
if($active == TRUE) //<--- THIS IS CORRECT, you are doing a comparison
->
if($active = TRUE) . now it works <3 //<--- THIS IS NOT CORRECT, it must not be an assignment
thx for help
best regards[/quote]
Your if clause must use "==" to make a comparison. If you use "=", you are doing an assignment to the variable and the if() will ALWAYS execute the code inside the if statement.