You are here

function _publication_date_get_date in Publication Date 7

Same name and namespace in other branches
  1. 6 publication_date.module \_publication_date_get_date()
  2. 7.2 publication_date.module \_publication_date_get_date()

Worker function to get a published date from the database.

Parameters

int $nid: The node ID.

Return value

the publication date for the given node, or false if the node is not published.

See also

hook_node_load()

1 call to _publication_date_get_date()
publication_date_node_load in ./publication_date.module
Implements hook_node_load().

File

./publication_date.module, line 100
Add a field to nodes containing the publication date.

Code

function _publication_date_get_date($nid) {
  $date = db_query("SELECT published_at FROM {publication_date} WHERE nid = :nid", array(
    ':nid' => $nid,
  ))
    ->fetchField();
  return $date;
}