/** * Prepares an activity list for display using daily grouping. * * @param resource Query result to work through * * @return array Array of grouped activities */ function prepare_activity_list(&$results) { global $vbulletin, $db, $show, $stylevar, $vbphrase; $activity_groups = array(); while ($activity = $db->fetch_array($results)) { $activity = prepare_timeline_entry($activity, 'daily', $groupid); if (!$activity) { continue; } if (!isset($activity_groups["{$groupid}"])) { $activity_groups["{$groupid}"] = ''; } if ($activity['notetype'] != 'system' and $activity['dateline'] > issue_lastview($activity)) { $activity['newflag'] = true; } ($hook = vBulletinHook::fetch_hook('project_timeline_item')) ? eval($hook) : false; eval('$activity_groups["$groupid"] .= "' . fetch_template('pt_timeline_item') . '";'); } // do we need to show the timeline fix for less than 3.6.8? $show['js_timeline_fix'] = $vbulletin->options['templateversion'] < '3.6.8'; return $activity_groups; }
/** * Prepares issue data for display. * * @param array Issue data without any processing * * @return array Processed issue data */ function prepare_issue($issue) { global $vbulletin, $vbphrase, $stylevar; if ($vbulletin->options['wordwrap'] != 0) { $issue['title'] = fetch_word_wrapped_string($issue['title']); $issue['summary'] = fetch_word_wrapped_string($issue['summary']); } $issue['title'] = fetch_censored_text($issue['title']); $issue['summary'] = fetch_censored_text($issue['summary']); $issue['lastposttime'] = vbdate($vbulletin->options['timeformat'], $issue['lastpost']); $issue['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $issue['lastpost'], true); // post reply date/time (for search results as posts mainly) if ($issue['submitdate']) { $issue['submittime'] = vbdate($vbulletin->options['timeformat'], $issue['submitdate']); $issue['submitdate'] = vbdate($vbulletin->options['dateformat'], $issue['submitdate'], true); } else { $issue['submitdate'] = ''; $issue['submittime'] = ''; } $issue['replycount'] = vb_number_format($issue['replycount']); $issue['attachcount'] = vb_number_format($issue['attachcount']); if ($typeicon = $vbulletin->pt_issuetype["{$issue['issuetypeid']}"]['iconfile']) { $issue['typeicon'] = $typeicon; } $issue['issuetype'] = $vbphrase["issuetype_{$issue['issuetypeid']}_singular"]; $issue['status'] = $vbphrase["issuestatus{$issue['issuestatusid']}"]; $issue = fetch_issue_version_text($issue); if (!$issue['projectcategoryid']) { $issue['categorytitle'] = $vbphrase['unknown']; } $issue['priority_text'] = $vbphrase["priority_{$issue['priority']}"]; if (!$issue['milestoneid']) { $issue['milestonetitle'] = $vbphrase['none_meta']; } $issue['lastread'] = issue_lastview($issue); $issue['newflag'] = $issue['lastpost'] > $issue['lastread']; ($hook = vBulletinHook::fetch_hook('project_issue_prepare')) ? eval($hook) : false; return $issue; }
/** * Any closing work to be done. */ function prepare_end() { global $show; $issueperms = $this->factory->browsing_perms; $vbulletin =& $this->registry; if ($issueperms['generalpermissions'] & $vbulletin->pt_bitfields['general']['canmanage']) { $this->note['noteipaddress'] = $this->note['noteipaddress'] ? htmlspecialchars_uni(long2ip($this->note['noteipaddress'])) : ''; } else { $this->note['noteipaddress'] = ''; } $show['edit_note'] = can_edit_issue_note($this->issue, $this->note, $issueperms); $show['edit_history'] = ($this->note['lasteditdate'] and $show['edit_note']); $show['reply_note'] = (($this->issue['state'] == 'open' or $issueperms['postpermissions'] & $vbulletin->pt_bitfields['post']['cancloseissue']) and $this->note['visible'] != 'deleted'); $this->note['newflag'] = $this->note['dateline'] > issue_lastview($this->issue); }