function tripal_pub_set_pub_url

2.x tripal_pub.admin.inc tripal_pub_set_pub_url($node, $pub_id)
3.x tripal_pub.admin.inc tripal_pub_set_pub_url($node, $pub_id)
1.x tripal_pub.admin.inc tripal_pub_set_pub_url($node, $pub_id)
1 call to tripal_pub_set_pub_url()

File

tripal_pub/includes/tripal_pub.admin.inc, line 222

Code

function tripal_pub_set_pub_url($node, $pub_id) {

  $node_url = "node/$node->nid";
  $url_alias = "pub/$pub_id";

  // remove any previous alias
  db_query("DELETE FROM {url_alias} WHERE src = '%s'", $node_url);
  // add the new alias
  path_set_alias($node_url, $url_alias);

  return $url_alias;
}