Skip to content

Commit

Permalink
lots more junk
Browse files Browse the repository at this point in the history
  • Loading branch information
chandeeland committed Feb 26, 2012
1 parent c6b3662 commit 9dec954
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*~
46 changes: 46 additions & 0 deletions classes/people.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
class Person {
public $gender = null;
public $glasses = false;
public $mood = null;

public $image_url;
public $top;
public $bottom;
public $left;
public $righLt;

public function __construct($p) {

$info = $p->attributes;

// count gender
if (isset($info->gender)) {
if ($info->gender->value == 'male') {
$this->gender = 'male';
$this->gender_c = $info->gender->confidence;
} else {
$this->gender = 'female';
$this->gender_c = $info->gender->confidence;
}
}

// nerdiness
if (isset($info->glasses)) {
if ($info->glasses->value) {
$this->glasses = true;
}
}

// mood
if (!empty($info->mood)) {
$this->mood = $info->mood->value;
}

$this->image_url = $p->url;
$this->top = round($p->center->y - ($p->height / 2));
$this->bottom = round($p->center->y + ($p->height / 2));
$this->left = round($p->center->x - ($p->width / 2));
$this->right = round($p->center->x - ($p->width / 2));
}
}
11 changes: 11 additions & 0 deletions web/detail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
session_start();
if (array_key_exists('pics', $_SESSION) && array_key_exists('i', $_REQUEST)) {
$pics = $_SESSION['pics'];
$i = $_REQUEST['i'];
} else {
header('Location: /report.php');
}
?>

<img src="<?= $pics[$i]; ?>">

0 comments on commit 9dec954

Please sign in to comment.