Quantcast
Channel: Function Library - Sodapop Documentation
Viewing all articles
Browse latest Browse all 30

$sodapop->database->modsInPosition($position)

$
0
0
modsInPosition($position) determines which modules are to be loaded for the given position, then processes all the info from the modules in that position loading them into an array $mod then returning the array  
Parameter: $position - the module position we are looking to load modules into
Location: model.sodapop.php

public function modsInPosition($position) {
$query = " select *
from modules
where positions = '$position'
order by ordering";
$result = $this->getData($query);
while ($row= mysql_fetch_array($result, MYSQL_ASSOC)) {

$i++;
$mod[$i]['id'] = $row['id'];
$mod[$i]['name'] = $row['name'];
$mod[$i]['positions'] = $row['positions'];
$mod[$i]['pages'] = $row['pages'];
$mod[$i]['hidden'] = $row['hidden'];
$mod[$i]['params'] = $row['params'];
$mod[$i]['active'] = $row['active'];
//I want to move this logic out of the model, but it's gonna live
//here for now:
$params = explode("::", $mod[$i]['params']);
foreach ($params as $k) {
list ($name, $value) = explode("==", $k);
$mod[$i][$name] = $value;
}
}

return $mod;
}

Viewing all articles
Browse latest Browse all 30

Trending Articles