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:  * root object class
  5:  * @package classes
  6:  */
  7: // force UTF-8 Ø
  8: // classes.php
  9: 
 10: /* * *****************************************************************************
 11:  * ******************************************************************************
 12:  * Persistent Object Class *****************************************************
 13:  *
 14:  * Parent ABSTRACT class of all persistent objects. This class should not be
 15:  * instantiated, only used for subclasses. This cannot be enforced, but please
 16:  * follow it!
 17:  *
 18:  * A child class should run the follwing in its constructor:
 19:  *
 20:  * $new = $this->instantiate('tablename',
 21:  *   array('uniquestring'=>$value, 'uniqueid'=>$uniqueid));
 22:  *
 23:  * where 'tablename' is the name of the database table to use for this object
 24:  * type, and array('uniquestring'=>$value, ...) defines a unique set of columns
 25:  * (keys) and their current values which uniquely identifies a single record in
 26:  * that database table for this object.
 27:  *
 28:  * Note: This is a persistable model that does not save automatically. You MUST
 29:  * call $this->save(); explicitly to persist the data in child classes.
 30:  *
 31:  * ******************************************************************************
 32:  * **************************************************************************** */
 33: 
 34: // The query cache
 35: $_zp_object_cache = array();
 36: define('OBJECT_CACHE_DEPTH', 150); //   how many objects to hold for each object class
 37: // ABSTRACT
 38: 
 39: class PersistentObject {
 40: 
 41:     var $loaded = false;
 42:     var $exists = false;
 43:     var $table;
 44:     var $transient;
 45:     protected $id = 0;
 46:     private $unique_set = NULL;
 47:     private $cache_by;
 48:     private $use_cache = false;
 49:     private $tempdata = NULL;
 50:     private $data = NULL;
 51:     private $updates = NULL;
 52: 
 53:     /**
 54:      *
 55:      * @deprecated
 56:      */
 57:     function __construct($tablename, $unique_set, $cache_by = NULL, $use_cache = true, $is_transient = false, $allowCreate = true) {
 58:         deprecated_functions::PersistentObject();
 59:         return instantiate($tablename, $unique_set, $cache_by, $use_cache, $is_transient, $allowCreate);
 60:     }
 61: 
 62:     /**
 63:       }
 64:      *
 65:      * Prime instantiator for Zenphoto objects
 66:      * @param $tablename    The name of the database table
 67:      * @param $unique_set   An array of unique fields
 68:      * @param $cache_by
 69:      * @param $use_cache
 70:      * @param $is_transient Set true to prevent database insertion
 71:      * @param $allowCreate Set true to allow a new object to be made.
 72:      * @return bool will be true if the unique_set does not already exist
 73:      */
 74:     function instantiate($tablename, $unique_set, $cache_by = NULL, $use_cache = true, $is_transient = false, $allowCreate = true) {
 75:         global $_zp_object_cache;
 76:         //  insure a cache entry
 77:         $classname = get_class($this);
 78:         if (!isset($_zp_object_cache[$classname])) {
 79:             $_zp_object_cache[$classname] = array();
 80:         }
 81:         // Initialize the variables.
 82:         // Load the data into the data array using $this->load()
 83:         $this->data = $this->tempdata = $this->updates = array();
 84:         $this->loaded = false;
 85:         $this->table = $tablename;
 86:         $this->unique_set = $unique_set;
 87:         if (is_null($cache_by)) {
 88:             $this->cache_by = serialize($unique_set);
 89:         } else {
 90:             $this->cache_by = $this->unique_set[$cache_by];
 91:         }
 92:         $this->use_cache = $use_cache;
 93:         $this->transient = $is_transient;
 94:         return $this->load($allowCreate);
 95:     }
 96: 
 97:     /**
 98:      *
 99:      * check the cache for presence of the entry and return it if found
100:      * @param $entry
101:      */
102:     private function getFromCache() {
103:         global $_zp_object_cache;
104:         if (isset($_zp_object_cache[$c = get_class($this)]) && isset($_zp_object_cache[$c][$this->cache_by])) {
105:             return $_zp_object_cache[$c][$this->cache_by];
106:         }
107:         return NULL;
108:     }
109: 
110:     /**
111:      *
112:      * add the entry to the cache
113:      * @param $entry
114:      */
115:     private function addToCache($entry) {
116:         global $_zp_object_cache;
117:         if ($entry) {
118:             if (count($_zp_object_cache[$classname = get_class($this)]) >= OBJECT_CACHE_DEPTH) {
119:                 array_shift($_zp_object_cache[$classname]); //  discard the oldest
120:             }
121:             $_zp_object_cache[$classname][$this->cache_by] = $entry;
122:         }
123:     }
124: 
125:     /**
126:      * Set a variable in this object. Does not persist to the database until
127:      * save() is called. So, IMPORTANT: Call save() after set() to persist.
128:      * If the requested variable is not in the database, sets it in temp storage,
129:      * which won't be persisted to the database.
130:      */
131:     function set($var, $value) {
132:         if (empty($var))
133:             return false;
134:         if ($this->loaded && !array_key_exists($var, $this->data)) {
135:             $this->tempdata[$var] = $value;
136:         } else {
137:             $this->updates[$var] = $value;
138:         }
139:         return true;
140:     }
141: 
142:     /**
143:      * Sets default values for new objects using the set() method.
144:      * Should do nothing in the base class; subclasses should override.
145:      */
146:     protected function setDefaults() {
147: 
148:     }
149: 
150:     /**
151:      * Change one or more values of the unique set assigned to this record.
152:      * Checks if the record already exists first, if so returns false.
153:      * If successful returns true and changes $this->unique_set
154:      * A call to move is instant, it does not require a save() following it.
155:      */
156:     function move($new_unique_set) {
157:         // Check if we have a row
158:         $result = query_single_row('SELECT * FROM ' . prefix($this->table) . getWhereClause($new_unique_set) . ' LIMIT 1;');
159:         if (!$result || $result['id'] == $this->id) { //    we should not find an entry for the new unique set!
160:             if (!zp_apply_filter('move_object', true, $this, $new_unique_set)) {
161:                 return false;
162:             }
163:             $sql = 'UPDATE ' . prefix($this->table) . getSetClause($new_unique_set) . ' ' . getWhereClause($this->unique_set);
164:             $result = query($sql);
165:             if ($result && db_affected_rows() == 1) { //    and the update should have effected just one record
166:                 $this->unique_set = $new_unique_set;
167:                 return true;
168:             }
169:         }
170:         return false;
171:     }
172: 
173:     /**
174:      * Copy this record to another unique set. Checks if the record exists there
175:      * first, if so returns false. If successful returns true. No changes are made
176:      * to this object and no other objects are created, just the database entry.
177:      * A call to copy is instant, it does not require a save() following it.
178:      */
179:     function copy($new_unique_set) {
180:         // Check if we have a row
181:         $result = query('SELECT * FROM ' . prefix($this->table) . getWhereClause($new_unique_set) . ' LIMIT 1;');
182: 
183:         if ($result && db_num_rows($result) == 0) {
184:             if (!zp_apply_filter('copy_object', true, $this, $new_unique_set)) {
185:                 return false;
186:             }
187:             // Note: It's important for $new_unique_set to come last, as its values should override.
188:             $insert_data = array_merge($this->data, $this->updates, $this->tempdata, $new_unique_set);
189:             unset($insert_data['id']);
190:             unset($insert_data['hitcounter']); //   start fresh on new copy
191:             if (empty($insert_data)) {
192:                 return true;
193:             }
194:             $sql = 'INSERT INTO ' . prefix($this->table) . ' (';
195:             $i = 0;
196:             foreach (array_keys($insert_data) as $col) {
197:                 if ($i > 0)
198:                     $sql .= ", ";
199:                 $sql .= "`$col`";
200:                 $i++;
201:             }
202:             $sql .= ') VALUES (';
203:             $i = 0;
204:             foreach (array_values($insert_data) as $value) {
205:                 if ($i > 0)
206:                     $sql .= ', ';
207:                 if (is_null($value)) {
208:                     $sql .= 'NULL';
209:                 } else {
210:                     $sql .= db_quote($value);
211:                 }
212:                 $i++;
213:             }
214:             $sql .= ');';
215:             $success = query($sql);
216:             if ($success && db_affected_rows() == 1) {
217:                 return zp_apply_filter('copy_object', db_insert_id(), $this);
218:             }
219:         }
220:         return false;
221:     }
222: 
223:     /**
224:      * Deletes object from the database
225:      *
226:      * @return bool
227:      */
228:     function remove() {
229:         if (!zp_apply_filter('remove_object', true, $this)) {
230:             return false;
231:         }
232:         $id = $this->id;
233:         if (empty($id)) {
234:             $id = ' is NULL'; //    allow delete of bad item!
235:         } else {
236:             $id = '=' . $id;
237:         }
238:         $sql = 'DELETE FROM ' . prefix($this->table) . ' WHERE `id`' . $id;
239:         $this->loaded = false;
240:         $this->transient = true;
241:         return query($sql);
242:     }
243: 
244:     /**
245:      * Returns the id
246:      *
247:      * @return string
248:      */
249:     function getID() {
250:         return $this->id;
251:     }
252: 
253:     /**
254:      *
255:      * returns the database record of the object
256:      * @return array
257:      */
258:     function getData() {
259:         $this->save();
260:         return $this->data;
261:     }
262: 
263:     /**
264:      * Get the value of a variable. If $current is false, return the value
265:      * as of the last save of this object.
266:      */
267:     function get($var, $current = true) {
268:         if ($current && isset($this->updates[$var])) {
269:             return $this->updates[$var];
270:         } else if (isset($this->data[$var])) {
271:             return $this->data[$var];
272:         } else if (isset($this->tempdata[$var])) {
273:             return $this->tempdata[$var];
274:         } else {
275:             return null;
276:         }
277:     }
278: 
279:     /**
280:      * Load the data array from the database, using the unique id set to get the unique record.
281:      *
282:      * @param bool $allowCreate set to true to enable new object creation.
283:      * @return false if the record already exists, true if a new record was created.
284:      */
285:     private function load($allowCreate) {
286:         $new = $entry = null;
287:         // Set up the SQL query in case we need it...
288:         $sql = 'SELECT * FROM ' . prefix($this->table) . getWhereClause($this->unique_set) . ' LIMIT 1;';
289:         // But first, try the cache.
290:         if ($this->use_cache) {
291:             $entry = $this->getFromCache();
292:         }
293:         // Check the database if: 1) not using cache, or 2) didn't get a hit.
294:         if (empty($entry)) {
295:             $entry = query_single_row($sql, false);
296:             // Save this entry into the cache so we get a hit next time.
297:             if ($entry)
298:                 $this->addToCache($entry);
299:         }
300: 
301:         // If we don't have an entry yet, this is a new record. Create it.
302:         if (empty($entry)) {
303:             if ($this->transient) { // no don't save it in the DB!
304:                 $entry = array_merge($this->unique_set, $this->updates, $this->tempdata);
305:                 $entry['id'] = 0;
306:             } else if (!$allowCreate) {
307:                 return NULL; // does not exist and we are not allowed to create it
308:             } else {
309:                 $new = true;
310:                 $this->save();
311:                 $entry = query_single_row($sql);
312:                 // If we still don't have an entry, something went wrong...
313:                 if (!$entry)
314:                     return null;
315:                 // Save this new entry into the cache so we get a hit next time.
316:                 $this->addToCache($entry);
317:             }
318:         }
319:         $this->data = $entry;
320:         $this->id = (int) $entry['id'];
321:         $this->loaded = true;
322:         return $new;
323:     }
324: 
325:     /**
326:      * Save the updates made to this object since the last update. Returns
327:      * true if successful, false if not.
328:      */
329:     function save() {
330:         if ($this->transient)
331:             return false; // If this object isn't supposed to be persisted, don't save it.
332:         if (!$this->unique_set) { // If we don't have a unique set, then this is incorrect. Don't attempt to save.
333:             zp_error('empty $this->unique set is empty');
334:             return false;
335:         }
336:         if (!$this->id) {
337:             $this->setDefaults();
338:             // Create a new object and set the id from the one returned.
339:             $insert_data = array_merge($this->unique_set, $this->updates, $this->tempdata);
340:             if (empty($insert_data)) {
341:                 return true;
342:             }
343:             $i = 0;
344:             $cols = $vals = '';
345:             foreach ($insert_data as $col => $value) {
346:                 if ($i > 0)
347:                     $cols .= ", ";
348:                 $cols .= "`$col`";
349:                 if ($i > 0)
350:                     $vals .= ", ";
351:                 if (is_null($value)) {
352:                     $vals .= "NULL";
353:                 } else {
354:                     $vals .= db_quote($value);
355:                 }
356:                 $i++;
357:             }
358:             $sql = 'INSERT INTO ' . prefix($this->table) . ' (' . $cols . ') VALUES (' . $vals . ')';
359:             $success = query($sql);
360:             if (!$success || db_affected_rows() != 1) {
361:                 return false;
362:             }
363:             foreach ($insert_data as $key => $value) { // copy over any changes
364:                 $this->data[$key] = $value;
365:             }
366:             $this->data['id'] = $this->id = (int) db_insert_id(); // so 'get' will retrieve it!
367:             $this->loaded = true;
368:             $this->updates = array();
369:             $this->tempdata = array();
370:         } else {
371:             // Save the existing object (updates only) based on the existing id.
372:             if (empty($this->updates)) {
373:                 return true;
374:             } else {
375:                 $sql = 'UPDATE ' . prefix($this->table) . ' SET';
376:                 $i = 0;
377:                 foreach ($this->updates as $col => $value) {
378:                     if ($i > 0)
379:                         $sql .= ",";
380:                     if (is_null($value)) {
381:                         $sql .= " `$col` = NULL";
382:                     } else {
383:                         $sql .= " `$col` = " . db_quote($value);
384:                     }
385:                     $this->data[$col] = $value;
386:                     $i++;
387:                 }
388:                 $sql .= ' WHERE id=' . $this->id . ';';
389:                 $success = query($sql);
390:                 if (!$success || db_affected_rows() != 1) {
391:                     return false;
392:                 }
393:                 foreach ($this->updates as $key => $value) {
394:                     $this->data[$key] = $value;
395:                 }
396:                 $this->updates = array();
397:             }
398:         }
399:         zp_apply_filter('save_object', true, $this);
400:         $this->addToCache($this->data);
401:         return true;
402:     }
403: 
404:     /**
405:      *
406:      * "Magic" function to return a string identifying the object when it is treated as a string
407:      * @return string
408:      */
409:     public function __toString() {
410:         return $this->table . " (" . $this->id . ")";
411:     }
412: 
413: }
414: 
415: //////////////////////////////////////////////////////////////////////////////////////////////////////
416: /**
417:  * The basic ThemeObject class. Extends PersistentObject, is extended by various Theme related objects.
418:  * Provides some basic methods that all use.
419:  */
420: class ThemeObject extends PersistentObject {
421: 
422:     private $commentcount; //Contains the number of comments
423:     var $comments = NULL; //Contains an array of the comments of the object
424:     var $manage_rights = ADMIN_RIGHTS;
425:     var $manage_some_rights = ADMIN_RIGHTS;
426:     var $view_rights = VIEW_ALL_RIGHTS;
427: 
428:     /**
429:      * Class instantiator
430:      */
431:     function __construct() {
432:         // no action required
433:     }
434: 
435:     /**
436:      * Returns the title
437:      *
438:      * @return string
439:      */
440:     function getTitle($locale = NULL) {
441:         $text = $this->get('title');
442:         if ($locale !== 'all') {
443:             $text = get_language_string($text, $locale);
444:         }
445:         $text = zpFunctions::unTagURLs($text);
446:         return $text;
447:     }
448: 
449:     /**
450:      * Stores the title
451:      *
452:      * @param string $title the title
453:      */
454:     function setTitle($title) {
455:         $this->set('title', zpFunctions::tagURLs($title));
456:     }
457: 
458:     /**
459:      * Returns the partent id
460:      *
461:      * @return string
462:      */
463:     function getParentID() {
464:         return $this->get('parentid');
465:     }
466: 
467:     /**
468:      * Sets the ParentID field
469:      * @param $v id of the parent
470:      */
471:     function setParentID($v) {
472:         $this->set('parentid', $v);
473:     }
474: 
475:     /**
476:      * Returns the hitcount
477:      *
478:      * @return int
479:      */
480:     function getHitcounter() {
481:         return $this->get('hitcounter');
482:     }
483: 
484:     /**
485:      * counts visits to the object
486:      */
487:     function countHit() {
488:         $this->set('hitcounter', $this->get('hitcounter') + 1);
489:         $this->save();
490:     }
491: 
492:     /**
493:      * Returns true published
494:      *
495:      * @return bool
496:      */
497:     function getShow() {
498:         return $this->get('show');
499:     }
500: 
501:     /**
502:      * Stores the published value
503:      *
504:      * @param bool $show True if the album is published
505:      */
506:     function setShow($show) {
507:         $old_show = $this->get('show');
508:         $new_show = (int) ($show && true);
509:         $this->set('show', $new_show);
510:         if ($old_show != $new_show && $this->get('id')) {
511:             zp_apply_filter('show_change', $this);
512:         }
513:     }
514: 
515:     /**
516:      * Returns the tag data
517:      *
518:      * @return string
519:      */
520:     function getTags() {
521:         return readTags($this->getID(), $this->table);
522:     }
523: 
524:     /**
525:      * Stores tag information
526:      *
527:      * @param string $tags the tag list
528:      */
529:     function setTags($tags) {
530:         if (!$this->getID()) { //   requires a valid id to link tags to the object
531:             $this->save();
532:         }
533:         storeTags(array_unique($tags), $this->getID(), $this->table);
534:     }
535: 
536:     /**
537:      * Checks if an object has a tag assigned.
538:      *
539:      * @param string $checktag tag to check for
540:      *
541:      * @return bool
542:      */
543:     function hasTag($checktag) {
544:         $tags = $this->getTags();
545:         return in_array($checktag, $tags);
546:     }
547: 
548:     /**
549:      * Returns the unformatted date
550:      *
551:      * @return int
552:      */
553:     function getDateTime() {
554:         return $this->get('date');
555:     }
556: 
557:     /**
558:      * Stores the date
559:      *
560:      * @param string $datetime formatted date
561:      */
562:     function setDateTime($datetime) {
563:         if ($datetime) {
564:             $newtime = dateTimeConvert($datetime);
565:             if ($newtime !== false) {
566:                 $this->set('date', $newtime);
567:             }
568:         } else {
569:             $this->set('date', NULL);
570:         }
571:     }
572: 
573:     /**
574:      * Returns the codeblocks as an serialized array
575:      *
576:      * @return array
577:      */
578:     function getCodeblock() {
579:         return zpFunctions::unTagURLs($this->get("codeblock"));
580:     }
581: 
582:     /**
583:      * set the codeblocks as an serialized array
584:      *
585:      */
586:     function setCodeblock($cb) {
587:         $this->set('codeblock', zpFunctions::tagURLs($cb));
588:     }
589: 
590:     /**
591:      * returns the custom data field
592:      *
593:      * @return string
594:      */
595:     function getCustomData($locale = NULL) {
596:         $text = $this->get('custom_data');
597:         if ($locale !== 'all') {
598:             $text = get_language_string($text, $locale);
599:         }
600:         $text = zpFunctions::unTagURLs($text);
601:         return $text;
602:     }
603: 
604:     /**
605:      * Sets the custom data field
606:      *
607:      * @param string $val the value to be put in custom_data
608:      */
609:     function setCustomData($val) {
610:         $this->set('custom_data', zpFunctions::tagURLs($val));
611:     }
612: 
613:     /**
614:      * Retuns true if comments are allowed
615:      *
616:      * @return bool
617:      */
618:     function getCommentsAllowed() {
619:         return $this->get('commentson');
620:     }
621: 
622:     /**
623:      * Sets the comments allowed flag
624:      *
625:      * @param bool $commentson true if they are allowed
626:      */
627:     function setCommentsAllowed($commentson) {
628:         $this->set('commentson', (int) ($commentson && true));
629:     }
630: 
631:     /**
632:      * Returns an array of comments for this album
633:      *
634:      * @param bool $moderated if false, ignores comments marked for moderation
635:      * @param bool $private if false ignores private comments
636:      * @param bool $desc set to true for descending order
637:      * @return array
638:      */
639:     function getComments($moderated = false, $private = false, $desc = false) {
640:         $sql = "SELECT *, (date + 0) AS date FROM " . prefix("comments") .
641:                         " WHERE `type`='" . $this->table . "' AND `ownerid`='" . $this->getID() . "'";
642:         if (!$moderated) {
643:             $sql .= " AND `inmoderation`=0";
644:         }
645:         if (!$private) {
646:             $sql .= " AND `private`=0";
647:         }
648:         $sql .= " ORDER BY id";
649:         if ($desc) {
650:             $sql .= ' DESC';
651:         }
652:         $comments = query_full_array($sql);
653:         $this->comments = $comments;
654:         return $this->comments;
655:     }
656: 
657:     /**
658:      * Adds comments to the album
659:      * assumes data is coming straight from GET or POST
660:      *
661:      * Returns a comment object
662:      *
663:      * @param string $name Comment author name
664:      * @param string $email Comment author email
665:      * @param string $website Comment author website
666:      * @param string $comment body of the comment
667:      * @param string $code CAPTCHA code entered
668:      * @param string $code_ok CAPTCHA hash expected
669:      * @param string $ip the IP address of the comment poster
670:      * @param bool $private set to true if the comment is for the admin only
671:      * @param bool $anon set to true if the poster wishes to remain anonymous
672:      * @param string $customdata
673:      * @return object
674:      */
675:     function addComment($name, $email, $website, $comment, $code, $code_ok, $ip, $private, $anon, $customdata) {
676:         $goodMessage = zp_apply_filter('object_addComment', $name, $email, $website, $comment, $code, $code_ok, $this, $ip, $private, $anon, $customdata);
677:         return $goodMessage;
678:     }
679: 
680:     /**
681:      * Returns the count of comments in the album. Ignores comments in moderation
682:      *
683:      * @return int
684:      */
685:     function getCommentCount() {
686:         if (is_null($this->commentcount)) {
687:             if ($this->comments == null) {
688:                 $count = db_count("comments", "WHERE `type`='" . $this->table . "' AND `inmoderation`=0 AND `private`=0 AND `ownerid`=" . $this->getID());
689:                 $this->commentcount = $count;
690:             } else {
691:                 $this->commentcount = count($this->comments);
692:             }
693:         }
694:         return $this->commentcount;
695:     }
696: 
697:     /**
698:      * Checks basic access rights of an object
699:      * @param bit $action what the caller wants to do
700:      */
701:     function isMyItem($action) {
702:   if (!$this->checkPublishDates()) {
703:     $this->setShow(0);
704:   }
705:         if (zp_loggedin($this->manage_rights)) {
706:             return true;
707:         }
708:         if (zp_loggedin($this->view_rights) && ($action == LIST_RIGHTS)) { // sees all
709:             return true;
710:         }
711:         if (zp_apply_filter('check_credentials', false, $this, $action)) {
712:             return true;
713:         }
714:         return NULL;
715:     }
716: 
717:     /**
718:      * returns false (deny) if gallery is "private"
719:      * @param $hint
720:      * @param $show
721:      */
722:     function checkForGuest(&$hint = NULL, &$show = NULL) {
723:         return !(GALLERY_SECURITY != 'public');
724:     }
725: 
726:     /**
727:      *
728:      * Checks if viewing of object is allowed
729:      * @param string $hint
730:      * @param string $show
731:      */
732:     function checkAccess(&$hint = NULL, &$show = NULL) {
733:     if ($this->isMyItem(LIST_RIGHTS)) {
734:       return true;
735:     }
736:     return $this->checkforGuest($hint, $show);
737:   }
738:   
739:   /**
740:    * Checks if the item is either expired or in scheduled publishing
741:    * A class method wrapper of the functions.php function of the same name
742:    * @return boolean
743:    */
744:   function checkPublishDates() {
745:     $row = array();
746:     if (isAlbumClass($this) || isImageClass($this)) {
747:       $row = array(
748:           'show' => $this->getShow(),
749:           'expiredate' => $this->getExpireDate(),
750:           'publishdate' => $this->getPublishDate()
751:       );
752:     } else if ($this->table == 'news' || $this->table == 'pages') {
753:       $row = array(
754:           'show' => $this->getShow(),
755:           'expiredate' => $this->getExpireDate(),
756:           'publishdate' => $this->getDateTime()
757:       );
758:     }
759:     $check = checkPublishDates($row);
760:     if ($check == 1 || $check == 2) {
761:       return false;
762:     } else {
763:       return true;
764:     }
765:   }
766: 
767: }
768: 
769: //////////////////////////////////////////////////////////////////////////////////////////////////////
770: /**
771:  * Root class for images and albums
772:  *
773:  */
774: class MediaObject extends ThemeObject {
775: 
776:     /**
777:      * Class instantiator
778:      */
779:     function __construct() {
780:         //  no actions required
781:     }
782: 
783:     /**
784:      * Returns the description
785:      *
786:      * @return string
787:      */
788:     function getDesc($locale = NULL) {
789:         $text = $this->get('desc');
790:         if ($locale == 'all') {
791:             return zpFunctions::unTagURLs($text);
792:         } else {
793:             return applyMacros(zpFunctions::unTagURLs(get_language_string($text, $locale)));
794:         }
795:     }
796: 
797:     /**
798:      * Stores the description
799:      *
800:      * @param string $desc description text
801:      */
802:     function setDesc($desc) {
803:         $desc = zpFunctions::tagURLs($desc);
804:         $this->set('desc', $desc);
805:     }
806: 
807:     /**
808:      * Returns the sort order
809:      *
810:      * @return string
811:      */
812:     function getSortOrder() {
813:         return $this->get('sort_order');
814:     }
815: 
816:     /**
817:      * Stores the sort order
818:      *
819:      * @param string $sortorder image sort order
820:      */
821:     function setSortOrder($sortorder) {
822:         $this->set('sort_order', $sortorder);
823:     }
824: 
825:     /**
826:      * Returns the guest user
827:      *
828:      * @return string
829:      */
830:     function getUser() {
831:         return $this->get('user');
832:     }
833: 
834:     /**
835:      * Sets the guest user
836:      *
837:      * @param string $user
838:      */
839:     function setUser($user) {
840:         $this->set('user', $user);
841:     }
842: 
843:     /**
844:      * Returns the password
845:      *
846:      * @return string
847:      */
848:     function getPassword() {
849:         if (GALLERY_SECURITY != 'public') {
850:             return NULL;
851:         } else {
852:             return $this->get('password');
853:         }
854:     }
855: 
856:     /**
857:      * Sets the encrypted password
858:      *
859:      * @param string $pwd the cleartext password
860:      */
861:     function setPassword($pwd) {
862:         $this->set('password', $pwd);
863:     }
864: 
865:     /**
866:      * Returns the password hint
867:      *
868:      * @return string
869:      */
870:     function getPasswordHint($locale = NULL) {
871:         $text = $this->get('password_hint');
872:         if ($locale !== 'all') {
873:             $text = get_language_string($text, $locale);
874:         }
875:         $text = zpFunctions::unTagURLs($text);
876:         return $text;
877:     }
878: 
879:     /**
880:      * Sets the password hint
881:      *
882:      * @param string $hint the hint text
883:      */
884:     function setPasswordHint($hint) {
885:         $this->set('password_hint', zpFunctions::tagURLs($hint));
886:     }
887: 
888:     /**
889:      * Returns the expire date
890:      *
891:      * @return string
892:      */
893:     function getExpireDate() {
894:         $dt = $this->get("expiredate");
895:         if ($dt == '0000-00-00 00:00:00') {
896:             return NULL;
897:         } else {
898:             return $dt;
899:         }
900:     }
901: 
902:     /**
903:      * sets the expire date
904:      *
905:      */
906:     function setExpireDate($ed) {
907:         if ($ed) {
908:             $newtime = dateTimeConvert($ed);
909:             if ($newtime === false)
910:                 return;
911:             $this->set('expiredate', $newtime);
912:         } else {
913:             $this->set('expiredate', NULL);
914:         }
915:     }
916: 
917:     /**
918:      * Returns the publish date
919:      *
920:      * @return string
921:      */
922:     function getPublishDate() {
923:         $dt = $this->get("publishdate");
924:         if ($dt == '0000-00-00 00:00:00') {
925:             return NULL;
926:         } else {
927:             return $dt;
928:         }
929:     }
930: 
931:     /**
932:      * sets the publish date
933:      *
934:      */
935:     function setPublishDate($ed) {
936:         if ($ed) {
937:             $newtime = dateTimeConvert($ed);
938:             if ($newtime === false)
939:                 return;
940:             $this->set('publishdate', $newtime);
941:         } else {
942:             $this->set('publishdate', NULL);
943:         }
944:     }
945: 
946: }
947: 
948: ?>
949: 
Zenphoto doc API documentation generated by ApiGen