[dev] [commit] r1023 - wwwbase/ajax
automailer at dexonline.ro
automailer at dexonline.ro
Thu Oct 17 01:24:04 EEST 2013
Author: grigoroiualex
Date: Thu Oct 17 01:24:04 2013
New Revision: 1023
Log:
Forgot to svn add one file :D
Added:
wwwbase/ajax/visualGetImages.php
Added: wwwbase/ajax/visualGetImages.php
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ wwwbase/ajax/visualGetImages.php Thu Oct 17 01:24:04 2013 (r1023)
@@ -0,0 +1,44 @@
+<?php
+
+require_once('../../phplib/util.php');
+
+$revised = util_getRequestParameter('revised');
+$page = util_getRequestParameter('page');
+$limit = util_getRequestParameter('rows');
+$resp = array();
+$images = array();
+
+$total = Model::factory('Visual')->where('revised', $revised)->count();
+$lines = Model::factory('Visual')->where('revised', $revised)
+ ->limit($limit)->offset(($page - 1) * $limit)->find_many();
+
+foreach ($lines as $line) {
+ $imgLexeme = Lexem::get_by_id($line->lexemeId);
+
+ if(!empty($imgLexeme)) {
+ $lexemes = '<div class="allLexemes"><span class="mainLexeme">' . $imgLexeme->formUtf8General . '</span><br/>';
+
+ } else {
+ $lexemes = '';
+ }
+
+ $tagsLexemes = VisualTag::get_all_by_imageId($line->id);
+
+ foreach ($tagsLexemes as $tagLexeme) {
+ $row = Lexem::get_by_id($tagLexeme->lexemeId);
+ $lexemes .= $row->formUtf8General . ', ';
+ }
+
+ $lexemes .= '</div>';
+
+ $user = User::get_by_id($line->userId);
+ $link = '<a title="Click pentru a vedea imaginea" href="' . Visual::getImageWww($line->path) . '">' . basename($line->path) . '</a>';
+ $images[] = array('lexeme' => $lexemes, 'user' => $user->nick, 'width' => $line->width,
+ 'height' => $line->height, 'userId' => $line->userId, 'imageId' => $line->id,
+ 'latestMod' => date('d.m.Y', $line->modDate), 'link' => $link);
+}
+
+$resp = array('total' => ceil($total / $limit), 'page' => $page, 'records' => $total, 'rows' => $images);
+
+echo json_encode($resp);
+?>
\ No newline at end of file
More information about the Dev
mailing list