function userNameByID($db,$id){
	$user = $db->get_where('users',array('user_id'=>$id));
	if(rows($user)){
		$user = getFirst($user);
		return $user['user_nick'];
	}
	return 'unknown';
}
Exemple #2
0
	private function getNewRevisionNumber($obj_id,$obj_type){
		$rev = 1;
		$result = $this->db->query("SELECT `revision` FROM `history` WHERE `obj_id` = '".$obj_id."' AND `obj_type` =  '".$obj_type."' ORDER BY `revision` DESC");
		if(rows($result)){
			$rev = getFirst($result);
			$rev = (int)$rev['revision'] + 1;
		}
		return $rev;
	}	
Exemple #3
0
 public function show()
 {
     $fullElement = null;
     if ($id = $this->uri->segment(3)) {
         if (is_numeric($id)) {
             $fullElement = new FullElement($this->oh, $id);
         } else {
             $id = urldecode($id);
             $tmp = $this->db->get_where('elements', array('main_name' => $id));
             if (rows($tmp)) {
                 $tmp = getFirst($tmp);
                 $fullElement = new FullElement($this->oh, $tmp['id']);
             }
         }
     }
     if (!$fullElement) {
         redirect('xem/shows');
         return false;
     } else {
         $this->out['fullelement'] = $fullElement;
     }
     $this->out['title'] = $fullElement->main_name . ' | Maping';
     $this->_loadView('show');
 }
Exemple #4
0
<body>
<header>
    <h1>Japan Journey </h1>
</header>
<div id="wrapper">
    <?php 
require './includes/menu.php';
?>
    <main>
        <?php 
if (isset($error)) {
    echo "<p>{$error}</p>";
} else {
    while ($row = $result->fetch()) {
        echo "<h2>{$row['title']}</h2>";
        $extract = getFirst($row['article']);
        echo "<p>{$extract['0']}";
        if ($extract[1]) {
            echo '<a href="details.php?article_id=' . $row['article_id'] . '"> More</a>';
        }
        echo '</p>';
    }
}
?>
    </main>
    <?php 
include './includes/footer.php';
?>
</div>
</body>
</html>
Exemple #5
0
    return [0, 0];
}
$c = new \esee\ChainBuilder([]);
foreach ($fonts as $font) {
    foreach ($chars as $char) {
        //6,7,8,
        $size = [9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24];
        foreach ($size as $s) {
            $im = imagecreatetruecolor(40, 40);
            $white = imagecolorallocate($im, 0xff, 0xff, 0xff);
            $black = imagecolorallocate($im, 0x0, 0x0, 0x0);
            imagefill($im, 0, 0, $white);
            //echo $fontDir .  $font . "\n"; exit();
            imagefttext($im, $s, 0, 5, 30, $black, $fontDir . $font, $char);
            $points = getPoints($im, 40, 40);
            list($x, $y) = getFirst($points);
            $c->reset($points);
            $chain = $c->makeChain2($x, $y);
            //\esee\Helper::view2($chain);
            //print_r($chain->path);	//  exit();
            if (is_null($chain)) {
                //echo $char . ' '.  $font . "\n";
                //\esee\Helper::view($points); if($i > 3) exit();
                continue;
            }
            $hash = join('', $chain->path);
            $hashs[strlen($hash)][] = [$hash, $char];
            //imagepng($im, './images/'.md5($font). '_' .$char. '_' . $s . '.png');
            imagedestroy($im);
        }
    }