Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed =& to be compatible with latest version of PHP.

  • Loading branch information...
commit 8524ace0fcae7e144aea803ad0261c31b97b3033 1 parent 4426843
Amadeus authored
20 includes/admin.class.php
View
@@ -75,7 +75,7 @@ function sgAdmin($basePath = "")
$galleryId = isset($_REQUEST["gallery"]) ? $_REQUEST["gallery"] : ".";
//load config from singapore root directory
- $this->config =& sgConfig::getInstance();
+ $this->config = sgConfig::getInstance();
$this->config->loadConfig($basePath."singapore.ini");
$this->config->loadConfig($basePath."secret.ini.php");
@@ -95,7 +95,7 @@ function sgAdmin($basePath = "")
//set current language from request vars or config
$this->language = isset($_REQUEST["lang"]) ? $_REQUEST["lang"] : $this->config->default_language;
//read the language file
- $this->translator =& Translator::getInstance($this->language);
+ $this->translator = Translator::getInstance($this->language);
$this->translator->readLanguageFile($this->config->base_path.$this->config->pathto_locale."singapore.".$this->language.".pmo");
$this->translator->readLanguageFile($this->config->base_path.$this->config->pathto_locale."singapore.admin.".$this->language.".pmo");
@@ -612,7 +612,7 @@ function doAction()
function &allGalleriesArray()
{
- $root =& $this->io->getGallery(".", new stdClass, 100);
+ $root = $this->io->getGallery(".", new stdClass, 100);
return $this->allGalleriesRecurse($root);
}
@@ -786,7 +786,7 @@ function checkPermissions($obj, $action, $gallery = null, $image = null)
function savePermissions()
{
- $obj =& $this->gallery;
+ $obj = $this->gallery;
$perms = 0;
@@ -940,9 +940,9 @@ function suspendUser() {
function reindexGallery($galleryId = null)
{
if($galleryId == null)
- $gal =& $this->gallery;
+ $gal = $this->gallery;
else
- $gal =& $this->io->getGallery($galleryId, new stdClass);
+ $gal = $this->io->getGallery($galleryId, new stdClass);
$imagesAdded = 0;
//get list of images
@@ -1088,7 +1088,7 @@ function addGallery()
//explicitly set permissions on gallery directory
@chmod($path, octdec($this->config->directory_mode));
- $gal =& new sgGallery($newGalleryId, $this->gallery);
+ $gal = new sgGallery($newGalleryId, $this->gallery);
$gal->name = $_REQUEST["newgallery"];
//set object owner
@@ -1263,7 +1263,7 @@ function addImage()
}
- $img =& new sgImage($image, $this->gallery);
+ $img = new sgImage($image, $this->gallery);
$img->name = strtr(substr($image, strrpos($image,"/"), strrpos($image,".")-strlen($image)), "_", " ");
list($img->width, $img->height, $img->type) = GetImageSize($path);
@@ -1272,7 +1272,7 @@ function addImage()
if(!$this->user->isGuest())
$img->owner = $this->user->username;
- $this->gallery->images[] =& $img;
+ $this->gallery->images[] = $img;
//set as gallery thumbnail?
if($this->gallery->imageCount()==1)
@@ -1370,7 +1370,7 @@ function addMultipleImages()
// try to change file-permissions
@chmod($path, octdec($this->config->file_mode));
- $img =& new sgImage($image, $this->gallery);
+ $img = new sgImage($image, $this->gallery);
$img->name = strtr(substr($image, strrpos($image,"/"), strrpos($image,".")-strlen($image)), "_", " ");
list($img->width, $img->height, $img->type) = GetImageSize($path);
20 includes/gallery.class.php
View
@@ -56,9 +56,9 @@ class sgGallery extends sgItem
function sgGallery($id, &$parent)
{
$this->id = $id;
- $this->parent =& $parent;
- $this->config =& sgConfig::getInstance();
- $this->translator =& Translator::getInstance();
+ $this->parent = $parent;
+ $this->config = sgConfig::getInstance();
+ $this->translator = Translator::getInstance();
}
/** @return bool true if this is a non-album gallery; false otherwise */
@@ -215,25 +215,25 @@ function hasNext()
function &prevGallery()
{
- $tmp =& new sgGallery($this->parent->id.'/'.$this->parent->galleries[$this->index()-1], $this->parent);
+ $tmp = new sgGallery($this->parent->id.'/'.$this->parent->galleries[$this->index()-1], $this->parent);
return $tmp;
}
function &nextGallery()
{
- $tmp =& new sgGallery($this->parent->id.'/'.$this->parent->galleries[$this->index()+1], $this->parent);
+ $tmp = new sgGallery($this->parent->id.'/'.$this->parent->galleries[$this->index()+1], $this->parent);
return $tmp;
}
function prevURL($action = null)
{
- $tmp =& $this->prevGallery();
+ $tmp = $this->prevGallery();
return $tmp->URL(null, $action);
}
function nextURL($action = null)
{
- $tmp =& $this->nextGallery();
+ $tmp = $this->nextGallery();
return $tmp->URL(null, $action);
}
@@ -283,12 +283,12 @@ function thumbnail($type)
return;
elseif($this->filename == "__random__") {
srand(time()); //seed random number generator and select random image
- $img =& $this->images[rand(0,count($this->images)-1)];
+ $img = $this->images[rand(0,count($this->images)-1)];
} else
- $img =& $this->findImage($this->filename);
+ $img = $this->findImage($this->filename);
//create thumbnail
- $this->thumbnails[$type] =& new sgThumbnail($img, $type);
+ $this->thumbnails[$type] = new sgThumbnail($img, $type);
}
return $this->thumbnails[$type];
16 includes/image.class.php
View
@@ -56,9 +56,9 @@ class sgImage extends sgItem
function sgImage($id, &$parent)
{
$this->id = $id;
- $this->parent =& $parent;
- $this->config =& sgConfig::getInstance();
- $this->translator =& Translator::getInstance();
+ $this->parent = $parent;
+ $this->config = sgConfig::getInstance();
+ $this->translator = Translator::getInstance();
}
/**
@@ -120,7 +120,7 @@ function firstLink($action = null)
if(!$this->hasPrev())
return "";
- $tmp =& $this->firstImage();
+ $tmp = $this->firstImage();
return '<a href="'.$tmp->URL(null, $action).'">'.$this->firstText().'</a>';
}
@@ -145,19 +145,19 @@ function lastLink($action = null)
if(!$this->hasNext())
return "";
- $tmp =& $this->lastImage();
+ $tmp = $this->lastImage();
return '<a href="'.$tmp->URL(null, $action).'">'.$this->lastText().'</a>';
}
function prevURL($action = null)
{
- $tmp =& $this->prevImage();
+ $tmp = $this->prevImage();
return $tmp->URL(null, $action);
}
function nextURL($action = null)
{
- $tmp =& $this->nextImage();
+ $tmp = $this->nextImage();
return $tmp->URL(null, $action);
}
@@ -330,7 +330,7 @@ function &thumbnail($type)
{
//only create thumbnail if it doesn't already exist
if(!isset($this->thumbnails[$type]))
- $this->thumbnails[$type] =& new sgThumbnail($this, $type);
+ $this->thumbnails[$type] = new sgThumbnail($this, $type);
return $this->thumbnails[$type];
}
10 includes/io.class.php
View
@@ -30,7 +30,7 @@ class sgIO
*/
function sgIO()
{
- $this->config =& sgConfig::getInstance();
+ $this->config = sgConfig::getInstance();
}
/**
@@ -74,7 +74,7 @@ function getDescription()
*/
function &getGallery($galleryId, &$parent, $getChildGalleries = 1, $language = null)
{
- $gal =& new sgGallery($galleryId, $parent);
+ $gal = new sgGallery($galleryId, $parent);
if(file_exists($this->config->base_path.$this->config->pathto_galleries.$galleryId)) {
@@ -96,7 +96,7 @@ function &getGallery($galleryId, &$parent, $getChildGalleries = 1, $language = n
//always get the first image for the gallery thumbnail
//but only get the rest if child galleries are requested
if($getChildGalleries || $i==0) {
- $gal->images[$i] =& new sgImage($dir->files[$i], $gal);
+ $gal->images[$i] = new sgImage($dir->files[$i], $gal);
//trim off file extension and replace underscores with spaces
$temp = strtr(substr($gal->images[$i]->id, 0, strrpos($gal->images[$i]->id,".")-strlen($gal->images[$i]->id)), "_", " ");
@@ -114,7 +114,7 @@ function &getGallery($galleryId, &$parent, $getChildGalleries = 1, $language = n
) = @GetImageSize($this->config->base_path.$this->config->pathto_galleries.$gal->id."/".$gal->images[$i]->id);
//set parent link
- $gal->images[$i]->parent =& $gal;
+ $gal->images[$i]->parent = $gal;
} else
//otherwise just create an empty array of the appropriate length
$gal->images[$i] = $dir->files[$i];
@@ -127,7 +127,7 @@ function &getGallery($galleryId, &$parent, $getChildGalleries = 1, $language = n
if($getChildGalleries)
//but only fetch their info if required too
foreach($dir->dirs as $gallery)
- $gal->galleries[] =& $this->getGallery($galleryId."/".$gallery, $gal, $getChildGalleries-1, $language);
+ $gal->galleries[] = $this->getGallery($galleryId."/".$gallery, $gal, $getChildGalleries-1, $language);
else
//otherwise just copy their names in so they can be counted
$gal->galleries = $dir->dirs;
8 includes/io_csv.class.php
View
@@ -62,10 +62,10 @@ function getDescription()
*/
function &getGallery($galleryId, &$parent, $getChildGalleries = 1, $language = null)
{
- $gal =& new sgGallery($galleryId, $parent);
+ $gal = new sgGallery($galleryId, $parent);
if($language == null) {
- $translator =& Translator::getInstance();
+ $translator = Translator::getInstance();
$language = $translator->language;
}
@@ -100,7 +100,7 @@ function &getGallery($galleryId, &$parent, $getChildGalleries = 1, $language = n
//only fetch individual images if child galleries are required
if($getChildGalleries) {
for($i=0;$i<count($temp)-3;$i++) {
- $gal->images[$i] =& new sgImage($temp[$i+2][0], $gal, $this->config);
+ $gal->images[$i] = new sgImage($temp[$i+2][0], $gal, $this->config);
list(,
$gal->images[$i]->thumbnail,
$gal->images[$i]->owner,
@@ -131,7 +131,7 @@ function &getGallery($galleryId, &$parent, $getChildGalleries = 1, $language = n
//otherwise just fill in empty images
} else if(count($temp) > 3) {
for($i=0;$i<count($temp)-3;$i++)
- $gal->images[$i] =& new sgImage($temp[$i+2][0], $gal);
+ $gal->images[$i] = new sgImage($temp[$i+2][0], $gal);
}
} else
2  includes/io_mysql.class.php
View
@@ -24,7 +24,7 @@ class sgIO_mysql extends sgIOsql
*/
function sgIO_mysql()
{
- $this->config =& sgConfig::getInstance();
+ $this->config = sgConfig::getInstance();
mysql_connect($this->config->sql_host, $this->config->sql_user, $this->config->sql_pass);
mysql_select_db($this->config->sql_database);
}
2  includes/io_sqlite.class.php
View
@@ -29,7 +29,7 @@ class sgIO_sqlite extends sgIOsql
*/
function sgIO_sqlite()
{
- $this->config =& sgConfig::getInstance();
+ $this->config = sgConfig::getInstance();
$this->db = sqlite_open($this->config->base_path.$this->config->pathto_data_dir."sqlite.dat");
}
6 includes/iosql.class.php
View
@@ -39,7 +39,7 @@ function error()
*/
function &getGallery($galleryId, &$parent, $getChildGalleries = 1, $language = null)
{
- $gal =& new sgGallery($galleryId, $parent);
+ $gal = new sgGallery($galleryId, $parent);
if($language == null) $language = $this->config->default_language;
@@ -81,7 +81,7 @@ function &getGallery($galleryId, &$parent, $getChildGalleries = 1, $language = n
"WHERE galleryid='".$this->escape_string($galleryId)."' and lang=''");
for($i=0;$i<$this->num_rows($res);$i++) {
$imginfo = $this->fetch_array($res);
- $gal->images[$i] =& new sgImage($imginfo['filename'], $gal);
+ $gal->images[$i] = new sgImage($imginfo['filename'], $gal);
$gal->images[$i]->thumbnail = $imginfo['thumbnail'];
$gal->images[$i]->owner = $imginfo['owner'];
$gal->images[$i]->groups = $imginfo['groups'];
@@ -115,7 +115,7 @@ function &getGallery($galleryId, &$parent, $getChildGalleries = 1, $language = n
if($getChildGalleries)
//but only fetch their info if required too
foreach($dir->dirs as $gallery)
- $gal->galleries[] =& $this->getGallery($galleryId."/".$gallery, $gal, $getChildGalleries-1, $language);
+ $gal->galleries[] = $this->getGallery($galleryId."/".$gallery, $gal, $getChildGalleries-1, $language);
else
//otherwise just copy their names in so they can be counted
$gal->galleries = $dir->dirs;
20 includes/singapore.class.php
View
@@ -107,7 +107,7 @@ function Singapore($basePath = "")
$_REQUEST = array_map("htmlentities", $_REQUEST);
//load config from singapore root directory
- $this->config =& sgConfig::getInstance();
+ $this->config = sgConfig::getInstance();
$this->config->loadConfig($basePath."singapore.ini");
$this->config->loadConfig($basePath."secret.ini.php");
@@ -166,7 +166,7 @@ function Singapore($basePath = "")
}
//read the language file
- $this->translator =& Translator::getInstance($this->language);
+ $this->translator = Translator::getInstance($this->language);
$this->translator->readLanguageFile($this->config->base_path.$this->config->pathto_locale."singapore.".$this->language.".pmo");
//clear the UMASK
@@ -222,7 +222,7 @@ function selectGallery($galleryId = "")
//fetch galleries passing previous gallery as parent pointer
for($i=0; $i<$numberOfAncestors; $i++)
- if(!$this->ancestors[$i] =& $this->io->getGallery(
+ if(!$this->ancestors[$i] = $this->io->getGallery(
$ancestorIds[$i], $this->ancestors[$i-1],
//only fetch children of bottom level gallery
($i==$numberOfAncestors-1) ? 1 : 0
@@ -285,14 +285,14 @@ function selectImage($image)
if(is_string($image)) {
foreach($this->gallery->images as $index => $img)
if($img->id == $image) {
- $this->image =& $this->gallery->images[$index];
+ $this->image = $this->gallery->images[$index];
return true;
}
} elseif(is_int($image) && $image >= 0 && $image < count($this->gallery->images)) {
- $this->image =& $this->gallery->images[$image];
+ $this->image = $this->gallery->images[$image];
return true;
}
- $this->image =& new sgImage("", $this->gallery);
+ $this->image = new sgImage("", $this->gallery);
$this->image->name = $this->translator->_g("Image not found '%s'",htmlspecialchars($image));
return false;
}
@@ -775,14 +775,14 @@ function &previewThumbnailsArray()
for($i = $start; $i < $start + $this->config->thumb_number_preview; $i++)
if(isset($this->image->parent->images[$i]))
- $ret[$i] =& $this->image->parent->images[$i];
+ $ret[$i] = $this->image->parent->images[$i];
return $ret;
}
function previewThumbnails()
{
- $thumbs =& $this->previewThumbnailsArray();
+ $thumbs = $this->previewThumbnailsArray();
$index = $this->image->index();
$ret = "";
foreach($thumbs as $key => $thumb) {
@@ -847,7 +847,7 @@ function arraystripslashes($toStrip)
function thumbnailPath($gallery, $image, $width, $height, $forceSize, $mode = 1)
{
- $config =& sgConfig::getInstance();
+ $config = sgConfig::getInstance();
switch($mode) {
case 0 :
return $config->pathto_data_dir."cache/".$width."x".$height.($forceSize?"f":"").strtr("-$gallery-$image",":/?\\","----");
@@ -932,7 +932,7 @@ function getBrowserLanguages()
*/
function mkdir($path)
{
- $config =& sgConfig::getInstance();
+ $config = sgConfig::getInstance();
if($config->safe_mode_hack) {
$connection = ftp_connect($config->ftp_server);
// login to ftp server
4 includes/thumbnail.class.php
View
@@ -31,8 +31,8 @@ class sgThumbnail
function sgThumbnail(&$img, $type)
{
- $this->config =& sgConfig::getInstance();
- $this->image =& $img;
+ $this->config = sgConfig::getInstance();
+ $this->image = $img;
$widthVar = "thumb_width_".$type;
$heightVar = "thumb_height_".$type;
2  install/install.php
View
@@ -92,7 +92,7 @@
setupHeader("Step 2 of 2: Setup Database");
//create config object
- $config =& sgConfig::getInstance();
+ $config = sgConfig::getInstance();
$config->loadConfig($basePath."singapore.ini");
$config->base_path = $basePath;
2  install/uninstall.php
View
@@ -50,7 +50,7 @@
setupHeader("Step 2 of 2: Delete database information");
//create config object
- $config =& sgConfig::getInstance();
+ $config = sgConfig::getInstance();
$config->loadConfig($basePath."singapore.ini");
$config->base_path = $basePath;
Please sign in to comment.
Something went wrong with that request. Please try again.