forked from GNUsocial/gnu-social
Photo Galleries now actually use the database.
This commit is contained in:
parent
7e8ff72c0b
commit
70c1a9a506
@ -87,27 +87,15 @@ class PhotosAction extends Action
|
|||||||
$username = $pathparts[0];
|
$username = $pathparts[0];
|
||||||
$this->elementStart('ul', array('class' => 'photothumbs'));
|
$this->elementStart('ul', array('class' => 'photothumbs'));
|
||||||
|
|
||||||
//scorbett
|
$photo_obj= new GNUsocialPhoto();
|
||||||
$photo_obj = new GNUsocialPhoto();
|
$photos = $photo_obj->getGalleryPage(1, 0, 9);
|
||||||
$photo_obj->getGalleryPage(1, 0, 9);
|
|
||||||
|
|
||||||
while (false !== ($file = readdir($dir))) {
|
foreach ($photos as $photo) {
|
||||||
$fparts = explode('-', $file);
|
$this->elementStart('li');
|
||||||
if ($fparts[0] == $username // uploaded by this user
|
$this->elementStart('a', array('href' => $photo->uri));
|
||||||
&& ((substr($file, -4) == '.png')
|
$this->element('img', array('src' => $photo->thumb_uri));
|
||||||
|| (substr($file, -4) == '.jpg') // XXX: is this needed? status.net seems to save jpgs as .jpeg
|
$this->elementEnd('a');
|
||||||
|| (substr($file, -5) == '.jpeg')
|
$this->elementEnd('li');
|
||||||
|| (substr($file, -4) == '.gif'))) { // and it's an image
|
|
||||||
common_log(LOG_INFO, 'file : ' . $file);
|
|
||||||
$this->elementStart('li');
|
|
||||||
$this->elementStart('a', array('href' => 'http://' . common_config('site', 'server') . '/file/' . $file));
|
|
||||||
if (!file_exists(INSTALLDIR . '/file/thumb.' . $file)) {
|
|
||||||
photo_make_thumbnail($file);
|
|
||||||
}
|
|
||||||
$this->element('img', array('src' => 'http://' . common_config('site', 'server') . '/file/' . 'thumb.' . $file));
|
|
||||||
$this->elementEnd('a');
|
|
||||||
$this->elementEnd('li');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user