public function before_filter() { $this->filter(); $this->layout = false; $this->current_version = Version::find('first', array('select' => 'versions.*', 'joins' => 'INNER JOIN packages on versions.package_id = packages.id INNER JOIN users ON users.id = packages.user_id', 'order' => 'versions.created_at DESC')); $date = DateHelper::from_db($this->current_version->created_at); $date = date(DATE_RFC822, $date); $this->header("Last-Modified: {$date}"); }
/** * index */ public function index() { switch ($this->format) { case 'xml': if ($this->user->active == 0) { exit; } $this->layout = false; $this->render('channel/index.xml'); $this->header('Content-Type: text/xml', 200); $this->current_version = Version::find('first', array('select' => 'versions.*', 'joins' => 'INNER JOIN packages on versions.package_id = packages.id INNER JOIN users ON users.id = packages.user_id', 'order' => 'versions.version DESC')); $date = DateHelper::from_db($this->current_version->created_at); $date = date(DATE_RFC822, $date); $this->header("Last-Modified: {$date}"); break; default: $this->packages = $this->user->packages; $this->header('Content-Type: text/html', 200); break; } }
' alt='avatar'/></td> <td><?php echo link_to(h($package->user->username . '/' . $package->name), url_for("PackageController", 'show', $package->user->username, $package->name)); ?> </td> </tr> </table> </td> <td><span class='small'><?php echo $version->summary; ?> </span></td> <td><?php echo $version->min_php; ?> </td> <td><span class='small'><?php echo distance_of_time_in_words(DateHelper::from_db($package->updated_at), time(), true); ?> ago</span></td> </tr> <?php } ?> </tbody> </table> <div id='pagination'> <?php echo paginate($packages); ?> </div>
private function load_release() { $this->package = Package::find('first', array('conditions' => array('name' => $_GET['name'], 'user_id' => $this->user->id))); $date = DateHelper::from_db($this->package->updated_at); $date = date(DATE_RFC822, $date); $this->header("Last-Modified: {$date}"); $this->version = Version::find('first', array('conditions' => array('version' => $_GET['version'], 'package_id' => $this->package->id))); $this->data = unserialize($this->version->meta); }
echo $versions->length; ?> of <?php echo $total_versions; ?> </p> <ul class='versions'> <?php foreach ($versions as $_version) { $url = url_for('VersionController', 'show', $package->user->username, $package->name, $_version->version); ?> <li><?php echo link_to($_version->version, $url); ?> - <?php echo date("F j, Y", DateHelper::from_db($_version->created_at)); ?> </li> <?php } ?> </ul> <?php if ($this->is_logged_in() && $this->user->id == $package->user_id) { ?> <div> <div class='right'> <p><?php echo delete_link('Delete Package', url_for('PackageController', 'delete', $package->id), true, 'Are you sure? \\n This will delete all versions of this package'); ?>
?> </div></td> <td><?php echo link_to($version->version, url_for("VersionController", 'show', $package->user->username, $package->name, $version->version)); ?> </td> <td width='25%'><div class='small summary-right'><?php echo $version->summary; ?> </div></td> <td><?php echo $version->min_php; ?> </td> <td><span class='small'><?php echo distance_of_time_in_words(DateHelper::from_db($version->created_at), time(), true); ?> ago</span></td> <td><?php echo isset($package->rating) ? PackageRating::convert_to_human($package->rating) : 0; ?> %</td> </tr> <?php } ?> </tbody> </table> <div id='pagination'> <?php echo paginate($packages);