// RES_COMMENT properties define('RESTRICTION', 10); // RES_COMMENT and RES_SUBRESTRICTION restriction /* GUID's for PR_MDB_PROVIDER */ define("ZARAFA_SERVICE_GUID", makeGuid("{3C253DCA-D227-443C-94FE-425FAB958C19}")); // default store define("ZARAFA_STORE_PUBLIC_GUID", makeGuid("{D47F4A09-D3BD-493C-B2FC-3C90BBCB48D4}")); // public store define("ZARAFA_STORE_DELEGATE_GUID", makeGuid("{7C7C1085-BC6D-4E53-9DAB-8A53F8DEF808}")); // other store define('ZARAFA_STORE_ARCHIVER_GUID', makeGuid("{BC8953AD-2E3F-4172-9404-896FF459870F}")); // archive store /* global profile section guid */ define('pbGlobalProfileSectionGuid', makeGuid("{C8B0DB13-05AA-1A10-9BB0-00AA002FC45A}")); /* Zarafa Contacts provider GUID */ define('ZARAFA_CONTACTS_GUID', makeGuid("{30047F72-92E3-DA4F-B86A-E52A7FE46571}")); /* Permissions */ // Get permission type define('ACCESS_TYPE_DENIED', 1); define('ACCESS_TYPE_GRANT', 2); define('ACCESS_TYPE_BOTH', 3); define('ecRightsNone', 0x0); define('ecRightsReadAny', 0x1); define('ecRightsCreate', 0x2); define('ecRightsEditOwned', 0x8); define('ecRightsDeleteOwned', 0x10); define('ecRightsEditAny', 0x20); define('ecRightsDeleteAny', 0x40); define('ecRightsCreateSubfolder', 0x80); define('ecRightsFolderAccess', 0x100); //define('ecrightsContact' ,0x00000200);
<?php include 'page/block/top.php'; $rs_photoList = $db->select(' SELECT p.label, p.id, p.description, c.id AS `category_id`, c.label AS `category_label` FROM `photo` AS `p` JOIN `category` AS `c` ON c.id = p.category_id WHERE p.category_id="' . $_GET['category_id'] . '" AND p.status="1" AND c.status="1" ORDER BY p.position ASC '); foreach ($rs_photoList['data'] as $key => $item) { if (isset($_GET['photo_id']) && $_GET['photo_id'] == $item['id']) { $photo = $key; $class = 'current'; $tpl->assignVar('PAGE_TITLE', PAGE_TITLE . ' - ' . $item['category_label'] . ': ' . $item['label']); } else { $class = ''; } $tpl->assignLoopVar('photo', array('id' => $item['id'], 'guid' => makeGuid($item['label']), 'category_id' => $item['category_id'], 'category_guid' => makeGuid($item['category_label']), 'class' => $class)); } if (isset($_GET['photo_id'])) { $rs_photo = $db->select('SELECT `description`, `label`, `id` FROM `photo` WHERE `id`="' . $_GET['photo_id'] . '" AND `category_id`="' . $_GET['category_id'] . '" AND `status`="1" ORDER BY `position` ASC', 0, 1); if ($rs_photo['total'] > 0) { $tpl->assignVar('PAGE_DESCRIPTION', PAGE_DESCRIPTION . ' ' . $rs_photo['data'][0]['description']); $tpl->assignVar(array('photo_id' => $rs_photo['data'][0]['id'], 'photo_description' => $rs_photo['data'][0]['description'], 'photo_guid' => makeGuid($rs_photo['data'][0]['label']))); } } if ($rs_photoList['total'] != 0) { $nextPhoto = $rs_photoList['data'][($photo + 1) % count($rs_photoList['data'])]; $tpl->assignVar(array('nextPhoto_id' => $nextPhoto['id'], 'nextPhoto_guid' => makeGuid($nextPhoto['label']), 'nextPhoto_category_id' => $nextPhoto['category_id'], 'nextPhoto_category_guid' => makeGuid($nextPhoto['category_label']))); }
<?php require '../inc/conf.php'; header('Cache-Control: no-cache'); set_time_limit(30); ini_set("memory_limit", '64M'); $dir = ROOT_DIR . 'media/image/screenshot/'; $name = makeGuid(preg_replace('#(.+)\\.[a-zA-Z]+$#isU', '$1', $_FILES['Filedata']['name'])); $extention = strtolower(preg_replace('#.+\\.([a-zA-Z]+)$#isU', '$1', $_FILES['Filedata']['name'])); $id = $db->insert('INSERT INTO map_image SET parent_id=' . $_POST['mapId'] . ', name="' . $name . '"'); $db->update('UPDATE map SET image_id=' . $id . ' WHERE id=' . $_POST['mapId']); $image = $dir . 'original/' . $id . '.' . $extention; if (file_exists($image)) { unlink($image); } move_uploaded_file($_FILES['Filedata']['tmp_name'], $image); foreach ($IMAGE_SIZE as $size) { $size = explode('x', $size); $dest = $dir . $size[0] . (isset($size[1]) ? 'x' . $size[1] : '') . '/' . $id . '.jpg'; if (file_exists($dest)) { unlink($dest); } redimage($image, $dest, $size[0], isset($size[1]) ? $size[1] : false); } redimage($image, ROOT_DIR . 'backoffice/img/preview/map_image_' . $id . '.jpg', 80, 80); echo $id;
<?php $rs_category = $db->select('SELECT `id`, `label` FROM `category` WHERE `status`="1" ORDER BY `position` ASC'); foreach ($rs_category['data'] as $category) { $rs_photo = $db->select('SELECT `id`, `label` FROM `photo` WHERE `category_id`="' . $category['id'] . '" AND `status`="1" ORDER BY `position` ASC', 0, 1); if ($rs_photo['total'] != 0) { $photo = $rs_photo['data'][0]; $tpl->assignLoopVar('category', array('id' => $category['id'], 'label' => $category['label'], 'guid' => makeGuid($category['label']), 'photo_id' => $photo['id'], 'photo_guid' => makeGuid($photo['label']), 'class' => isset($_GET['category_id']) && $_GET['category_id'] == $category['id'] ? 'selected' : 'off')); } }