You are here

function _encoded_sticky2weight in Weight 5

1 call to _encoded_sticky2weight()
weight_nodeapi in ./weight.module

File

./weight.module, line 425

Code

function _encoded_sticky2weight(&$node) {
  if ($node->sticky > 0) {
    $node->node_weight = $node->sticky == 1 ? 0 : 100 - $node->sticky;
    $node->sticky = 1;
  }
  else {
    $node->node_weight = $node->sticky == 0 ? 0 : -($node->sticky + 100);
    $node->sticky = 0;
  }
}