function makesimpleitems() { $timthumb = str_replace("/plugins/connectors/vistory/", "/timthumb.php", urlpath()); $p2parray = array(); if ($this->parsed_response) { for ($i = 0; $i < count($this->parsed_response->data->items); $i++) { $rec = $this->parsed_response->data->items[$i]; $obj = new obj(); $obj->title = $rec->title; $obj->subtitle = $rec->description; $obj->description = $rec->description; $obj->identifier = $rec->id; $obj->image = $rec->image; $obj->dataProvider = $rec->dataProvider; $obj->rights = $rec->rights; $obj->dcCreator = $rec->dcCreator; // $obj->image = $rec->enclosure; $obj->summary = new obj(); $obj->summary->lines = array("p: ", "img:" . $obj->image); $obj->details = new obj(); $obj->details->lines = array("p: ", "p: ", "img:" . $rec->enclosure, "h1:" . $obj->title, "p:" . $obj->description, "p:" . $obj->dataProvider, "p:" . $obj->dcCreator, "p:" . $obj->rights, "p: "); array_push($p2parray, $obj); } $this->parsed_response = array("raw" => $this->parsed_response, "p2p" => $p2parray); } }
function makesimpleitems() { $timthumb = str_replace("/plugins/connectors/vistory/", "/timthumb.php", urlpath()); $p2parray = array(); if ($this->parsed_response) { for ($i = 0; $i < count($this->parsed_response); $i++) { $rec = $this->parsed_response[$i]; $obj = new obj(); $obj->title = $rec->title; $obj->subtitle = $rec->description; $obj->description = $rec->description; $obj->identifier = $rec->identifier; /* $obj->object_number = $rec["fields"]["object_number"]; $obj->location = $rec["fields"]["location"]; $obj->place = $rec["fields"]["place"]; $obj->artist = $rec["fields"]["artist"]; $obj->date_text = $rec["fields"]["date_text"]; $obj->collection_code = $rec["fields"]["collection_code"]; $obj->museum_number = $rec["fields"]["museum_number"]; */ $obj->image = $rec->thumb; $obj->image320 = $rec->thumb; $obj->thumb2 = $rec->thumb; $obj->summary = new obj(); $obj->summary->lines = array("img:" . $obj->thumb2, "h1:" . $obj->title, "p:" . $obj->subtitle, "p: "); $obj->details = new obj(); $obj->details->lines = array("h1:" . $obj->title, "movie:" . $rec->mp4small, "p:" . $obj->description); array_push($p2parray, $obj); } $this->parsed_response = array("raw" => $this->parsed_response, "p2p" => $p2parray); } }
function makesimpleitems() { // var_dump($this->parsed_response["meta"]); $timthumb = str_replace("/plugins/connectors/victoria_and_albert/", "/timthumb.php", urlpath()); $this->parsed_response["meta"]["a"] = "aaaaa"; if ($this->parsed_response && $this->parsed_response && $this->parsed_response["records"]) { for ($i = 0; $i < count($this->parsed_response["records"]); $i++) { $rec = $this->parsed_response["records"][$i]; $obj = new obj(); $obj->title = $rec["fields"]["object"]; $obj->subtitle = $rec["fields"]["slug"]; $obj->identifier = $rec["pk"]; $obj->object_number = $rec["fields"]["object_number"]; $obj->location = $rec["fields"]["location"]; $obj->place = $rec["fields"]["place"]; $obj->artist = $rec["fields"]["artist"]; $obj->lat = $rec["fields"]["latitude"]; $obj->lon = $rec["fields"]["longitude"]; $obj->date_text = $rec["fields"]["date_text"]; $obj->collection_code = $rec["fields"]["collection_code"]; $obj->museum_number = $rec["fields"]["museum_number"]; $obj->image = sprintf("http://media.vam.ac.uk/media/thira/collection_images/%s/%s.jpg", substr($rec["fields"]["primary_image_id"], 0, 6), $rec["fields"]["primary_image_id"]); $obj->image320 = $timthumb . "?w=320&a=t&zc=1&src=" . $obj->image; $obj->thumb2 = $timthumb . "?h=160&w=320&a=t&zc=1&src=" . $obj->image; $obj->summary = new obj(); $obj->summary->lines = array("img:" . $obj->thumb2, "h1:" . $obj->title, "p:" . $obj->subtitle, "p: "); $obj->details = new obj(); $obj->details->lines = array("h1:" . $obj->title, "zimg:" . $obj->image320 . "," . $obj->image, "p:" . $obj->subtitle); $this->parsed_response["records"][$i]["p2pitem"] = $obj; $this->parsed_response["meta"]["b"] = $i; } } }
if (!@mkdir(urlpath(constant($r)), 0744)) { error(_SH . rmroot(urlpath(constant($r) . " couldn't be created."))); } } elseif (!is_writable(urlpath(constant($r)))) { if (!@chmod(urlpath(constant($r)), 0744)) { error(_SH . rmroot(urlpath(constant($r) . " isn't writable."))); } } } // now we need to be sure that the INC helper file, exists. if (!file_exists(INK . 'inc' . EXT)) { // if the template does not exists, send an error if (!file_exists(TMPL . 'inc' . EXT)) { error("INC template doesn't exists."); } file_put_contents(urlpath(INC) . 'inc' . EXT, str_replace('%PATH%', ROOT . BASE, file_get_contents(TMPL . 'inc' . EXT))); } } unset($_F); // generate htaccess (beta) $_hta = ROOT . '.htaccess'; $_htf = TMPL . 'htaccess' . EXT; if (!file_exists($_hta)) { include CORE . 'config' . EXT; $_htf = file_get_contents($_htf); $_htf = preg_replace('/\\<\\?.*\\?\\>\\n*/', '', $_htf); if (isset($_CFG['charset'])) { $_htf = str_replace('%CHARSET%', strtoupper($_CFG['charset']), $_htf); } $_htf = str_replace('%ROOT%', PATH, $_htf); file_put_contents($_hta, $_htf);
$search_array = array("text" => "amsterdam"); if ($GET['srch']) { $search_array = array("text" => $GET['srch']); } $results = $f->photos_search($search_array); $items = array(); $p2p = array(); foreach ($results['photo'] as $photo) { $item = new obj(); $item->authorid = $photo['owner']; $item->author_link = "http://www.flickr.com/photos/" . $photo['owner'] . "/" . $photo['id']; $item->title = $photo['title']; $item->autor_stream = "http://www.flickr.com/people/" . $photo['owner']; $item->thumbnail = sprintf("http://farm%s.staticflickr.com/%s/%s_%s.jpg", $photo['farm'], $photo['server'], $photo['id'], $photo['secret']); $item->getperson = urlpath() . "getperson.php?id=" . $photo['owner']; $item->getpicture = urlpath() . "getpicture.php?id=" . $photo['id']; array_push($items, $item); $item2 = new obj(); $item2->summary = new obj(); $item2->summary->lines = array("img:" . $item->thumbnail, "h1:" . $item->title, "p: "); $item2->details = new obj(); $item2->details->lines = array("img:" . $item->thumbnail, "h1:" . $item->title, "p: "); array_push($p2p, $item2); } $retval = new obj(); $retval->status = 0; $retval->statusMsg = sprintf("success"); $retval->raw = $recent; $retval->data = new obj(); $retval->data->items = $items; $retval->data->p2p = $p2p;