You are here

function _simplemeta_meta_calculate_fit in Simple Meta 6.2

Same name and namespace in other branches
  1. 7.2 simplemeta.module \_simplemeta_meta_calculate_fit()
  2. 7 simplemeta.module \_simplemeta_meta_calculate_fit()

Parameters

string $path:

Return value

int a numeric representation of how specific the path is

1 call to _simplemeta_meta_calculate_fit()
simplemeta_meta_save in ./simplemeta.module
Save meta data

File

./simplemeta.module, line 460

Code

function _simplemeta_meta_calculate_fit($path) {
  $fit = 0;
  $parts = explode('/', $path, MENU_MAX_PARTS);
  $number_parts = count($parts);
  $slashes = $number_parts - 1;
  foreach ($parts as $k => $part) {
    if ($part != '%') {
      $fit |= 1 << $slashes - $k;
    }
  }
  return $fit;
}