function widgets_get_selected in Widgets 6
Get selected widgets for a node.
Parameters
$nid: Node ID.
Return value
Array containing selected widget ID's.
2 calls to widgets_get_selected()
- widgets_block_content in ./
widgets.block.inc - Assemble block content.
- widgets_form_alter in ./
widgets.module - Implementation of hook_form_alter().
File
- ./
widgets.inc, line 45 - Implementaion of custom functions for Widgets module.
Code
function widgets_get_selected($nid) {
$selected = array();
if ($results = db_query('SELECT * FROM {widgets} WHERE nid = %d ORDER BY weight ASC', $nid)) {
while ($row = db_fetch_array($results)) {
$selected[] = $row['widget_nid'];
}
}
return $selected;
}