Skip to content

Commit

Permalink
Removed various unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenrnl committed Jul 1, 2013
1 parent 5ec12a2 commit e4c24c7
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 23 deletions.
1 change: 0 additions & 1 deletion php/UnitTests/photoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,6 @@ public function testGetLatLon() {
$ph=photo::removePhotosWithLatLon($photos);
$this->assertEquals(4, sizeof($ph));

$photosLatLon=array();
foreach($photos as $photo) {
$point=$photo->getLatLon($track, 300, true);
$photo->setLatLon($point);
Expand Down
4 changes: 2 additions & 2 deletions php/UnitTests/ratingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ public function testDeleteRating($rating_id, $avg) {
$rating->lookup();
$photo=new photo($rating->get("photo_id"));

$tmp_avg=rating::getAverage($photo);
$tmp_rating=$rating->get("rating");
/*$tmp_avg=rating::getAverage($photo);
$tmp_rating=$rating->get("rating");*/
$photo->lookup();

$rating->delete();
Expand Down
1 change: 0 additions & 1 deletion php/classes/annotatedPhoto.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ public function display($type=null) {
}

$noted_image = ImageCreateTrueColor (ImageSX($orig_image), ImageSY($orig_image) + ((ImageFontHeight($font) + $padding) * $count));
$white = ImageColorAllocate($noted_image, 255,255, 255);

/* Use a light grey background to hide the jpeg artifacts caused by the sharp edges in text. */

Expand Down
1 change: 0 additions & 1 deletion php/classes/map.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function addMarker(marker $marker) {
* @param array Array of objects to get markers from
*/
public function addMarkers(array $objs) {
$markers=array();
foreach($objs as $obj) {
$marker=$obj->getMarker();
if($marker instanceof marker) {
Expand Down
1 change: 0 additions & 1 deletion php/classes/rating.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public static function setRating($rating, photo $photo) {
$user=user::getCurrent();
$user->lookup();

$where="";
if(!($user->is_admin() || $user->get("allow_rating"))) {
return;
}
Expand Down
7 changes: 3 additions & 4 deletions php/cli/cli.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct(user $user, $api, array $args) {
throw new CliUserNotAdminException("CLI_USER must be an admin user");
}
$user->prefs->load();
$lang=$user->load_language();
$user->load_language();
$this->args=new arguments($args);
}

Expand Down Expand Up @@ -109,7 +109,7 @@ private function processFiles() {
$file=new file($filename);
$file->check();

$mime=$file->getMime();
$file->getMime();
if($file->type=="directory" && conf::get("import.cli.recursive")) {
$this->files=array_merge($this->files, file::getFromDir($file, true));
} else if($file->type!="image") {
Expand Down Expand Up @@ -359,7 +359,7 @@ private function doConfig() {
*/
private function doDumpConfig() {
$conf=conf::getAll();
foreach ($conf as $name=>$item) {
foreach ($conf as $item) {
foreach ($item as $citem) {
if($citem instanceof confItemBool) {
$value=( $citem->getValue() ? "true": "false" );
Expand All @@ -381,7 +381,6 @@ public function processDirpattern() {

$cur=getcwd();
$curlen=strlen($cur);
$files=array();
foreach($this->files as $file) {
if(substr($file, 0, $curlen) != $cur) {
throw new CliNotInCWDException("Sorry, --dirpattern can only be used when importing files under the current dir. i.e. do not use absolute paths or '../' when specifying --dirpattern.");
Expand Down
4 changes: 2 additions & 2 deletions php/code.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function __toString() {
* @todo contains HTML
*/
public static function getOverview() {
$smileys=self::getArray();
self::getArray();
$html="<div class=\"smileys\">";
foreach (self::$smileys as $smiley) {
$html.="<div>";
Expand Down Expand Up @@ -272,7 +272,7 @@ public static function getFromName($name) {
*/
function checkparam($value) {
if(!empty($this->regexp)) {
return preg_match($regexp, $value);
return preg_match($this->regexp, $value);
} else {
return true;
}
Expand Down
1 change: 0 additions & 1 deletion php/comment.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ function delete() {
function getDisplayArray($user = null) {
$date=$this->get("comment_date");
$changed=$this->get("timestamp");
if($changed != $date) { $updated=$changed; }

$zophcode = new zophcode($this->get("comment"), array("b","i", "u"));
$comment="<div>" . $zophcode . "</div>";
Expand Down
7 changes: 4 additions & 3 deletions php/exif.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,14 @@ function process_exif($image) {
$lon = $lon * -1;
}
$exifdata["lon"]=$lon;

/*
// No alt in db yet
if(isset($exif["GPSAltitude"])) {
$altarray=explode("/", $exif["GPSAltitude"]);
$alt=$altarray[0] / $altarray[1];
// No alt in db yet
// $exifdata["alt"]=$alt;
$exifdata["alt"]=$alt;
}
*/
}

return $exifdata;
Expand Down
2 changes: 0 additions & 2 deletions php/group.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ function get_albums() {
}

function getDisplayArray() {
$members=$this->get_members();

$da = array(
translate("group") => $this->get("group_name"),
translate("description") => $this->get("description"),
Expand Down
4 changes: 1 addition & 3 deletions php/photo.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class photo extends zophTable {
* @todo only supports JPEG currently, should support more filetypes
*/
public function display($type=null) {
$headers=array();
$header=array();
$name = $this->get("name");
$image_path = conf::get("path.images") . "/" . $this->get("path") . "/";

Expand Down Expand Up @@ -480,8 +480,6 @@ public function getThumbnailLink($href = null) {
*/
public function getFullsizeLink($title) {
$user=user::getCurrent();
$image = $this->getURL();

return new block("link", array(
"href" => $this->getURL(),
"link" => $title,
Expand Down
1 change: 1 addition & 0 deletions php/settings.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public static function detectInstance(array $ini) {
*/
public static function parseINI($i) {
if(!isset($i["php_location"])) {
$php_loc=dirname($_SERVER['SCRIPT_FILENAME']);
log::msg("No php_location setting in " . INI_FILE . " found that matches " . $php_loc, log::FATAL, log::GENERAL);
} else {
self::$php_loc=$i["php_location"];
Expand Down
1 change: 0 additions & 1 deletion php/util.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ function create_zipfile($photos, $maxsize, $filename, $filenum, $user) {
if ($zip->open($tempfile, ZIPARCHIVE::CREATE)!==TRUE) {
die("cannot open $tempfile\n");
}
$count=sizeof($photos);
foreach($photos as $key => $photo) {
if($data=@file_get_contents($photo->getFilePath())) {
$size=strlen($data);
Expand Down
1 change: 0 additions & 1 deletion php/webimport.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ public static function deleteFile($md5) {
* @param Array $vars
*/
public static function getFileList(Array $import) {
$loaded=0;
foreach($import as $md5) {
$file=file::getFromMD5(conf::get("path.images") . "/" . conf::get("path.upload"), $md5);
if(!empty($file)) {
Expand Down

0 comments on commit e4c24c7

Please sign in to comment.