1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501: 502: 503: 504: 505: 506: 507: 508: 509: 510: 511: 512: 513: 514: 515: 516: 517: 518: 519: 520: 521: 522: 523: 524: 525: 526: 527: 528: 529: 530: 531: 532: 533: 534: 535: 536: 537: 538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554: 555: 556: 557: 558: 559: 560: 561: 562: 563: 564: 565: 566: 567: 568: 569: 570: 571: 572: 573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605: 606: 607: 608: 609: 610: 611: 612: 613: 614: 615: 616: 617: 618: 619: 620: 621: 622: 623: 624: 625: 626: 627: 628: 629: 630: 631: 632: 633: 634: 635: 636: 637: 638: 639: 640: 641: 642: 643: 644: 645: 646: 647: 648: 649: 650: 651: 652: 653: 654: 655: 656: 657: 658: 659: 660: 661: 662: 663: 664: 665:
<?php
function replaceOption($oldkey, $newkey) {
deprecated_functions::notify(gettext("Use renameOption() instead"));
renameOption($oldkey, $newkey);
}
function is_valid_email_zp($input_email) {
deprecated_functions::notify(gettext("Use the isValidEmail() instead"));
return isValidEmail($input_email);
}
function genAlbumList(&$list, $curAlbum = NULL, $rights = UPLOAD_RIGHTS) {
global $_zp_gallery;
deprecated_functions::notify(gettext("Use the gallery class method getAllAlbums() or getAllAlbumsFromDB() instead"));
$list = $_zp_gallery->getAllAlbums($curAlbum, $rights, true);
}
function getAllAlbums($album = NULL) {
deprecated_functions::notify(gettext("Use the gallery class method getAllAlbums() or getAllAlbumsFromDB() instead"));
global $_zp_current_album, $_zp_gallery;
if (is_null($album))
$album = $_zp_current_album;
if (!is_object($album))
return;
$list = getAllAlbums($albumobj = NULL, $rights = LIST_RIGHTS, false);
return $list;
}
if (function_exists('printImageStatistic')) {
function printPopularAlbums($number = 5, $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = 'hitcounter', $width = NULL, $height = NULL, $crop = NULL, $albumfolder = '', $firstimglink = false, $threshold = 0, $collection = false) {
deprecated_functions::notify(gettext("Use printAlbumStatistisc() instead"));
printAlbumStatistic($number, "popular", $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $albumfolder, $firstimglink, $threshold, $collection);
}
function printLatestAlbums($number = 5, $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $albumfolder = '', $firstimglink = false, $collection = false) {
deprecated_functions::notify(gettext("Use printAlbumStatistisc() instead"));
printAlbumStatistic($number, "latest", $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $albumfolder, $firstimglink, $collection);
}
function printMostRatedAlbums($number = 5, $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $albumfolder = '', $firstimglink = false, $threshold = 0, $collection = false) {
deprecated_functions::notify(gettext("Use printAlbumStatistisc() instead"));
printAlbumStatistic($number, "mostrated", $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $albumfolder, $firstimglink, $threshold, $collection);
}
function printTopRatedAlbums($number = 5, $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $albumfolder = '', $firstimglink = false, $threshold = 0, $collection = false) {
deprecated_functions::notify(gettext("Use printAlbumStatistisc() instead"));
printAlbumStatistic($number, "toprated", $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $albumfolder, $firstimglink, $threshold, $collection);
}
function printLatestUpdatedAlbums($number = 5, $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $albumfolder = '', $firstimglink = false, $collection = false) {
deprecated_functions::notify(gettext("Use printAlbumStatistisc() instead"));
printAlbumStatistic($number, "latestupdated", $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $albumfolder, $firstimglink, $collection);
}
function printPopularImages($number = 5, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false, $threshold = 0) {
deprecated_functions::notify(gettext("Use printImageStatistisc() instead"));
printImageStatistic($number, "popular", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink, $threshold);
}
function printTopRatedImages($number = 5, $albumfolder = "", $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false, $threshold = 0) {
deprecated_functions::notify(gettext("Use printImageStatistisc() instead"));
printImageStatistic($number, "toprated", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink, $threshold);
}
function printMostRatedImages($number = 5, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false, $threshold = 0) {
deprecated_functions::notify(gettext("Use printImageStatistisc() instead"));
printImageStatistic($number, "mostrated", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink, $threshold);
}
function printLatestImages($number = 5, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false) {
deprecated_functions::notify(gettext("Use printImageStatistisc() instead"));
printImageStatistic($number, "latest", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink);
}
function printLatestImagesByDate($number = 5, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false) {
deprecated_functions::notify(gettext("Use printImageStatistisc() instead"));
printImageStatistic($number, "latest-date", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink);
}
function printLatestImagesByMtime($number = 5, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false) {
deprecated_functions::notify(gettext("Use printImageStatistisc() instead"));
printImageStatistic($number, "latest-mtime", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink);
}
}
function filterImageQuery($result, $source) {
if ($result) {
while ($row = db_fetch_assoc($result)) {
$image = newImage(null, $row);
$album = $image->album;
if ($album->name == $source || $album->checkAccess()) {
if (isImagePhoto($image)) {
if ($image->checkAccess()) {
return $image;
}
}
}
}
db_free_result($result);
}
return NULL;
}
function getRandomImages($daily = false) {
global $_zp_gallery;
$deprecatednote = gettext("Use the image_album_statistics plugin function getImageStatistic() with appropiate parameters");
if($daily) {
$deprecatednote .= ' ' . gettext("For picture of the day functionality use the image_album_statistics plugin function getPictureOfTheDay()");
}
deprecated_functions::notify($deprecatednote);
if ($daily) {
$potd = getSerializedArray(getOption('picture_of_the_day'));
if (date('Y-m-d', $potd['day']) == date('Y-m-d')) {
$album = newAlbum($potd['folder'], true, true);
if ($album->exists) {
$image = newImage($album, $potd['filename'], true);
if ($image->exists) {
return $image;
}
}
}
}
if (zp_loggedin()) {
$imageWhere = '';
} else {
$imageWhere = " AND " . prefix('images') . ".show=1";
}
$result = query('SELECT `folder`, `filename` ' .
' FROM ' . prefix('images') .
' INNER JOIN ' . prefix('albums') . ' ON ' . prefix('images') . '.albumid = ' . prefix('albums') . '.id ' .
' INNER JOIN (SELECT CEIL(RAND() * (SELECT MAX(id) FROM ' . prefix('images') . ')) AS id) AS r2 ON ' . prefix('images') . '.id >= r2.id ' .
' WHERE ' . prefix('albums') . '.folder!="" ' . $imageWhere . ' ORDER BY ' . prefix('images') . '.id LIMIT 1');
$images = filterImageQuery($result, NULL);
if ($image) {
if ($daily) {
$potd = array('day' => time(), 'folder' => $image->getAlbumName(), 'filename' => $image->getFileName());
setThemeOption('picture_of_the_day', serialize($potd), NULL, $_zp_gallery->getCurrentTheme());
}
return $image;
}
return NULL;
}
function getRandomImagesAlbum($rootAlbum = NULL, $daily = false) {
global $_zp_current_album, $_zp_gallery;
$deprecatednote = gettext("Use the image_album_statistic plugin function getImageStatisic() with appropiate parameters");
if($daily) {
$deprecatednote .= ' ' . gettext("For picture of the day functionality use the image_album_statiscic plugin function getPictureOfTheDay()-");
}
deprecated_functions::notify($deprecatednote);
if (empty($rootAlbum) && !in_context(ZP_ALBUM)) {
return null;
}
if (empty($rootAlbum)) {
$album = $_zp_current_album;
} else {
if (is_object($rootAlbum)) {
$album = $rootAlbum;
} else {
$album = newAlbum($rootAlbum);
}
}
if ($daily && ($potd = getOption('picture_of_the_day:' . $album->name))) {
$potd = getSerializedArray($potd);
if (date('Y-m-d', $potd['day']) == date('Y-m-d')) {
$rndalbum = newAlbum($potd['folder']);
$image = newImage($rndalbum, $potd['filename']);
if ($image->exists)
return $image;
}
}
$image = NULL;
if ($album->isDynamic()) {
$images = $album->getImages(0);
shuffle($images);
while (count($images) > 0) {
$result = array_pop($images);
if (Gallery::validImage($result['filename'])) {
$image = newImage(newAlbum($result['folder']), $result['filename']);
}
}
} else {
$albumfolder = $album->getFileName();
if ($album->isMyItem(LIST_RIGHTS)) {
$imageWhere = '';
$albumInWhere = '';
} else {
$imageWhere = " AND " . prefix('images') . ".show=1";
$albumInWhere = prefix('albums') . ".show=1";
}
$query = "SELECT id FROM " . prefix('albums') . " WHERE ";
if ($albumInWhere) {
$query .= $albumInWhere . ' AND ';
}
$query .= "folder LIKE " . db_quote(db_LIKE_escape($albumfolder) . '%');
$result = query($query);
if ($result) {
$albumids = array();
while ($row = db_fetch_assoc($result)) {
$albumids[] = $row['id'];
}
if (empty($albumids)) {
$albumInWhere = ' AND ' . $albumInWhere;
} else {
$albumInWhere = ' AND ' . prefix('albums') . ".id IN (" . implode(',', $albumids) . ')';
}
db_free_result($result);
$sql = 'SELECT `folder`, `filename` ' .
' FROM ' . prefix('images') . ', ' . prefix('albums') .
' WHERE ' . prefix('albums') . '.folder!="" AND ' . prefix('images') . '.albumid = ' .
prefix('albums') . '.id ' . $albumInWhere . $imageWhere . ' ORDER BY RAND()';
$result = query($sql);
$image = filterImageQuery($result, $album->name);
}
}
if ($image) {
if ($daily) {
$potd = array('day' => time(), 'folder' => $image->getAlbumName(), 'filename' => $image->getFileName());
setThemeOption('picture_of_the_day:' . $album->name, serialize($potd), NULL, $_zp_gallery->getCurrentTheme());
}
}
return $image;
}
function printRandomImages($number = 5, $class = null, $option = 'all', $rootAlbum = '', $width = NULL, $height = NULL, $crop = NULL, $fullimagelink = false) {
deprecated_functions::notify(gettext("Use the image_album_statistics plugin function getImageStatistic() with appropiate parameters. You might need to adjust your theme's CSS."));
if (is_null($crop) && is_null($width) && is_null($height)) {
$crop = 2;
} else {
if (is_null($width))
$width = 85;
if (is_null($height))
$height = 85;
if (is_null($crop)) {
$crop = 1;
} else {
$crop = (int) $crop && true;
}
}
if (!empty($class))
$class = ' class="' . $class . '"';
echo "<ul" . $class . ">";
for ($i = 1; $i <= $number; $i++) {
switch ($option) {
case "all":
$randomImage = getRandomImages();
break;
case "album":
$randomImage = getRandomImagesAlbum($rootAlbum);
break;
}
if (is_object($randomImage) && $randomImage->exists) {
echo "<li>\n";
if ($fullimagelink) {
$randomImageURL = $randomImage->getFullimageURL();
} else {
$randomImageURL = $randomImage->getLink();
}
echo '<a href="' . html_encode($randomImageURL) . '" title="' . sprintf(gettext('View image: %s'), html_encode($randomImage->getTitle())) . '">';
switch ($crop) {
case 0:
$sizes = getSizeCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, $randomImage, 'thumb');
$html = '<img src="' . html_encode(pathurlencode($randomImage->getCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, TRUE))) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($randomImage->getTitle()) . '" />' . "\n";
break;
case 1:
$sizes = getSizeCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, $randomImage);
$html = '<img src="' . html_encode(pathurlencode($randomImage->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, TRUE))) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($randomImage->getTitle()) . '" />' . "\n";
break;
case 2:
$sizes = getSizeDefaultThumb($randomImage);
$html = '<img src="' . html_encode(pathurlencode($randomImage->getThumb())) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($randomImage->getTitle()) . '" />' . "\n";
break;
}
echo zp_apply_filter('custom_image_html', $html, false, $randomImage);
echo "</a>";
echo "</li>\n";
} else {
break;
}
}
echo "</ul>";
}
function cleanHTML($html) {
deprecated_functions::notify(gettext("Use tidyHTML() instead"));
return tidyHTML($html);
}
function getTotalImagesIn($album) {
deprecated_functions::notify(gettext("Use AlbumBase class method getNumAllImages() instead"));
return $album->getNumAllImages();
}
function checkPublishDates($row) {
deprecated_functions::notify(gettext("Use themeObject::checkScheduledPublishing() instead"));
return themeObject::checkScheduledPublishing($row);
}
class internal_deprecations {
static function LanguageSubdomains() {
deprecated_functions::notify(gettext('Use getLanguageSubdomains() instead'));
}
static function getLanguageText() {
deprecated_functions::notify(gettext('Use getLanguageText() instead'));
}
static function setexifvars() {
deprecated_functions::notify(gettext('Use setexifvars() instead'));
}
static function hasPrimaryScripts() {
deprecated_functions::notify(gettext('Use hasPrimaryScripts() instead'));
}
static function removeDir() {
deprecated_functions::notify(gettext('Use removeDir() instead'));
}
static function tagURLs() {
deprecated_functions::notify(gettext('Use tagURLs() instead'));
}
static function unTagURLs() {
deprecated_functions::notify(gettext('Use unTagURLs() instead'));
}
static function updateImageProcessorLink() {
deprecated_functions::notify(gettext('Use updateImageProcessorLink() instead'));
}
static function pluginDebug() {
deprecated_functions::notify(gettext('Use pluginDebug() instead'));
}
static function removeTrailingSlash($string) {
deprecated_functions::notify(gettext('Use removeTrailingSlash() instead'));
}
static function tidyHTML() {
deprecated_functions::notify(gettext('Use tidyHTML() instead'));
}
static function PersistentObject() {
deprecated_functions::notify(gettext('Use the instantiate method instead'));
}
}
class zpFunctions {
static function LanguageSubdomains() {
internal_deprecations::LanguageSubdomains();
return getLanguageSubdomains();
}
static function getLanguageText($loc = NULL, $separator = NULL) {
internal_deprecations::getLanguageText();
return getLanguageText($loc, $separator);
}
static function setexifvars() {
internal_deprecations::setexifvars();
setexifvars();
}
static function hasPrimaryScripts() {
internal_deprecations::hasPrimaryScripts();
return hasPrimaryScripts();
}
static function removeDir($path, $within = false) {
internal_deprecations::removeDir();
return removeDir($path, $within);
}
static function tagURLs($text) {
internal_deprecations::tagURLs();
return tagURLs($text);
}
static function unTagURLs($text) {
internal_deprecations::unTagURLs();
return unTagURLs($text);
}
static function updateImageProcessorLink($text) {
internal_deprecations::updateImageProcessorLink();
return updateImageProcessorLink($text);
}
static function pluginDebug($extension, $priority, $start) {
internal_deprecations::pluginDebug();
pluginDebug($extension, $priority, $start);
}
static function removeTrailingSlash($string) {
internal_deprecations::removeTrailingSlash();
return removeTrailingSlash($string);
}
static function tidyHTML($html) {
internal_deprecations::tidyHTML();
return tidyHTML($html);
}
}