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:  * Zenpage root classes
   5:  * @author Stephen Billard (sbillard), Malte Müller (acrylian)
   6:  * @package plugins
   7:  * @subpackage zenpage
   8:  */
   9: /**
  10:  * Some global variable setup
  11:  *
  12:  */
  13: //TODO: on the 1.4.7 release these combinews defines can be removed.
  14: define('ZENPAGE_COMBINEWS', false);
  15: define('ZP_COMBINEWS', false);
  16: 
  17: define('ZP_SHORTENINDICATOR', $shortenindicator = getOption('zenpage_textshorten_indicator'));
  18: define('ZP_SHORTEN_LENGTH', getOption('zenpage_text_length'));
  19: define('ZP_READ_MORE', getOption("zenpage_read_more"));
  20: define('ZP_ARTICLES_PER_PAGE', getOption("zenpage_articles_per_page"));
  21: if (!defined('MENU_TRUNCATE_STRING'))
  22:     define('MENU_TRUNCATE_STRING', getOption('menu_truncate_string'));
  23: if (!defined('MENU_TRUNCATE_INDICATOR'))
  24:     define('MENU_TRUNCATE_INDICATOR', getOption('menu_truncate_indicator'));
  25: if (!defined('ZP_NEWS_ENABLED')) {
  26:   if (getOption('enabled-zenpage-items') == 'news-and-pages' || getOption('enabled-zenpage-items') == 'news') {
  27:     define('ZP_NEWS_ENABLED', true);
  28:   } else {
  29:     define('ZP_NEWS_ENABLED', false);
  30:   }
  31: }
  32: if (!defined('ZP_PAGES_ENABLED')) {
  33:   if (getOption('enabled-zenpage-items') == 'news-and-pages' || getOption('enabled-zenpage-items') == 'pages') {
  34:     define('ZP_PAGES_ENABLED', true);
  35:   } else {
  36:     define('ZP_PAGES_ENABLED', false);
  37:   }
  38: }
  39: 
  40: class Zenpage {
  41: 
  42:     public $categoryStructure = array();
  43:     // article defaults (mirrors category vars)
  44:     protected $sortorder = 'date';
  45:     protected $sortdirection = true;
  46:     protected $sortSticky = true;
  47:     // page defaults
  48:     protected $page_sortorder;
  49:     protected $page_sortdirection;
  50:     /**
  51:      * Class instantiator
  52:      */
  53:     function __construct() {
  54:         $allcategories = query_full_array("SELECT * FROM " . prefix('news_categories') . " ORDER by sort_order");
  55:         $this->categoryStructure = array();
  56:         foreach ($allcategories as $cat) {
  57:             $this->categoryStructure[$cat['id']] = $cat;
  58:         }
  59:     }
  60: 
  61:     static function expiry() {
  62:         /**
  63:          * Un-publishes pages/news whose expiration date has been reached
  64:          *
  65:          */
  66:         $sql = ' WHERE `date`<="' . date('Y-m-d H:i:s') . '" AND `show`="1"' .
  67:                         ' AND `expiredate`<="' . date('Y-m-d H:i:s') . '"' .
  68:                         ' AND `expiredate`!="0000-00-00 00:00:00"' .
  69:                         ' AND `expiredate` IS NOT NULL';
  70:         foreach (array('news' => 'ZenpageNews', 'pages' => 'ZenpagePage') as $table => $class) {
  71:             $result = query_full_array('SELECT * FROM ' . prefix($table) . $sql);
  72:             if ($result) {
  73:                 foreach ($result as $item) {
  74:                     $obj = new $class($item['titlelink']);
  75:                     $obj->setShow(0);
  76:                     $obj->save();
  77:                 }
  78:             }
  79:         }
  80:     }
  81: 
  82:     /**
  83:      * Provides the complete category structure regardless of permissions.
  84:      * This is needed for quick checking of status of a category and is used only internally to the Zenpage core.
  85:      * @return array
  86:      */
  87:     private function getCategoryStructure() {
  88:         return $this->categoryStructure;
  89:     }
  90: 
  91:     /*   * ********************************* */
  92:     /* general page functions   */
  93:     /*   * ********************************* */
  94: 
  95:     function visibleCategory($cat) {
  96:         return $this->categoryStructure[$cat['cat_id']]['show'];
  97:     }
  98: 
  99:     /**
 100:      * Gets all pages or published ones.
 101:      *
 102:      * NOTE: Since this function only returns titlelinks for use with the object model it does not exclude pages that are password protected
 103:      *
 104:      * @param bool $published TRUE for published or FALSE for all pages including un-published
 105:      * @param bool $toplevel TRUE for only the toplevel pages
 106:      * @param int $number number of pages to get (NULL by default for all)
 107:      * @param string $sorttype NULL for the standard order as sorted on the backend, "title", "date", "id", "popular", "mostrated", "toprated", "random"
 108:      * @param string $sortdirection false for ascenting, true for descending
 109:      * @return array
 110:      */
 111:     function getPages($published = NULL, $toplevel = false, $number = NULL, $sorttype = NULL, $sortdirection = NULL) {
 112:         global $_zp_loggedin;
 113:         if (is_null($sortdirection)) {
 114:             $sortdirection = $this->getSortDirection('pages');
 115:         }
 116:         if (is_null($sorttype)) {
 117:             $sorttype = $this->getSortType('pages');
 118:         }
 119:         if (is_null($published)) {
 120:             $published = !zp_loggedin();
 121:             $all = zp_loggedin(MANAGE_ALL_PAGES_RIGHTS);
 122:         } else {
 123:             $all = !$published;
 124:         }
 125:         $gettop = '';
 126:         if ($published) {
 127:             if ($toplevel)
 128:                 $gettop = " AND parentid IS NULL";
 129:             $show = " WHERE `show` = 1 AND date <= '" . date('Y-m-d H:i:s') . "'" . $gettop;
 130:         } else {
 131:             if ($toplevel)
 132:                 $gettop = " WHERE parentid IS NULL";
 133:             $show = $gettop;
 134:         }
 135:         if ($sortdirection) {
 136:             $sortdir = ' DESC';
 137:         } else {
 138:             $sortdir = ' ASC';
 139:         }
 140:         switch ($sorttype) {
 141:             case 'date':
 142:                 $sortorder = 'date';
 143:                 break;
 144:             case 'lastchange':
 145:                 $sortorder = 'lastchange';
 146:                 break;
 147:             case 'title':
 148:                 $sortorder = 'title';
 149:                 break;
 150:             case 'id':
 151:                 $sortorder = 'id';
 152:                 break;
 153:             case 'popular':
 154:                 $sortorder = 'hitcounter';
 155:                 break;
 156:             case 'mostrated':
 157:                 $sortorder = 'total_votes';
 158:                 break;
 159:             case 'toprated':
 160:                 if (empty($sortdir))
 161:                     $sortdir = ' DESC';
 162:                 $sortorder = '(total_value/total_votes) ' . $sortdir . ', total_value';
 163:                 break;
 164:             case 'random':
 165:                 $sortorder = 'RAND()';
 166:                 $sortdir = '';
 167:                 break;
 168:             default:
 169:                 $sortorder = 'sort_order';
 170:                 break;
 171:         }
 172:         $all_pages = array(); // Disabled cache var for now because it does not return un-publishded and published if logged on index.php somehow if logged in.
 173:         $result = query('SELECT * FROM ' . prefix('pages') . $show . ' ORDER by `' . $sortorder . '`' . $sortdir);
 174:         if ($result) {
 175:             while ($row = db_fetch_assoc($result)) {
 176:                 if ($all || $row['show']) {
 177:                     $all_pages[] = $row;
 178:                 } else if ($_zp_loggedin) {
 179:                     $page = new ZenpagePage($row['titlelink']);
 180:                     if ($page->isMyItem(LIST_RIGHTS)) {
 181:                         $all_pages[] = $row;
 182:                         if ($number && count($result) >= $number) {
 183:                             break;
 184:                         }
 185:                     }
 186:                 }
 187:             }
 188:             db_free_result($result);
 189:         }
 190:         return $all_pages;
 191:     }
 192: 
 193:  /**
 194:    * Returns a list of Zenpage page IDs that the current viewer is not allowed to see
 195:    * Helper function to be used with getAllTagsUnique() and getAllTagsCount()
 196:    * Note if the Zenpage plugin is not enabled but items exists this returns no IDs so you need an extra check afterwards!
 197:    *
 198:    * @return array
 199:    */
 200:   function getNotViewablePages() {
 201:     global $_zp_not_viewable_pages_list;
 202:     if (zp_loggedin(ADMIN_RIGHTS | ALL_PAGES_RIGHTS)) {
 203:       return array(); //admins can see all
 204:     }
 205:     if (is_null($_zp_not_viewable_pages_list)) {
 206:       $items = $this->getPages(true, false, NULL, NULL, NULL);
 207:       if (!is_null($items)) {
 208:         $_zp_not_viewable_pages_list = array();
 209:         foreach ($items as $item) {
 210:           $obj = new ZenpageNews($item['titlelink']);
 211:           if (!$obj->isProtected()) {
 212:             $_zp_not_viewable_pages_list[] = $obj->getID();
 213:           }
 214:         }
 215:       }
 216:     }
 217:     return $_zp_not_viewable_pages_list;
 218:   }
 219: 
 220:     /*   * ********************************* */
 221:     /* general news article functions   */
 222:     /*   * ********************************* */
 223: 
 224:     /**
 225:      * Gets all news articles titlelink.
 226:      *
 227:      * NOTE: Since this function only returns titlelinks for use with the object model it does not exclude articles that are password protected via a category
 228:      *
 229:      *
 230:      * @param int $articles_per_page The number of articles to get
 231:      * @param string $published "published" for an published articles,
 232:      *                                                  "unpublished" for an unpublised articles,
 233:      *                                                  "published-unpublished" for published articles only from an unpublished category,
 234:      *                                                  "sticky" for sticky articles (published or not!) for admin page use only,
 235:      *                                                  "all" for all articles
 236:      * @param boolean $ignorepagination Since also used for the news loop this function automatically paginates the results if the "page" GET variable is set. To avoid this behaviour if using it directly to get articles set this TRUE (default FALSE)
 237:      * @param string $sortorder "date" (default), "title", "id, "popular", "mostrated", "toprated", "random"
 238:      *                                                  This parameter is not used for date archives
 239:      * @param bool $sortdirection TRUE for descending, FALSE for ascending. Note: This parameter is not used for date archives
 240:      * @param bool $sticky set to true to place "sticky" articles at the front of the list.
 241:      * @return array
 242:      */
 243:     function getArticles($articles_per_page = 0, $published = NULL, $ignorepagination = false, $sortorder = NULL, $sortdirection = NULL, $sticky = NULL, $category = NULL) {
 244:         global $_zp_current_category, $_zp_post_date, $_zp_newsCache;
 245:         if (empty($published)) {
 246:             if (zp_loggedin(ALL_NEWS_RIGHTS) || ($category && $category->isMyItem(ALL_NEWS_RIGHTS))) {
 247:                 $published = "all";
 248:             } else {
 249:                 $published = "published";
 250:             }
 251:         }
 252:         if ($category) {
 253:             $sortObj = $category;
 254:         } else {
 255:             $sortObj = $this;
 256:         }
 257:         if (is_null($sticky)) {
 258:             $sticky = $sortObj->getSortSticky();
 259:         }
 260: 
 261:         if (is_null($sortdirection)) {
 262:             $sortdirection = $sortObj->getSortDirection('news');
 263:         }
 264:         if (is_null($sortorder)) {
 265:             $sortorder = $sortObj->getSortType('news');
 266:         }
 267:     $newsCacheIndex = "$sortorder-$sortdirection-$published-" . (bool) $sticky;
 268:     if ($category) {
 269:             $newsCacheIndex .= '-' . $category->getTitlelink();
 270:         }
 271:         if (isset($_zp_newsCache[$newsCacheIndex])) {
 272:             $result = $_zp_newsCache[$newsCacheIndex];
 273:         } else {
 274:             $show = $currentcategory = false;
 275:             if ($category) {
 276:                 if (is_object($_zp_current_category)) {
 277:                     $currentcategory = $_zp_current_category->getTitlelink();
 278:                 }
 279:                 $showConjunction = ' AND ';
 280:                 // new code to get nested cats
 281:                 $catid = $category->getID();
 282:                 $subcats = $category->getSubCategories();
 283:                 if ($subcats) {
 284:                     $cat = " (cat.cat_id = '" . $catid . "'";
 285:                     foreach ($subcats as $subcat) {
 286:                         $subcatobj = new ZenpageCategory($subcat);
 287:                         $cat .= "OR cat.cat_id = '" . $subcatobj->getID() . "' ";
 288:                     }
 289:                     $cat .= ") AND cat.news_id = news.id ";
 290:                 } else {
 291:                     $cat = " cat.cat_id = '" . $catid . "' AND cat.news_id = news.id ";
 292:                 }
 293:             } else {
 294:                 $showConjunction = ' WHERE ';
 295:             }
 296: 
 297:             if ($sticky) {
 298:                 $sticky = 'sticky DESC,';
 299:             }
 300:             if ($sortdirection) {
 301:                 $dir = " DESC";
 302:             } else {
 303:                 $dir = " ASC";
 304:             }
 305:             // sortorder and sortdirection (only used for all news articles and categories naturally)
 306:             switch ($sortorder) {
 307:                 case "date":
 308:                 default:
 309:                     $sort1 = "date" . $dir;
 310:                     break;
 311:                 case 'lastchange':
 312:                     $sort1 = 'lastchange' . $dir;
 313:                     break;
 314:                 case "id":
 315:                     $sort1 = "id" . $dir;
 316:                     break;
 317:                 case "title":
 318:                     $sort1 = "title" . $dir;
 319:                     break;
 320:                 case "popular":
 321:                     $sort1 = 'hitcounter' . $dir;
 322:                     break;
 323:                 case "mostrated":
 324:                     $sort1 = 'total_votes' . $dir;
 325:                     break;
 326:                 case "toprated":
 327:                     $sort1 = '(total_value/total_votes) DESC, total_value';
 328:                     break;
 329:                 case "random":
 330:                     $sort1 = 'RAND()';
 331:                     break;
 332:             }
 333: 
 334:             /** get all articles * */
 335:             switch ($published) {
 336:                 case "published":
 337:                     $show = "$showConjunction `show` = 1 AND date <= '" . date('Y-m-d H:i:s') . "'";
 338:                     $getUnpublished = false;
 339:                     break;
 340:                 case "published-unpublished":
 341:                     $show = "$showConjunction `show` = 1 AND date <= '" . date('Y-m-d H:i:s') . "'";
 342:                     $getUnpublished = true;
 343:                     break;
 344:                 case "unpublished":
 345:                     $show = "$showConjunction `show` = 0 AND date <= '" . date('Y-m-d H:i:s') . "'";
 346:                     $getUnpublished = true;
 347:                     break;
 348:                 case 'sticky':
 349:                     $show = "$showConjunction `sticky` <> 0";
 350:                     $getUnpublished = true;
 351:                     break;
 352:                 case "all":
 353:                     $getUnpublished = true;
 354:                     $show = false;
 355:                     break;
 356:             }
 357:             $order = " ORDER BY $sticky";
 358: 
 359:             if (in_context(ZP_ZENPAGE_NEWS_DATE)) {
 360:                 $datesearch = '';
 361:                 switch ($published) {
 362:                     case "published":
 363:                         $datesearch = "date LIKE '$_zp_post_date%' ";
 364:                         break;
 365:                     case "unpublished":
 366:                         $datesearch = "date LIKE '$_zp_post_date%' ";
 367:                         break;
 368:                     case "all":
 369:                         $datesearch = "date LIKE '$_zp_post_date%' ";
 370:                         break;
 371:                 }
 372:                 if ($datesearch) {
 373:                     if ($show) {
 374:                         $datesearch = ' AND ' . $datesearch;
 375:                     } else {
 376:                         $datesearch = ' WHERE ' . $datesearch;
 377:                     }
 378:                 }
 379:                 $order .= " date DESC";
 380:             } else {
 381:                 $datesearch = "";
 382:                 if ($category) {
 383:                     $order .= ' news.';
 384:                 } else {
 385:                     $order .= ' ';
 386:                 }
 387:                 $order .= $sort1;
 388:             }
 389:             if ($category) {
 390:                 $sql = "SELECT DISTINCT news.date, news.title, news.titlelink, news.sticky FROM " . prefix('news') . " as news, " . prefix('news2cat') . " as cat WHERE" . $cat . $show . $order;
 391:             } else {
 392:                 $sql = "SELECT date, title, titlelink, sticky FROM " . prefix('news') . $show . $datesearch . " " . $order;
 393:             }
 394:             $resource = query($sql);
 395:             $result = array();
 396:             if ($resource) {
 397:                 while ($item = db_fetch_assoc($resource)) {
 398:                     $article = new ZenpageNews($item['titlelink']);
 399:                     if ($getUnpublished || $article->isMyItem(LIST_RIGHTS) || $currentcategory && ($article->inNewsCategory($currentcategory)) || $article->categoryIsVisible()) {
 400:                         $result[] = $item;
 401:                     }
 402:                 }
 403:                 db_free_result($resource);
 404:                 if ($sortorder == 'title') { // multi-lingual field!
 405:                     $result = sortByMultilingual($result, 'title', $sortdirection);
 406:                     if ($sticky) {
 407:                         $stickyItems = array();
 408:                         foreach ($result as $key => $element) {
 409:                             if ($element['sticky']) {
 410:                                 array_unshift($stickyItems, $element);
 411:                                 unset($result[$key]);
 412:                             }
 413:                         }
 414:                         $stickyItems = sortMultiArray($stickyItems, 'sticky', true);
 415:                         $result = array_merge($stickyItems, $result);
 416:                     }
 417:                 }
 418:             }
 419:             $_zp_newsCache[$newsCacheIndex] = $result;
 420:         }
 421: 
 422:         if ($articles_per_page) {
 423:             if ($ignorepagination) {
 424:                 $offset = 0;
 425:             } else {
 426:                 $offset = self::getOffset($articles_per_page);
 427:             }
 428:             $result = array_slice($result, $offset, $articles_per_page);
 429:         }
 430:         return $result;
 431:     }
 432: 
 433:  /**
 434:    * Returns a list of Zenpage news article IDs that the current viewer is not allowed to see
 435:    * Helper function to be used with getAllTagsUnique() and getAllTagsCount() or db queries only
 436:    * Note if the Zenpage plugin is not enabled but items exists this returns no IDs so you need an extra check afterwards!
 437:    *
 438:    * @return array
 439:    */
 440:   function getNotViewableNews() {
 441:     global $_zp_not_viewable_news_list;
 442:     if (zp_loggedin(ADMIN_RIGHTS | ALL_NEWS_RIGHTS)) {
 443:       return array(); //admins can see all
 444:     }
 445:     if (is_null($_zp_not_viewable_news_list)) {
 446:       $items = $this->getArticles(0, 'published', true, NULL, NULL, NULL, NULL);
 447:       if (!is_null($items)) {
 448:         $_zp_not_viewable_news_list = array();
 449:         foreach ($items as $item) {
 450:           $obj = new ZenpageNews($item['titlelink']);
 451:           if ($obj->isProtected()) {
 452:             $_zp_not_viewable_news_list[] = $obj->getID();
 453:           }
 454:         }
 455:       }
 456:     }
 457:     return $_zp_not_viewable_news_list;
 458:   }
 459: 
 460:   /**
 461:      * Returns an article from the album based on the index passed.
 462:      *
 463:      * @param int $index
 464:      * @return int
 465:      */
 466:     function getArticle($index, $published = NULL, $sortorder = NULL, $sortdirection = NULL, $sticky = true) {
 467:         $articles = $this->getArticles(0, NULL, true, $sortorder, $sortdirection, $sticky);
 468:         if ($index >= 0 && $index < count($articles)) {
 469:             $article = $articles[$index];
 470:             $obj = new ZenpageNews($articles[$index]['titlelink']);
 471:             return $obj;
 472:         }
 473:         return false;
 474:     }
 475: 
 476:     /**
 477:      * Gets the LIMIT and OFFSET for the query that gets the news articles
 478:      *
 479:      * @param int $articles_per_page The number of articles to get
 480:      * @param bool $ignorepagination If pagination should be ingored so always with the first is started (false is default)
 481:      * @return string
 482:      */
 483:     static function getOffset($articles_per_page, $ignorepagination = false) {
 484:         global $_zp_page, $subpage;
 485:         if (OFFSET_PATH) {
 486:             $page = $subpage + 1;
 487:         } else {
 488:             $page = $_zp_page;
 489:         }
 490:         if ($ignorepagination || is_null($page)) { //   maybe from a feed since this means that $_zp_page is not set
 491:             $offset = 0;
 492:         } else {
 493:             $offset = ($page - 1) * $articles_per_page;
 494:         }
 495:         return $offset;
 496:     }
 497: 
 498:     /**
 499:      * Returns the articles count
 500:      * @deprecated since version 1.4.6
 501:      *
 502:      */
 503:     function getTotalArticles() {
 504:         global $_zp_current_category;
 505:         if (empty($_zp_current_category)) {
 506:             if (isset($_GET['category'])) {
 507:                 $cat = sanitize($_GET['category']);
 508:                 $catobj = new ZenpageCategory($cat);
 509:             } else {
 510:                 return count($this->getArticles(0));
 511:             }
 512:         } else {
 513:             $catobj = $_zp_current_category;
 514:         }
 515:         return count($catobj->getArticles());
 516:     }
 517: 
 518:     /**
 519:      * Retrieves a list of all unique years & months
 520:      * @param bool $yearsonly If set to true only the years' count is returned (Default false)
 521:      * @param string $order 'desc' (default) or 'asc' for descending or ascending
 522:      * @return array
 523:      */
 524:     function getAllArticleDates($yearsonly = false, $order = 'desc') {
 525:         $alldates = array();
 526:         $cleandates = array();
 527:         $sql = "SELECT date FROM " . prefix('news');
 528:         if (!zp_loggedin(MANAGE_ALL_NEWS_RIGHTS)) {
 529:             $sql .= " WHERE `show` = 1";
 530:         }
 531:         $result = query_full_array($sql);
 532:         foreach ($result as $row) {
 533:             $alldates[] = $row['date'];
 534:         }
 535:         foreach ($alldates as $adate) {
 536:             if (!empty($adate)) {
 537:                 if ($yearsonly) {
 538:                     $cleandates[] = substr($adate, 0, 4);
 539:                 } else {
 540:                     $cleandates[] = substr($adate, 0, 7) . "-01";
 541:                 }
 542:             }
 543:         }
 544:         $datecount = array_count_values($cleandates);
 545:         switch ($order) {
 546:             case 'desc':
 547:             default:
 548:                 krsort($datecount);
 549:                 break;
 550:             case 'asc':
 551:                 ksort($datecount);
 552:                 break;
 553:         }
 554:         return $datecount;
 555:     }
 556: 
 557:     /**
 558:      *
 559:      * filters query results for only news that should be shown. (that is fit to print?)
 560:      * @param $sql query to return all candidates of interest
 561:      * @param $offset skip this many legitimate items (used for pagination)
 562:      * @param $limit return only this many items
 563:      */
 564:     private function siftResults($sql, $offset, $limit) {
 565:         $resource = $result = query($sql);
 566:         if ($resource) {
 567:             $result = array();
 568:             while ($item = db_fetch_assoc($resource)) {
 569:                 if ($item['type'] == 'news') {
 570:                     $article = new ZenpageNews($item['titlelink']);
 571:                     if (!$article->categoryIsVisible()) {
 572:                         continue;
 573:                     }
 574:                 }
 575:                 $offset--;
 576:                 if ($offset < 0) {
 577:                     $result[] = $item;
 578:                     if ($limit && count($result) >= $limit) {
 579:                         break;
 580:                     }
 581:                 }
 582:             }
 583:             db_free_result($resource);
 584:         }
 585:         return $result;
 586:     }
 587: 
 588:     /**
 589:      * Gets news articles and images of a gallery to show them together on the news section
 590:      *
 591:      * NOTE: This function does not exclude articles that are password protected via a category
 592:      *
 593:      * @param int $articles_per_page The number of articles to get
 594:      * @param string $mode  "latestimages-thumbnail"
 595:      *                                          "latestimages-thumbnail-customcrop"
 596:      *                                          "latestimages-sizedimage"
 597:      *                                          "latestalbums-thumbnail"
 598:      *                                          "latestalbums-thumbnail-customcrop"
 599:      *                                          "latestalbums-sizedimage"
 600:      *                                          "latestimagesbyalbum-thumbnail"
 601:      *                                          "latestimagesbyalbum-thumbnail-customcrop"
 602:      *                                          "latestimagesbyalbum-sizedimage"
 603:      *                                          "latestupdatedalbums-thumbnail" (for RSS and getLatestNews() used only)
 604:      *                                          "latestupdatedalbums-thumbnail-customcrop" (for RSS and getLatestNews() used only)
 605:      *                                          "latestupdatedalbums-sizedimage" (for RSS and getLatestNews() used only)
 606:      *  NOTE: The "latestupdatedalbums" variants do NOT support pagination as required on the news loop!
 607:      *
 608:      * @param string $published "published" for published articles,
 609:      *                                                  "unpublished" for un-published articles,
 610:      *                                                  "all" for all articles
 611:      * @param string $sortorder     id, date or mtime, only for latestimages-... modes
 612:      * @param bool $sticky set to true to place "sticky" articles at the front of the list.
 613:      * @param string $direction     "desc" or "asc"
 614:      * @return array
 615:      * @deprecated since version 1.4.6
 616:      */
 617:     protected function getCombiNews($articles_per_page = '', $mode = '', $published = NULL, $sortorder = NULL, $sticky = true, $sortdirection = 'desc') {
 618:         global $_zp_combiNews_cache, $_zp_gallery;
 619: 
 620:         if (is_null($published)) {
 621:             if (zp_loggedin(ZENPAGE_NEWS_RIGHTS | ALL_NEWS_RIGHTS)) {
 622:                 $published = "all";
 623:             } else {
 624:                 $published = "published";
 625:             }
 626:         }
 627: 
 628:         if (empty($mode)) {
 629:             $mode = getOption('zenpage_combinews_mode');
 630:         }
 631: 
 632:         if (isset($_zp_combiNews_cache[$published . $mode . $sticky . $sortorder . $sortdirection])) {
 633:             return $_zp_combiNews_cache[$published . $mode . $sticky . $sortorder . $sortdirection];
 634:         }
 635: 
 636:         if ($published == "published") {
 637:             $show = " WHERE `show` = 1 AND date <= '" . date('Y-m-d H:i:s') . "'";
 638:             $imagesshow = " AND images.show = 1 ";
 639:         } else {
 640:             $show = "";
 641:             $imagesshow = "";
 642:         }
 643:         getAllAccessibleAlbums($_zp_gallery, $albumlist, false);
 644:         if (empty($albumlist)) {
 645:             $albumWhere = 'albums.`id` is NULL';
 646:         } else {
 647:             $albumWhere = 'albums.`id` in (' . implode(',', $albumlist) . ')';
 648:         }
 649:         if ($articles_per_page) {
 650:             $offset = self::getOffset($articles_per_page);
 651:         } else {
 652:             $offset = 0;
 653:         }
 654:         if (empty($sortorder)) {
 655:             $combinews_sortorder = getOption("zenpage_combinews_sortorder");
 656:         } else {
 657:             $combinews_sortorder = $sortorder;
 658:         }
 659:         $stickyorder = '';
 660:         if ($sticky) {
 661:             $stickyorder = 'sticky DESC,';
 662:         }
 663:         switch (strtolower($sortdirection)) {
 664:             case 'desc':
 665:             default:
 666:                 $sortdir = 'DESC';
 667:                 break;
 668:             case 'asc':
 669:                 $sortdir = 'ASC';
 670:                 break;
 671:         }
 672:         $type3 = query("SET @type3:='0'");
 673:         switch ($mode) {
 674:             case "latestimages-thumbnail":
 675:             case "latestimages-thumbnail-customcrop":
 676:             case "latestimages-sizedimage":
 677:             case "latestimages-sizedimage-maxspace":
 678:             case "latestimages-fullimage":
 679:                 $albumWhere = ' AND ' . $albumWhere;
 680:                 $sortorder = $combinews_sortorder;
 681:                 $type1 = query("SET @type1:='news'");
 682:                 $type2 = query("SET @type2:='images'");
 683:                 switch ($combinews_sortorder) {
 684:                     case 'id':
 685:                     case 'date':
 686:                         $imagequery = "(SELECT albums.folder, images.filename, images.date, @type2, @type3 as sticky FROM " . prefix('images') . " AS images, " . prefix('albums') . " AS albums
 687:                             WHERE albums.id = images.albumid " . $imagesshow . $albumWhere . ")";
 688:                         break;
 689:                     case 'publishdate':
 690:                         $imagequery = "(SELECT albums.folder, images.filename, IFNULL(images.publishdate,images.date), @type2, @type3 as sticky FROM " . prefix('images') . " AS images, " . prefix('albums') . " AS albums
 691:                                                     WHERE albums.id = images.albumid " . $imagesshow . $albumWhere . ")";
 692:                     case 'mtime':
 693:                         $imagequery = "(SELECT albums.folder, images.filename, FROM_UNIXTIME(images.mtime), @type2, @type3 as sticky FROM " . prefix('images') . " AS images, " . prefix('albums') . " AS albums
 694:                             WHERE albums.id = images.albumid " . $imagesshow . $albumWhere . ")";
 695:                         break;
 696:                 }
 697:                 $result = $this->siftResults("(SELECT title as albumname, titlelink, date, @type1 as type, sticky FROM " . prefix('news') . " " . $show . ")
 698:                                                                         UNION
 699:                                                                         " . $imagequery . "
 700:                                                                         ORDER BY $stickyorder date " . $sortdir, $offset, $articles_per_page);
 701:                 break;
 702:             case "latestalbums-thumbnail":
 703:             case "latestalbums-thumbnail-customcrop":
 704:             case "latestalbums-sizedimage":
 705:             case "latestalbums-sizedimage-maxspace":
 706:             case "latestalbums-fullimage":
 707:             default:
 708:                 if (empty($show)) {
 709:                     $albumWhere = ' WHERE ' . $albumWhere;
 710:                 } else {
 711:                     $albumWhere = ' AND ' . $albumWhere;
 712:                 }
 713:                 $sortorder = $combinews_sortorder;
 714:                 $type1 = query("SET @type1:='news'");
 715:                 $type2 = query("SET @type2:='albums'");
 716:                 switch ($combinews_sortorder) {
 717:                     case 'id':
 718:                     case 'date':
 719:                         $albumquery = "(SELECT albums.folder, albums.title, albums.date, @type2, @type3 as sticky FROM " . prefix('albums') . " AS albums
 720:                             " . $show . $albumWhere . ")";
 721:                         break;
 722:                     case 'publishdate':
 723:                         $albumquery = "(SELECT albums.folder, albums.title, IFNULL(albums.publishdate,albums.date), @type2, @type3 as sticky FROM " . prefix('albums') . " AS albums
 724:                                                     " . $show . $albumWhere . ")";
 725:                         break;
 726:                     case 'mtime':
 727:                     default:
 728:                         $albumquery = "(SELECT albums.folder, albums.title, FROM_UNIXTIME(albums.mtime), @type2, @type3 as sticky FROM " . prefix('albums') . " AS albums
 729:                             " . $show . $albumWhere . ")";
 730:                         break;
 731:                 }
 732:                 $result = $this->siftResults("(SELECT title as albumname, titlelink, date, @type1 as type, sticky FROM " . prefix('news') . " " . $show . ")
 733:                                                                         UNION
 734:                                                                         " . $albumquery . "
 735:                                                                         ORDER BY $stickyorder date " . $sortdir, $offset, $articles_per_page);
 736:                 break;
 737:             case "latestimagesbyalbum-thumbnail":
 738:             case "latestimagesbyalbum-thumbnail-customcrop":
 739:             case "latestimagesbyalbum-sizedimage":
 740:             case "latestimagesbyalbum-sizedimage-maxspace":
 741:             case "latestimagesbyalbum-fullimage":
 742:                 $albumWhere = ' AND ' . $albumWhere;
 743:                 $type1 = query("SET @type1:='news'");
 744:                 $type2 = query("SET @type2:='albums'");
 745:                 if (empty($combinews_sortorder) || $combinews_sortorder != "date" || $combinews_sortorder != "mtime" || $combinews_sortorder != "publishdate") {
 746:                     $combinews_sortorder = "date";
 747:                 }
 748:                 $sortorder = "images." . $combinews_sortorder;
 749:                 switch ($combinews_sortorder) {
 750:                     case "date":
 751:                         $imagequery = "(SELECT DISTINCT DATE_FORMAT(" . $sortorder . ",'%Y-%m-%d'), albums.folder, DATE_FORMAT(images.date,'%Y-%m-%d'), @type2, @type3 as sticky FROM " . prefix('images') . " AS images, " . prefix('albums') . " AS albums
 752:                                                         WHERE albums.id = images.albumid " . $imagesshow . $albumWhere . ")";
 753:                         break;
 754:                     case "mtime":
 755:                         $imagequery = "(SELECT DISTINCT FROM_UNIXTIME(" . $sortorder . ",'%Y-%m-%d'), albums.folder, DATE_FORMAT(images.mtime,'%Y-%m-%d'), @type2, @type3 as sticky FROM " . prefix('images') . " AS images, " . prefix('albums') . " AS albums
 756:                                                         WHERE albums.id = images.albumid " . $imagesshow . $albumWhere . ")";
 757:                     case "publishdate":
 758:                         $imagequery = "(SELECT DISTINCT FROM_UNIXTIME(" . $sortorder . ",'%Y-%m-%d'), albums.folder, DATE_FORMAT(images.publishdate,'%Y-%m-%d'), @type2, @type3 as sticky FROM " . prefix('images') . " AS images, " . prefix('albums') . " AS albums
 759:                                                                                 WHERE albums.id = images.albumid " . $imagesshow . $albumWhere . ")";
 760:                         break;
 761:                 }
 762:                 $result = $this->siftResults("(SELECT title as albumname, titlelink, date, @type1 as type, sticky FROM " . prefix('news') . " " . $show . ")
 763:                                                                         UNION
 764:                                                                         " . $imagequery . "
 765:                                                                         ORDER By $stickyorder date " . $sortdir, $offset, $articles_per_page);
 766:                 break;
 767:             case "latestupdatedalbums-thumbnail":
 768:             case "latestupdatedalbums-thumbnail-customcrop":
 769:             case "latestupdatedalbums-sizedimage":
 770:             case "latestupdatedalbums-sizedimage-maxspace":
 771:             case "latestupdatedalbums-fullimage":
 772:                 $latest = $this->getArticles($articles_per_page, NULL, true, 'date', $sortdirection);
 773:                 $counter = '';
 774:                 foreach ($latest as $news) {
 775:                     $article = new ZenpageNews($news['titlelink']);
 776:                     if ($article->checkAccess()) {
 777:                         $counter++;
 778:                         $latestnews[$counter] = array(
 779:                                         "albumname"  => $article->getTitle(),
 780:                                         "titlelink"  => $article->getTitlelink(),
 781:                                         "date"           => $article->getDateTime(),
 782:                                         "type"           => "news",
 783:                         );
 784:                     }
 785:                 }
 786:                 $albums = getAlbumStatistic($articles_per_page, "latestupdated", '', $sortdirection);
 787:                 $latestalbums = array();
 788:                 $counter = "";
 789:                 foreach ($albums as $album) {
 790:                     $counter++;
 791:                     $tempalbum = $album;
 792:                     $tempalbumthumb = $tempalbum->getAlbumThumbImage();
 793:                     $timestamp = $tempalbum->get('mtime');
 794:                     if ($timestamp == 0) {
 795:                         $albumdate = $tempalbum->getDateTime();
 796:                     } else {
 797:                         $albumdate = strftime('%Y-%m-%d %H:%M:%S', $timestamp);
 798:                     }
 799:                     $latestalbums[$counter] = array(
 800:                                     "albumname"  => $tempalbum->getFileName(),
 801:                                     "titlelink"  => $tempalbum->getTitle(),
 802:                                     "date"           => $albumdate,
 803:                                     "type"           => 'albums',
 804:                     );
 805:                 }
 806:                 //$latestalbums = array_merge($latestalbums, $item);
 807:                 $latest = array_merge($latestnews, $latestalbums);
 808:                 $result = sortMultiArray($latest, "date", $sortdirection != 'asc');
 809:                 if (count($result) > $articles_per_page) {
 810:                     $result = array_slice($result, 0, $articles_per_page);
 811:                 }
 812:                 break;
 813:         }
 814:         $_zp_combiNews_cache[$published . $mode . $sticky . $sortorder . $sortdirection] = $result;
 815:         return $result;
 816:     }
 817: 
 818:     /**
 819:      * Returns the full path of the news index page (news page 1) or if the "news on zp index" option is set a link to the gallery index.
 820:      *
 821:      * @return string
 822:      */
 823:     function getNewsIndexURL() {
 824:         Zenpage_internal_deprecations::getNewsIndexURL();
 825:         return getNewsIndexURL();
 826:     }
 827: 
 828:     /**
 829:      * Returns partial path of news category
 830:      *
 831:      * @return string
 832:      * @deprecated since version 1.4.6
 833:      */
 834:     function getNewsCategoryPath($category, $page = NULL) {
 835:         Zenpage_internal_deprecations::getNewsCategoryPath();
 836:         $rewrite = '/' . _CATEGORY_ . '/' . $category;
 837:         $plain = "/index.php?p=news&category=$category";
 838:         if ($page > 1) {
 839:             $rewrite .='/' . $page;
 840:             $plain .= '&page=' . $page;
 841:         }
 842:         return rewrite_path($rewrite, $plain); //deprecated
 843:     }
 844: 
 845:     /**
 846:      * Returns partial path of news date archive
 847:      *
 848:      * @return string
 849:      * @deprecated since version 1.4.6
 850:      */
 851:     function getNewsArchivePath($date, $page = NULL) {
 852:         Zenpage_internal_deprecations::getNewsArchivePath();
 853:         return getNewsArchivePath($date, $page);
 854:     }
 855: 
 856:     /**
 857:      * Returns partial path of news article title
 858:      *
 859:      * @return string
 860:      * @deprecated since version 1.4.6
 861:      */
 862:     function getNewsTitlePath($title) {
 863:         Zenpage_internal_deprecations::getNewsTitlePath();
 864:         return rewrite_path(_NEWS_ . "/$title", "/index.php?p=news&title=$title"); //deprecated
 865:     }
 866: 
 867:     /*   * ********************************* */
 868:     /* general news category functions  */
 869:     /*   * ********************************* */
 870: 
 871:     /**
 872:      * Gets the category link of a category
 873:      *
 874:      * @param string $catname the title of the category
 875:      * @return string
 876:      * @deprecated since version 1.4.6
 877:      */
 878:     function getCategoryLink($catname) {
 879:         Zenpage_internal_deprecations::getCategoryLink();
 880:         foreach ($this->getAllCategories(false) as $cat) {
 881:             if ($cat['titlelink'] == $catname) {
 882:                 return $cat['title'];
 883:             }
 884:         }
 885:     }
 886: 
 887:     /**
 888:      * Gets a category titlelink by id
 889:      *
 890:      * @param int $id id of the category
 891:      * @return array
 892:      */
 893:     function getCategory($id) {
 894:         foreach ($this->getAllCategories(false) as $cat) {
 895:             if ($cat['id'] == $id) {
 896:                 return $cat;
 897:             }
 898:         }
 899:         return '';
 900:     }
 901: 
 902:     /**
 903:      * Gets all categories
 904:      * @param bool $visible TRUE for published and unprotected
 905:      * @param string $sorttype NULL for the standard order as sorted on the backend, "title", "id", "popular", "random"
 906:      * @param bool $sortdirection TRUE for ascending or FALSE for descending order
 907:      * @return array
 908:      */
 909:     function getAllCategories($visible = true, $sorttype = NULL, $sortdirection = NULL) {
 910:         $structure = $this->getCategoryStructure();
 911:         if (is_null($sortdirection))
 912:             $sortdirection = $this->sortdirection;
 913: 
 914:         switch ($sorttype) {
 915:             case "id":
 916:                 $sortorder = "id";
 917:                 break;
 918:             case "title":
 919:                 $sortorder = "title";
 920:                 break;
 921:             case "popular":
 922:                 $sortorder = 'hitcounter';
 923:                 break;
 924:             case "random":
 925:                 $sortorder = 'random';
 926:                 break;
 927:             default:
 928:                 $sortorder = "sort_order";
 929:                 break;
 930:         }
 931:         if ($visible) {
 932:             foreach ($structure as $key => $cat) {
 933:                 $catobj = new ZenpageCategory($cat['titlelink']);
 934:                 if ($catobj->getShow() || $catobj->isMyItem(LIST_RIGHTS)) {
 935:                     $structure[$key]['show'] = 1;
 936:                 } else {
 937:                     unset($structure[$key]);
 938:                 }
 939:             }
 940:         }
 941:         if (!is_null($sorttype) || !is_null($sortdirection)) {
 942:             if ($sorttype == 'random') {
 943:                 shuffle($structure);
 944:             } else {
 945:      //sortMultiArray descending = true
 946:      if($sortdirection) {
 947:        $sortdir = false;
 948:      } else {
 949:        $sortdir = true;
 950:      }
 951:                 $structure = sortMultiArray($structure, $sortorder, $sortdir, true, false, false);
 952:             }
 953:         }
 954:         return $structure;
 955:     }
 956: 
 957:     /**
 958:      *
 959:      * "Magic" function to return a string identifying the object when it is treated as a string
 960:      * @return string
 961:      */
 962:     public function __toString() {
 963:         return 'Zenpage';
 964:     }
 965: 
 966:     function getSortDirection($what = 'news') {
 967:         if ($what == 'pages') {
 968:             return $this->page_sortdirection;
 969:         } else {
 970:             return $this->sortdirection;
 971:         }
 972:     }
 973: 
 974:     function setSortDirection($value, $what = 'news') {
 975:         if ($what == 'pages') {
 976:             $this->page_sortdirection = (int) ($value && true);
 977:         } else {
 978:             $this->sortdirection = (int) ($value && true);
 979:         }
 980:     }
 981: 
 982:     function getSortType($what = 'news') {
 983:         if ($what == 'pages') {
 984:             return $this->page_sortorder;
 985:         } else {
 986:             return $this->sortorder;
 987:         }
 988:     }
 989: 
 990:     function setSortType($value, $what = 'news') {
 991:         if ($what == 'pages') {
 992:             $this->page_sortorder = $value;
 993:         } else {
 994:             $this->sortorder = $value;
 995:         }
 996:     }
 997: 
 998:     function getSortSticky() {
 999:         return $this->sortSticky;
1000:     }
1001: 
1002:     function setSortSticky($value) {
1003:         $this->sortSticky = (bool) $value;
1004:     }
1005: 
1006: }
1007: 
1008: // ZenpageCMS
1009: 
1010: /**
1011:  *
1012:  * Base class from which all Zenpage classes derive
1013:  *
1014:  */
1015: class ZenpageRoot extends ThemeObject {
1016: 
1017:     protected $sortorder;
1018:     protected $sortdirection;
1019:     protected $sortSticky = true;
1020: 
1021:     /**
1022:      * Returns the perma link status (only used on admin)
1023:      *
1024:      * @return string
1025:      */
1026:     function getPermalink() {
1027:         return $this->get("permalink");
1028:     }
1029: 
1030:     /*   * '
1031:      * sets the permalink
1032:      */
1033: 
1034:     function setPermalink($v) {
1035:         $this->set('permalink', $v);
1036:     }
1037: 
1038:     /**
1039:      * Returns the titlelink
1040:      *
1041:      * @return string
1042:      */
1043:     function getTitlelink() {
1044:         return $this->get("titlelink");
1045:     }
1046: 
1047:     /**
1048:      * sets the title link
1049:      * @param $v
1050:      */
1051:     function setTitlelink($v) {
1052:         $this->set("titlelink", $v);
1053:     }
1054: 
1055: }
1056: 
1057: // Zenpage main class end
1058: 
1059: /**
1060:  *
1061:  * Base class from which Zenpage news articles and pages derive
1062:  *
1063:  */
1064: class ZenpageItems extends ZenpageRoot {
1065: 
1066:     /**
1067:      * Class instantiator
1068:      */
1069:     function __construct() {
1070:         // no action required
1071:     }
1072: 
1073:     /**
1074:      * Returns the author
1075:      *
1076:      * @return string
1077:      */
1078:     function getAuthor() {
1079:         return $this->get("author");
1080:     }
1081: 
1082:     /**
1083:      *
1084:      * sets the author attribute
1085: 
1086:      */
1087:     function setAuthor($a) {
1088:         $this->set("author", $a);
1089:     }
1090: 
1091:     /**
1092:      * Returns the content
1093:      *
1094:      * @return string
1095:      */
1096:     function getContent($locale = NULL) {
1097:         $text = $this->get("content");
1098:         if ($locale == 'all') {
1099:             return zpFunctions::unTagURLs($text);
1100:         } else {
1101:             return applyMacros(zpFunctions::unTagURLs(get_language_string($text, $locale)));
1102:         }
1103:     }
1104: 
1105:     /**
1106:      *
1107:      * Set the content datum
1108:      * @param $c full language string
1109:      */
1110:     function setContent($c) {
1111:         $c = zpFunctions::tagURLs($c);
1112:         $this->set("content", $c);
1113:     }
1114: 
1115:     /**
1116:      * Returns the last change date
1117:      *
1118:      * @return string
1119:      */
1120:     function getLastchange() {
1121:         return $this->get("lastchange");
1122:     }
1123: 
1124:     /**
1125:      *
1126:      * sets the last change date
1127:      */
1128:     function setLastchange($d) {
1129:         if ($d) {
1130:             $newtime = dateTimeConvert($d);
1131:             if ($newtime === false)
1132:                 return;
1133:             $this->set('lastchange', $newtime);
1134:         } else {
1135:             $this->set('lastchange', NULL);
1136:         }
1137:     }
1138: 
1139:     /**
1140:      * Returns the last change author
1141:      *
1142:      * @return string
1143:      */
1144:     function getLastchangeAuthor() {
1145:         return $this->get("lastchangeauthor");
1146:     }
1147: 
1148:     /**
1149:      *
1150:      * stores the last change author
1151:      */
1152:     function setLastchangeAuthor($a) {
1153:         $this->set("lastchangeauthor", $a);
1154:     }
1155: 
1156:     /**
1157:      * Returns the locked status , "1" if locked (only used on the admin)
1158:      *
1159:      * @return string
1160:      */
1161:     function getLocked() {
1162:         return $this->get("locked");
1163:     }
1164: 
1165:     /**
1166:      * sets the locked status , "1" if locked (only used on the admin)
1167:      *
1168:      */
1169:     function setLocked($l) {
1170:         $this->set("locked", $l);
1171:     }
1172: 
1173:     /**
1174:      * Returns the extra content
1175:      *
1176:      * @return string
1177:      */
1178:     function getExtraContent($locale = NULL) {
1179:         $text = $this->get("extracontent");
1180:         if ($locale == 'all') {
1181:             return zpFunctions::unTagURLs($text);
1182:         } else {
1183:             return applyMacros(zpFunctions::unTagURLs(get_language_string($text, $locale)));
1184:         }
1185:     }
1186: 
1187:     /**
1188:      * sets the extra content
1189:      *
1190:      */
1191:     function setExtraContent($ec) {
1192:         $this->set("extracontent", zpFunctions::tagURLs($ec));
1193:     }
1194: 
1195:     /**
1196:      * Returns the expire date
1197:      *
1198:      * @return string
1199:      */
1200:     function getExpireDate() {
1201:         $dt = $this->get("expiredate");
1202:         if ($dt == '0000-00-00 00:00:00') {
1203:             return NULL;
1204:         } else {
1205:             return $dt;
1206:         }
1207:     }
1208: 
1209:     /**
1210:      * sets the expire date
1211:      *
1212:      */
1213:     function setExpireDate($ed) {
1214:         if ($ed) {
1215:             $newtime = dateTimeConvert($ed);
1216:             if ($newtime === false)
1217:                 return;
1218:             $this->set('expiredate', $newtime);
1219:         } else {
1220:             $this->set('expiredate', NULL);
1221:         }
1222:     }
1223: 
1224: }
1225: 
1226: ?>
Zenphoto doc API documentation generated by ApiGen