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:  * A plugin to generate a file download list.
  5:  * This download folder can be relative to your Zenphoto root (<i>foldername</i>) or external to it (<i>../foldername</i>).
  6:  * By default the <var>%UPLOAD_FOLDER%</var> folder is chosen so you can use the file manager to manage these files.
  7:  *
  8:  * You can also override that folder by using the <var>printdownloadList()</var> function parameters directly. Additionally
  9:  * you can set a downloadlink to a specific file directly by using <code>printDownloadURL(<i>path-to-file</i>);<code>.
 10:  *
 11:  * The file names and the download path of the items are stored with the number of downloads in the database's plugin_storage table.
 12:  *
 13:  * The download link is something like:
 14:  * <var>www.yourdomain.com/download.php?file=<i>id number of the download</i></var>.
 15:  *
 16:  * So the actual download source is not public. The list itself is generated directly from the file system. However,
 17:  * files which no longer exist are
 18:  * kept in the database for statistical reasons until you clear them manually via the statistics utility.
 19:  *
 20:  * You will need to modify your theme to use this plugin. You can use the codeblock fields if your theme supports them or
 21:  * insert the function calls directly where you want the list to appear.
 22:  *
 23:  * To protect the download directory from direct linking you need to set up a proper <var>.htaccess</var> for this folder.
 24:  *
 25:  * The <var>printDownloadAlbumZipURL()</var> function will create a zipfile of the album <i>on the fly</i>.
 26:  * The source of the images may be the original
 27:  * images from the album and its subalbums or they may be the <i>sized</i> images from the cache. Use the latter if you want
 28:  * the images to be watermarked.
 29:  *
 30:  * The list has a CSS class <var>downloadList</var> attached.
 31:  *
 32:  * @author Malte Müller (acrylian)
 33:  * @package plugins
 34:  * @subpackage misc
 35:  * @tags "file download", "download manager", download
 36:  */
 37: $plugin_is_filter = 800 | ADMIN_PLUGIN | THEME_PLUGIN;
 38: $plugin_description = gettext("Plugin to generate file download lists.");
 39: $plugin_author = "Malte Müller (acrylian), Stephen Billard (sbillard)";
 40: 
 41: $option_interface = "downloadList";
 42: 
 43: zp_register_filter('admin_utilities_buttons', 'DownloadList::button');
 44: 
 45: /**
 46:  * Plugin option handling class
 47:  *
 48:  */
 49: class DownloadList {
 50: 
 51:     function __construct() {
 52:         setOptionDefault('downloadList_directory', UPLOAD_FOLDER);
 53:         setOptionDefault('downloadList_showfilesize', 1);
 54:         setOptionDefault('downloadList_showdownloadcounter', 1);
 55:         setOptionDefault('downloadList_user', NULL);
 56:         setOptionDefault('downloadList_password', getOption('downloadList_pass'));
 57:         setOptionDefault('downloadList_hint', NULL);
 58:         setOptionDefault('downloadList_rights', NULL);
 59:         setOptionDefault('downloadList_zipFromCache', 0);
 60:     }
 61: 
 62:     function getOptionsSupported() {
 63:         $options = array(gettext('Download directory')                                           => array('key'      => 'downloadList_directory', 'type'     => OPTION_TYPE_TEXTBOX,
 64:                                         'order'  => 2,
 65:                                         'desc'   => gettext("This download folder can be relative to your Zenphoto installation (<em>foldername</em>) or external to it (<em>../foldername</em>)! You can override this setting by using the parameter of the printdownloadList() directly on calling.")),
 66:                         gettext('Show filesize of download items')               => array('key'      => 'downloadList_showfilesize', 'type'  => OPTION_TYPE_CHECKBOX,
 67:                                         'order'  => 3,
 68:                                         'desc'   => ''),
 69:                         gettext('Show download counter of download items') => array('key'        => 'downloadList_showdownloadcounter', 'type'   => OPTION_TYPE_CHECKBOX,
 70:                                         'order'  => 4,
 71:                                         'desc'   => ''),
 72:                         gettext('Files to exclude from the download list') => array('key'        => 'downloadList_excludesuffixes', 'type'   => OPTION_TYPE_TEXTBOX,
 73:                                         'order'  => 5,
 74:                                         'desc'   => gettext('A list of file suffixes to exclude. Separate with comma and omit the dot (e.g "jpg").')),
 75:                         gettext('Zip source')                                                            => array('key'          => 'downloadList_zipFromCache', 'type'      => OPTION_TYPE_RADIO,
 76:                                         'order'      => 6,
 77:                                         'buttons'    => array(gettext('From album') => 0, gettext('From Cache') => 1),
 78:                                         'desc'       => gettext('Make the album zip from the album folder or from the sized images in the cache.')),
 79:                         gettext('User rights')                                                       => array('key'      => 'downloadList_rights', 'type'    => OPTION_TYPE_CHECKBOX,
 80:                                         'order'  => 1,
 81:                                         'desc'   => gettext('Check if users are required to have <em>file</em> rights to download.'))
 82:         );
 83:         if (GALLERY_SECURITY == 'public') {
 84:             $options[gettext('credentials')] = array('key'       => 'downloadList_credentials', 'type'   => OPTION_TYPE_CUSTOM,
 85:                             'order'  => 0,
 86:                             'desc'   => gettext('Provide credentials to password protect downloads'));
 87:         }
 88:         return $options;
 89:     }
 90: 
 91:     function handleOption($option, $currentValue) {
 92:         $user = getOption('downloadList_user');
 93:         $x = getOption('downloadList_password');
 94:         $hint = getOption('downloadList_hint');
 95:         ?>
 96:         <input type="hidden" name="password_enabled_downloadList" id="password_enabled_downloadList" value="0" />
 97:         <p class="password_downloadListextrashow">
 98:             <a href="javascript:toggle_passwords('_downloadList',true);">
 99:                 <?php echo gettext("Password:"); ?>
100:             </a>
101:             <?php
102:             if (empty($x)) {
103:                 ?>
104:                 <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/lock_open.png" alt="" class="icon-postiion-top8" />
105:                 <?php
106:             } else {
107:                 $x = '          ';
108:                 ?>
109:                 <a onclick="resetPass('_downloadList');" title="<?php echo gettext('clear password'); ?>"><img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/lock.png"  alt="" class="icon-postiion-top8" /></a>
110:                 <?php
111:             }
112:             ?>
113:         </p>
114:         <div class="password_downloadListextrahide" style="display:none">
115:             <a href="javascript:toggle_passwords('_downloadList',false);">
116:                 <?php echo gettext("Guest user:"); ?>
117:             </a>
118:             <br />
119:             <input type="text" size="27" id="user_name_downloadList" name="user_downloadList"
120:                          onkeydown="passwordClear('_downloadList');"
121:                          value="<?php echo html_encode($user); ?>" />
122:             <br />
123:             <span id="strength_downloadList"><?php echo gettext("Password:"); ?></span>
124:             <br />
125:             <input type="password" size="27"
126:                          id="pass_downloadList" name="pass_downloadList"
127:                          onkeydown="passwordClear('_downloadList');"
128:                          onkeyup="passwordStrength('_downloadList');"
129:                          value="<?php echo $x; ?>" />
130:             <label><input type="checkbox" name="disclose_password_downloadList" id="disclose_password_downloadList" onclick="passwordClear('_downloadList');
131:                             togglePassword('_downloadList');"><?php echo gettext('Show password'); ?></label>
132:             <br />
133:             <span class="password_field__downloadList">
134:                 <span id="match_downloadList"><?php echo gettext("(repeat)"); ?></span>
135:                 <br />
136:                 <input type="password" size="27"
137:                              id="pass_r_downloadList" name="pass_r_downloadList" disabled="disabled"
138:                              onkeydown="passwordClear('_downloadList');"
139:                              onkeyup="passwordMatch('_downloadList');"
140:                              value="<?php echo $x; ?>" />
141:                 <br />
142:             </span>
143:             <?php echo gettext("Password hint:"); ?>
144:             <br />
145:             <?php print_language_string_list($hint, 'hint_downloadList', false, NULL, 'hint_downloadList', 27); ?>
146:         </div>
147:         <?php
148:     }
149: 
150:     static function handleOptionSave($themename, $themealbum) {
151:         $notify = processCredentials('downloadList', '_downloadList');
152:         if ($notify == '?mismatch=user') {
153:             return '&custom=' . gettext('You must supply a password for the DownloadList user');
154:         } else if ($notify) {
155:             return '&custom=' . gettext('Your DownloadList passwords were empty or did not match');
156:         }
157:         return false;
158:     }
159: 
160:     /**
161:      * Updates the download count entry when processing a download. For internal use.
162:      * @param string $path Path of the download item
163:      * @param bool $nocountupdate false if the downloadcount should not be increased and only the entry be added to the db if it does not already exist
164:      */
165:     static function updateListItemCount($path) {
166:         $checkitem = query_single_row("SELECT `data` FROM " . prefix('plugin_storage') . " WHERE `aux` = " . db_quote($path) . " AND `type` = 'downloadList'");
167:         if ($checkitem) {
168:             $downloadcount = $checkitem['data'] + 1;
169:             query("UPDATE " . prefix('plugin_storage') . " SET `data` = " . $downloadcount . ", `type` = 'downloadList' WHERE `aux` = " . db_quote($path) . " AND `type` = 'downloadList'");
170:         }
171:     }
172: 
173:     /**
174:      * Adds a new download item to the database. For internal use.
175:      * @param string $path Path of the download item
176:      */
177:     static function addListItem($path) {
178:         $checkitem = query_single_row("SELECT `data` FROM " . prefix('plugin_storage') . " WHERE `aux` = " . db_quote($path) . " AND `type` = 'downloadList'");
179:         if (!$checkitem) {
180:             query("INSERT INTO " . prefix('plugin_storage') . " (`type`,`aux`,`data`) VALUES ('downloadList'," . db_quote($path) . ",'0')");
181:         }
182:   zp_apply_filter('downloadlist_processdownload',$path);
183:     }
184: 
185:     /*   * Gets the download items from all download items from the database. For internal use in the downloadList functions.
186:      * @return array
187:      */
188: 
189:     static function getListItemsFromDB() {
190:         $downloaditems = query_full_array("SELECT id, `aux`, `data` FROM " . prefix('plugin_storage') . " WHERE `type` = 'downloadList'");
191:         return $downloaditems;
192:     }
193: 
194:     /*   * Gets the download items from all download items from the database. For internal use in the downloadlink functions.
195:      * @return array
196:      */
197: 
198:     static function getListItemFromDB($file) {
199:         $downloaditem = query_single_row($sql = "SELECT id, `aux`, `data` FROM " . prefix('plugin_storage') . " WHERE `type` = 'downloadList' AND `aux` = " . db_quote($file));
200:         return $downloaditem;
201:     }
202: 
203:     /**
204:      * Gets the id of a download item from the database for the download link. For internal use.
205:      * @param string $path Path of the download item (without WEBPATH)
206:      * @return bool|string
207:      */
208:     static function getItemID($path) {
209:         $downloaditem = query_single_row("SELECT id, `aux`, `data` FROM " . prefix('plugin_storage') . " WHERE `type` = 'downloadList' AND `aux` = " . db_quote($path));
210:         if ($downloaditem) {
211:             return $downloaditem['id'];
212:         } else {
213:             return false;
214:         }
215:     }
216: 
217:     /**
218:      * @param array $array List of download items
219:      * @param string $listtype "ol" or "ul" for the type of HTML list you want to use
220:      * @return array
221:      */
222:     static function printListArray($array, $listtype = 'ol') {
223:         if ($listtype != 'ol' || $listtype != 'ul') {
224:             $listtype = 'ol';
225:         }
226:         $filesize = '';
227:         foreach ($array as $key => $file) {
228:             ?>
229:             <li>
230:                 <?php
231:                 if (is_array($file)) { // for sub directories
232:                     echo $key;
233:                     echo '<' . $listtype . '>';
234:                     self::printListArray($file, $listtype);
235:                     echo '</' . $listtype . '>';
236:                 } else {
237:                     printDownloadURL($file);
238:                 }
239:                 ?>
240:             </li>
241:             <?php
242:         }
243:     }
244: 
245:     /**
246:      * Admin overview button for download statistics utility
247:      */
248:     static function button($buttons) {
249:         $buttons[] = array(
250:                         'category'       => gettext('Info'),
251:                         'enable'             => true,
252:                         'button_text'    => gettext('Download statistics'),
253:                         'formname'       => 'downloadstatistics_button',
254:                         'action'             => WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/downloadList/download_statistics.php',
255:                         'icon'               => WEBPATH . '/' . ZENFOLDER . '/images/bar_graph.png',
256:                         'title'              => gettext('Counts of downloads'),
257:                         'alt'                    => '',
258:                         'hidden'             => '',
259:                         'rights'             => ADMIN_RIGHTS,
260:         );
261:         return $buttons;
262:     }
263: 
264:     static function noFile() {
265:         global $_downloadFile;
266:         if (TEST_RELEASE) {
267:             $file = $_downloadFile;
268:         } else {
269:             $file = basename($_downloadFile);
270:         }
271:         ?>
272:         <script type="text/javascript">
273:             // <!-- <![CDATA[
274:             window.onload = function() {
275:                 alert('<?php printf(gettext('File “%was not found.'), $file); ?>');
276:             }
277:             // ]]> -->
278:         </script>
279:         <?php
280:     }
281: 
282: }
283: 
284: class AlbumZip {
285: 
286:     /**
287:      * generates an array of filenames to zip
288:      * recurses into the albums subalbums
289:      *
290:      * @param object $album album object to add
291:      * @param int $base the length of the base album name
292:      */
293:     static function AddAlbum($album, $base, $filebase) {
294:         global $_zp_zip_list, $zip_gallery;
295:         $albumbase = substr($album->name, $base) . '/';
296:         foreach ($album->sidecars as $suffix) {
297:             $f = $albumbase . $album->name . '.' . $suffix;
298:             if (file_exists(internalToFilesystem($f))) {
299:                 $_zp_zip_list[$filebase . $f] = $f;
300:             }
301:         }
302:         $images = $album->getImages();
303:         foreach ($images as $imagename) {
304:             $image = newImage($album, $imagename);
305:             $f = $albumbase . $image->filename;
306:             $_zp_zip_list[$filebase . internalToFilesystem($f)] = $f;
307:             $imagebase = stripSuffix($image->filename);
308:             foreach ($image->sidecars as $suffix) {
309:                 $f = $albumbase . $imagebase . '.' . $suffix;
310:                 if (file_exists($f)) {
311:                     $_zp_zip_list[$filebase . $f] = $f;
312:                 }
313:             }
314:         }
315:         $albums = $album->getAlbums();
316:         foreach ($albums as $albumname) {
317:             $subalbum = newAlbum($albumname);
318:             if ($subalbum->exists && !$album->isDynamic()) {
319:                 self::AddAlbum($subalbum, $base, $filebase);
320:             }
321:         }
322:     }
323: 
324:     /**
325:      * generates an array of cachefilenames to zip
326:      * recurses into the albums subalbums
327:      *
328:      * @param object $album album object to add
329:      * @param int $base the length of the base album name
330:      */
331:     static function AddAlbumCache($album, $base, $filebase) {
332:         global $_zp_zip_list, $zip_gallery, $defaultSize;
333:         $albumbase = substr($album->name, $base) . '/';
334:         $images = $album->getImages();
335:         foreach ($images as $imagename) {
336:             $image = newImage($album, $imagename);
337:             $uri = $image->getSizedImage($defaultSize);
338:             if (strpos($uri, 'i.php?') === false) {
339:                 $f = $albumbase . $image->filename;
340:                 $c = $albumbase . basename($uri);
341:                 $_zp_zip_list[$filebase . $c] = $f;
342:             }
343:         }
344:         $albums = $album->getAlbums();
345:         foreach ($albums as $albumname) {
346:             $subalbum = newAlbum($albumname);
347:             if ($subalbum->exists && !$album->isDynamic()) {
348:                 self::AddAlbumCache($subalbum, $base, $filebase);
349:             }
350:         }
351:     }
352: 
353:     /**
354:      * Emits a page error. Used for attempts to bypass password protection
355:      *
356:      * @param string $err error code
357:      * @param string $text error message
358:      *
359:      */
360:     static function pageError($err, $text) {
361:         header("HTTP/1.0 " . $err . ' ' . $text);
362:         header("Status: " . $err . ' ' . $text);
363:         echo "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head>   <title>" . $err . " - " . $text . "</TITLE> <META NAME=\"ROBOTS\" CONTENT=\"NOINDEX, FOLLOW\"></head>";
364:         echo "<BODY bgcolor=\"#ffffff\" text=\"#000000\" link=\"#0000ff\" vlink=\"#0000ff\" alink=\"#0000ff\">";
365:         echo "<FONT face=\"Helvitica,Arial,Sans-serif\" size=\"2\">";
366:         echo "<b>" . sprintf(gettext('Page error: %2$s (%1$s)'), $err, $text) . "</b><br /><br />";
367:         echo "</body></html>";
368:         exitZP();
369:     }
370: 
371:     /**
372:      * Creates a zip file of the album
373:      *
374:      * @param string $albumname album folder
375:      * @param bool fromcache if true, images will be the "sized" image in the cache file
376:      */
377:     static function create($albumname, $fromcache) {
378:         global $_zp_zip_list, $_zp_gallery, $defaultSize;
379:         $album = newAlbum($albumname);
380:         if (!$album->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumname)) {
381:             self::pageError(403, gettext("Forbidden"));
382:         }
383:         if (!$album->exists) {
384:             self::pageError(404, gettext('Album not found'));
385:         }
386:         $_zp_zip_list = array();
387:         if ($fromcache) {
388:             $opt = array('large_file_size' => 5 * 1024 * 1024, 'comment' => sprintf(gettext('Created from cached images of %1$s on %2$s.'), $album->name, zpFormattedDate(DATE_FORMAT, time())));
389:             loadLocalOptions(false, $_zp_gallery->getCurrentTheme());
390:             $defaultSize = getOption('image_size');
391:             self::AddAlbumCache($album, strlen($albumname), SERVERPATH . '/' . CACHEFOLDER . '/' . $albumname);
392:         } else {
393:             $opt = array('large_file_size' => 5 * 1024 * 1024, 'comment' => sprintf(gettext('Created from images in %1$s on %2$s.'), $album->name, zpFormattedDate(DATE_FORMAT, time())));
394:             self::AddAlbum($album, strlen($albumname), SERVERPATH . '/' . ALBUMFOLDER . '/' . $albumname);
395:         }
396:         $zip = new ZipStream($albumname . '.zip', $opt);
397:         foreach ($_zp_zip_list as $path => $file) {
398:             @set_time_limit(6000);
399:             $zip->add_file_from_path(internalToFilesystem($file), internalToFilesystem($path));
400:         }
401:         $zip->finish();
402:     }
403: 
404: 
405: }
406: 
407: /**
408:  * Prints the actual download list included all subfolders and files
409:  * @param string $dir An optional different folder to generate the list that overrides the folder set on the option.
410:  * @param string $listtype "ol" or "ul" for the type of HTML list you want to use
411:  * @param array $filters an array of files to exclude from the list. Standard items are Array( '.', '..','.DS_Store','Thumbs.db','.htaccess','.svn')
412:  * @param array $excludesuffixes an array of file suffixes (without trailing dot to exclude from the list (e.g. "jpg")
413:  * @param string $sort 'asc" or "desc" (default) for alphabetical ascending or descending list
414:  */
415: function printdownloadList($dir = '', $listtype = 'ol', $filters = array(), $excludesuffixes = '', $sort = 'desc') {
416:     if ($listtype != 'ol' || $listtype != 'ul') {
417:         $listtype = 'ol';
418:     }
419:     $files = getdownloadList($dir, $filters, $excludesuffixes, $sort);
420:     echo '<' . $listtype . ' class="downloadList">';
421:     DownloadList::printListArray($files, $listtype);
422:     echo '</' . $listtype . '>';
423: }
424: 
425: /**
426:  * Gets the actual download list included all subfolders and files
427:  * @param string $dir8 An optional different folder to generate the list that overrides the folder set on the option.
428:  *                                      This could be a subfolder of the main download folder set on the plugin's options. You have to include the base directory as like this:
429:  *                                      "folder" or "folder/subfolder" or "../folder"
430:  *                                      You can also set any folder within or without the root of your Zenphoto installation as a download folder with this directly
431:  * @param string $listtype "ol" or "ul" for the type of HTML list you want to use
432:  * @param array $filters8 an array of files to exclude from the list. Standard items are '.', '..','.DS_Store','Thumbs.db','.htaccess','.svn'
433:  * @param array $excludesuffixes an array of file suffixes (without trailing dot to exclude from the list (e.g. "jpg")
434:  * @param string $sort 'asc" or "desc" (default) for alphabetical ascending or descending list
435:  * @return array
436:  */
437: function getdownloadList($dir8, $filters8, $excludesuffixes, $sort) {
438:     $filters = Array('Thumbs.db');
439:     foreach ($filters8 as $key => $file) {
440:         $filters[$key] = internalToFilesystem($file);
441:     }
442:     if (empty($dir8)) {
443:         $dir = SERVERPATH . '/' . getOption('downloadList_directory');
444:     } else {
445:         if (substr($dir8, 0, 1) == '/' || strpos($dir8, ':') !== false) {
446:             $dir = internalToFilesystem($dir8);
447:         } else {
448:             $dir = SERVERPATH . '/' . internalToFilesystem($dir8);
449:         }
450:     }
451:     if (empty($excludesuffixes)) {
452:         $excludesuffixes = getOption('downloadList_excludesuffixes');
453:     }
454:     if (empty($excludesuffixes)) {
455:         $excludesuffixes = array();
456:     } elseif (!is_array($excludesuffixes)) {
457:         $excludesuffixes = explode(',', $excludesuffixes);
458:     }
459:     if ($sort == 'asc') {
460:         $direction = 0;
461:     } else {
462:         $direction = 1;
463:     }
464:     $dirs = array_diff(scandir($dir, $direction), $filters);
465:     $dir_array = Array();
466:     if ($sort == 'asc') {
467:         natsort($dirs);
468:     }
469:     foreach ($dirs as $file) {
470:         if (@$file{0} != '.') { //  exclude "hidden" files
471:             if (is_dir(internalToFilesystem($dir) . '/' . $file)) {
472:                 $dirN = filesystemToInternal($dir) . "/" . filesystemToInternal($file);
473:                 $dir_array[$file] = getdownloadList($dirN, $filters8, $excludesuffixes, $sort);
474:             } else {
475:                 if (!in_array(getSuffix($file), $excludesuffixes)) {
476:                     $dir_array[$file] = $dir . '/' . filesystemToInternal($file);
477:                 }
478:             }
479:         }
480:     }
481:     return $dir_array;
482: }
483: 
484: /**
485:  * Gets the download url for a file
486:  * @param string $file the path to a file to get a download link.
487:  */
488: function getDownloadURL($file) {
489:     if (substr($file, 0, 1) != '/' && strpos($file, ':') === false) {
490:         $file = SERVERPATH . '/' . getOption('downloadList_directory') . '/' . $file;
491:     }
492:     $request = parse_url(getRequestURI());
493:     if (isset($request['query'])) {
494:         $query = parse_query($request['query']);
495:     } else {
496:         $query = array();
497:     }
498:     DownloadList::addListItem($file); // add item to db if not already exists without updating the counter
499:     $link = '';
500:     if ($id = DownloadList::getItemID($file)) {
501:         $query['download'] = $id;
502:         $link = FULLWEBPATH . '/' . preg_replace('~^' . WEBPATH . '/~', '', $request['path']) . '?' . http_build_query($query);
503:     }
504:     return $link;
505: }
506: 
507: /**
508:  * Prints a download link for a file, depending on the plugin options including the downloadcount and filesize
509:  * @param string $file the path to a file to print a download link.
510:  * @param string $linktext Optionally how you wish to call the link. Set/leave  to NULL to use the filename.
511:  */
512: function printDownloadURL($file, $linktext = NULL) {
513:     if (substr($file, 0, 1) != '/' && strpos($file, ':') === false) {
514:         $file = SERVERPATH . '/' . getOption('downloadList_directory') . '/' . $file;
515:     }
516:     $filesize = '';
517:     if (getOption('downloadList_showfilesize')) {
518:         $filesize = @filesize(internalToFilesystem($file));
519:         $filesize = ' (' . byteConvert($filesize) . ')';
520:     }
521:     if (getOption('downloadList_showdownloadcounter')) {
522:         $downloaditem = DownloadList::getListItemFromDB($file);
523:         if ($downloaditem) {
524:             $downloadcount = ' - ' . sprintf(ngettext('%u download', '%u downloads', $downloaditem['data']), $downloaditem['data']);
525:         } else {
526:             $downloadcount = ' - ' . gettext('0 downloads');
527:         }
528:         $filesize .= $downloadcount;
529:     }
530:     if (empty($linktext)) {
531:         $filename = basename($file);
532:     } else {
533:         $filename = $linktext;
534:     }
535:     echo '<a href="' . html_encode(getDownloadURL($file)) . '" rel="nofollow" class="downloadlist_link">' . html_encode($filename) . '</a><small>' . $filesize . '</small>';
536: }
537: 
538: /**
539:  *
540:  * Prints a download link for an album zip of the current album (therefore to be used only on album.php/image.php).
541:  * This function only creates a download count and then redirects to the original Zenphoto album zip download.
542:  *
543:  * @param string $linktext
544:  * @param object $albumobj
545:  * @param bool $fromcache if true get the images from the cache
546:  */
547: function printDownloadAlbumZipURL($linktext = NULL, $albumobj = NULL, $fromcache = NULL) {
548:     global $_zp_current_album;
549:     $request = parse_url(getRequestURI());
550:     if (isset($request['query'])) {
551:         $query = parse_query($request['query']);
552:     } else {
553:         $query = array();
554:     }
555:     if (is_null($albumobj)) {
556:         $albumobj = $_zp_current_album;
557:     }
558:     if (!is_null($albumobj) && !$albumobj->isDynamic()) {
559:         $file = $albumobj->name . '.zip';
560:         DownloadList::addListItem($file);
561:         if (getOption('downloadList_showdownloadcounter')) {
562:             $downloaditem = DownloadList::getListItemFromDB($file);
563:             if ($downloaditem) {
564:                 $downloadcount = ' - ' . sprintf(ngettext('%u download', '%u downloads', $downloaditem['data']), $downloaditem['data']);
565:             } else {
566:                 $downloadcount = ' - ' . gettext('0 downloads');
567:             }
568:             $filesize = '<small>' . $downloadcount . '</small>';
569:         } else {
570:             $filesize = '';
571:         }
572:         if (!empty($linktext)) {
573:             $file = $linktext;
574:         }
575:         $query['download'] = $albumobj->name;
576:         $query['albumzip'] = 'true';
577:         if ($fromcache) {
578:             $query['fromcache'] = 'true';
579:         }
580:         $link = FULLWEBPATH . '/' . preg_replace('~^' . WEBPATH . '/~', '', $request['path']) . '?' . http_build_query($query);
581:         echo '<a href="' . html_encode($link) . '" rel="nofollow" class="downloadlist_link">' . html_encode($file) . '</a>' . $filesize;
582:     }
583: }
584: 
585: /**
586:  * Process any download requests
587:  */
588: if (isset($_GET['download'])) {
589:   $item = sanitize($_GET['download']);
590:   if (empty($item) || !extensionEnabled('downloadList')) {
591:     if (TEST_RELEASE) {
592:       zp_error(gettext('Forbidden'));
593:     } else {
594:       header("HTTP/1.0 403 " . gettext("Forbidden"));
595:       header("Status: 403 " . gettext("Forbidden"));
596:       exitZP(); //  terminate the script with no output
597:     }
598:   }
599:   $hash = getOption('downloadList_password');
600:   if (GALLERY_SECURITY != 'public' || $hash) {
601:     //  credentials required to download
602:     if(!zp_loggedin((getOption('downloadList_rights')) ? FILES_RIGHTS : ALL_RIGHTS)) {
603:         $user = getOption('downloadList_user');
604:         zp_handle_password('download_auth', $hash, $user);
605:         if ((!empty($hash) && zp_getCookie('download_auth') != $hash)) {
606:         $show = ($user) ? true : NULL;
607:         $hint = '';
608:         if (!empty($hash)) {
609:             $hint = get_language_string(getOption('downloadList_hint'));
610:         }
611:         if (isset($_GET['albumzip'])) {
612:             $item .= '&albumzip';
613:         }
614:         printPasswordForm($hint, true, $show, '?download=' . $item);
615:         exitZP();
616:         }
617:     }
618:   }
619:   if (isset($_GET['albumzip'])) {
620:     DownloadList::updateListItemCount($item . '.zip');
621:     require_once(SERVERPATH . '/' . ZENFOLDER . '/lib-zipStream.php');
622:     if (isset($_GET['fromcache'])) {
623:       $fromcache = sanitize($isset($_GET['fromcache']));
624:     } else {
625:       $fromcache = getOption('downloadList_zipFromCache');
626:     }
627:     AlbumZip::create($item, $fromcache);
628:     exitZP();
629:   } else {
630:     require_once(SERVERPATH . '/' . ZENFOLDER . '/lib-MimeTypes.php');
631:     $item = (int) $item;
632:     $path = query_single_row("SELECT `aux` FROM " . prefix('plugin_storage') . " WHERE id=" . $item);
633:     $_downloadFile = internalToFilesystem($path['aux']);
634:     if (file_exists($_downloadFile)) {
635:       DownloadList::updateListItemCount($_downloadFile);
636:       $ext = getSuffix($_downloadFile);
637:       $mimetype = getMimeString($ext);
638:       header('Content-Description: File Transfer');
639:       header('Content-Type: ' . $mimetype);
640:       header('Content-Disposition: attachment; filename=' . basename(urldecode($_downloadFile)));
641:       header('Content-Transfer-Encoding: binary');
642:       header('Expires: 0');
643:       header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
644:       header('Pragma: public');
645:       header('Content-Length: ' . filesize($_downloadFile));
646:       flush();
647:       readfile($_downloadFile);
648:       exitZP();
649:     } else {
650:       zp_register_filter('theme_body_open', 'DownloadList::noFile');
651:     }
652:   }
653: }
654: ?>
Zenphoto doc API documentation generated by ApiGen