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:  * Generates individually sitemap.org compatible XML files for use with Google and other search engines.
   5:  * It supports albums and images as well as optionally Zenpage pages, news articles and news categories.
   6:  * Sitemaps need to be generated via the button on the admin overview page and are cached as static
   7:  * files in the <var>/%STATIC_CACHE_FOLDER%/sitemap/</var> folder.
   8:  * Individual sitemaps are generated for all of the above item types as well as a sitemapindex file.
   9:  * Album sitemaps are split into individual sitemaps per album (incl. all albums pages) and image sitemaps
  10:  * into individual sitemaps per album.
  11:  *
  12:  * The sitemapindex file can be referenced via <var>www.yourdomain.com/zenphoto/index.php?sitemap</var> or
  13:  * with modrewrite <var>www.yourdomain.com/zenphoto/?sitemap</var>.
  14:  *
  15:  * <b>IMPORTANT:</b> A multilingual sitemap requires the <var>dynamic-locale</var> plugin and either the <var>seo_locale</var> plugin or <i>language subdomains</i>.
  16:  *
  17:  * @author Malte Müller (acrylian) based on the plugin by Jeppe Toustrup (Tenzer) http://github.com/Tenzer/zenphoto-sitemap and on contributions by timo, Blue Dragonfly and Francois Marechal (frankm)
  18:  * @package plugins
  19:  * @subpackage seo
  20:  */
  21: $plugin_is_filter = 0 | CLASS_PLUGIN;
  22: $plugin_description = gettext('Generates sitemap.org compatible XML files for use with Google and other search engines.');
  23: $plugin_notice = gettext('<strong>Note:</strong> The index links may not match if using the Zenpage option "news on index" that some themes provide! Also it does not "know" about "custom pages" outside Zenpage or any special custom theme setup!!');
  24: $plugin_author = 'Malte Müller (acrylian)';
  25: 
  26: $option_interface = 'sitemap';
  27: 
  28: zp_register_filter('admin_utilities_buttons', 'sitemap::button');
  29: 
  30: $sitemapfolder = SERVERPATH . '/' . STATIC_CACHE_FOLDER . '/sitemap';
  31: if (!file_exists($sitemapfolder)) {
  32:     if (!mkdir_recursive($sitemapfolder, FOLDER_MOD)) {
  33:         die(gettext("sitemap cache folder could not be created. Please try to create it manually via FTP with chmod 0777."));
  34:     }
  35: }
  36: 
  37: define('SITEMAP_CHUNK', getOption('sitemap_processing_chunk'));
  38: define('GOOGLE_SITEMAP', getOption('sitemap_google'));
  39: if (getOption('multi_lingual') && defined('LOCALE_TYPE')) {
  40:     define('SITEMAP_LOCALE_TYPE', LOCALE_TYPE);
  41: } else {
  42:     define('SITEMAP_LOCALE_TYPE', 0);
  43: }
  44: 
  45: /**
  46:  * Plugin option handling class
  47:  *
  48:  */
  49: class sitemap {
  50: 
  51:     var $startmtime;
  52:     var $disable = false; // manual disable caching a page
  53: 
  54:     function __construct() {
  55:         setOptionDefault('sitemap_changefreq_index', 'daily');
  56:         setOptionDefault('sitemap_changefreq_albums', 'daily');
  57:         setOptionDefault('sitemap_changefreq_images', 'daily');
  58:         setOptionDefault('sitemap_changefreq_pages', 'weekly');
  59:         setOptionDefault('sitemap_changefreq_newsindex', 'daily');
  60:         setOptionDefault('sitemap_changefreq_news', 'daily');
  61:         setOptionDefault('sitemap_changefreq_newscats', 'weekly');
  62:         setOptionDefault('sitemap_lastmod_albums', 'mtime');
  63:         setOptionDefault('sitemap_lastmod_images', 'mtime');
  64:         setOptionDefault('sitemap_processing_chunk', 25);
  65:         setOptionDefault('sitemap_galleryindex', '');
  66:         setOptionDefault('sitemap_google', 0);
  67:         setOptionDefault('sitemap_google_fullimage', 0);
  68:     }
  69: 
  70:     function getOptionsSupported() {
  71:         global $_common_locale_type;
  72:         $localdesc = '<p>' . gettext('If checked links to the alternative languages will be in the form <code><em>language</em>.domain</code> where <code><em>language</em></code> is the language code, e.g. <code><em>fr</em></code> for French.') . '</p>';
  73:         if (!$_common_locale_type) {
  74:             $localdesc .= '<p>' . gettext('This requires that you have created the appropriate subdomains pointing to your Zenphoto installation. That is <code>fr.mydomain.com/zenphoto/</code> must point to the same location as <code>mydomain.com/zenphoto/</code>. (Some providers will automatically redirect undefined subdomains to the main domain. If your provider does this, no subdomain creation is needed.)') . '</p>';
  75:         }
  76:         $options = array(
  77:                         gettext('Gallery index page')                                                    => array('key'                  => 'sitemap_galleryindex', 'type'               => OPTION_TYPE_TEXTBOX,
  78:                                         'order'              => 11,
  79:                                         'multilingual' => false,
  80:                                         'desc'               => gettext('If your theme does not use the theme index.php page as the gallery index, enter the name of the page here. In the Zenpage theme for example this could be gallery.php. In that case you enter "gallery". If this is not empty the index.php sitemap is not generated.')),
  81:                         gettext('Album date')                                                                    => array('key'              => 'sitemap_lastmod_albums', 'type'             => OPTION_TYPE_SELECTOR,
  82:                                         'order'          => 0,
  83:                                         'selections' => array(gettext("date")    => "date",
  84:                                                         gettext("mtime") => "mtime"),
  85:                                         'desc'           => gettext('Field to use for the last modification date of albums.')),
  86:                         gettext('Image date')                                                                    => array('key'              => 'sitemap_lastmod_images', 'type'             => OPTION_TYPE_SELECTOR,
  87:                                         'order'          => 1,
  88:                                         'selections' => array(gettext("date")    => "date",
  89:                                                         gettext("mtime") => "mtime"),
  90:                                         'desc'           => gettext('Field to use for the last modification date of images.')),
  91:                         gettext('Change frequency - Zenphoto index')                     => array('key'              => 'sitemap_changefreq_index', 'type'           => OPTION_TYPE_SELECTOR,
  92:                                         'order'          => 2,
  93:                                         'selections' => array(gettext("always")  => "always",
  94:                                                         gettext("hourly")    => "hourly",
  95:                                                         gettext("daily")     => "daily",
  96:                                                         gettext("weekly")    => "weekly",
  97:                                                         gettext("monthly") => "monthly",
  98:                                                         gettext("yearly")    => "yearly",
  99:                                                         gettext("never")     => "never"),
 100:                                         'desc'           => ''),
 101:                         gettext('Change frequency - albums')                                     => array('key'              => 'sitemap_changefreq_albums', 'type'          => OPTION_TYPE_SELECTOR,
 102:                                         'order'          => 3,
 103:                                         'selections' => array(gettext("always")  => "always",
 104:                                                         gettext("hourly")    => "hourly",
 105:                                                         gettext("daily")     => "daily",
 106:                                                         gettext("weekly")    => "weekly",
 107:                                                         gettext("monthly") => "monthly",
 108:                                                         gettext("yearly")    => "yearly",
 109:                                                         gettext("never")     => "never"),
 110:                                         'desc'           => ''),
 111:                         gettext('Change frequency - images')                                     => array('key'              => 'sitemap_changefreq_images', 'type'          => OPTION_TYPE_SELECTOR,
 112:                                         'order'          => 4,
 113:                                         'selections' => array(gettext("always")  => "always",
 114:                                                         gettext("hourly")    => "hourly",
 115:                                                         gettext("daily")     => "daily",
 116:                                                         gettext("weekly")    => "weekly",
 117:                                                         gettext("monthly") => "monthly",
 118:                                                         gettext("yearly")    => "yearly",
 119:                                                         gettext("never")     => "never"),
 120:                                         'desc'           => ''),
 121:                         gettext('Change frequency - Zenpage pages')                      => array('key'              => 'sitemap_changefreq_pages', 'type'           => OPTION_TYPE_SELECTOR,
 122:                                         'order'          => 5,
 123:                                         'selections' => array(gettext("always")  => "always",
 124:                                                         gettext("hourly")    => "hourly",
 125:                                                         gettext("daily")     => "daily",
 126:                                                         gettext("weekly")    => "weekly",
 127:                                                         gettext("monthly") => "monthly",
 128:                                                         gettext("yearly")    => "yearly",
 129:                                                         gettext("never")     => "never"),
 130:                                         'desc'           => ''),
 131:                         gettext('Change frequency - Zenpage news index')             => array('key'              => 'sitemap_changefreq_newsindex', 'type'           => OPTION_TYPE_SELECTOR,
 132:                                         'order'          => 6,
 133:                                         'selections' => array(gettext("always")  => "always",
 134:                                                         gettext("hourly")    => "hourly",
 135:                                                         gettext("daily")     => "daily",
 136:                                                         gettext("weekly")    => "weekly",
 137:                                                         gettext("monthly") => "monthly",
 138:                                                         gettext("yearly")    => "yearly",
 139:                                                         gettext("never")     => "never"),
 140:                                         'desc'           => ''),
 141:                         gettext('Change frequency: Zenpage news articles')       => array('key'              => 'sitemap_changefreq_news', 'type'            => OPTION_TYPE_SELECTOR,
 142:                                         'order'          => 7,
 143:                                         'selections' => array(gettext("always")  => "always",
 144:                                                         gettext("hourly")    => "hourly",
 145:                                                         gettext("daily")     => "daily",
 146:                                                         gettext("weekly")    => "weekly",
 147:                                                         gettext("monthly") => "monthly",
 148:                                                         gettext("yearly")    => "yearly",
 149:                                                         gettext("never")     => "never"),
 150:                                         'desc'           => ''),
 151:                         gettext('Change frequency - Zenpage news categories')    => array('key'              => 'sitemap_changefreq_newscats', 'type'            => OPTION_TYPE_SELECTOR,
 152:                                         'order'          => 8,
 153:                                         'selections' => array(gettext("always")  => "always",
 154:                                                         gettext("hourly")    => "hourly",
 155:                                                         gettext("daily")     => "daily",
 156:                                                         gettext("weekly")    => "weekly",
 157:                                                         gettext("monthly") => "monthly",
 158:                                                         gettext("yearly")    => "yearly",
 159:                                                         gettext("never")     => "never"),
 160:                                         'desc'           => ''),
 161:                         gettext('Enable Google image and video extension')       => array('key'      => 'sitemap_google', 'type'     => OPTION_TYPE_CHECKBOX,
 162:                                         'order'  => 9,
 163:                                         'desc'   => gettext('If checked, the XML output file will be formatted using the Google XML image and video extensions where applicable.') . '<p class="notebox">' . gettext('<strong>Note:</strong> Other search engines (Yahoo, Bing) might not be able to read your sitemap. Also the Google extensions cover only image and video formats. If you use custom file types that are not covered by Zenphoto standard plugins or types like .mp3, .txt and .html you should probably not use this or modify the plugin. Also, if your site is really huge think about if you really need this setting as the creation may cause extra workload of your server and result in timeouts') . '</p>'),
 164:                         gettext('Google image and video extension: Link full image ')        => array('key'      => 'sitemap_google_fullimage', 'type'   => OPTION_TYPE_CHECKBOX,
 165:                                         'order'  => 10,
 166:                                         'desc'   => gettext('If checked, the original full image is referenced instead of the sized images in the cache. For image formats only.')),
 167:                         gettext('Google - URL to image license')                             => array('key'                  => 'sitemap_license', 'type'                => OPTION_TYPE_TEXTBOX,
 168:                                         'order'              => 12,
 169:                                         'multilingual' => true,
 170:                                         'desc'               => gettext('Optional. Used only if the Google extension is checked. Must be an absolute URL address of the form: http://mydomain.com/license.html')),
 171:                         gettext('Sitemap processing chunk')                                      => array('key'      => 'sitemap_processing_chunk', 'type'   => OPTION_TYPE_TEXTBOX,
 172:                                         'order'  => 13,
 173:                                         'desc'   => gettext('The number of albums that will be processed for each sitemap file. Lower this value if you get script timeouts when creating the files.')),
 174:                         gettext('Use subdomains') . '*'                                              => array('key'          => 'dynamic_locale_subdomain', 'type'       => OPTION_TYPE_CHECKBOX,
 175:                                         'order'      => 14,
 176:                                         'disabled' => $_common_locale_type,
 177:                                         'desc'       => $localdesc)
 178:         );
 179:         if ($_common_locale_type) {
 180:             $options['note'] = array('key'       => 'sitemap_locale_type', 'type'    => OPTION_TYPE_NOTE,
 181:                             'order'  => 15,
 182:                             'desc'   => '<p class="notebox">' . $_common_locale_type . '</p>');
 183:         } else {
 184:             $_common_locale_type = gettext('* This option may be set via the <a href="javascript:gotoName(\'sitemap-extended\');"><em>sitemap-extended</em></a> plugin options.');
 185:             $options['note'] = array('key'       => 'sitemap_locale_type',
 186:                             'type'   => OPTION_TYPE_NOTE,
 187:                             'order'  => 16,
 188:                             'desc'   => gettext('<p class="notebox">*<strong>Note:</strong> The setting of this option is shared with other plugins.</p>'));
 189:         }
 190:         return $options;
 191:     }
 192: 
 193:     function handleOption($option, $currentValue) {
 194: 
 195:     }
 196: 
 197:     /**
 198:      * creates the Utilities button to purge the static sitemap cache
 199:      * @param array $buttons
 200:      * @return array
 201:      */
 202:     static function button($buttons) {
 203:         $buttons[] = array(
 204:                         'category'       => gettext('Seo'),
 205:                         'enable'             => true,
 206:                         'button_text'    => gettext('Sitemap tools'),
 207:                         'formname'       => 'sitemap_button',
 208:                         'action'             => PLUGIN_FOLDER . '/sitemap-extended/sitemap-extended-admin.php',
 209:                         'icon'               => 'images/cache.png',
 210:                         'title'              => gettext('Generate or purge sitemap cache files.'),
 211:                         'alt'                    => '',
 212:                         'hidden'             => '',
 213:                         'rights'             => ADMIN_RIGHTS
 214:         );
 215:         return $buttons;
 216:     }
 217: 
 218: }
 219: 
 220: if (isset($_GET['sitemap'])) {
 221:     $sitemappath = SERVERPATH . '/' . STATIC_CACHE_FOLDER . '/sitemap/sitemapindex.xml';
 222:     if (file_exists($sitemappath)) {
 223:         $sitemapfile = file_get_contents($sitemappath);
 224:         echo $sitemapfile;
 225:     }
 226:     exitZP();
 227: }
 228: 
 229: /**
 230:  * Simple helper function which simply outputs a string and ends it of with a new-line.
 231:  * @param  string $string text string
 232:  * @return string
 233:  */
 234: function sitemap_echonl($string) {
 235:     return $string . "\n";
 236: }
 237: 
 238: /**
 239:  * Generates a sitemap file.
 240:  *
 241:  * @param string $filename How the file should be named. ".xml" is appended automatically
 242:  * @param string $data The actual sitemap data as generated by the appropiate functions
 243:  */
 244: function generateSitemapCacheFile($filename, $data) {
 245:     if (!empty($data)) {
 246:         $filepath = SERVERPATH . '/' . STATIC_CACHE_FOLDER . '/sitemap/' . $filename . '.xml';
 247:         $handler = fopen($filepath, 'w');
 248:         fwrite($handler, $data);
 249:         fclose($handler);
 250:         echo '<li>' . $filename . '</li>';
 251:     }
 252: }
 253: 
 254: /**
 255:  * Generates the sitemap index file that points to the individual sitemaps from the content of the sitemap cache.
 256:  * It is always named "sitemapindex.xml"
 257:  */
 258: function generateSitemapIndexCacheFile() {
 259:     $data = '';
 260:     $cachefolder = SERVERPATH . '/' . STATIC_CACHE_FOLDER . '/sitemap/';
 261:     $dirs = array_diff(scandir($cachefolder), array('.', '..', '.DS_Store', 'Thumbs.db', '.htaccess', '.svn'));
 262:     if ($dirs) {
 263:         $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
 264:         $data .= sitemap_echonl('<sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
 265:         foreach ($dirs as $dir) {
 266:             $data .= sitemap_echonl("\t<sitemap>");
 267:             $data .= sitemap_echonl("\t\t<loc>" . FULLWEBPATH . '/' . STATIC_CACHE_FOLDER . '/sitemap/' . $dir . '</loc>');
 268:             $data .= sitemap_echonl("\t\t<lastmod>" . sitemap_getISO8601Date() . '</lastmod>');
 269:             $data .= sitemap_echonl("\t</sitemap>");
 270:         }
 271:         $data .= sitemap_echonl('</sitemapindex>');
 272:         $filepath = SERVERPATH . '/' . STATIC_CACHE_FOLDER . '/sitemap/sitemapindex.xml';
 273:         $handler = fopen($filepath, 'w');
 274:         fwrite($handler, $data);
 275:         fclose($handler);
 276:         echo '<p>sitemapindex.xml created.</p>';
 277:     }
 278: }
 279: 
 280: /**
 281:  * Checks the changefreq value if entered manually and makes sure it is only one of the supported regarding sitemap.org
 282:  * @param  string $changefreq One of the supported changefrequence values regarding sitemap.org. Default is empty or wrong is "daily".
 283:  * @return string
 284:  */
 285: function sitemap_getChangefreq($changefreq = '') {
 286:     $changefreq = sanitize($changefreq);
 287:     switch ($changefreq) {
 288:         case 'always':
 289:         case 'hourly':
 290:         case 'daily':
 291:         case 'weekly':
 292:         case 'monthly':
 293:         case 'yearly':
 294:         case 'never':
 295:             $changefreq = $changefreq;
 296:             break;
 297:         default:
 298:             $changefreq = 'daily';
 299:             break;
 300:     }
 301:     return $changefreq;
 302: }
 303: 
 304: /**
 305:  * Gets the dateformat for images and albums only.
 306:  * @param object $obj image or album object
 307:  * @param  string $option "date" or "mtime". If "mtime" is discovered to be not set, the date values is taken instead so we don't get 1970-01-10 dates
 308:  * @return string
 309:  */
 310: function sitemap_getDateformat($obj, $option) {
 311:     $date = '';
 312:     switch ($option) {
 313:         case 'date':
 314:         default:
 315:             $date = $obj->getDatetime();
 316:             break;
 317:         case 'mtime':
 318:             $timestamp = $obj->get('mtime');
 319:             if ($timestamp == 0) {
 320:                 $date = $obj->getDatetime();
 321:             } else {
 322:                 return gmstrftime('%Y-%m-%dT%H:%M:%SZ', $timestamp);
 323:                 // For more streamlined but PHP5-only equivalent, remove the above line and uncomment the following:
 324:                 // return gmstrftime(DATE_ISO8601, $timestamp);
 325:             }
 326:             break;
 327:     }
 328:     return sitemap_getISO8601Date($date);
 329:     // For more streamlined but PHP5-only equivalent, remove the above line and uncomment the following:
 330:     // return gmstrftime(DATE_ISO8601, strtotime($date));
 331: }
 332: 
 333: /**
 334:  * Gets the limit and offset for the db queries for sitemap splitting.
 335:  * @param  int $items_per_sitemap Number of items per sitemap
 336:  * @return string
 337:  */
 338: function sitemap_getDBLimit($items_per_sitemap = 2) {
 339:     global $sitemap_number;
 340:     if ($sitemap_number < 1) {
 341:         $sitemap_number = 1;
 342:     }
 343:     $offset = ($sitemap_number - 1) * $items_per_sitemap;
 344:     $limit = " LIMIT " . $offset . "," . $items_per_sitemap;
 345:     return $limit;
 346: }
 347: 
 348: /* * TODO index links are not splitted into several sitemaps yet
 349:  *
 350:  * Gets the links to the index of a Zenphoto gallery incl. index pagination
 351:  *
 352:  * @return string
 353:  */
 354: 
 355: function getSitemapIndexLinks() {
 356:     global $_zp_gallery, $sitemap_number;
 357:     $data = '';
 358:     if ($sitemap_number < 2) {
 359:         set_context(ZP_INDEX);
 360:         $albums_per_page = getOption('albums_per_page');
 361:         if (getOption('sitemap_galleryindex')) {
 362:             $galleryindex_mod = _PAGE_ . '/' . getOption('sitemap_galleryindex');
 363:             $galleryindex_nomod = 'index.php?p=' . getOption('sitemap_galleryindex') . '&amp;page=';
 364:         } else {
 365:             $galleryindex_mod = '';
 366:             $galleryindex_nomod = 'index.php?page=';
 367:         }
 368:         $toplevelpages = getTotalPages();
 369:         $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
 370:         $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
 371:         $sitemap_locales = generateLanguageList();
 372:         $changefreq = sitemap_getChangefreq(getOption('sitemap_changefreq_index'));
 373:         // normal index/homepage we need in any case always
 374:         switch (SITEMAP_LOCALE_TYPE) {
 375:             case 1:
 376:                 foreach ($sitemap_locales as $locale) {
 377:                     $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . seo_locale::localePath(true, $locale) . "/</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 378:                 }
 379:                 break;
 380:             case 2:
 381:                 foreach ($sitemap_locales as $locale) {
 382:                     $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . dynamic_locale::fullHostPath($locale) . "/</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 383:                 }
 384:                 break;
 385:             default:
 386:                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . FULLWEBPATH . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 387:                 break;
 388:         }
 389:         // the extra ones if we have a custom gallery index
 390:         if (getOption('sitemap_galleryindex')) {
 391:             switch (SITEMAP_LOCALE_TYPE) {
 392:                 case 1:
 393:                     foreach ($sitemap_locales as $locale) {
 394:                         $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . seo_locale::localePath(true, $locale) . '/' . $galleryindex_mod . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 395:                     }
 396:                     break;
 397:                 case 2:
 398:                     foreach ($sitemap_locales as $locale) {
 399:                         $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . rewrite_path(dynamic_locale::fullHostPath($locale) . '/' . $galleryindex_mod, dynamic_locale::fullHostPath($locale) . '/' . $galleryindex_nomod) . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 400:                     }
 401:                     break;
 402:                 default:
 403:                     $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . rewrite_path($galleryindex_mod, $galleryindex_nomod, FULLWEBPATH) . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 404:                     break;
 405:             }
 406:         }
 407:         // print further index pages if available
 408:         if ($toplevelpages) {
 409:             if (getOption('sitemap_galleryindex')) {
 410:                 $galleryindex_mod = $galleryindex_mod . '/';
 411:             } else {
 412:                 $galleryindex_mod = $galleryindex_mod . _PAGE_ . '/';
 413:             }
 414:             for ($x = 2; $x <= $toplevelpages; $x++) {
 415:                 switch (SITEMAP_LOCALE_TYPE) {
 416:                     case 1:
 417:                         foreach ($sitemap_locales as $locale) {
 418:                             $url = seo_locale::localePath(true, $locale) . '/' . $galleryindex_mod . $x;
 419:                             $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 420:                         }
 421:                         break;
 422:                     case 2:
 423:                         foreach ($sitemap_locales as $locale) {
 424:                             $url = rewrite_path($galleryindex_mod . $x, $galleryindex_nomod . $x, dynamic_locale::fullHostPath($locale));
 425:                             $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 426:                         }
 427:                         break;
 428:                     default:
 429:                         $url = rewrite_path($galleryindex_mod . $x, $galleryindex_nomod . $x, FULLWEBPATH);
 430:                         $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 431:                         break;
 432:                 }
 433:             }
 434:         }
 435:         $data .= sitemap_echonl('</urlset>'); // End off the <urlset> tag
 436:         restore_context();
 437:         return $data;
 438:     } // sitemap number end
 439: }
 440: 
 441: /**
 442:  *
 443:  * Enter description here ...
 444:  * @param object $obj the starting point
 445:  * @param array $albumlist the container for the results
 446:  * @param string $gateway name of validation function
 447:  */
 448: function getSitemapAlbumList($obj, &$albumlist, $gateway) {
 449:     global $_zp_gallery;
 450:     $locallist = $obj->getAlbums();
 451:     foreach ($locallist as $folder) {
 452:         $album = newAlbum($folder);
 453:         if ($album->getShow() && $gateway($album)) {
 454:             $albumlist[] = array('folder' => $album->name, 'date' => $album->getDateTime(), 'title' => $album->getTitle());
 455:             if (!$album->isDynamic()) {
 456:                 getSitemapAlbumList($album, $albumlist, $gateway);
 457:             }
 458:         }
 459:     }
 460: }
 461: 
 462: /**
 463:  * gateway check for albums (no refinement of the criteria)
 464:  * @param object $album
 465:  */
 466: function passAlbums($album) {
 467:     return true;
 468: }
 469: 
 470: /**
 471:  * gateway function for images (screens out dynamic albums and password protected albums)
 472:  * @param object $album
 473:  */
 474: function passImages($album) {
 475:     return !$album->isDynamic() && !$album->getPassword();
 476: }
 477: 
 478: /**
 479:  * Places album and all of its album pages on one sitemap
 480:  *
 481:  * Gets links to all albums incl. pagination and if the Google image video extension is enabled for images using this as well.
 482:  * This is independent from the images fetched by getSitemapImages().
 483:  *
 484:  * NOTE: Using the Google extension is currently NOT recommended if you have a huge gallery.
 485:  *
 486:  * @return string
 487:  */
 488: function getSitemapAlbums() {
 489:     global $_zp_gallery, $sitemap_number;
 490:     $data = '';
 491:     $sitemap_locales = generateLanguageList();
 492:     $albumchangefreq = getOption('sitemap_changefreq_albums');
 493:     $imagechangefreq = getOption('sitemap_changefreq_images');
 494:     $albumlastmod = getOption('sitemap_lastmod_albums');
 495:     $albumlastmod = sanitize($albumlastmod);
 496:     $imagelastmod = getOption('sitemap_lastmod_images');
 497: 
 498:     $albums = array();
 499:     getSitemapAlbumList($_zp_gallery, $albums, 'passAlbums');
 500:     $offset = ($sitemap_number - 1);
 501:     $albums = array_slice($albums, $offset, SITEMAP_CHUNK);
 502:     if (!empty($albums)) {
 503:         $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
 504:         $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
 505:         foreach ($albums as $album) {
 506:             $albumobj = newAlbum($album['folder']);
 507:             set_context(ZP_ALBUM);
 508:             makeAlbumCurrent($albumobj);
 509:             $pageCount = getTotalPages();
 510:             //$imageCount = getNumImages();
 511:             //$images = $albumobj->getImages();
 512:             $date = sitemap_getDateformat($albumobj, $albumlastmod);
 513:             switch (SITEMAP_LOCALE_TYPE) {
 514:                 case 1:
 515:                     foreach ($sitemap_locales as $locale) {
 516:                         $url = seo_locale::localePath(true, $locale) . '/' . pathurlencode($albumobj->name) . '/';
 517:                         $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
 518:                         $data .= sitemap_echonl("\t</url>");
 519:                     }
 520:                     break;
 521:                 case 2:
 522:                     foreach ($sitemap_locales as $locale) {
 523:                         $url = rewrite_path(pathurlencode($albumobj->name) . '/', '?album=' . pathurlencode($albumobj->name), dynamic_locale::fullHostPath($locale));
 524:                         $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
 525:                         $data .= sitemap_echonl("\t</url>");
 526:                     }
 527:                     break;
 528:                 default:
 529:                     $url = rewrite_path(pathurlencode($albumobj->name) . '/', '?album=' . pathurlencode($albumobj->name), FULLWEBPATH);
 530:                     $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
 531:                     $data .= sitemap_echonl("\t</url>");
 532:                     break;
 533:             }
 534:             // print album pages if avaiable
 535:             if ($pageCount > 1) {
 536:                 for ($x = 2; $x <= $pageCount; $x++) {
 537:                     switch (SITEMAP_LOCALE_TYPE) {
 538:                         case 1:
 539:                             foreach ($sitemap_locales as $locale) {
 540:                                 $url = seo_locale::localePath(true, $locale) . '/' . pathurlencode($albumobj->name) . '/' . _PAGE_ . '/' . $x . '/';
 541:                                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
 542:                                 $data .= sitemap_echonl("\t</url>");
 543:                             }
 544:                             break;
 545:                         case 2:
 546:                             foreach ($sitemap_locales as $locale) {
 547:                                 $url = rewrite_path(pathurlencode($albumobj->name) . '/' . _PAGE_ . '/' . $x . '/', '?album=' . pathurlencode($albumobj->name) . '&amp;page=' . $x, dynamic_locale::fullHostPath($locale));
 548:                                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
 549:                                 $data .= sitemap_echonl("\t</url>");
 550:                             }
 551:                             break;
 552:                         default:
 553:                             $url = rewrite_path(pathurlencode($albumobj->name) . '/' . _PAGE_ . '/' . $x . '/', '?album=' . pathurlencode($albumobj->name) . '&amp;page=' . $x, FULLWEBPATH);
 554:                             $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
 555:                             $data .= sitemap_echonl("\t</url>");
 556:                             break;
 557:                     }
 558:                 }
 559:             }
 560:         }
 561:         $data .= sitemap_echonl('</urlset>'); // End off the <urlset> tag
 562:     }
 563:     restore_context();
 564:     return $data;
 565: }
 566: 
 567: /**
 568:  * currently this splitts only sitemaps for albums and its images. Spliting the images itself requires a major rework...
 569:  *
 570:  * Gets links to all images for all albums (album by album)
 571:  *
 572:  * @return string
 573:  */
 574: function getSitemapImages() {
 575:     global $_zp_gallery, $sitemap_number;
 576:     $data = '';
 577:     $sitemap_locales = generateLanguageList();
 578:     $imagechangefreq = getOption('sitemap_changefreq_images');
 579:     $imagelastmod = getOption('sitemap_lastmod_images');
 580:     $limit = sitemap_getDBLimit(1);
 581:     $albums = array();
 582:     getSitemapAlbumList($_zp_gallery, $albums, 'passImages');
 583:     $offset = ($sitemap_number - 1);
 584:     $albums = array_slice($albums, $offset, SITEMAP_CHUNK);
 585:     if ($albums) {
 586:         $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
 587:         if (GOOGLE_SITEMAP) {
 588:             $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">');
 589:         } else {
 590:             $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
 591:         }
 592:         foreach ($albums as $album) {
 593:             @set_time_limit(120); //    Extend script timeout to allow for gathering the images.
 594:             $albumobj = newAlbum($album['folder']);
 595:             $images = $albumobj->getImages();
 596:             // print plain images links if available
 597:             if ($images) {
 598:                 foreach ($images as $image) {
 599:                     $imageobj = newImage($albumobj, $image);
 600:                     $ext = getSuffix($imageobj->filename);
 601:                     $date = sitemap_getDateformat($imageobj, $imagelastmod);
 602:                     switch (SITEMAP_LOCALE_TYPE) {
 603:                         case 1:
 604:                             foreach ($sitemap_locales as $locale) {
 605:                                 $path = seo_locale::localePath(true, $locale) . '/' . pathurlencode($albumobj->name) . '/' . urlencode($imageobj->filename) . IM_SUFFIX;
 606:                                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $path . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $imagechangefreq . "</changefreq>\n\t\t<priority>0.6</priority>\n");
 607:                                 if (GOOGLE_SITEMAP) {
 608:                                     $data .= getSitemapGoogleImageVideoExtras($albumobj, $imageobj, $locale);
 609:                                 }
 610:                                 $data .= sitemap_echonl("</url>");
 611:                             }
 612:                             break;
 613:                         case 2:
 614:                             foreach ($sitemap_locales as $locale) {
 615:                                 $path = rewrite_path(pathurlencode($albumobj->name) . '/' . urlencode($imageobj->filename) . IM_SUFFIX, '?album=' . pathurlencode($albumobj->name) . '&amp;image=' . urlencode($imageobj->filename), dynamic_locale::fullHostPath($locale));
 616:                                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $path . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $imagechangefreq . "</changefreq>\n\t\t<priority>0.6</priority>\n");
 617:                                 if (GOOGLE_SITEMAP) {
 618:                                     $data .= getSitemapGoogleImageVideoExtras($albumobj, $imageobj, $locale);
 619:                                 }
 620:                                 $data .= sitemap_echonl("</url>");
 621:                             }
 622:                             break;
 623:                         default:
 624:                             $path = rewrite_path(pathurlencode($albumobj->name) . '/' . urlencode($imageobj->filename) . IM_SUFFIX, '?album=' . pathurlencode($albumobj->name) . '&amp;image=' . urlencode($imageobj->filename), FULLWEBPATH);
 625:                             $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $path . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $imagechangefreq . "</changefreq>\n\t\t<priority>0.6</priority>\n");
 626:                             if (GOOGLE_SITEMAP) {
 627:                                 $data .= getSitemapGoogleImageVideoExtras($albumobj, $imageobj, NULL);
 628:                             }
 629:                             $data .= sitemap_echonl("</url>");
 630:                             break;
 631:                     }
 632:                 }
 633:             }
 634:         }
 635:         $data .= sitemap_echonl('</urlset>'); // End off the <urlset> tag
 636:     }
 637:     return $data;
 638: }
 639: 
 640: /**
 641:  * Helper function to get the loop index if the Google video extension is enabled
 642:  */
 643: function getSitemapGoogleLoopIndex($imageCount, $pageCount) {
 644:     if (GOOGLE_SITEMAP) {
 645:         $loop_index = array();
 646:         for ($x = 1; $x <= $pageCount; $x++) {
 647:             if ($imageCount < ($x * getOption('images_per_page'))) {
 648:                 $val = $imageCount - (($x - 1) * getOption('images_per_page'));
 649:             } else {
 650:                 $val = getOption('images_per_page');
 651:             }
 652:             array_push($loop_index, $val);
 653:         }
 654:         return $loop_index;
 655:     }
 656:     return NULL;
 657: }
 658: 
 659: /**
 660:  * Helper function to get the image/video extra entries for albums if the Google video extension is enabled
 661:  * @return string
 662:  */
 663: function getSitemapGoogleImageVideoExtras($albumobj, $imageobj, $locale) {
 664:     $data = '';
 665:     $host = PROTOCOL . '://' . html_encode($_SERVER["HTTP_HOST"]);
 666:     $ext = strtolower(strrchr($imageobj->filename, "."));
 667:     $location = '';
 668:     if ($imageobj->getLocation()) {
 669:         $location .= $imageobj->getLocation($locale) . ', ';
 670:     }
 671:     if ($imageobj->getCity()) {
 672:         $location .= $imageobj->getCity($locale) . ', ';
 673:     }
 674:     if ($imageobj->getState()) {
 675:         $location .= $imageobj->getState($locale) . ', ';
 676:     }
 677:     if ($imageobj->getCountry()) {
 678:         $location .= $imageobj->getCountry($locale);
 679:     }
 680:     $license = get_language_string(getOption('sitemap_license'), $locale);
 681:     if (isImageVideo($imageobj) && in_array($ext, array('.mpg', '.mpeg', '.mp4', '.m4v', '.mov', '.wmv', '.asf', '.avi', '.ra', '.ram', '.flv', '.swf'))) { // google says it can index these so we list them even if unsupported by Zenphoto
 682:         $data .= sitemap_echonl("\t\t<video:video>\n\t\t\t<video:thumbnail_loc>" . $host . html_encode($imageobj->getThumb()) . "</video:thumbnail_loc>\n");
 683:         $data .= sitemap_echonl("\t\t\t<video:title>" . html_encode($imageobj->getTitle($locale)) . "</video:title>");
 684:         if ($imageobj->getDesc()) {
 685:             $data .= sitemap_echonl("\t\t\t<video:description>" . html_encode(getBare($imageobj->getDesc($locale))) . "</video:description>");
 686:         }
 687:         $data .= sitemap_echonl("\t\t\t<video:content_loc>" . $host . pathurlencode($imageobj->getFullImageURL()) . "</video:content_loc>");
 688:         $data .= sitemap_echonl("\t\t</video:video>");
 689:     } else if (in_array($ext, array('.jpg', '.jpeg', '.gif', '.png'))) { // this might need to be extended!
 690:         if(getOption('sitemap_google_fullimage')) {
 691:             $imagelocation = $host . pathurlencode($imageobj->getFullImageURL());
 692:         } else {
 693:             $imagelocation = $host . html_encode($imageobj->getSizedImage(getOption('image_size')));
 694:         }
 695:         $data .= sitemap_echonl("\t\t<image:image>\n\t\t\t<image:loc>" . $imagelocation . "</image:loc>\n");
 696:         // disabled for the multilingual reasons above
 697:         $data .= sitemap_echonl("\t\t\t<image:title>" . html_encode($imageobj->getTitle($locale)) . "</image:title>");
 698:         if ($imageobj->getDesc()) {
 699:             $data .= sitemap_echonl("\t\t\t<image:caption>" . html_encode(getBare($imageobj->getDesc($locale))) . "</image:caption>");
 700:         }
 701:         if (!empty($license)) {
 702:             $data .= sitemap_echonl("\t\t\t<image:license>" . $license . "</image:license>");
 703:         }
 704:         // location is kept although the same multilingual issue applies
 705:         if (!empty($location)) {
 706:             $data .= sitemap_echonl("\t\t\t<image:geo_location>" . $location . "</image:geo_location>");
 707:         }
 708:         $data .= sitemap_echonl("\t\t</image:image>");
 709:     }
 710:     return $data;
 711: }
 712: 
 713: /**
 714:  * Gets links to all Zenpage pages
 715:  *
 716:  * @return string
 717:  */
 718: function getSitemapZenpagePages() {
 719:     global $_zp_zenpage, $sitemap_number;
 720:     //not splitted into several sitemaps yet
 721:     if ($sitemap_number == 1) {
 722:         $data = '';
 723:         $limit = sitemap_getDBLimit(2);
 724:         $sitemap_locales = generateLanguageList();
 725:         $changefreq = getOption('sitemap_changefreq_pages');
 726:         $pages = $_zp_zenpage->getPages(true);
 727:         if ($pages) {
 728:             $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
 729:             $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
 730:             foreach ($pages as $page) {
 731:                 $pageobj = new ZenpagePage($page['titlelink']);
 732:                 $date = substr($pageobj->getDatetime(), 0, 10);
 733:                 $lastchange = '';
 734:                 if (!is_null($pageobj->getLastchange()))
 735:                     $lastchange = substr($pageobj->getLastchange(), 0, 10);
 736:                 if ($date > $lastchange && !empty($lastchangedate))
 737:                     $date = $lastchange;
 738:                 if (!$pageobj->isProtected()) {
 739:                     switch (SITEMAP_LOCALE_TYPE) {
 740:                         case 1:
 741:                             foreach ($sitemap_locales as $locale) {
 742:                                 $url = seo_locale::localePath(true, $locale) . '/' . _PAGES_ . '/' . urlencode($page['titlelink']);
 743:                                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 744:                             }
 745:                             break;
 746:                         case 2:
 747:                             foreach ($sitemap_locales as $locale) {
 748:                                 $url = rewrite_path(_PAGES_ . '/' . urlencode($page['titlelink']), '?p=pages&amp;title=' . urlencode($page['titlelink']), dynamic_locale::fullHostPath($locale));
 749:                                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 750:                             }
 751:                             break;
 752:                         default:
 753:                             $url = rewrite_path(_PAGES_ . '/' . urlencode($page['titlelink']), '?p=pages&amp;title=' . urlencode($page['titlelink']), FULLWEBPATH);
 754:                             $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 755:                             break;
 756:                     }
 757:                 }
 758:             }
 759:             $data .= sitemap_echonl('</urlset>'); // End off the <urlset> tag
 760:         }
 761:         return $data;
 762:     }
 763: }
 764: 
 765: /**
 766:  * Gets links to the main Zenpage news index incl. pagination
 767:  *
 768:  * @return string
 769:  */
 770: function getSitemapZenpageNewsIndex() {
 771:     global $_zp_zenpage, $sitemap_number;
 772:     //not splitted into several sitemaps yet
 773:     if ($sitemap_number == 1) {
 774:         $data = '';
 775:         $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
 776:         $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
 777:         $sitemap_locales = generateLanguageList();
 778:         $changefreq = getOption('sitemap_changefreq_newsindex');
 779:         switch (SITEMAP_LOCALE_TYPE) {
 780:             case 1:
 781:                 foreach ($sitemap_locales as $locale) {
 782:       $url = seo_locale::localePath(true, $locale) . '/' . _NEWS_ . '/1';
 783:           $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 784:                 }
 785:                 Break;
 786:             case 2:
 787:                 foreach ($sitemap_locales as $locale) {
 788:                     $url = rewrite_path(_NEWS_ . '/1', '?p=news&amp;page=1', dynamic_locale::fullHostPath($locale));
 789:                     $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 790:                 }
 791:                 Break;
 792:             default:
 793:                 $url = rewrite_path(_NEWS_ . '/1', '?p=news&amp;page=1', FULLWEBPATH);
 794:                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 795:                 Break;
 796:         }
 797:         // getting pages for the main news loop
 798:         /* Not used anyway
 799:           if(!empty($articlesperpage)) {
 800:           $zenpage_articles_per_page = sanitize_numeric($articlesperpage);
 801:           } else {
 802:           $zenpage_articles_per_page = ZP_ARTICLES_PER_PAGE;
 803:           } */
 804:         $zenpage_articles_per_page = ZP_ARTICLES_PER_PAGE;
 805:         $newspages = ceil($_zp_zenpage->getTotalArticles() / $zenpage_articles_per_page);
 806:         if ($newspages > 1) {
 807:             for ($x = 2; $x <= $newspages; $x++) {
 808:                 switch (SITEMAP_LOCALE_TYPE) {
 809:                     case 1:
 810:                         foreach ($sitemap_locales as $locale) {
 811:                             $url = seo_locale::localePath(true, $locale) . '/' . _NEWS_ . '/' . $x;
 812:                             $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 813:                         }
 814:                         break;
 815:                     case 2:
 816:                         foreach ($sitemap_locales as $locale) {
 817:                             $url = rewrite_path(_NEWS_ . '/' . $x, '?p=news&amp;page=' . $x, dynamic_locale::fullHostPath($locale));
 818:                             $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 819:                         }
 820:                         break;
 821:                     default:
 822:                         $url = rewrite_path(_NEWS_ . '/' . $x, '?p=news&amp;page=' . $x, FULLWEBPATH);
 823:                         $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . sitemap_getISO8601Date() . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 824:                         break;
 825:                 }
 826:             }
 827:         }
 828:         $data .= sitemap_echonl('</urlset>'); // End off the <urlset> tag
 829:         return $data;
 830:     }
 831: }
 832: 
 833: /**
 834:  * Gets to the Zenpage news articles
 835:  *
 836:  * @param  string $changefreq One of the supported changefrequence values regarding sitemap.org. Default is empty or wrong is "daily".
 837:  * @return string
 838:  */
 839: function getSitemapZenpageNewsArticles() {
 840:     global $_zp_zenpage, $sitemap_number;
 841:     //not splitted into several sitemaps yet
 842:     if ($sitemap_number == 1) {
 843:         $data = '';
 844:         $sitemap_locales = generateLanguageList();
 845:         $changefreq = getOption('sitemap_changefreq_news');
 846:         $articles = $_zp_zenpage->getArticles('', 'published', true, "date", "desc");
 847:         if ($articles) {
 848:             $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
 849:             $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
 850:             foreach ($articles as $article) {
 851:                 $articleobj = new ZenpageNews($article['titlelink']);
 852:                 $date = substr($articleobj->getDatetime(), 0, 10);
 853:                 $lastchange = '';
 854:                 if (!is_null($articleobj->getLastchange()))
 855:                     $lastchange = substr($articleobj->getLastchange(), 0, 10);
 856:                 if ($date > $lastchange && !empty($lastchangedate))
 857:                     $date = $lastchange;
 858:                 if (!$articleobj->inProtectedCategory()) {
 859:                     switch (SITEMAP_LOCALE_TYPE) {
 860:                         case 1:
 861:                             foreach ($sitemap_locales as $locale) {
 862:                                 $url = seo_locale::localePath(true, $locale) . '/' . _NEWS_ . '/' . urlencode($articleobj->getTitlelink());
 863:                                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 864:                             }
 865:                             break;
 866:                         case 2:
 867:                             foreach ($sitemap_locales as $locale) {
 868:                                 $url = rewrite_path(_NEWS_ . '/' . urlencode($articleobj->getTitlelink()), '?p=news&amp;title=' . urlencode($articleobj->getTitlelink()), dynamic_locale::fullHostPath($locale));
 869:                                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 870:                             }
 871:                             break;
 872:                         default:
 873:                             $url = rewrite_path(_NEWS_ . '/' . urlencode($articleobj->getTitlelink()), '?p=news&amp;title=' . urlencode($articleobj->getTitlelink()), FULLWEBPATH);
 874:                             $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 875:                             break;
 876:                     }
 877:                 }
 878:             }
 879:             $data .= sitemap_echonl('</urlset>'); // End off the <urlset> tag
 880:         }
 881:         return $data;
 882:     }
 883: }
 884: 
 885: /**
 886:  * Gets links to Zenpage news categories incl. pagination
 887:  *
 888:  * @return string
 889:  */
 890: function getSitemapZenpageNewsCategories() {
 891:     global $_zp_zenpage, $sitemap_number;
 892:     //TODO not splitted into several sitemaps yet
 893:     if ($sitemap_number == 1) {
 894:         $data = '';
 895:         $sitemap_locales = generateLanguageList();
 896:         $changefreq = getOption('sitemap_changefreq_newscats');
 897:         $newscats = $_zp_zenpage->getAllCategories();
 898:         if ($newscats) {
 899:             $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
 900:             $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
 901:             foreach ($newscats as $newscat) {
 902:                 $catobj = new ZenpageCategory($newscat['titlelink']);
 903:                 if (!$catobj->isProtected()) {
 904:                     switch (SITEMAP_LOCALE_TYPE) {
 905:                         case 1:
 906:                             foreach ($sitemap_locales as $locale) {
 907:                                 $url = seo_locale::localePath(true, $locale) . '/' . _CATEGORY_ . '/' . urlencode($catobj->getTitlelink()) . '/1';
 908:                                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 909:                             }
 910:                             break;
 911:                         case 2:
 912:                             foreach ($sitemap_locales as $locale) {
 913:                                 $url = rewrite_path(_CATEGORY_ . '/' . urlencode($catobj->getTitlelink()) . '/1', '?p=news&amp;category=' . urlencode($catobj->getTitlelink()) . '&amp;page=1', dynamic_locale::fullHostPath($locale));
 914:                                 $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 915:                             }
 916:                             break;
 917:                         default:
 918:                             $url = rewrite_path(_CATEGORY_ . '/' . urlencode($catobj->getTitlelink()) . '/1', '?p=news&amp;category=' . urlencode($catobj->getTitlelink()) . '&amp;page=1', FULLWEBPATH);
 919:                             $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 920:                             break;
 921:                     }
 922:                     // getting pages for the categories
 923:                     /*
 924:                       if(!empty($articlesperpage)) {
 925:                       $zenpage_articles_per_page = sanitize_numeric($articlesperpage);
 926:                       } else {
 927:                       $zenpage_articles_per_page = ZP_ARTICLES_PER_PAGE;
 928:                       } */
 929:                     $zenpage_articles_per_page = ZP_ARTICLES_PER_PAGE;
 930:                     $articlecount = count($catobj->getArticles());
 931:                     $catpages = ceil($articlecount / $zenpage_articles_per_page);
 932:                     if ($catpages > 1) {
 933:                         for ($x = 2; $x <= $catpages; $x++) {
 934:                             switch (SITEMAP_LOCALE_TYPE) {
 935:                                 case 1:
 936:                                     foreach ($sitemap_locales as $locale) {
 937:                                         $url = seo_locale::localePath(true, $locale) . '/' . _CATEGORY_ . '/' . urlencode($catobj->getTitlelink()) . '/' . $x;
 938:                                         $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 939:                                     }
 940:                                     break;
 941:                                 case 2:
 942:                                     foreach ($sitemap_locales as $locale) {
 943:                                         $url = rewrite_path(_CATEGORY_ . '/' . urlencode($catobj->getTitlelink()) . '/' . $x, '?p=news&amp;category=' . urlencode($catobj->getTitlelink()) . '&amp;page=' . $x, dynamic_locale::fullHostPath($locale));
 944:                                         $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 945:                                     }
 946:                                     break;
 947:                                 default:
 948:                                     $url = rewrite_path(_CATEGORY_ . '/' . urlencode($catobj->getTitlelink()) . '/' . $x, '?p=news&amp;category=' . urlencode($catobj->getTitlelink()) . '&amp;page=' . $x, FULLWEBPATH);
 949:                                     $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<changefreq>" . $changefreq . "</changefreq>\n\t\t<priority>0.9</priority>\n\t</url>");
 950:                                     break;
 951:                             }
 952:                         }
 953:                     }
 954:                 }
 955:             }
 956:             $data .= sitemap_echonl('</urlset>'); // End off the <urlset> tag
 957:         }
 958:         return $data;
 959:     }
 960: }
 961: 
 962: /**
 963:  * Cleans out the cache folder.
 964:  *
 965:  */
 966: function clearSitemapCache() {
 967:     $cachefolder = SERVERPATH . '/' . STATIC_CACHE_FOLDER . '/sitemap/';
 968:     if (is_dir($cachefolder)) {
 969:         $handle = opendir($cachefolder);
 970:         while (false !== ($filename = readdir($handle))) {
 971:             $fullname = $cachefolder . '/' . $filename;
 972:             if (is_dir($fullname) && !(substr($filename, 0, 1) == '.')) {
 973:                 if (($filename != '.') && ($filename != '..')) {
 974:                     RSS::clearRSSCache($fullname);
 975:                     rmdir($fullname);
 976:                 }
 977:             } else {
 978:                 if (file_exists($fullname) && !(substr($filename, 0, 1) == '.')) {
 979:                     @chmod($fullname, 0777);
 980:                     unlink($fullname);
 981:                 }
 982:             }
 983:         }
 984:         closedir($handle);
 985:     }
 986: }
 987: 
 988: /**
 989:  * Returns an ISO-8601 compliant date/time string for the given date/time.
 990:  * While PHP5 can use the date format constant DATE_ISO8601, this function is designed to allow PHP4 use as well.
 991:  * Eventually it can be deprecated, by:
 992:  *   1. Replacing parameterless references to this function with date(DATE_ISO8601)
 993:  *   2. Replacing references to this function in sitemap_getDateformat as documented there
 994:  *
 995:  */
 996: function sitemap_getISO8601Date($date = '') {
 997:     if (empty($date)) {
 998:         return gmstrftime('%Y-%m-%dT%H:%M:%SZ');
 999:     } else {
1000:         return gmstrftime('%Y-%m-%dT%H:%M:%SZ', strtotime($date));
1001:     }
1002: }
1003: 
Zenphoto doc API documentation generated by ApiGen