function _weight_decode in Weight 7
Same name and namespace in other branches
- 6 weight.module \_weight_decode()
Convert our weight back out of sticky.
2 calls to _weight_decode()
- weight_node_load in ./
weight.module - Implements hook_node_load().
- weight_node_selector in ./
weight.module - Generate JS code for selecting individual node weights on admin page
File
- ./
weight.module, line 329 - This module uses the sticky column of the node table to add weighting to nodes.
Code
function _weight_decode(&$node) {
if ($node->sticky == 0 || $node->sticky == 1) {
$node->node_weight = 0;
return;
}
if ($node->sticky > 0) {
$node->node_weight = 100 - $node->sticky;
$node->sticky = 1;
}
else {
$node->node_weight = -($node->sticky + 100);
$node->sticky = 0;
}
}