You are here

function profile2_revision_list in Profile 2 7.2

Return a list of all the existing revision numbers.

4 calls to profile2_revision_list()
profile2_diff_block_view in contrib/profile2_diff.module
Implements hook_block_view().
profile2_diff_diffs_show in contrib/profile2_diff.pages.inc
Create output string for a comparison of 'profile' between versions 'old_vid' and 'new_vid'.
profile2_diff_latest in contrib/profile2_diff.pages.inc
Menu callback - show latest diff for a given profile.
profile2_revision_list_build in ./profile2.module
Build the table of older revisions of a profile.

File

./profile2.module, line 1527
Support for configurable user profiles.

Code

function profile2_revision_list($profile) {
  $revisions = array();

  //  $result = db_select("profile_revision", "r"
  $result = db_query('SELECT r.vid, r.log, r.authorid AS uid, p.vid AS current_vid, r.timestamp, u.name FROM {profile_revision} r LEFT JOIN {profile} p ON p.vid = r.vid INNER JOIN {users} u ON u.uid = r.authorid WHERE r.pid = :pid ORDER BY r.vid DESC', array(
    ':pid' => $profile->pid,
  ));
  foreach ($result as $revision) {
    $revisions[$revision->vid] = $revision;
  }
  return $revisions;
}