Overview

Packages

  • admin
  • classes
    • media
  • CodeIgniter
    • Libraries
  • core
  • functions
  • JSMin
  • None
  • OpenID
  • PHP
  • PHPMailer
  • plugins
    • admin
    • development
    • feed
    • mail
    • media
    • misc
    • seo
    • spam
    • uploader
    • users
    • zenpage
    • zenphoto
      • news
  • Services
    • JSON

Classes

  • _zp_captcha
  • _zp_HTML_cache
  • admin_approval
  • Album
  • AlbumBase
  • AlbumZip
  • AMFReader
  • AMFStream
  • AnyFile
  • AnyFile_Options
  • Auth_OpenID
  • Auth_OpenID_AlreadySigned
  • Auth_OpenID_AssociateRequest
  • Auth_OpenID_Association
  • Auth_OpenID_AuthRequest
  • Auth_OpenID_AX
  • Auth_OpenID_AX_AttrInfo
  • Auth_OpenID_AX_Error
  • Auth_OpenID_AX_FetchRequest
  • Auth_OpenID_AX_FetchResponse
  • Auth_OpenID_AX_KeyValueMessage
  • Auth_OpenID_AX_Message
  • Auth_OpenID_AX_StoreRequest
  • Auth_OpenID_AX_StoreResponse
  • Auth_OpenID_BcMathWrapper
  • Auth_OpenID_CancelResponse
  • Auth_OpenID_CheckAuthRequest
  • Auth_OpenID_CheckIDRequest
  • Auth_OpenID_Consumer
  • Auth_OpenID_ConsumerResponse
  • Auth_OpenID_CryptUtil
  • Auth_OpenID_DatabaseConnection
  • Auth_OpenID_Decoder
  • Auth_OpenID_DiffieHellman
  • Auth_OpenID_DiffieHellmanSHA1ConsumerSession
  • Auth_OpenID_DiffieHellmanSHA1ServerSession
  • Auth_OpenID_DiffieHellmanSHA256ConsumerSession
  • Auth_OpenID_DiffieHellmanSHA256ServerSession
  • Auth_OpenID_DumbStore
  • Auth_OpenID_Encoder
  • Auth_OpenID_EncodingError
  • Auth_OpenID_Extension
  • Auth_OpenID_FailureResponse
  • Auth_OpenID_FileStore
  • Auth_OpenID_GenericConsumer
  • Auth_OpenID_GmpMathWrapper
  • Auth_OpenID_KVForm
  • Auth_OpenID_MalformedReturnURL
  • Auth_OpenID_MalformedTrustRoot
  • Auth_OpenID_Mapping
  • Auth_OpenID_MathLibrary
  • Auth_OpenID_MDB2Store
  • Auth_OpenID_MemcachedStore
  • Auth_OpenID_Message
  • Auth_OpenID_MySQLStore
  • Auth_OpenID_NamespaceMap
  • Auth_OpenID_NoReturnToError
  • Auth_OpenID_OpenIDStore
  • Auth_OpenID_PAPE_Request
  • Auth_OpenID_PAPE_Response
  • Auth_OpenID_Parse
  • Auth_OpenID_PlainTextConsumerSession
  • Auth_OpenID_PlainTextServerSession
  • Auth_OpenID_PostgreSQLStore
  • Auth_OpenID_Request
  • Auth_OpenID_Server
  • Auth_OpenID_ServerError
  • Auth_OpenID_ServerErrorContainer
  • Auth_OpenID_ServerRequest
  • Auth_OpenID_ServerResponse
  • Auth_OpenID_ServiceEndpoint
  • Auth_OpenID_ServiceEndpointLoader
  • Auth_OpenID_SessionNegotiator
  • Auth_OpenID_SetupNeededResponse
  • Auth_OpenID_Signatory
  • Auth_OpenID_SigningEncoder
  • Auth_OpenID_SQLiteStore
  • Auth_OpenID_SQLStore
  • Auth_OpenID_SRegBase
  • Auth_OpenID_SRegRequest
  • Auth_OpenID_SRegResponse
  • Auth_OpenID_SuccessResponse
  • Auth_OpenID_TrustRoot
  • Auth_OpenID_TypeURIMismatch
  • Auth_OpenID_UntrustedReturnURL
  • Auth_OpenID_WebResponse
  • Auth_Yadis_Discovery
  • Auth_Yadis_DiscoveryResult
  • Auth_Yadis_dom
  • Auth_Yadis_domxml
  • Auth_Yadis_HTTPFetcher
  • Auth_Yadis_HTTPResponse
  • Auth_Yadis_Manager
  • Auth_Yadis_ManagerLoader
  • Auth_Yadis_ParanoidHTTPFetcher
  • Auth_Yadis_ParseHTML
  • Auth_Yadis_PHPSession
  • Auth_Yadis_PlainHTTPFetcher
  • Auth_Yadis_ProxyResolver
  • Auth_Yadis_Service
  • Auth_Yadis_SessionLoader
  • Auth_Yadis_XMLParser
  • Auth_Yadis_XRDS
  • Auth_Yadis_Yadis
  • auto_backup
  • AVCSequenceParameterSetReader
  • bxslider
  • cacheManager
  • cacheManagerFeed
  • CI_jsmin
  • CI_load
  • cloneZenphoto
  • codeIgniter_kludge
  • colorbox
  • Comment
  • comment_form
  • contactformOptions
  • crop_image
  • cycle
  • defaultCodeblocks
  • deprecated_functions
  • DownloadList
  • dynamic_locale
  • dynamicAlbum
  • elFinder_options
  • email_new_user
  • exampleMacros
  • external_auth
  • ExternalFeed
  • externalFeed_options
  • favorites
  • favoritesOptions
  • federated_logon
  • feed
  • fieldExtender
  • flag_thumbnail
  • Gallery
  • galleryArticles
  • getID3
  • getid3_aac
  • getid3_apetag
  • getid3_flv
  • getid3_handler
  • getid3_id3v1
  • getid3_id3v2
  • getid3_lib
  • getid3_lyrics3
  • getid3_mp3
  • getid3_mpeg
  • getid3_quicktime
  • getid3_swf
  • GoogleMap
  • Googlemaps
  • googleVerifyOptions
  • hitcounter
  • HTML
  • htmlmetatags
  • http_auth
  • Image
  • image_effects
  • internal_deprecations
  • ipBlocker
  • jcarousel
  • jPlayer
  • jplayer_options
  • jquery_rating
  • JSMin
  • lib_GD_Options
  • lib_Imagick_Options
  • lib_NoGraphics
  • MediaObject
  • menu_manager
  • MergedRSS
  • MergedRSSOptions
  • mobile
  • Mobile_Detect
  • mobileTheme
  • multipleLayoutOptions
  • null_seo
  • OAuthConsumer
  • OAuthDataStore
  • OAuthRequest
  • OAuthServer
  • OAuthSignatureMethod
  • OAuthSignatureMethod_HMAC_SHA1
  • OAuthSignatureMethod_PLAINTEXT
  • OAuthSignatureMethod_RSA_SHA1
  • OAuthToken
  • OAuthUtil
  • pagedThumbsNav
  • pagedthumbsOptions
  • PclZip
  • PersistentObject
  • PHPMailer
  • PlainText
  • POP3
  • print_album_menu
  • pseudoPlayer
  • publishContent
  • quota_manager
  • reCaptcha
  • ReCaptchaResponse
  • register_user
  • rewriteRules
  • rewriteTokens
  • RSS
  • RSS_internal_deprecations
  • rss_options
  • search_statistics
  • SearchEngine
  • security_logger
  • seo_locale
  • Services_JSON
  • Services_JSON_Error
  • setupexternalFeed
  • setupRSS
  • show_not_loggedin
  • sitemap
  • slideshow
  • SMTP
  • static_html_cache
  • tagsuggest
  • TextObject
  • TextObject_internal_deprecations
  • TextObject_Options
  • ThemeObject
  • themeSwitcher
  • tinymce4Options
  • tinyURL
  • Transientimage
  • tweet
  • TwitterOAuth
  • UploadHandler
  • user_expiry
  • user_groups
  • user_logout_options
  • userAddressFields
  • utf8
  • Video
  • Video_internal_deprecations
  • VideoObject_Options
  • viewer_size_image_options
  • WEBdocs
  • WEBdocs_Options
  • xmpMetadata
  • Zenpage
  • Zenpage_internal_deprecations
  • ZenpageCategory
  • zenpagecms
  • ZenpageItems
  • ZenpageNews
  • ZenpagePage
  • ZenpageRoot
  • Zenphoto_Administrator
  • Zenphoto_Authority
  • zenphoto_org_news
  • zenphoto_seo
  • zenphotoDonate
  • ZipStream
  • zp_PHPMailer
  • zpCaptcha
  • zpFunctions
  • zpLegacySpam
  • zpMutex
  • zpSimpleSpam
  • zpTrivialSpam

Exceptions

  • BadFunctionCallException
  • BadMethodCallException
  • Exception
  • getid3_exception
  • JSMin_UnterminatedCommentException
  • JSMin_UnterminatedRegExpException
  • JSMin_UnterminatedStringException
  • LogicException
  • OAuthExcept
  • phpmailerException

Functions

  • __autoload
  • _escape_xref
  • _recaptcha_aes_encrypt
  • _recaptcha_aes_pad
  • _recaptcha_http_post
  • _recaptcha_mailhide_email_parts
  • _recaptcha_mailhide_urlbase64
  • _recaptcha_qsencode
  • accessAllAlbums
  • add_context
  • addalbumsToDatabase
  • addCategoriesToDatabase
  • addGeoCoord
  • addItem
  • addPagesToDatabase
  • addPluginScript
  • addPluginType
  • addSubalbumMenus
  • admin_album_list
  • admin_securityChecks
  • admin_showupdate
  • adminPageNav
  • adminToolbox
  • albumNumber
  • applyMacros
  • Auth_OpenID_arrangeByType
  • Auth_OpenID_AX_checkAlias
  • Auth_OpenID_AX_toTypeURIs
  • Auth_OpenID_bestMatchingService
  • Auth_OpenID_checkFieldName
  • Auth_OpenID_checkSessionType
  • Auth_OpenID_checkTimestamp
  • Auth_OpenID_detectMathLibrary
  • Auth_OpenID_discover
  • Auth_OpenID_discoverURI
  • Auth_OpenID_discoverWithoutYadis
  • Auth_OpenID_discoverWithYadis
  • Auth_OpenID_discoverXRI
  • Auth_OpenID_extractReturnURL
  • Auth_OpenID_findOPLocalIdentifier
  • Auth_OpenID_getAllAssociationTypes
  • Auth_OpenID_getAllowedReturnURLs
  • Auth_OpenID_getAuthorityPattern
  • Auth_OpenID_getAvailableSessionTypes
  • Auth_OpenID_getDefaultAssociationOrder
  • Auth_OpenID_getDefaultGen
  • Auth_OpenID_getDefaultMod
  • Auth_OpenID_getDefaultNegotiator
  • Auth_OpenID_getEncodedPattern
  • Auth_OpenID_getEncryptedNegotiator
  • Auth_OpenID_getEscapeRE
  • Auth_OpenID_getMathLib
  • Auth_OpenID_getOnlyEncryptedOrder
  • Auth_OpenID_getOpenIDConsumerTypeURIs
  • Auth_OpenID_getOpenIDTypeName
  • Auth_OpenID_getOpenIDTypeURIs
  • Auth_OpenID_getOPOrUserServices
  • Auth_OpenID_getSecretSize
  • Auth_OpenID_getSessionTypes
  • Auth_OpenID_getSupportedAssociationTypes
  • Auth_OpenID_getUnreserved
  • Auth_OpenID_getURIPattern
  • Auth_OpenID_getURLIllegalCharRE
  • Auth_OpenID_HMACSHA1
  • Auth_OpenID_HMACSHA256
  • Auth_OpenID_include_init
  • Auth_OpenID_isError
  • Auth_OpenID_isOpenID1
  • Auth_OpenID_legacy_discover
  • Auth_OpenID_makeOpenIDEndpoints
  • Auth_OpenID_math_extensions
  • Auth_OpenID_mkNonce
  • Auth_OpenID_noMathSupport
  • Auth_OpenID_pct_encoded_replace
  • Auth_OpenID_pct_encoded_replace_unreserved
  • Auth_OpenID_registerNamespaceAlias
  • Auth_OpenID_remove_dot_segments
  • Auth_OpenID_removeNamespaceAlias
  • Auth_OpenID_returnToMatches
  • Auth_OpenID_setNoMathSupport
  • Auth_OpenID_SHA1
  • Auth_OpenID_SHA256
  • Auth_OpenID_splitNonce
  • Auth_OpenID_supportsSReg
  • Auth_OpenID_urinorm
  • Auth_OpenID_verifyReturnTo
  • Auth_Yadis_array_scramble
  • Auth_Yadis_escapeForIRI
  • Auth_Yadis_getCanonicalID
  • Auth_Yadis_getDefaultProxy
  • Auth_Yadis_getEscapeRE
  • Auth_Yadis_getIPrivateChars
  • Auth_Yadis_getNSMap
  • Auth_Yadis_getServiceEndpoints
  • Auth_Yadis_getSupportedExtensions
  • Auth_Yadis_getUCSChars
  • Auth_Yadis_getXMLParser
  • Auth_Yadis_getXRDExpiration
  • Auth_Yadis_getXrefRE
  • Auth_Yadis_getXRIAuthorities
  • Auth_Yadis_identifierScheme
  • Auth_Yadis_iriToURI
  • Auth_Yadis_pct_escape_unicode
  • Auth_Yadis_providerIsAuthoritative
  • Auth_Yadis_rootAuthority
  • Auth_Yadis_setDefaultParser
  • Auth_Yadis_startswith
  • Auth_Yadis_toIRINormal
  • Auth_Yadis_toURINormal
  • Auth_Yadis_XRI
  • Auth_Yadis_XRIAppendArgs
  • authorSelector
  • build_query
  • build_url
  • bulkActionRedirect
  • bulkTags
  • byteConvert
  • cacheImage
  • checkAccess
  • checkAlbumimagesort
  • checkAlbumParentid
  • checkAlbumPassword
  • checkChosenItemStatus
  • checkChosenMenuset
  • checked
  • checkFolder
  • checkForEmptyTitle
  • checkForGuest
  • checkForPage
  • checkForPassword
  • checkForUpdate
  • checkHitcounterDisplay
  • checkIfChecked
  • checkIfLockedNews
  • checkIfLockedPage
  • checkIfNew
  • checkInstall
  • checkLayoutUseForImages
  • checkNewsAccess
  • checkNewsCategoryPassword
  • checkObjectsThumb
  • checkPagePassword
  • checkPageValidity
  • checkParentLayouts
  • checkPublishDates
  • checkRequiredField
  • checkSelectedAlbum
  • checkSignature
  • cleanAlbum
  • cleanHTML
  • clearSitemapCache
  • clonedFrom
  • codeblocktabsJS
  • comment_form_addComment
  • comment_form_handle_comment
  • comment_form_PaginationJS
  • comment_form_postcomment
  • comment_form_print10Most
  • comment_form_visualEditor
  • commentFormUseCaptcha
  • commentReply
  • commentsAllowed
  • consolidatedEditMessages
  • copyLayoutSelection
  • copyThemeDirectory
  • countArticles
  • countCombiNews
  • createMenuIfNotExists
  • createRelatedItemsResultArray
  • cron_starter
  • currentRelativeURL
  • customOptions
  • dateDiff
  • datepickerJS
  • dateTimeConvert
  • db_affected_rows
  • db_close
  • db_collation
  • db_connect
  • db_count
  • db_create
  • db_create_table
  • db_error
  • db_fetch_assoc
  • db_fetch_row
  • db_free_result
  • db_getSQLmode
  • db_insert_id
  • db_LIKE_escape
  • db_list_fields
  • db_name
  • db_num_rows
  • db_permissions
  • db_quote
  • db_setSQLmode
  • db_show
  • db_software
  • db_table_update
  • db_truncate_table
  • debug404
  • debugLog
  • debugLogBacktrace
  • debugLogVar
  • defaultCodeblocks_codebox
  • deleteArticle
  • deleteCategory
  • deleteItem
  • deleteLayoutSelection
  • deletePage
  • deleteThemeDirectory
  • detect_fetcher
  • detect_math
  • detect_query_corruption
  • detect_random
  • detect_stores
  • detect_xml
  • dircopy
  • displayError
  • doIncludes
  • elFinder_admin_tabs
  • elFinder_tinymce
  • enableExtension
  • escape
  • executeRSS
  • exitZP
  • exposeZenPhotoInformations
  • extensionEnabled
  • fetchComments
  • filesystemToInternal
  • filter_extractReturnURL
  • filter_MatchesAnyOpenIDConsumerType
  • filter_MatchesAnyOpenIDType
  • filterImageQuery
  • fix_path_redirect
  • formatList
  • fullText
  • galleryAlbumsPerPage
  • genAlbumList
  • generateCaptcha
  • generateLanguageList
  • generateListFromArray
  • generateListFromFiles
  • generateRadiobuttonsFromArray
  • generateSitemapCacheFile
  • generateSitemapIndexCacheFile
  • generateUnorderedListFromArray
  • get_AnyFile_suffixes
  • get_context
  • get_filterScript
  • get_instance
  • get_language_string
  • getAdminThumb
  • getAlbumArray
  • getAlbumBreadcrumb
  • getAlbumBreadcrumbAdmin
  • getAlbumCustomData
  • getAlbumData
  • getAlbumDate
  • getAlbumDesc
  • getAlbumFolder
  • getAlbumGeodata
  • getAlbumId
  • getAlbumInherited
  • getAlbumLinkURL
  • getAlbumLocation
  • getAlbumPage
  • getAlbumPlace
  • getAlbumStatistic
  • getAlbumThumb
  • getAlbumTitle
  • getAlbumURL
  • getAllAccessibleAlbums
  • getAllAlbums
  • getAllArticleDates
  • getAllCategories
  • getAllDates
  • getAllowedTags
  • getAllSubAlbumIDs
  • getAllSubalbums
  • getAllTagsCount
  • getAllTagsFromAlbum
  • getAllTagsFromAlbum_multi_unique
  • getAllTagsFromZenpage
  • getAllTagsUnique
  • getAllTranslations
  • getAnnotatedAlbumTitle
  • getAnnotatedImageTitle
  • getArticles
  • getAuthor
  • getBare
  • getBareAlbumDesc
  • getBareAlbumTitle
  • getBareGalleryDesc
  • getBareGalleryTitle
  • getBareImageDesc
  • getBareImageTitle
  • getBareNewsAlbumTitle
  • getBareNewsTitle
  • getBarePageTitle
  • getCategory
  • getCategoryID
  • getCategoryLink
  • getCategoryParentID
  • getCategorySortOrder
  • getCategoryTitle
  • getCheckboxState
  • getCodeblock
  • getCombiNews
  • getCommentAddress
  • getCommentAuthorEmail
  • getCommentAuthorLink
  • getCommentAuthorName
  • getCommentAuthorSite
  • getCommentBody
  • getCommentCount
  • getCommentDate
  • getCommentDateTime
  • getCommentErrors
  • getCommentsAllowed
  • getCommentStored
  • getCommentTime
  • getConsumer
  • getContentShorten
  • getCurrentMenuItem
  • getCurrentNewsArchive
  • getCurrentNewsCategory
  • getCurrentNewsCategoryID
  • getCurrentNewsCategoryParentID
  • getCurrentNewsPage
  • getCurrentPage
  • getCurrentTheme
  • getCustomAlbumThumb
  • getCustomAlbumThumbMaxSpace
  • getCustomImageURL
  • getCustomPageURL
  • getCustomSizedImageMaxSpace
  • getCustomSizedImageThumbMaxSpace
  • getDefaultHeight
  • getDefaultSizedImage
  • getDefaultWidth
  • getDownloadLink
  • getdownloadList
  • getDownloadURL
  • getE
  • getEnabledPlugins
  • getExpiryDatePost
  • getFavoritesURL
  • getField
  • getFirstImageURL
  • getFullHeight
  • getFullImageURL
  • getFullNewsImage
  • getFullWidth
  • getGalleryDesc
  • getGalleryIndexURL
  • getGalleryTitle
  • getGeoCoord
  • getHeadTitle
  • getHitcounter
  • getImageArgs
  • getImageCacheFilename
  • getImageCachePostfix
  • getImageCity
  • getImageCountry
  • getImageCustomData
  • getImageData
  • getImageDate
  • getImageDesc
  • getImageEXIFData
  • getImageGeodata
  • getImageID
  • getImageLinkURL
  • getImageLocation
  • getImageMetaData
  • getImageParameters
  • getImageProcessorURI
  • getImageProcessorURIFromCacheName
  • getImageRotation
  • getImageSortOrder
  • getImageState
  • getImageStatistic
  • getImageThumb
  • getImageTitle
  • getImageURI
  • getImageURL
  • getItem
  • getItemByID
  • getItemTitleAndURL
  • getjPlayerSkinCSS
  • getjPlayerSkins
  • getLanguageArray
  • getLanguageFlag
  • getLastImageURL
  • getLatestComments
  • getLatestNews
  • getLatestZenpageComments
  • getLayout
  • getLayoutSelector
  • getLink
  • getLinkHTML
  • getLogTabs
  • getMacros
  • getMainSiteName
  • getMainSiteURL
  • getManagedAlbumList
  • getMaxSpaceContainer
  • getMenuFromLink
  • getMenuItemChilds
  • getMenuItems
  • getMenumanagerPredicessor
  • getMenumanagerSuccessor
  • getMenuSetSelector
  • getMenuVisibility
  • getMimeString
  • getNestedAlbumList
  • getNewsAdminOption
  • getNewsAdminOptionPath
  • getNewsAlbumName
  • getNewsAlbumTitle
  • getNewsAlbumURL
  • getNewsArchivePath
  • getNewsArchiveURL
  • getNewsAuthor
  • getNewsCategories
  • getNewsCategoryCustomData
  • getNewsCategoryDesc
  • getNewsCategoryPath
  • getNewsCategoryURL
  • getNewsContent
  • getNewsContentShorten
  • getNewsCustomData
  • getNewsDate
  • getNewsExtraContent
  • getNewsID
  • getNewsImageTags
  • getNewsIndexURL
  • getNewsLink
  • getNewsPagesStatistic
  • getNewsPathNav
  • getNewsReadMore
  • getNewsTitle
  • getNewsTitleLink
  • getNewsTitlePath
  • getNewsType
  • getNewsURL
  • getNewsVideoContent
  • getNextAlbum
  • getNextAlbumURL
  • getNextImageThumb
  • getNextImageURL
  • getNextNewsPageURL
  • getNextNewsURL
  • getNextPageURL
  • getNextPrevNews
  • getNotViewableAlbums
  • getNotViewableImages
  • getNumAlbums
  • getNumAllSubalbums
  • getNumImages
  • getNumNews
  • getNumPages
  • getNumSubalbums
  • getOpenIDURL
  • getOption
  • getOptionFromDB
  • getOptionList
  • getPageAuthor
  • getPageContent
  • getPageCustomData
  • getPageDate
  • getPageExtraContent
  • getPageID
  • getPageLastChangeDate
  • getPageLinkPath
  • getPageLinkURL
  • getPageNavList
  • getPageNumURL
  • getPageParentID
  • getPageRedirect
  • getPages
  • getPageSelector
  • getPageSortorder
  • getPageTitle
  • getPageTitleLink
  • getPageURL
  • getParentAlbums
  • getParentAlbumsAdmin
  • getParentBreadcrumb
  • getParentItems
  • getParentMenuItems
  • getParentNewsCategories
  • getParentPages
  • getPasswordProtectImage
  • getPHPFiles
  • getPlugin
  • getPluginFiles
  • getPluginTabs
  • getPrevAlbum
  • getPrevAlbumURL
  • getPrevImageThumb
  • getPrevImageURL
  • getPrevNewsPageURL
  • getPrevNewsURL
  • getPrevPageURL
  • getProtectedImageURL
  • getRandomImages
  • getRandomImagesAlbum
  • getRating
  • getRelatedItems
  • getRequestURI
  • getReturnTo
  • getRSSHeaderLink
  • getRSSLink
  • getScheme
  • getSearchDate
  • getSearchURL
  • getSearchWords
  • getSelectedLayout
  • getSerializedArray
  • getSetClause
  • getSiteHomeURL
  • getSitemapAlbumList
  • getSitemapAlbums
  • getSitemapGoogleImageVideoExtras
  • getSitemapGoogleLoopIndex
  • getSitemapImages
  • getSitemapIndexLinks
  • getSitemapZenpageNewsArticles
  • getSitemapZenpageNewsCategories
  • getSitemapZenpageNewsIndex
  • getSitemapZenpagePages
  • getSizeCustomImage
  • getSizeDefaultImage
  • getSizeDefaultThumb
  • getSizedImageURL
  • getSizeFullImage
  • getStore
  • getSubCategories
  • getSubtabs
  • getSuffix
  • getTagCountByAccess
  • getTagOrder
  • getTags
  • gettext_pl
  • gettext_th
  • getTheme
  • getThemeFiles
  • getThemeOption
  • getTimezones
  • getTinyMCE4ConfigFiles
  • getTitle
  • getTotalArticles
  • getTotalImagesIn
  • getTotalNewsPages
  • getTotalPages
  • getTrustRoot
  • getUnprotectedImageURL
  • getUrAlbum
  • getURL
  • getUserIP
  • getUserLocale
  • getVersion
  • getViewerImageSize
  • getWatermarkParam
  • getWatermarkPath
  • getWatermarks
  • getWhereClause
  • getXSRFToken
  • getZenpageHitcounter
  • getZenpageRSSHeaderLink
  • getZenpageRSSLink
  • getZenpageStatistic
  • googleVerifyHead
  • handleSearchParms
  • hasDynamicAlbumSuffix
  • hasNextImage
  • hasNextPage
  • hasPrevImage
  • hasPrevPage
  • hitcounter
  • html_decode
  • html_encode
  • html_encodeTagged
  • httpsRedirect
  • httpUploadHandler
  • httpUploadHandler_admin_tabs
  • i18nSetLocale
  • imageBlurGD
  • imageDebug
  • imageError
  • imageNumber
  • imgSrcURI
  • in_context
  • inNewsCategory
  • inProtectedNewsCategory
  • installSignature
  • instrument
  • inSubNewsCategoryOf
  • internalToFilesystem
  • inventMenuItem
  • iptc_make_tag
  • is_AdminEditPage
  • is_connected
  • is_GalleryNewsType
  • is_News
  • is_NewsArchive
  • is_NewsArticle
  • is_NewsCategory
  • is_NewsPage
  • is_NewsType
  • is_Pages
  • is_valid_email_zp
  • is_valid_image
  • is_valid_other_type
  • is_zip
  • isAlbumClass
  • isAlbumPage
  • isArchive
  • isHandledAlbum
  • isImageClass
  • isImagePage
  • isImagePhoto
  • isImageVideo
  • isLandscape
  • isMyAlbum
  • isMyNews
  • isMyPage
  • isolate
  • isProtectedAlbum
  • isProtectedNewsCategory
  • isProtectedPage
  • isSubNewsCategoryOf
  • isValidURL
  • jQueryUpload_head
  • jQueryUpload_headers
  • jQueryUploadHandler
  • jQueryUploadHandler_admin_tabs
  • js_encode
  • json_decode
  • json_encode
  • kses
  • kses_array_lc
  • kses_attr
  • kses_bad_protocol
  • kses_bad_protocol_once
  • kses_bad_protocol_once2
  • kses_check_attr_val
  • kses_decode_entities
  • kses_hair
  • kses_hook
  • kses_html_error
  • kses_js_entities
  • kses_no_null
  • kses_normalize_entities
  • kses_normalize_entities2
  • kses_split
  • kses_split2
  • kses_stripslashes
  • kses_version
  • ksesProcess
  • layoutSelector
  • layoutSelector_album
  • listDBUses
  • listDirectoryFiles
  • listUses
  • load_zenpage_news
  • load_zenpage_pages
  • loadLocalOptions
  • log_message
  • lookupSortKey
  • macro_admin_tabs
  • macroList_show
  • makeAlbumCurrent
  • makeImageCurrent
  • makeSpecialImageName
  • markRelease_button
  • mb_strlen
  • mb_strpos
  • mb_strrpos
  • mb_strtolower
  • mb_strtoupper
  • mb_substr
  • mb_substr_count
  • menu_admin_toolbox_global
  • menu_tabs
  • minDiff
  • mkdir_recursive
  • my_truncate_string
  • myts_date
  • newAlbum
  • newImage
  • next_album
  • next_comment
  • next_image
  • next_news
  • next_page
  • ngettext_pl
  • ngettext_th
  • normalizeColumns
  • omsAdditions
  • openedForComments
  • parse_query
  • parse_size
  • parseAllowedTags
  • parseHttpAcceptLanguage
  • passAlbums
  • passImages
  • pathurlencode
  • PclZipUtilCopyBlock
  • PclZipUtilOptionText
  • PclZipUtilPathInclusion
  • PclZipUtilPathReduction
  • PclZipUtilRename
  • PclZipUtilTranslateWinPath
  • PHPMailerAutoload
  • populateManagedObjectsList
  • postAlbumSort
  • postIndexDecode
  • postIndexEncode
  • prefix
  • prepareAlbumPage
  • prepareCustomPage
  • prepareImagePage
  • prepareIndexPage
  • print404status
  • print_language_string_list
  • printAddToFavorites
  • printAdminFooter
  • printAdminHeader
  • printAdminRightsTable
  • printAdminToolbox
  • printAlbumBreadcrumb
  • printAlbumButtons
  • printAlbumCustomData
  • printAlbumData
  • printAlbumDate
  • printAlbumDesc
  • printAlbumEditForm
  • printAlbumEditRow
  • printAlbumLegend
  • printAlbumLink
  • printAlbumLocation
  • printAlbumMap
  • printAlbumMenu
  • printAlbumMenuJump
  • printAlbumMenuList
  • printAlbumMenuListAlbum
  • printAlbumPlace
  • printAlbumRating
  • printAlbumsSelector
  • printAlbumStatistic
  • printAlbumStatisticItem
  • printAlbumThumbImage
  • printAlbumTitle
  • printAlbumURL
  • printAlbumZip
  • printAllDates
  • printAllNewsCategories
  • printAllTags
  • printAllTagsAs
  • printAllTagsFromAlbum
  • printAllTagsFromZenpage
  • printAnnotatedAlbumTitle
  • printAnnotatedImageTitle
  • printArticleCategories
  • printArticleDatesDropdown
  • printArticlesPerPageDropdown
  • printBareAlbumDesc
  • printBareAlbumTitle
  • printBareGalleryDesc
  • printBareGalleryTitle
  • printBareImageDesc
  • printBareImageTitle
  • printBareNewsTitle
  • printBarePageTitle
  • printBulkActions
  • printCaptcha
  • printCategoriesStatistic
  • printCategoryCheckboxListEntry
  • printCategoryDropdown
  • printCategoryListSortableTable
  • printCategorySelection
  • printCodeblock
  • printCodeblockEdit
  • printCommentAuthorLink
  • printCommentErrors
  • printCommentForm
  • printContactForm
  • printCurrentNewsArchive
  • printCurrentNewsCategory
  • printCustomAlbumThumbImage
  • printCustomAlbumThumbMaxSpace
  • printCustomMenu
  • printCustomPageSelector
  • printCustomPageURL
  • printCustomSizedImage
  • printCustomSizedImageMaxHeight
  • printCustomSizedImageMaxSpace
  • printCustomSizedImageThumbMaxSpace
  • printDefaultSizedImage
  • printDownloadAlbumZipURL
  • printDownloadLink
  • printDownloadLinkAlbumZip
  • printdownloadList
  • printDownloadURL
  • printEditable
  • printEditCommentLink
  • printEditDropdown
  • printExpired
  • printFavoritesLink
  • printFavoritesURL
  • printField
  • printGalleryDesc
  • printGalleryIndexURL
  • printGalleryTitle
  • printGoogleMap
  • printHeadTitle
  • printHomeLink
  • printImageCustomData
  • printImageData
  • printImageDate
  • printImageDesc
  • printImageDiv
  • printImageEXIFData
  • printImageID
  • printImageLink
  • printImageMap
  • printImageMetadata
  • printImageRating
  • printImageSortOrder
  • printImageStatistic
  • printImageThumb
  • printImageTitle
  • printImageURL
  • printItemEditLink
  • printItemsList
  • printItemsListTable
  • printItemStatusDropdown
  • printjCarouselThumbNav
  • printjPlayerPlaylist
  • printLanguageSelector
  • printLatestAlbums
  • printLatestComments
  • printLatestImages
  • printLatestImagesByDate
  • printLatestImagesByMtime
  • printLatestNews
  • printLatestUpdatedAlbums
  • printLatestZenpageComments
  • printLink
  • printLinkHTML
  • printLogoAndLinks
  • printManagedObjects
  • printMenuemanagerPageList
  • printMenuemanagerPageListWithNav
  • printMenumanagerBreadcrumb
  • printMenumanagerNextLink
  • printMenumanagerPrevLink
  • printMostPopularItems
  • printMostRatedAlbums
  • printMostRatedImages
  • printMostRatedItems
  • printNestedAlbumsList
  • printNestedItemsList
  • printNestedMenu
  • printNews
  • printNewsArchive
  • printNewsAuthor
  • printNewsCategories
  • printNewsCategoryCustomData
  • printNewsCategoryDesc
  • printNewsCategoryURL
  • printNewsContent
  • printNewsCustomData
  • printNewsDate
  • printNewsExtraContent
  • printNewsImageTags
  • printNewsIndexURL
  • printNewsLink
  • printNewsPageList
  • printNewsPageListWithNav
  • printNewsReadMoreLink
  • printNewsStatistic
  • printNewsTitle
  • printNewsTitleLink
  • printNewsURL
  • printNextNewsLink
  • printNextNewsPageLink
  • printNextPageLink
  • printNextPageURL
  • printPageArticleTags
  • printPageAuthor
  • printPageContent
  • printPageCustomData
  • printPageDate
  • printPagedThumbsNav
  • printPageExtraContent
  • printPageID
  • printPageLastChangeDate
  • printPageLinkURL
  • printPageList
  • printPageListWithNav
  • printPageMenu
  • printPageNav
  • printPageSelector
  • printPagesListTable
  • printPagesStatistic
  • printPageTitle
  • printPageTitleLink
  • printPageURL
  • printParentBreadcrumb
  • printParentPagesBreadcrumb
  • printPasswordForm
  • printPopularAlbums
  • printPopularImages
  • printPreloadScript
  • printPrevNewsLink
  • printPrevNewsPageLink
  • printPrevPageLink
  • printPrevPageURL
  • printPublished
  • printPublishIconLink
  • printRandomImages
  • printRating
  • printRegisterURL
  • printRegistrationForm
  • printRelatedItems
  • printRSSHeaderLink
  • printRSSLink
  • printSearchBreadcrumb
  • printSearchForm
  • printSiteHomeURL
  • printSizedImageLink
  • printSizedImageURL
  • printSlideShow
  • printSlideShowJS
  • printSlideShowLink
  • printSortableHead
  • printSortOrderDropdown
  • printSubPagesExcerpts
  • printSubtabs
  • printTabs
  • printTags
  • printThumbNav
  • printTopRatedAlbums
  • printTopRatedImages
  • printTopRatedItems
  • printUnpublishedDropdown
  • printUserLogin_out
  • printUserSizeImage
  • printUserSizeSelector
  • printVersion
  • printZenJavascripts
  • printZenpageIconLegend
  • printZenpageItemsBreadcrumb
  • printZenpageNewsCategorySelector
  • printZenpagePagesSelector
  • printZenpageRSSHeaderLink
  • printZenpageRSSLink
  • printZenpageStatistic
  • printZenphotoLink
  • process_language_string_save
  • processAlbumBulkActions
  • processAlbumEdit
  • processCodeblockSave
  • processCommentBulkActions
  • processCredentials
  • processCustomOptionSave
  • processEditSelection
  • processExpired
  • processImageBulkActions
  • processImageEdit
  • processManagedObjects
  • processMenuBulkActions
  • processOrder
  • processRights
  • processTags
  • processZenpageBulkActions
  • propSizes
  • publishItem
  • purgeOption
  • query
  • query_full_array
  • query_single_row
  • rc4
  • read_exif_data_protected
  • readTags
  • recaptcha_check_answer
  • recaptcha_get_html
  • recaptcha_get_signup_url
  • recaptcha_mailhide_html
  • recaptcha_mailhide_url
  • reconfigureAction
  • reconfigureCS
  • reconfigurePage
  • recordMissing
  • rem_context
  • removeParentAlbumNames
  • resetCurrentAlbum
  • restore_context
  • reveal
  • rewrite_get_album_image
  • rewrite_path
  • rewrite_path_zenpage
  • RSS_Channel
  • RSS_Retrieve
  • RSS_Tags
  • rulesList
  • run
  • safe_fnmatch
  • safe_glob
  • sanitize
  • sanitize_numeric
  • sanitize_path
  • sanitize_script
  • sanitize_string
  • sanitizeRedirect
  • save_context
  • saveLayoutSelection
  • saveZenphotoLayoutSelection
  • search_quote
  • secureServer
  • seo_cleanup_button
  • seoFriendly
  • seoFriendlyJS
  • set_context
  • setAlbumCustomData
  • setAlbumSubtabs
  • setImageCustomData
  • setMainDomain
  • setOption
  • setOptionDefault
  • setPluginDomain
  • setThemeColumns
  • setThemeDomain
  • setThemeOption
  • setThemeOptionDefault
  • setupAllowedMaps
  • setupCurrentLocale
  • setupDomain
  • setupTheme
  • shortenContent
  • showOrNotShowField
  • shuffle_assoc
  • signatureChange
  • site_upgrade_button
  • site_upgrade_status
  • sitemap_echonl
  • sitemap_getChangefreq
  • sitemap_getDateformat
  • sitemap_getDBLimit
  • sitemap_getISO8601Date
  • skipScheduledPublishing
  • sortByKey
  • sortByMultilingual
  • sortMultiArray
  • standardScripts
  • standardThemeOptions
  • stickyNews
  • storeConfig
  • storeTags
  • stripSuffix
  • submenuOf
  • switchLog
  • tagSelector
  • tagSuggestJS
  • tagSuggestJS_admin
  • tagSuggestJS_frontend
  • themeIsEditable
  • themeSetup
  • timezoneDiff
  • tinymce4ConfigJS
  • truncate_string
  • unpublishedZenphotoItemCheck
  • unpublishSubalbums
  • unQuote
  • unzip
  • updateArticle
  • updateCacheName
  • updateCategory
  • updateConfigItem
  • updateItemSortorder
  • updateItemsSortorder
  • updateMenuItem
  • updatePage
  • upload_extra
  • upload_form
  • upload_head
  • user_mailing_list_button
  • validateLocale
  • wordpress_import_button
  • wp_prefix
  • wp_query_full_array
  • wpimport_TryAgainError
  • XSRFdefender
  • XSRFToken
  • zenJavascript
  • zenpageAlbumImage
  • zenpageBulkActionMessage
  • zenpageHitcounter
  • zenpageJSCSS
  • zenpageOpenedForComments
  • zenpagePublish
  • zenphoto_PHPMailer
  • zenphoto_sendmail
  • zenPhotoTheme
  • zp_apply_filter
  • zp_clearCookie
  • zp_colorAllocate
  • zp_cookieEncode
  • zp_copyCanvas
  • zp_createImage
  • zp_drawRectangle
  • zp_error
  • zp_filter_slot
  • zp_filter_unique_id
  • zp_getCookie
  • zp_getFonts
  • zp_graphicsLibInfo
  • zp_handle_password
  • zp_handle_password_single
  • zp_has_filter
  • zp_image_types
  • zp_imageCanRotate
  • zp_imageColorTransparent
  • zp_imageDims
  • zp_imageFill
  • zp_imageFontHeight
  • zp_imageFontWidth
  • zp_imageFromString
  • zp_imageGet
  • zp_imageGray
  • zp_imageHeight
  • zp_imageIPTC
  • zp_imageKill
  • zp_imageLoadFont
  • zp_imageMerge
  • zp_imageOutput
  • zp_imageResizeAlpha
  • zp_imageUnsharpMask
  • zp_imageWidth
  • zp_load_album
  • zp_load_gallery
  • zp_load_image
  • zp_load_page
  • zp_load_request
  • zp_load_search
  • zp_loggedin
  • zp_mail
  • zp_register_filter
  • zp_remove_filter
  • zp_resampleImage
  • zp_rotateImage
  • zp_session_start
  • zp_setCookie
  • zp_writeString
  • zpErrorHandler
  • zpFormattedDate
  • zpRewriteURL
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  1: <?php
  2: 
  3: /**
  4:  * Support functions for "statistics" about images and albums.
  5:  *
  6:  * Supports such statistics as "most popular", "latest", "top rated", etc.
  7:  *
  8:  * <b>CAUTION:</b> The way to get a specific album has changed. You now have to pass the foldername of an album instead the album title.
  9:  *
 10:  * @author Malte Müller (acrylian), Stephen Billard (sbillard), gjr
 11:  * @package plugins
 12:  */
 13: $plugin_description = gettext("Functions that provide various statistics about images and albums in the gallery.");
 14: $plugin_author = "Malte Müller (acrylian), Stephen Billard (sbillard)";
 15: 
 16: require_once(dirname(dirname(__FILE__)) . '/template-functions.php');
 17: 
 18: /**
 19:  * Returns a array of album objects of album statistic accordingly to $option
 20:  *
 21:  * @param int $number the number of albums to get
 22:  * @param string $option
 23:  *      "popular" for the most popular albums,
 24:  *      "latest" for the latest uploaded by id (Discovery)
 25:  *      "latest-date" for the latest by date
 26:  *      "latest-mtime" for the latest by mtime
 27:  *      "latest-publishdate" for the latest by publishdate
 28:  *    "mostrated" for the most voted,
 29:  *      "toprated" for the best voted
 30:  *      "latestupdated" for the latest updated
 31:  *      "random" for random order (yes, strictly no statistical order...)
 32:  * @param string $albumfolder The name of an album to get only the statistc for its direct subalbums
 33:  * @param integer $threshold the minimum number of ratings (for rating options) or hits (for popular option) an album must have to be included in the list. (Default 0)
 34:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics to include all subalbum levels
 35:  * @return array
 36:  */
 37: function getAlbumStatistic($number = 5, $option, $albumfolder = '', $threshold = 0, $sortdirection = 'desc', $collection = false) {
 38:   global $_zp_gallery;
 39:   if ($albumfolder) {
 40:     $obj = newAlbum($albumfolder);
 41:     $albumWhere = ' WHERE parentid = ' . $obj->getID();
 42:     if ($collection) {
 43:       $albumWhere = '';
 44:       $ids = getAllSubAlbumIDs($albumfolder);
 45:       if (!empty($ids)) {
 46:         foreach ($ids as $id) {
 47:           $getids[] = $id['id'];
 48:         }
 49:         $getids = implode(', ', $getids);
 50:         $albumWhere = ' WHERE id IN (' . $getids . ')';
 51:       } else {
 52:         $albumWhere = ' WHERE parentid = ' . $obj->getID();
 53:       }
 54:     }
 55:   } else {
 56:     $obj = $_zp_gallery;
 57:     $albumWhere = '';
 58:   }
 59:   switch (strtolower($sortdirection)) {
 60:     case 'desc':
 61:     default:
 62:       $sortdir = 'DESC';
 63:       break;
 64:     case 'asc':
 65:       $sortdir = 'ASC';
 66:       break;
 67:   }
 68:   if (($option == 'toprated' || $option == 'mostrated' || $option == 'popular') && $threshold > 0) {
 69:     if (empty($albumWhere)) {
 70:       $albumWhere = ' WHERE ';
 71:     } else {
 72:       $albumWhere .= ' AND ';
 73:     }
 74:     if (($option == 'toprated' || $option == 'mostrated') && $threshold > 0) {
 75:       $albumWhere .= 'total_votes >= ' . $threshold;
 76:     }
 77:     if ($option == 'popular' && $threshold > 0) {
 78:       $albumWhere .= 'hitcounter >= ' . $threshold;
 79:     }
 80:   }
 81:   switch ($option) {
 82:     case "popular":
 83:       $sortorder = "hitcounter";
 84:       break;
 85:     default:
 86:     case "latest":
 87:       $sortorder = "id";
 88:       break;
 89:     case "latest-mtime":
 90:       $sortorder = "mtime";
 91:       break;
 92:     case "latest-date":
 93:       $sortorder = "date";
 94:       break;
 95:     case "latest-publishdate":
 96:       $sortorder = "IFNULL(publishdate,date)";
 97:       break;
 98:     case "mostrated":
 99:       $sortorder = "total_votes";
100:       break;
101:     case "toprated":
102:       $sortorder = "(total_value/total_votes) DESC, total_value";
103:       break;
104:     case "latestupdated":
105:       $sortorder = 'updateddate';
106:       break;
107:     case "random":
108:       $sortorder = "RAND()";
109:       break;
110:   }
111:   $albumArray = array();
112:   if ($obj->table == 'albums' && $obj->isDynamic()) {
113:     $albums = $obj->getAlbums(0, $sortorder, $sortdir);
114:     foreach ($albums as $album) {
115:       $album = newAlbum($album);
116:       if ($album->checkAccess() && ($album->getShow() || zp_loggedin(VIEW_UNPUBLISHED_RIGHTS))) {
117:         $albumArray[] = $album;
118:         if (count($albumArray) >= $number) { // got enough
119:           break;
120:         }
121:       }
122:     }
123:   } else {
124:     $result = query("SELECT id, title, folder, thumb FROM " . prefix('albums') . $albumWhere . " ORDER BY " . $sortorder . " " . $sortdir);
125:     while ($row = db_fetch_assoc($result)) {
126:       $album = newAlbum($row['folder'], true, true);
127:       if ($album->exists && $album->checkAccess() && ($album->getShow() || zp_loggedin(VIEW_UNPUBLISHED_RIGHTS))) {
128:         //actually we only use "folder" but keep for backward compatibility in case someone uses those for now …
129:         $albumArray[] = $album;
130:         if (count($albumArray) >= $number) { // got enough
131:           break;
132:         }
133:       }
134:     }
135:     db_free_result($result);
136:   }
137:   return $albumArray;
138: }
139: 
140: /**
141:  * Prints album statistic according to $option as an unordered HTML list
142:  * A css id is attached by default named '$option_album'
143:  *
144:  * @param string $number the number of albums to get
145:  * @param string $option
146:  *      "popular" for the most popular albums,
147:  *      "latest" for the latest uploaded by id (Discovery)
148:  *      "latest-date" for the latest by date
149:  *      "latest-mtime" for the latest by mtime
150:  *      "latest-publishdate" for the latest by publishdate
151:  *    "mostrated" for the most voted,
152:  *      "toprated" for the best voted
153:  *      "latestupdated" for the latest updated
154:  *      "random" for random order (yes, strictly no statistical order...)
155:  * @param bool $showtitle if the album title should be shown
156:  * @param bool $showdate if the album date should be shown
157:  * @param bool $showdesc if the album description should be shown
158:  * @param integer $desclength the length of the description to be shown
159:  * @param string $showstatistic
160:  *      "hitcounter" for showing the hitcounter (views),
161:  *      "rating" for rating,
162:  *      "rating+hitcounter" for both.
163:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
164:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
165:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
166:  * @param integer $threshold the minimum number of ratings (for rating options) or hits (for popular option) an album must have to be included in the list. (Default 0)
167:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics to include all subalbum levels
168:  */
169: function printAlbumStatistic($number, $option, $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $albumfolder = '', $firstimglink = false, $threshold = 0, $collection = false) {
170:     $albums = getAlbumStatistic($number, $option, $albumfolder, $threshold, $collection);
171:     echo "\n<div id=\"" . $option . "_album\">\n";
172:     echo "<ul>";
173:     foreach ($albums as $album) {
174:         printAlbumStatisticItem($album, $option, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $firstimglink);
175:     }
176:     echo "</ul></div>\n";
177: }
178: 
179: /**
180:  * A helper function that only prints a item of the loop within printAlbumStatistic()
181:  * Not for standalone use.
182:  *
183:  * @param array $album the array with album objects that getAlbumsStatistic() submitted
184:  * @param string $option
185:  *      "popular" for the most popular albums,
186:  *      "latest" for the latest uploaded by id (Discovery)
187:  *      "latest-date" for the latest by date
188:  *      "latest-mtime" for the latest by mtime
189:  *      "latest-publishdate" for the latest by publishdate
190:  *    "mostrated" for the most voted,
191:  *      "toprated" for the best voted
192:  *      "latestupdated" for the latest updated
193:  *      "random" for random order (yes, strictly no statistical order...)
194:  * @param bool $showtitle if the album title should be shown
195:  * @param bool $showdate if the album date should be shown
196:  * @param bool $showdesc if the album description should be shown
197:  * @param integer $desclength the length of the description to be shown
198:  * @param string $showstatistic
199:  *      "hitcounter" for showing the hitcounter (views),
200:  *      "rating" for rating,
201:  *      "rating+hitcounter" for both.
202:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
203:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
204:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
205:  * @param bool $firstimglink 'false' (default) if the album thumb link should lead to the album page, 'true' if to the first image of theh album if the album itself has images
206:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics to include all subalbum levels
207:  */
208: function printAlbumStatisticItem($album, $option, $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $firstimglink = false) {
209:     global $_zp_gallery;
210:     $twidth = $width;
211:     $theight = $height;
212:     if (is_null($crop) && is_null($width) && is_null($height)) {
213:         $crop = 2;
214:     } else {
215:         if (is_null($width))
216:             $width = 85;
217:         if (is_null($height))
218:             $height = 85;
219:         if (is_null($crop)) {
220:             $crop = 1;
221:         } else {
222:             $crop = (int) $crop && true;
223:         }
224:     }
225:     $tempalbum = $album;
226:     if ($firstimglink && $tempimage = $tempalbum->getImage(0)) {
227:         $albumpath = $tempimage->getLink();
228:     } else {
229:         $albumpath = $tempalbum->getLink();
230:     }
231:     echo "<li><a href=\"" . $albumpath . "\" title=\"" . html_encode($tempalbum->getTitle()) . "\">\n";
232:     $albumthumb = $tempalbum->getAlbumThumbImage();
233:     switch ($crop) {
234:         case 0:
235:             $sizes = getSizeCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, $albumthumb);
236:             echo '<img src="' . html_encode(pathurlencode($albumthumb->getCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, TRUE))) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($albumthumb->getTitle()) . '" /></a>' . "\n";
237:             break;
238:         case 1;
239:     if(isImagePhoto($albumthumb)) {
240:       $sizes = getSizeCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, $albumthumb);
241:     } else {
242:       $sizes[0] = $width;
243:       $sizes[1] = $height;
244:     }
245:             echo '<img src="' . html_encode(pathurlencode($albumthumb->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, TRUE))) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($albumthumb->getTitle()) . '" /></a>' . "\n";
246:             break;
247:         case 2:
248:             $sizes = getSizeDefaultThumb($albumthumb);
249:             echo '<img src="' . html_encode(pathurlencode($albumthumb->getThumb())) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($albumthumb->getTitle()) . '" /></a>' . "\n";
250:             break;
251:     }
252:     if ($showtitle) {
253:         echo "<h3><a href=\"" . $albumpath . "\" title=\"" . html_encode($tempalbum->getTitle()) . "\">\n";
254:         echo $tempalbum->getTitle() . "</a></h3>\n";
255:     }
256:     if ($showdate) {
257:         if ($option === "latestupdated") {
258:             $filechangedate = strtotime($tempalbum->getUpdatedDate());
259:             echo "<p>" . sprintf(gettext("Last update: %s"), zpFormattedDate(DATE_FORMAT, $filechangedate)) . "</p>";
260:             $latestimage = query_single_row("SELECT mtime FROM " . prefix('images') . " WHERE albumid = " . $tempalbum->getID() . " AND `show` = 1 ORDER BY id DESC");
261:             if ($latestimage) {
262:                 $count = db_count('images', "WHERE albumid = " . $tempalbum->getID() . " AND mtime = " . $latestimage['mtime']);
263:                 if ($count <= 1) {
264:                     $image = gettext("image");
265:                 } else {
266:                     $image = gettext("images");
267:                 }
268:                 echo "<span>" . sprintf(gettext('%1$u new %2$s'), $count, $image) . "</span>";
269:             }
270:         } else {
271:             echo "<p>" . zpFormattedDate(DATE_FORMAT, strtotime($tempalbum->getDateTime())) . "</p>";
272:         }
273:     }
274:     if ($showstatistic === "rating" OR $showstatistic === "rating+hitcounter") {
275:         $votes = $tempalbum->get("total_votes");
276:         $value = $tempalbum->get("total_value");
277:         if ($votes != 0) {
278:             $rating = round($value / $votes, 1);
279:         }
280:         echo "<p>" . sprintf(gettext('Rating: %1$u (Votes: %2$u)'), $rating, $tempalbum->get("total_votes")) . "</p>";
281:     }
282:     if ($showstatistic === "hitcounter" OR $showstatistic === "rating+hitcounter") {
283:         $hitcounter = $tempalbum->getHitcounter();
284:         if (empty($hitcounter)) {
285:             $hitcounter = "0";
286:         }
287:         echo "<p>" . sprintf(gettext("Views: %u"), $hitcounter) . "</p>";
288:     }
289:     if ($showdesc) {
290:         echo shortenContent($tempalbum->getDesc(), $desclength, ' (...)');
291:     }
292:     echo "</li>";
293: }
294: 
295: /**
296:  * Prints the most popular albums
297:  *
298:  * @param string $number the number of albums to get
299:  * @param bool $showtitle if the album title should be shown
300:  * @param bool $showdate if the album date should be shown
301:  * @param bool $showdesc if the album description should be shown
302:  * @param integer $desclength the length of the description to be shown
303:  * @param string $showstatistic
304:  *      "hitcounter" for showing the hitcounter (views),
305:  *      "rating" for rating,
306:  *      "rating+hitcounter" for both.
307:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
308:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
309:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
310:  * @param bool $firstimglink 'false' (default) if the album thumb link should lead to the album page, 'true' if to the first image of theh album if the album itself has images
311:  * @param integer $threshold the minimum number of ratings (for rating options) or hits (for popular option) an album must have to be included in the list. (Default 0)
312:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics to include all subalbum levels
313:  */
314: 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) {
315:     printAlbumStatistic($number, "popular", $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $albumfolder, $firstimglink, $threshold, $collection);
316: }
317: 
318: /**
319:  * Prints the latest albums
320:  *
321:  * @param string $number the number of albums to get
322:  * @param bool $showtitle if the album title should be shown
323:  * @param bool $showdate if the album date should be shown
324:  * @param bool $showdesc if the album description should be shown
325:  * @param integer $desclength the length of the description to be shown
326:  * @param string $showstatistic
327:  *      "hitcounter" for showing the hitcounter (views),
328:  *      "rating" for rating,
329:  *      "rating+hitcounter" for both.
330:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
331:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
332:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
333:  * @param bool $firstimglink 'false' (default) if the album thumb link should lead to the album page, 'true' if to the first image of theh album if the album itself has images
334:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics to include all subalbum levels
335:  */
336: function printLatestAlbums($number = 5, $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $albumfolder = '', $firstimglink = false, $collection = false) {
337:     printAlbumStatistic($number, "latest", $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $albumfolder, $firstimglink, $collection);
338: }
339: 
340: /**
341:  * Prints the most rated albums
342:  *
343:  * @param string $number the number of albums to get
344:  * @param bool $showtitle if the album title should be shown
345:  * @param bool $showdate if the album date should be shown
346:  * @param bool $showdesc if the album description should be shown
347:  * @param integer $desclength the length of the description to be shown
348:  * @param string $showstatistic
349:  *      "hitcounter" for showing the hitcounter (views),
350:  *      "rating" for rating,
351:  *      "rating+hitcounter" for both.
352:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
353:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
354:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
355:  * @param bool $firstimglink 'false' (default) if the album thumb link should lead to the album page, 'true' if to the first image of theh album if the album itself has images
356:  * @param integer $threshold the minimum number of ratings (for rating options) or hits (for popular option) an album must have to be included in the list. (Default 0)
357:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics to include all subalbum levels
358:  */
359: 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) {
360:     printAlbumStatistic($number, "mostrated", $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $albumfolder, $firstimglink, $threshold, $collection);
361: }
362: 
363: /**
364:  * Prints the top voted albums
365:  *
366:  * @param string $number the number of albums to get
367:  * @param bool $showtitle if the album title should be shown
368:  * @param bool $showdate if the album date should be shown
369:  * @param bool $showdesc if the album description should be shown
370:  * @param integer $desclength the length of the description to be shown
371:  * @param string $showstatistic
372:  *      "hitcounter" for showing the hitcounter (views),
373:  *      "rating" for rating,
374:  *      "rating+hitcounter" for both.
375:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
376:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
377:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
378:  * @param bool $firstimglink 'false' (default) if the album thumb link should lead to the album page, 'true' if to the first image of theh album if the album itself has images
379:  * @param integer $threshold the minimum number of ratings (for rating options) or hits (for popular option) an album must have to be included in the list. (Default 0)
380:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics to include all subalbum levels
381:  */
382: 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) {
383:     printAlbumStatistic($number, "toprated", $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $albumfolder, $firstimglink, $threshold, $collection);
384: }
385: 
386: /**
387:  * Prints the latest updated albums
388:  *
389:  * @param string $number the number of albums to get
390:  * @param bool $showtitle if the album title should be shown
391:  * @param bool $showdate if the album date should be shown
392:  * @param bool $showdesc if the album description should be shown
393:  * @param integer $desclength the length of the description to be shown
394:  * @param string $showstatistic
395:  *      "hitcounter" for showing the hitcounter (views),
396:  *      "rating" for rating,
397:  *      "rating+hitcounter" for both.
398:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
399:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
400:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
401:  * @param bool $firstimglink 'false' (default) if the album thumb link should lead to the album page, 'true' if to the first image of theh album if the album itself has images
402:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics to include all subalbum levels
403:  */
404: function printLatestUpdatedAlbums($number = 5, $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $albumfolder = '', $firstimglink = false, $collection = false) {
405:     printAlbumStatistic($number, "latestupdated", $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $albumfolder, $firstimglink, $collection);
406: }
407: 
408: /**
409:  * Returns a array of image objects of image statistic according to $option
410:  *
411:  * @param string $number the number of images to get
412:  * @param string $option "popular" for the most popular images,
413:  *      "popular" for the most popular albums,
414:  *      "latest" for the latest uploaded by id (Discovery)
415:  *      "latest-date" for the latest by date
416:  *      "latest-mtime" for the latest by mtime
417:  *      "latest-publishdate" for the latest by publishdate
418:  *    "mostrated" for the most voted,
419:  *      "toprated" for the best voted
420:  *      "latestupdated" for the latest updated
421:  *      "random" for random order (yes, strictly no statistical order...)
422:  * @param string $albumfolder foldername of an specific album
423:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
424:  * @param integer $threshold the minimum number of ratings (for rating options) or hits (for popular option) an image must have to be included in the list. (Default 0)
425:  * @return string
426:  */
427: function getImageStatistic($number, $option, $albumfolder = '', $collection = false, $threshold = 0, $sortdirection = 'desc') {
428:   global $_zp_gallery;
429:   if ($albumfolder) {
430:     $obj = newAlbum($albumfolder);
431:     $albumWhere = ' AND albums.id = ' . $obj->getID();
432:     if ($collection) {
433:       $albumWhere = '';
434:       $ids = getAllSubAlbumIDs($albumfolder);
435:       if (!empty($ids)) {
436:         foreach ($ids as $id) {
437:           $getids[] = $id['id'];
438:         }
439:         $getids = implode(', ', $getids);
440:         $albumWhere = ' AND albums.id IN (' . $getids . ')';
441:       }
442:     } else {
443:       $albumWhere = ' AND albums.id = ' . $obj->getID();
444:     }
445:   } else {
446:     $obj = $_zp_gallery;
447:     $albumWhere = '';
448:   }
449:   if (($option == 'toprated' || $option == 'mostrated') && $threshold > 0) {
450:     $albumWhere .= 'AND images.total_votes >= ' . $threshold;
451:   }
452:   if ($option == 'popular' && $threshold > 0) {
453:     $albumWhere .= 'AND images.hitcounter >= ' . $threshold;
454:   }
455:   switch (strtolower($sortdirection)) {
456:     case 'desc':
457:     default:
458:       $sortdir = 'DESC';
459:       break;
460:     case 'asc':
461:       $sortdir = 'ASC';
462:       break;
463:   }
464:   switch ($option) {
465:     case "popular":
466:       $sortorder = "images.hitcounter";
467:       break;
468:     case "latest-date":
469:       $sortorder = "images.date";
470:       break;
471:     case "latest-mtime":
472:       $sortorder = "images.mtime";
473:       break;
474:     default:
475:     case "latest":
476:       $sortorder = "images.id";
477:       break;
478:     case "latest-publishdate":
479:       $sortorder = "IFNULL(images.publishdate,images.date)";
480:       break;
481:     case "mostrated":
482:       $sortorder = "images.total_votes";
483:       break;
484:     case "toprated":
485:       $sortorder = "(images.total_value/images.total_votes) DESC, images.total_value";
486:       break;
487:     case "random":
488:       $sortorder = "RAND()";
489:       break;
490:   }
491:   $imageArray = array();
492:   if (!empty($albumfolder) && $obj->isDynamic()) {
493:     $sorttype = str_replace('images.', '', $sortorder);
494:     $images = $obj->getImages(0, 0, $sorttype, $sortdir);
495:     foreach ($images as $image) {
496:       $image = newImage($obj, $image);
497:       if ($image->exists && $image->checkAccess() && ($image->getShow() || zp_loggedin(VIEW_UNPUBLISHED_RIGHTS))) {
498:         $imageArray[] = $image;
499:         if (count($imageArray) >= $number) { // got enough
500:           break;
501:         }
502:       }
503:     }
504:   } else {
505:     $result = query("SELECT images.filename AS filename, albums.folder AS folder FROM " . prefix('images') . " AS images, " . prefix('albums') . " AS albums " . "WHERE (images.albumid = albums.id) " . $albumWhere . " ORDER BY " . $sortorder . " " . $sortdir);
506:     while ($row = db_fetch_assoc($result)) {
507:       $image = newImage(NULL, $row, true);
508:       if ($image->exists && $image->checkAccess() && ($image->getShow() || zp_loggedin(VIEW_UNPUBLISHED_RIGHTS))) {
509:         $imageArray[] = $image;
510:         if (count($imageArray) >= $number) { // got enough
511:           break;
512:         }
513:       }
514:     }
515:     db_free_result($result);
516:   }
517:   return $imageArray;
518: }
519: 
520: /**
521:  * Prints image statistic according to $option as an unordered HTML list
522:  * A css id is attached by default named accordingly'$option'
523:  *
524:  * @param string $number the number of albums to get
525:  * @param string $option "popular" for the most popular images,
526:  *      "popular" for the most popular albums,
527:  *      "latest" for the latest uploaded by id (Discovery)
528:  *      "latest-date" for the latest by date
529:  *      "latest-mtime" for the latest by mtime
530:  *      "latest-publishdate" for the latest by publishdate
531:  *    "mostrated" for the most voted,
532:  *      "toprated" for the best voted
533:  *      "latestupdated" for the latest updated
534:  *      "random" for random order (yes, strictly no statistical order...)
535:  * @param string $albumfolder foldername of an specific album
536:  * @param bool $showtitle if the image title should be shown
537:  * @param bool $showdate if the image date should be shown
538:  * @param bool $showdesc if the image description should be shown
539:  * @param integer $desclength the length of the description to be shown
540:  * @param string $showstatistic "hitcounter" for showing the hitcounter (views),
541:  *      "rating" for rating,
542:  *      "rating+hitcounter" for both.
543:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
544:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
545:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
546:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
547:  * @param bool $fullimagelink 'false' (default) for the image page link , 'true' for the unprotected full image link (to use Colorbox for example)
548:  * @param integer $threshold the minimum number of ratings (for rating options) or hits (for popular option) an image must have to be included in the list. (Default 0)
549:  * @return string
550:  */
551: function printImageStatistic($number, $option, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false, $threshold = 0) {
552:     $images = getImageStatistic($number, $option, $albumfolder, $collection, $threshold);
553:     if (is_null($crop) && is_null($width) && is_null($height)) {
554:         $crop = 2;
555:     } else {
556:         if (is_null($width))
557:             $width = 85;
558:         if (is_null($height))
559:             $height = 85;
560:         if (is_null($crop)) {
561:             $crop = 1;
562:         } else {
563:             $crop = (int) $crop && true;
564:         }
565:     }
566:     echo "\n<div id=\"$option\">\n";
567:     echo "<ul>";
568:     foreach ($images as $image) {
569:         if ($fullimagelink) {
570:             $imagelink = $image->getFullImageURL();
571:         } else {
572:             $imagelink = $image->getLink();
573:         }
574:         echo '<li><a href="' . html_encode($imagelink) . '" title="' . html_encode($image->getTitle()) . "\">\n";
575:         switch ($crop) {
576:             case 0:
577:                 $sizes = getSizeCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, $image);
578:                 echo '<img src="' . html_encode(pathurlencode($image->getCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, TRUE))) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($image->getTitle()) . "\" /></a>\n";
579:                 break;
580:             case 1:
581:                 $sizes = getSizeCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, $image);
582:                 echo '<img src="' . html_encode(pathurlencode($image->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, TRUE))) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($image->getTitle()) . "\" width=\"" . $width . "\" height=\"" . $height . "\" /></a>\n";
583:                 break;
584:             case 2:
585:                 $sizes = getSizeDefaultThumb($image);
586:                 echo '<img src="' . html_encode(pathurlencode($image->getThumb())) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($image->getTitle()) . "\" /></a>\n<br />";
587:                 break;
588:         }
589:         if ($showtitle) {
590:             echo '<h3><a href="' . html_encode($image->getLink()) . '" title="' . html_encode($image->getTitle()) . "\">\n";
591:             echo $image->getTitle() . "</a></h3>\n";
592:         }
593:         if ($showdate) {
594:             echo "<p>" . zpFormattedDate(DATE_FORMAT, strtotime($image->getDateTime())) . "</p>";
595:         }
596:         if ($showstatistic === "rating" OR $showstatistic === "rating+hitcounter") {
597:             $votes = $image->get("total_votes");
598:             $value = $image->get("total_value");
599:             if ($votes != 0) {
600:                 $rating = round($value / $votes, 1);
601:             }
602:             echo "<p>" . sprintf(gettext('Rating: %1$u (Votes: %2$u)'), $rating, $votes) . "</p>";
603:         }
604:         if ($showstatistic === "hitcounter" OR $showstatistic === "rating+hitcounter") {
605:             $hitcounter = $image->getHitcounter();
606:             if (empty($hitcounter)) {
607:                 $hitcounter = "0";
608:             }
609:             echo "<p>" . sprintf(gettext("Views: %u"), $hitcounter) . "</p>";
610:         }
611:         if ($showdesc) {
612:             echo shortenContent($image->getDesc(), $desclength, ' (...)');
613:         }
614:         echo "</li>";
615:     }
616:     echo "</ul></div>\n";
617: }
618: 
619: /**
620:  * Prints the most popular images
621:  *
622:  * @param string $number the number of images to get
623:  * @param string $albumfolder folder of an specific album
624:  * @param bool $showtitle if the image title should be shown
625:  * @param bool $showdate if the image date should be shown
626:  * @param bool $showdesc if the image description should be shown
627:  * @param integer $desclength the length of the description to be shown
628:  * @param string $showstatistic
629:  *      "hitcounter" for showing the hitcounter (views),
630:  *      "rating" for rating,
631:  *      "rating+hitcounter" for both.
632:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
633:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
634:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
635:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
636:  * @param bool $fullimagelink 'false' (default) for the image page link , 'true' for the unprotected full image link (to use Colorbox for example)
637:  * @param integer $threshold the minimum number of ratings (for rating options) or hits (for popular option) an image must have to be included in the list. (Default 0)
638:  */
639: 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) {
640:     printImageStatistic($number, "popular", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink, $threshold);
641: }
642: 
643: /**
644:  * Prints the n top rated images
645:  *
646:  * @param int $number The number if images desired
647:  * @param string $albumfolder folder of an specific album
648:  * @param bool $showtitle if the image title should be shown
649:  * @param bool $showdate if the image date should be shown
650:  * @param bool $showdesc if the image description should be shown
651:  * @param integer $desclength the length of the description to be shown
652:  * @param string $showstatistic
653:  *      "hitcounter" for showing the hitcounter (views),
654:  *      "rating" for rating,
655:  *      "rating+hitcounter" for both.
656:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
657:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
658:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
659:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
660:  * @param bool $fullimagelink 'false' (default) for the image page link , 'true' for the unprotected full image link (to use Colorbox for example)
661:  * @param integer $threshold the minimum number of ratings (for rating options) or hits (for popular option) an image must have to be included in the list. (Default 0)
662:  */
663: 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) {
664:     printImageStatistic($number, "toprated", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink, $threshold);
665: }
666: 
667: /**
668:  * Prints the n most rated images
669:  *
670:  * @param int $number The number if images desired
671:  * @param string $albumfolder folder of an specific album
672:  * @param bool $showtitle if the image title should be shown
673:  * @param bool $showdate if the image date should be shown
674:  * @param bool $showdesc if the image description should be shown
675:  * @param integer $desclength the length of the description to be shown
676:  * @param string $showstatistic
677:  *      "hitcounter" for showing the hitcounter (views),
678:  *      "rating" for rating,
679:  *      "rating+hitcounter" for both.
680:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
681:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
682:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
683:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
684:  * @param bool $fullimagelink 'false' (default) for the image page link , 'true' for the unprotected full image link (to use Colorbox for example)
685:  * @param integer $threshold the minimum number of ratings (for rating options) or hits (for popular option) an image must have to be included in the list. (Default 0)
686:  */
687: 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) {
688:     printImageStatistic($number, "mostrated", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink, $threshold);
689: }
690: 
691: /**
692:  * Prints the latest images by ID (the order zenphoto recognized the images on the filesystem)
693:  *
694:  * @param string $number the number of images to get
695:  * @param string $albumfolder folder of an specific album
696:  * @param bool $showtitle if the image title should be shown
697:  * @param bool $showdate if the image date should be shown
698:  * @param bool $showdesc if the image description should be shown
699:  * @param integer $desclength the length of the description to be shown
700:  * @param string $showstatistic
701:  *      "hitcounter" for showing the hitcounter (views),
702:  *      "rating" for rating,
703:  *      "rating+hitcounter" for both.
704:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
705:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
706:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
707:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
708:  * @param bool $fullimagelink 'false' (default) for the image page link , 'true' for the unprotected full image link (to use Colorbox for example)
709:  */
710: function printLatestImages($number = 5, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false) {
711:     printImageStatistic($number, "latest", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink);
712: }
713: 
714: /**
715:  * Prints the latest images by date order (date taken order)
716:  *
717:  * @param string $number the number of images to get
718:  * @param string $albumfolder folder of an specific album
719:  * @param bool $showtitle if the image title should be shown
720:  * @param bool $showdate if the image date should be shown
721:  * @param bool $showdesc if the image description should be shown
722:  * @param integer $desclength the length of the description to be shown
723:  * @param string $showstatistic
724:  *      "hitcounter" for showing the hitcounter (views),
725:  *      "rating" for rating,
726:  *      "rating+hitcounter" for both.
727:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
728:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
729:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
730:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
731:  * @param bool $fullimagelink 'false' (default) for the image page link , 'true' for the unprotected full image link (to use Colorbox for example)
732:  */
733: function printLatestImagesByDate($number = 5, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false) {
734:     printImageStatistic($number, "latest-date", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink);
735: }
736: 
737: /**
738:  * Prints the latest images by mtime order (date uploaded order)
739:  *
740:  * @param string $number the number of images to get
741:  * @param string $albumfolder folder of an specific album
742:  * @param bool $showtitle if the image title should be shown
743:  * @param bool $showdate if the image date should be shown
744:  * @param bool $showdesc if the image description should be shown
745:  * @param integer $desclength the length of the description to be shown
746:  * @param string $showstatistic
747:  *      "hitcounter" for showing the hitcounter (views),
748:  *      "rating" for rating,
749:  *  "rating+hitcounter" for both.
750:  * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
751:  * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
752:  * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
753:  * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
754:  * @param bool $fullimagelink 'false' (default) for the image page link , 'true' for the unprotected full image link (to use Colorbox for example)
755:  */
756: function printLatestImagesByMtime($number = 5, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false) {
757:     printImageStatistic($number, "latest-mtime", $albumfolder, $showtitle, $showdate, $showdesc, $desclength, $showstatistic, $width, $height, $crop, $collection, $fullimagelink);
758: }
759: 
760: /**
761:  * A little helper function that checks if an image or album is to be considered 'new' within the time range set in relation to getImageDate()/getAlbumDate()
762:  * Returns true or false.
763:  *
764:  * @param string $mode What to check "image" or "album".
765:  * @param integer $timerange The time range the item should be considered new. Default is 604800 (unix time seconds = ca. 7 days)
766:  * @return bool
767:  */
768: function checkIfNew($mode = "image", $timerange = 604800) {
769:     $currentdate = date("U");
770:     switch ($mode) {
771:         case "image":
772:             $itemdate = getImageDate("%s");
773:             break;
774:         case "album":
775:             $itemdate = getAlbumDate("%s");
776:             break;
777:     }
778:     $newcheck = $currentdate - $itemdate;
779:     if ($newcheck < $timerange) {
780:         return TRUE;
781:     } else {
782:         return FALSE;
783:     }
784: }
785: 
786: /**
787:  * Gets the number of all subalbums of all subalbum levels of either the current album or $albumobj
788:  *
789:  * @param object $albumobj Optional album object to check
790:  * @param string $pre Optional text you want to print before the number
791:  * @return bool
792:  */
793: function getNumAllSubalbums($albumobj, $pre = '') {
794:     global $_zp_gallery, $_zp_current_album;
795:     if (is_null($albumobj)) {
796:         $albumobj = $_zp_current_album;
797:     }
798:     $count = '';
799:     $albums = getAllAlbums($_zp_current_album);
800:     if (count($albums) != 0) {
801:         $count = '';
802:         foreach ($albums as $album) {
803:             $count++;
804:         }
805:         return $pre . $count;
806:     } else {
807:         return false;
808:     }
809: }
810: ?>
Zenphoto doc API documentation generated by ApiGen