Example #1
0
 public function runTags($tag)
 {
     $query = Image::query();
     $query->join('imagetag', 'image.image_id', '=', 'imagetag.image_id')->join('tag', 'imagetag.tag_id', '=', 'tag.tag_id')->join('location', 'image.location_id', '=', 'location.location_id')->select('image.image_id', 'thumbnail_url', 'standard_url', 'count_comment', 'count_likes', 'posted_at', 'link_url', 'author_image_url', 'author_name', 'author_link_url', 'source_id', 'location.location_id', 'image.created_at', 'image.updated_at', 'tag.tag_id', 'tag', 'pull_from_ig', 'name', 'latitude', 'longitude')->distinct()->where('tag.tag', $tag)->orderBy('image.image_id', 'DESC');
     $images = $query->get();
     return View::make('tag')->with(array('tag' => $tag, 'querys' => $images));
 }
Example #2
0
 function getImageList($offset = 0, $limit = null, $size = 0)
 {
     $qry = 'SELECT image.* ' . 'FROM image ' . 'WHERE portfolio_id = %d ' . 'AND size = %d ' . 'ORDER BY created DESC ';
     if ($offset > 0 && !is_null($limit)) {
         if ($offset) {
             if (common_config('db', 'type') == 'pgsql') {
                 $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
             } else {
                 $qry .= ' LIMIT ' . $offset . ', ' . $limit;
             }
         }
     }
     $image = new Image();
     $image->query(sprintf($qry, $this->id, $size));
     return $image;
 }
Example #3
0
<?php

header("Content-type:text/html;charset=utf-8");
require_once "../web.config.php";
require_once $realLibPath . "model/image.model.php";
require_once $realLibPath . "model/dict.model.php";
$img = new Image();
$id = $_POST['id'];
echo "我的id:" . $id;
//$dataArray=$article->query(array("id"=>6),array())[0];
//echo $dataArray;
$dataArray = current($img->query(array("ID" => $id), array()));
$imgCatArray = $img->getImgCat();
//var_dump($dataArray);
//@$currentPage = $_POST['currentPage'];
$imgArray = $img->query(array(), array());
$dict = new Dict();
$tplb = $dict->query(array("lxjp" => "tplb"), array("code", "name"));
//var_dump($tplb);
?>
<style>
     #tab2 li{
            float:left;
            margin:5px;
        }
      #tab2 li span{
            position:absolute;
            left:70px;
            top:70px;
        }
      #tab2 li img{
 public function postData()
 {
     $query = Image::query();
     if (Input::has('tag')) {
         $tag = Input::get('tag');
         $query->join('imagetag', 'image.image_id', '=', 'imagetag.image_id')->join('tag', 'imagetag.tag_id', '=', 'tag.tag_id')->join('location', 'image.location_id', '=', 'location.location_id')->select('image.image_id', 'thumbnail_url', 'standard_url', 'count_comment', 'count_likes', 'posted_at', 'link_url', 'author_image_url', 'author_name', 'author_link_url', 'source_id', 'location.location_id', 'image.created_at', 'image.updated_at', 'tag.tag_id', 'tag', 'pull_from_ig', 'name', 'latitude', 'longitude')->distinct()->where('tag.tag', $tag)->orderBy('image.image_id', 'DESC')->take(50);
     }
     $images = $query->get();
     return Response::json($images);
 }
    public function bloc_gestion()
    {
        $image = new Image();
        $query = "select * from {$image->table} where {$this->typeobjet}='{$this->idobjet}' order by classement";
        $resul = $image->query($query);
        while ($resul && ($row = $image->fetch_object($resul))) {
            $imagedesc = new Imagedesc();
            $imagedesc->charger($row->id, $this->lang);
            ?>

			<form action="<?php 
            echo $this->nompageadmin;
            ?>
" method="post">
			<input type="hidden" name="action" value="modifierphoto" />
			<input type="hidden" name="id_photo" value="<?php 
            echo $row->id;
            ?>
" />
			<input type="hidden" name="id" value="<?php 
            echo $this->idobjet;
            ?>
" />
			<input type="hidden" name="lang" value="<?php 
            echo $this->lang;
            ?>
" />
			<?php 
            $this->form_hidden_fieds();
            ?>

			<ul>
				<li class="lignesimple">
					<div class="cellule_designation" style="height:208px;">&nbsp;</div>
					<div class="cellule_photos" style="height:200px; overflow:hidden;"><a href="<?php 
            echo $this->chemin_objet($row->fichier);
            ?>
" target="_blank"><img src="../fonctions/redimlive.php?type=<?php 
            echo $this->typeobjet;
            ?>
&nomorig=<?php 
            echo $row->fichier;
            ?>
&width=&height=200&opacite=&nb=" border="0" /></a></div>
					<div class="cellule_supp"><a onclick="return confirm('<?php 
            echo trad('Supprimer définitivement cette image ?', 'admin');
            ?>
');" href="<?php 
            echo $this->url_page_admin();
            ?>
&id_photo=<?php 
            echo $row->id;
            ?>
&action=supprimerphoto"><img src="gfx/supprimer.gif" width="9" height="9" border="0" /></a></div>
				</li>
				<li class="lignesimple">
					<div class="cellule_designation" style="height:30px;"><?php 
            echo trad('Titre', 'admin');
            ?>
</div>
					<div class="cellule">
					<input type="text" name="titre_photo" style="width:219px;" class="form" value="<?php 
            echo htmlspecialchars($imagedesc->titre);
            ?>
" />
					</div>
				</li>
				<li class="lignesimple">
					<div class="cellule_designation" style="height:50px;"><?php 
            echo trad('Chapo', 'admin');
            ?>
</div>
					<div class="cellule"><textarea name="chapo_photo" rows="2"class="form" style="width:219px;"><?php 
            echo $imagedesc->chapo;
            ?>
</textarea></div>
				</li>
				<li class="lignesimple">
					<div class="cellule_designation" style="height:65px;"><?php 
            echo trad('Description', 'admin');
            ?>
</div>
					<div class="cellule"><textarea name="description_photo" class="form" rows="3"><?php 
            echo $imagedesc->description;
            ?>
</textarea></div>
				</li>

				<li class="lignesimple">
					<div class="cellule_designation" style="height:30px;"><?php 
            echo trad('Classement', 'admin');
            ?>
</div>
					<div class="cellule">
						<div class="classement">
							<a href="<?php 
            echo $this->url_page_admin() . "&id_photo=" . $row->id . "&action=modclassementphoto&type=M";
            ?>
"><img src="gfx/up.gif" border="0" /></a></div>
						<div class="classement">
							<a href="<?php 
            echo $this->url_page_admin() . "&id_photo=" . $row->id . "&action=modclassementphoto&type=D";
            ?>
"><img src="gfx/dn.gif" border="0" /></a></div>
					</div>

				</li>

				<li class="lignesimple">
					<div class="cellule_designation" style="height:30px;">&nbsp;</div>
					<div class="cellule" style="height:30px; border-bottom: 1px dotted #9DACB6"><input type="submit" value="<?php 
            echo trad('Enregistrer', 'admin');
            ?>
" /></div>
				</li>
			</ul>
			</form>

	   		<?php 
        }
    }
 public function testJson()
 {
     $query = Image::query();
     $query->join('imagetag', 'image.image_id', '=', 'imagetag.image_id')->join('tag', 'imagetag.tag_id', '=', 'tag.tag_id')->join('location', 'image.location_id', '=', 'location.location_id')->select('image.image_id', 'thumbnail_url', 'standard_url', 'count_comment', 'count_likes', 'posted_at', 'link_url', 'author_image_url', 'author_name', 'author_link_url', 'source_id', 'location.location_id', 'image.created_at', 'image.updated_at', 'tag.tag_id', 'tag', 'pull_from_ig', 'name', 'latitude', 'longitude')->distinct()->where('tag.tag', 'khaokho')->orderBy('image.image_id', 'DESC')->take(50);
     $images = $query->get();
     echo $images;
     return View::make('test');
 }
Example #7
0
<?php

require_once "../web.config.php";
require_once $realLibPath . "model/image.model.php";
$array = array("status" => "Y");
$array2 = array();
$img = new Image();
$imgArray = $img->query($array, $array2);
//echo "length:".$virtualAdminPath.length;
?>
<script type="text/javascript" src="/htdocs/admin/res/jquery-1.11.3.min.js"></script>
<style type="text/css">
.imgSelect{
	border-style:solid;
	border-color:#F00;
}
</style>
<div class="am-u-sm-7">
<table class="am-table am-table-default">
<tr>
<?php 
$i = 0;
foreach ($imgArray as $item) {
    if ($i < 5) {
        $i++;
        //显示td
        ?>
	<td><img height="100" class="home_imageinfo_seclect" width="100" src="<?php 
        echo $virtualAdminPath . $item['URL'];
        ?>
"/><div><?php 
Example #8
0
function liste_produits($rubrique, $critere, $order, $alpha)
{
    $produit = new Produit();
    $produitdesc = new Produitdesc();
    if ($alpha == "alpha") {
        $query = "select p.* from {$produit->table} p LEFT JOIN {$produitdesc->table} pd ON pd.produit = p.id and lang=" . ActionsLang::instance()->get_id_langue_courante() . " where p.rubrique=\"{$rubrique}\" order by pd.{$critere} {$order}";
    } else {
        $query = "select * from {$produit->table} where rubrique=\"{$rubrique}\" order by {$critere} {$order}";
    }
    $resul = $produit->query($query);
    $i = 0;
    while ($resul && ($row = $produit->fetch_object($resul))) {
        $produit->charger($row->ref);
        $produitdesc = new Produitdesc();
        $produitdesc->charger($row->id);
        if (!$produitdesc->affichage_back_office_permis()) {
            continue;
        }
        $fond = "ligne_" . ($i++ % 2 ? "claire" : "fonce");
        $image = new Image();
        $query_image = "select * from {$image->table} where produit=\"" . $row->id . "\" order by classement limit 0,1";
        $resul_image = $image->query($query_image);
        $row_image = $image->fetch_object($resul_image);
        ?>

<ul class="<?php 
        echo $fond;
        ?>
">
	<li><div class="vignette"><?php 
        if ($row_image) {
            ?>
 <img src="../fonctions/redimlive.php?nomorig=<?php 
            echo $row_image->fichier;
            ?>
&type=produit&width=51&height=51&exact=1" title="<?php 
            echo $produit->ref;
            ?>
" /><?php 
        }
        ?>
</div></li>
	<li style="width:61px;"><span class="texte_noedit" title="<?php 
        echo $row->ref;
        ?>
"><?php 
        echo substr($row->ref, 0, 9);
        if (strlen($row->ref) > 9) {
            echo " ...";
        }
        ?>
</span></li>
	<li style="width:225px;"><span id="titreprod_<?php 
        echo $row->id;
        ?>
" <?php 
        if ($produitdesc->est_langue_courante()) {
            echo 'class="texte_edit"';
        }
        ?>
><?php 
        echo substr($produitdesc->titre, 0, 35);
        if (strlen($produitdesc->titre) > 35) {
            echo " ...";
        }
        ?>
</span></li>
	<li style="width:39px;"><span id="stock_<?php 
        echo $row->id;
        ?>
" class="texte_edit"><?php 
        echo $row->stock;
        ?>
</span></li>
	<li style="width:30px;"><span id="prix_<?php 
        echo $row->id;
        ?>
" class="texte_edit"><?php 
        echo $row->prix;
        ?>
</span></li>
	<li style="width:68px;"><span id="prix2_<?php 
        echo $row->id;
        ?>
" class="texte_edit"><?php 
        echo $row->prix2;
        ?>
</span></li>
	<li style="width:64px;"><input id="promo_<?php 
        echo $row->id;
        ?>
" type="checkbox" name="promo[]" class="sytle_checkbox" onchange="checkvalues('promo','<?php 
        echo $row->id;
        ?>
')" <?php 
        if ($row->promo) {
            ?>
 checked="checked" <?php 
        }
        ?>
/></li>
	<li style="width:64px;"><input type="checkbox" id="nouveaute_<?php 
        echo $row->id;
        ?>
" name="nouveaute[]" class="sytle_checkbox" onchange="checkvalues('nouveaute','<?php 
        echo $row->id;
        ?>
')" <?php 
        if ($row->nouveaute) {
            ?>
 checked="checked" <?php 
        }
        ?>
/></li>
	<li style="width:53px;"><input type="checkbox" id="prod_ligne_<?php 
        echo $row->id;
        ?>
" name="ligne[]" class="sytle_checkbox" onchange="checkvalues('ligneprod','<?php 
        echo $row->id;
        ?>
')" <?php 
        if ($row->ligne) {
            ?>
 checked="checked" <?php 
        }
        ?>
/></li>
	<li style="width:41px;"><a href="produit_modifier.php?ref=<?php 
        echo $produit->ref;
        ?>
&rubrique=<?php 
        echo $produit->rubrique;
        ?>
"  class="txt_vert_11"><?php 
        echo trad('editer', 'admin');
        ?>
</a></li>

	<li style="width:78px; text-align:center;">
	<div class="bloc_classement">
  <div class="classement">
		<a href="produit_modifier.php?ref=<?php 
        echo $produit->id;
        ?>
&action=modclassement&parent=<?php 
        echo $rubrique;
        ?>
&type=M"><img src="gfx/up.gif" border="0" /></a>
	</div>
	 <div class="classement"><span id="classementprod_<?php 
        echo $produit->id;
        ?>
" class="classement_edit"><?php 
        echo $row->classement;
        ?>
</span></div>
	 <div class="classement">
		<a href="produit_modifier.php?ref=<?php 
        echo $produit->id;
        ?>
&action=modclassement&parent=<?php 
        echo $rubrique;
        ?>
&type=D"><img src="gfx/dn.gif" border="0" /></a>
	</div>
	</div>
	</li>
	<li style="width:37px; text-align:center;"><a href="javascript:supprimer_produit('<?php 
        echo $produit->ref;
        ?>
','<?php 
        echo $rubrique;
        ?>
')"><img src="gfx/supprimer.gif" width="9" height="9" border="0" /></a></li>
</ul>

<?php 
    }
}
 /**
  * 
  * Return an array of content for the current folder
  * 
  * @param string $dossier id of the current folder
  * @param string $critere order by clause
  * @param string $order ASC or DESC
  * @param string $alpha if order is alpha pu "alpha"
  * @return Array
  */
 public function getList($dossier, $critere, $order, $alpha)
 {
     $return = array();
     if ($alpha == "alpha") {
         $query = "select c.id, c.dossier, c.ligne, c.classement from " . Contenu::TABLE . " p LEFT JOIN " . Contenudesc::TABLE . " pd ON cd.contenu = c.id and lang=" . ActionsLang::instance()->get_id_langue_courante() . " where c.dossier=\"{$dossier}\" order by cd.{$critere} {$order}";
     } else {
         $query = "select id, dossier, ligne, classement from " . Contenu::TABLE . " where dossier=\"{$dossier}\" order by {$critere} {$order}";
     }
     $resul = $this->query($query);
     $i = 0;
     while ($resul && ($row = $this->fetch_object($resul))) {
         $contenudesc = new Contenudesc();
         $contenudesc->charger($row->id);
         if (!$contenudesc->affichage_back_office_permis()) {
             continue;
         }
         $image = new Image();
         $query_image = "select * from " . Image::TABLE . " where contenu=\"" . $row->id . "\" order by classement limit 0,1";
         $resul_image = $image->query($query_image);
         $row_image = $image->fetch_object($resul_image, 'image');
         $return[] = array("id" => $row->id, "dossier" => $row->dossier, "ligne" => $row->ligne, "classement" => $row->classement, "titre" => $contenudesc->titre, "langue_courante" => $contenudesc->est_langue_courante(), "image" => array("fichier" => $row_image->fichier));
     }
     return $return;
 }
Example #10
0
     */
    if (isset($_FILES['image']) && isset($_POST["image-upload"])) {
        $Image = new Image();
        $Image->uploadTo = $baseDir . 'images/posts/';
        $uploadedImage = $Image->upload($_FILES['image']);
        if ($uploadedImage) {
            $path = $Image->resize();
            try {
                //Set the appropriate hour
                if ($_POST["half"] == 'PM') {
                    $hour = $_POST["image-hour"] == 12 ? $hour = 12 : $_POST["image-hour"] + 12;
                } else {
                    $hour = $_POST["image-hour"];
                }
                $Image->setPath($path, $url);
                $Image->setDescription($_POST["image-description"]);
                $Image->setLocation($_POST["image-location"]);
                $Image->setMonth($_POST["image-month"]);
                $Image->setDay($_POST["image-day"]);
                $Image->setYear($_POST["image-year"]);
                $Image->setHour($_POST["image-hour"]);
                $Image->setMinute($_POST["image-minute"]);
                $Image->setPrivacy($_POST["image-privacy"]);
                $Image->query($user["id"], $user["username"], $user["name"]);
                echo '1';
            } catch (Exception $e) {
                echo $e->getMessage();
            }
        }
    }
}
$Image = new Image($Database);
//Prepare the facebook sql for getting photos
$fql = "SELECT src_big, created, caption FROM photo WHERE owner = me()";
$param = array('method' => 'fql.query', 'query' => $fql, 'callback' => '');
$result = $Facebook->api($param);
//Get the results
foreach ($result as $row) {
    //Check to see if a video is already posted
    $Statement = $Database->prepare("SELECT id FROM statuses WHERE month = ? AND day = ? AND year = ? AND calendar_id = ?");
    $Statement->execute(array(gmdate("m", $row["created"]), gmdate("d", $row["created"]), gmdate("Y", $row["created"]), $calendar["id"]));
    $rowCount = $Statement->rowCount();
    //If it is then skip
    if ($rowCount != 0) {
        continue;
    }
    //Update the database with the photos
    try {
        $Image->setUrlPath($row["src_big"]);
        $Image->setContent(substr($row["caption"], 0, 900) . ' Photo taken ' . gmdate("m-d-Y", $row["created"]));
        $Image->setCategory('image');
        $Image->setTags($row["caption"]);
        $Image->setMonth(gmdate("m", $row["created"]));
        $Image->setDay(gmdate("d", $row["created"]));
        $Image->setYear(gmdate("Y", $row["created"]));
        $Image->setLocation('');
        $Image->setCalendarId($calendar["id"]);
        $Image->query($user["id"]);
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
 /**
  * 
  * Return an array of product for the current category
  * 
  * @param string $rubrique id of the current category
  * @param string $critere order by clause
  * @param string $order ASC or DESC
  * @param string $alpha if order is alpha pu "alpha"
  * @return Array
  */
 public function getList($rubrique, $critere, $order, $alpha)
 {
     $return = array();
     if ($alpha == "alpha") {
         $query = "select p.id, p.ref, p.rubrique, p.stock, p.prix, p.prix2, p.promo, p.ligne, p.nouveaute, p.classement, p.tva from " . Produit::TABLE . " p LEFT JOIN " . Produitdesc::TABLE . " pd ON pd.produit = p.id and lang=" . ActionsLang::instance()->get_id_langue_courante() . " where p.rubrique=\"{$rubrique}\" order by pd.{$critere} {$order}";
     } else {
         $query = "select id, ref, rubrique, stock, prix, prix2, promo, ligne, nouveaute, classement, tva from " . Produit::TABLE . " where rubrique=\"{$rubrique}\" order by {$critere} {$order}";
     }
     $resul = $this->query($query);
     $i = 0;
     while ($resul && ($row = $this->fetch_object($resul))) {
         $produitdesc = new Produitdesc();
         $produitdesc->charger($row->id);
         if (!$produitdesc->affichage_back_office_permis()) {
             continue;
         }
         $image = new Image();
         $query_image = "select * from " . Image::TABLE . " where produit=\"" . $row->id . "\" order by classement limit 0,1";
         $resul_image = $image->query($query_image);
         $row_image = $image->fetch_object($resul_image, 'image');
         $return[] = array("ref" => $row->ref, "id" => $row->id, "rubrique" => $row->rubrique, "stock" => $row->stock, "variants" => $this->getVariants($row->id), "prix" => $row->prix, "prix2" => $row->prix2, "promo" => $row->promo, "ligne" => $row->ligne, "nouveaute" => $row->nouveaute, "classement" => $row->classement, "tva" => $row->tva, "titre" => $produitdesc->titre, "langue_courante" => $produitdesc->est_langue_courante(), "image" => array("fichier" => $row_image->fichier));
     }
     return $return;
 }