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:  * This imports Wordpress pages, posts, categories and comments to Zenpage
  5:  * 
  6:  * NOTE: Requires MySQLi enabled as the database handler.
  7:  *
  8:  * @author Malte Müller (acrylian)
  9:  * @package plugins
 10:  * @subpackage misc
 11:  */
 12: if (defined('OFFSET_PATH')) {
 13:     $plugin_is_filter = 5 | ADMIN_PLUGIN;
 14:     $plugin_description = gettext("Import Wordpress pages, posts, categories, and comments to Zenpage.");
 15:     $plugin_author = "Malte Müller (acrylian)";
 16: 
 17: 
 18:     zp_register_filter('admin_utilities_buttons', 'wordpress_import_button');
 19: 
 20:     function wordpress_import_button($buttons) {
 21:         $buttons[] = array(
 22:                         'category'       => gettext('Admin'),
 23:                         'enable'             => true,
 24:                         'button_text'    => gettext('Wordpress Importer'),
 25:                         'formname'       => 'wordpress_import.php',
 26:                         'action'             => WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/wordpress_import.php',
 27:                         'icon'               => WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/wordpress_import/wpmini-blue.png',
 28:                         'title'              => gettext('An importer for Wordpress posts and pages to Zenpage.'),
 29:                         'alt'                    => '',
 30:                         'hidden'             => '',
 31:                         'rights'             => ADMIN_RIGHTS
 32:         );
 33:         return $buttons;
 34:     }
 35: 
 36: } else {
 37: 
 38:     define('OFFSET_PATH', 3);
 39: 
 40:     require_once(dirname(dirname(__FILE__)) . '/admin-globals.php');
 41: 
 42:     if (extensionEnabled('zenpage')) {
 43:         require_once(dirname(dirname(__FILE__)) . '/' . PLUGIN_FOLDER . '/zenpage/zenpage-admin-functions.php');
 44:     }
 45: 
 46:     admin_securityChecks(NULL, currentRelativeURL());
 47: 
 48:     if (isset($_REQUEST['dbname']) || isset($_REQUEST['dbuser']) || isset($_REQUEST['dbpass']) || isset($_REQUEST['dbhost'])) {
 49:         XSRFdefender('wordpress');
 50:     }
 51: 
 52:     $webpath = WEBPATH . '/' . ZENFOLDER . '/';
 53: 
 54:     // some extra functions
 55:     function wp_query_full_array($sql, $wpconnection) {
 56:         $result = mysqli_query($wpconnection, $sql) or die(gettext("Query failed : ") . mysqli_error($wpconnection));
 57:         if ($result) {
 58:             $allrows = array();
 59:             while ($row = mysqli_fetch_assoc($result))
 60:                 $allrows[] = $row;
 61:             return $allrows;
 62:         } else {
 63:             return false;
 64:         }
 65:     }
 66: 
 67:     function wp_prefix($tablename, $wp_prefix) {
 68:         return '`' . $wp_prefix . $tablename . '`';
 69:     }
 70: 
 71:     function wpimport_TryAgainError($message) {
 72:         return '<p class="import-error">' . $message . '<br /><a href="wordpress_import.php">' . gettext('Please try again') . '</a>
 73:         </p>';
 74:     }
 75: 
 76:     $metaURL = '';
 77:     if (isset($_REQUEST['dbname']) || isset($_REQUEST['dbuser']) || isset($_REQUEST['dbpass']) || isset($_REQUEST['dbhost'])) {
 78:         // Wordpres DB connection
 79:         $wp_dbname = sanitize($_REQUEST['dbname']);
 80:         $wp_dbbuser = sanitize($_REQUEST['dbuser']);
 81:         $wp_dbpassword = sanitize($_REQUEST['dbpass']);
 82:         $wp_dbhost = sanitize($_REQUEST['dbhost']);
 83:         $wp_prefix = addslashes(sanitize($_REQUEST['tableprefix']));
 84:         $dbinfo_incomplete = '';
 85:         $db_noconnection = '';
 86:         $db_notselected = '';
 87:         $missingmessage = '<span style="color: red">' . gettext('Missing') . '</span>';
 88:         if (empty($wp_dbname) || empty($wp_dbbuser) || empty($wp_dbpassword) || empty($wp_dbhost)) {
 89:             if (empty($wp_dbname))
 90:                 $wp_dbname = $missingmessage;
 91:             if (empty($wp_dbbuser))
 92:                 $wp_dbbuser = $missingmessage;
 93:             if (empty($wp_dbpassword))
 94:                 $wp_dbpassword = $missingmessage;
 95:             if (empty($wp_dbhost))
 96:                 $wp_dbhost = $missingmessage;
 97:         }
 98:         $dbinfo = '
 99:         <h2>' . gettext('Wordpress-Database info') . '</h2>
100:             <ul>
101:                 <li>' . gettext('Database name') . ': <strong>' . $wp_dbname . '</strong></li>
102:                 <li>' . gettext('Database user') . ': <strong>' . $wp_dbbuser . '</strong></li>
103:                 <li>' . gettext('Database password') . ': <strong>' . $wp_dbpassword . '</strong></li>
104:                 <li>' . gettext('Database host') . ': <strong>' . $wp_dbhost . '</strong></li>
105:                 <li>' . gettext('Database table prefix') . '>: <strong>' . $wp_prefix . '</strong></li>
106:             </ul>
107:             ';
108:         if (empty($wp_dbname) || empty($wp_dbbuser) || empty($wp_dbpassword) || empty($wp_dbhost)) {
109:             $dbinfo_incomplete = wpimport_TryAgainError($message);
110:         }
111:         $wpdbconnection = @mysqli_connect($wp_dbhost, $wp_dbbuser, $wp_dbpassword, $wp_dbname); // open 2nd connection to Wordpress additionally to the existing Zenphoto connection
112:         mysqli_query($wpdbconnection, "SET NAMES 'utf8'");
113:         @mysqli_query($wpdbconnection, 'SET SESSION sql_mode="";');
114:         if (!$wpdbconnection) {
115:             $db_noconnection = wpimport_TryAgainError(gettext('<strong>ERROR:</strong> Could not connect to the Wordpress database - Query failed : ') . mysqli_error($wpdbconnection));
116:         }
117:         if (!@mysqli_select_db($wpdbconnection, $wp_dbname)) {
118:             $db_notselected = wpimport_TryAgainError(gettext('<strong>ERROR:</strong> Wordpress database could not be selected - Query failed : ') . mysqli_error($wpdbconnection));
119:         }
120: 
121:         /*       * *********************************
122:          * getting all Wordpress categories
123:          * ********************************** */
124:         $catinfo = '';
125:         if (!isset($_GET['refresh'])) {
126:             $cats = wp_query_full_array("SELECT * FROM " . wp_prefix('terms', $wp_prefix) . " as terms, " . wp_prefix('term_taxonomy', $wp_prefix) . " as tax WHERE tax.taxonomy = 'category' AND terms.term_id = tax.term_id", $wpdbconnection);
127:             //echo "<li><strong>Categories</strong>: <pre>"; print_r($cats); echo "</pre></li>"; // for debugging
128:             debugLogVar('Wordpress import - All Categories', $cats);
129: 
130:             //Add categories to Zenphoto database
131:             if ($cats) {
132:                 foreach ($cats as $cat) {
133:                     $cattitlelink = $cat['slug'];
134:                     $cattitle = $_zp_UTF8->convert($cat['name']);
135:                     //$catdesc = $_zp_UTF8->convert($cat['description']);
136:                     $catdesc = $cat['description'];
137:                     if (getcheckboxState('convertlinefeeds')) {
138:                         $catdesc = nl2br($catdesc);
139:                     }
140:                     if (query("INSERT INTO " . prefix('news_categories') . " (titlelink, title, permalink) VALUES (" . db_quote($cattitlelink) . ", " . db_quote($cattitle) . ", '1')", false)) {
141:                         $catinfo .= '<li class="import-success">' . sprintf(gettext("Category <em>%s</em> added"), $cat['name']) . '</li>';
142:                     } else {
143:                         $catinfo .= '<li class="import-exists">' . sprintf(gettext("A category with the title/titlelink <em>%s</em> already exists!"), $cat['name']) . '</li>';
144:                     }
145:                 }
146:             } else {
147:                 $catinfo .= '<li class="import-nothing">' . gettext('No categories to import.') . '</li>';
148:             }
149: 
150:             /*           * *********************************
151:              * getting all Wordpress tags
152:              * ********************************** */
153:             $taginfo = '';
154:             $tags = wp_query_full_array("SELECT * FROM " . wp_prefix('terms', $wp_prefix) . " as terms, " . wp_prefix('term_taxonomy', $wp_prefix) . " as tax WHERE tax.taxonomy = 'post_tag' AND terms.term_id = tax.term_id", $wpdbconnection);
155:             //echo "<li><strong>Tags</strong>: <pre>"; print_r($tags); echo "</pre></li>"; // for debugging
156:             debugLogVar('Wordpress import - Tags import', $tags);
157: 
158:             //Add tags to Zenphoto database
159:             if ($tags) {
160:                 foreach ($tags as $tag) {
161:                     if (query("INSERT INTO " . prefix('tags') . " (name) VALUES (" . db_quote($tag['slug']) . ")", false)) {
162:                         $taginfo .= '<li class="import-success">' . sprintf(gettext("Tag <em>%s</em> added"), $tag['name']) . '</li>';
163:                     } else {
164:                         $taginfo .= '<li class="import-exists">' . sprintf(gettext("A tag with the title/titlelink <em>%s</em> already exists!"), $tag['name']) . '</li>';
165:                     }
166:                 }
167:             } else {
168:                 $taginfo .= '<li class="import-nothing">' . gettext('No tags to import.') . '</li>';
169:             }
170:         }
171:         $postinfo = '';
172:         $postcount = '';
173:         if (!isset($_GET['refresh'])) {
174:             $limit = ' LIMIT 0,10';
175:         } else {
176:             $refresh = sanitize_numeric($_GET['refresh']);
177:             $limit = ' LIMIT ' . ($refresh) . ',10';
178:             $postcount = $refresh;
179:         }
180:         /*       * *********************************
181:          * get wp posts and pages
182:          * ********************************** */
183:         $posttotal = mysqli_query($wpdbconnection, "
184:             SELECT COUNT(*)
185:             FROM " . wp_prefix('posts', $wp_prefix) . "
186:             WHERE (post_type = 'post' OR post_type = 'page') AND (post_status = 'publish' OR post_status = 'draft')
187:         ");
188:         $row = db_fetch_row($posttotal);
189:         $posttotalcount = $row[0];
190:         
191:         $posts = wp_query_full_array("
192:         SELECT
193:         id,
194:         post_title as title,
195:         post_name as titlelink,
196:         post_content as content,
197:         post_date as date,
198:         post_modified as lastchange,
199:         post_status as `show`,
200:         post_type as type
201:         FROM " . wp_prefix('posts', $wp_prefix) . "
202:         WHERE (post_type = 'post' OR post_type = 'page') AND (post_status = 'publish' OR post_status = 'draft')
203:         ORDER BY post_date DESC" . $limit, $wpdbconnection);
204:         if ($posts) {
205:             //echo "Posts<br /><pre>"; print_r($posts); echo "</pre>"; // for debugging
206:             foreach ($posts as $post) {
207:                 //echo "<li><strong>".$post['title']."</strong> (id: ".$post['id']." / type: ".$post['type']." / date: ".$post['date'].")<br />";
208:                 debugLogVar('Wordpress import - Import post: "' . $post['title'] . '" (' . $post['type'] . ')', $posts);
209:                 if ($post['show'] == "publish") {
210:                     $show = 1;
211:                 } else {
212:                     $show = 0;
213:                 }
214:                 $post['title'] = $_zp_UTF8->convert($post['title']);
215:                 $titlelink = $post['titlelink'];
216:                 $post['content'] = $_zp_UTF8->convert($post['content']);
217:                 if (getcheckboxState('convertlinefeeds')) {
218:                     $post['content'] = nl2br($post['content']);
219:                 }
220:                 $post['date'] = $post['date'];
221:                 $post['lastchange'] = $post['lastchange'];
222:                 $post['type'] = $post['type'];
223:                 switch ($post['type']) {
224:                     case 'post':
225:                         //Add the post to Zenphoto database as Zenpage article
226:                         if (query("INSERT INTO " . prefix('news') . " (title,titlelink,content,date,lastchange,`show`,permalink) VALUES (" . db_quote($post['title']) . "," . db_quote($titlelink) . "," . db_quote($post['content']) . "," . db_quote($post['date']) . "," . db_quote($post['lastchange']) . "," . $show . ",1)", false)) {
227:                             $postinfo .= '<li class="import-success">' . sprintf(gettext('%1$s <em>%2$s</em> added'), $post['type'], $post['title']);
228:                         } else {
229:                             $postinfo .= '<li class="import-exists">' . sprintf(gettext('%1$s with the title/titlelink <em>%2$s</em> already exists!'), $post['type'], $post['title']);
230:                         }
231:                         // Get new id of the article
232:                         $newarticle = new ZenpageNews($titlelink, true);
233:                         $newarticleid = $newarticle->getID();
234:                         // getting the categories and tags assigned to this post (Wordpress pages do not have tags or categories
235:                         $termrelations = wp_query_full_array("
236:                             SELECT rel.object_id, rel.term_taxonomy_id, tax.term_id, tax.taxonomy, terms.term_id, terms.name, terms.slug
237:                             FROM " . wp_prefix('term_relationships', $wp_prefix) . " as rel,
238:                             " . wp_prefix('term_taxonomy', $wp_prefix) . " as tax,
239:                             " . wp_prefix('terms', $wp_prefix) . " as terms
240:                             WHERE tax.term_taxonomy_id = rel.term_taxonomy_id
241:                             AND tax.term_id = terms.term_id
242:                             AND rel.object_id = '" . $post['id'] . "'", $wpdbconnection);
243:                         //echo "<br /><strong>Categories:</strong><pre>"; print_r($termrelations); echo "</pre>"; // for debugging
244:                         $postinfo .= "<ul>";
245:                         if ($termrelations) {
246:                             foreach ($termrelations as $term) {
247:                                 $term['name'] = $_zp_UTF8->convert($term['name']);
248:                                 $term['slug'] = $term['slug'];
249:                                 $term['taxonomy'] = $term['taxonomy'];
250:                                 switch ($term['taxonomy']) {
251:                                     case 'category':
252:                                         //Get new id of category
253:                                         $getcat = query_single_row("SELECT titlelink, title,id from " . prefix('news_categories') . " WHERE titlelink = " . db_quote($term['slug']) . " AND title = " . db_quote($term['name']));
254:                                         //Prevent double assignments
255:                                         if (query_single_row("SELECT id from " . prefix('news2cat') . " WHERE news_id = " . $newarticleid . " AND cat_id=" . $getcat['id'], false)) {
256:                                             $postinfo .= '<li class="import-exists">' . sprintf(gettext('%1$s <em>%2$s</em> already assigned'), $term['taxonomy'], $term['name']);
257:                                         } else {
258:                                             if (query("INSERT INTO " . prefix('news2cat') . " (cat_id,news_id) VALUES (" . $getcat['id'] . "," . $newarticleid . ")", false)) {
259:                                                 $postinfo .= '<li class="import-success">' . sprintf(gettext('%1$s <em>%2$s</em> assigned'), $term['taxonomy'], $term['name']);
260:                                             } else {
261:                                                 $postinfo .= '<li class="import-error">' . sprintf(gettext('%1$s <em>%2$s</em> could not be assigned!'), $term['taxonomy'], $term['name']);
262:                                             }
263:                                         }
264:                                         break;
265:                                     case 'post_tag':
266:                                         //Get new id of tag
267:                                         // only use "slug" for tags as ZP different to WP has no name (title) and slug (urlname) separately but just an urlname
268:                                         $gettag = query_single_row("SELECT name,id from " . prefix('tags') . " WHERE name = " . db_quote($term['slug']));
269:                                         //Prevent double assignments
270:                                         if (query_single_row("SELECT id from " . prefix('obj_to_tag') . " WHERE objectid = " . $newarticleid . " AND tagid =" . $gettag['id'], false)) {
271:                                             $postinfo .= '<li class="import-exists">' . sprintf(gettext('%1$s <em>%2$s</em> already assigned'), $term['taxonomy'], $term['slug']);
272:                                         } else {
273:                                             if (query("INSERT INTO " . prefix('obj_to_tag') . " (tagid,type,objectid) VALUES (" . $gettag['id'] . ",'news'," . $newarticleid . ")", false)) {
274:                                                 $postinfo .= '<li class="import-success">' . sprintf(gettext('%1$s <em>%2$s</em> assigned'), $term['taxonomy'], $term['slug']);
275:                                             } else {
276:                                                 $postinfo .= '<li class="import-error">' . sprintf(gettext('%1$s <em>%2$s</em> could not be assigned!'), $term['taxonomy'], $term['slug']);
277:                                             }
278:                                         }
279:                                         break;
280:                                 }
281:                                 //echo "<li>".sprintf(gettext('%1$s <em>%2$s</em>'),$term['taxonomy'],$term['slug'])."</li>";
282:                             }
283:                             $postinfo .= "</ul>";
284:                             debugLogVar('Wordpress import - Term relations for "' . $post['title'] . '" (' . $post['type'] . ')', $termrelations);
285:                         }
286:                         break;
287:                     case 'page':
288:                         //Add the page to Zenphoto database as Zenpage page
289:                         if (query("INSERT INTO " . prefix('pages') . " (title,titlelink,content,date,lastchange,`show`,permalink) VALUES (" . db_quote($post['title']) . "," . db_quote($titlelink) . "," . db_quote($post['content']) . "," . db_quote($post['date']) . "," . db_quote($post['lastchange']) . "," . $show . ",1)", false)) {
290:                             $postinfo .= '<li class="import-success">' . sprintf(gettext('%1$s <em>%2$s</em> added'), $post['type'], $post['title']);
291:                         } else {
292:                             $postinfo .= '<li class="import-exists">' . sprintf(gettext('%1$s with the title/titlelink <em>%2$s</em> already exists!'), $post['type'], $post['title']);
293:                         }
294:                         break;
295:                 } // switch end
296: 
297:                 /*               * ***********************************************************************
298:                  * getting comments (for each post/page indiviually so we can assign them)
299:                  * ************************************************************************ */
300:                 switch ($post['type']) {
301:                     case 'post':
302:                         $ctype = 'news';
303:                         break;
304:                     case 'page':
305:                         $ctype = 'pages';
306:                         break;
307:                 }
308:                 $comments = wp_query_full_array("
309:                             SELECT comment_post_ID, comment_author, comment_author_email, comment_author_url,comment_date, comment_content, comment_approved
310:                             FROM " . wp_prefix('comments', $wp_prefix) . "
311:                             WHERE comment_approved = 1 AND comment_post_ID = " . $post['id'], $wpdbconnection);
312:                 $commentcount = '';
313:                 $commentexists_count = '';
314:                 if ($comments) {
315:                     $postinfo .= '<ul>';
316:                     foreach ($comments as $comment) {
317:                         $comment['comment_author'] = $_zp_UTF8->convert($comment['comment_author']);
318:                         $comment['comment_author_email'] = $comment['comment_author_email'];
319:                         $comment['comment_author_url'] = $comment['comment_author_url'];
320:                         $comment['comment_date'] = $comment['comment_date'];
321:                         $comment['comment_content'] = nl2br($_zp_UTF8->convert($comment['comment_content']));
322:                         if (getcheckboxState('convertlinefeeds')) {
323:                             $comment['comment_content'] = nl2br($comment['comment_content']);
324:                         }
325:                         $comment_approved = sanitize_numeric($comment['comment_approved']);
326:                         if ($comment_approved == 1) { // in WP 1 means approved, with ZP the opposite!
327:                             $comment_approved = 0;
328:                         } else {
329:                             $comment_approved = 1;
330:                         }
331:                         //echo "commentstatus:".$comment['comment_approved'];
332:                         if (query_single_row("SELECT * from " . prefix('comments') . " WHERE ownerid =" . $newarticleid . " AND name=" . db_quote($comment['comment_author']) . " AND email =" . db_quote($comment['comment_author_email']) . " AND website =" . db_quote($comment['comment_author_url']) . " AND date =" . db_quote($comment['comment_date']) . " AND comment =" . db_quote($comment['comment_content']) . " AND inmoderation =" . $comment_approved . " AND type='" . $ctype . "'", false)) {
333:                             $commentexists_count++;
334:                         } else {
335:                             if (query("INSERT INTO " . prefix('comments') . " (ownerid,name,email,website,date,comment,inmoderation,type) VALUES (" . $newarticleid . "," . db_quote($comment['comment_author']) . "," . db_quote($comment['comment_author_email']) . "," . db_quote($comment['comment_author_url']) . "," . db_quote($comment['comment_date']) . "," . db_quote($comment['comment_content']) . "," . $comment_approved . ",'" . $ctype . "')", true)) {
336:                                 $commentcount++;
337:                             } else {
338:                                 $postinfo .= '<li class="import-error">' . gettext('Comment could not be assigned!') . '</li>';
339:                             }
340:                         }
341:                     }
342:                     if ($commentexists_count != 0) {
343:                         $postinfo .= '<li class="import-exists">' . sprintf(ngettext('%1$u comment already exists.', '%1$u comments already exist.', $commentexists_count), $commentexists_count) . '</li>';
344:                     }
345:                     if ($commentcount != 0) {
346:                         $postinfo .= '<li class="import-success">' . sprintf(ngettext('%1$u comment imported.', '%1$u comments imported.', $commentcount), $commentcount) . '</li>';
347:                     }
348:                 } else {
349:                     $postinfo .= '<ul><li class="import-nothing">' . gettext('No comments to import') . '</li>';
350:                 }
351:                 debugLogVar('Wordpress import - Comments for "' . $post['title'] . '" (' . $post['type'] . ')', $comments);
352:                 $postinfo .= '</ul></li>';
353:                 $postcount++;
354:             } // posts foreach
355:             $metaURL = 'wordpress_import.php?refresh=' . $postcount . '&amp;dbname=' . $wp_dbname . '&amp;dbuser=' . $wp_dbbuser . '&amp;dbpass=' . $wp_dbpassword . '&amp;dbhost=' . $wp_dbhost . '&amp;tableprefix=' . $wp_prefix . '&amp;convertlinefeeds=' . getcheckboxState('convertlinefeeds') . '&amp;XSRFToken=' . getXSRFToken('wordpress');
356:         } else { // if posts are available at all
357:             $metaURL = ''; // to be sure...
358:             $postinfo .= "<li class='import-nothing'>" . gettext("No posts or pages to import.") . "</li>";
359:         }
360:     } // if db data set
361:     $zenphoto_tabs['overview']['subtabs'] = array(gettext('Wordpress') => '');
362:     printAdminHeader('overview', 'wordpress');
363:     if (!empty($metaURL) && $postcount < $posttotalcount) {
364:         ?>
365:         <meta http-equiv="refresh" content="1; url=<?php echo $metaURL; ?>" />
366:         <?php
367:     }
368:     ?>
369:     <style type="text/css">
370:         .import-success {
371:             color: darkgreen;
372:         }
373:         .import-nothing {
374:             color: #663300;
375:         }
376:         .import-exists {
377:             color: darkblue;
378:         }
379:         .import-error {
380:             color: red;
381:         }
382:     </style>
383:     </head>
384:     <body>
385:         <?php printLogoAndLinks(); ?>
386:         <div id="main">
387:             <?php printTabs(); ?>
388:             <div id="content">
389:                 <?php printSubtabs('Wordpress'); ?>
390:                 <div class="tabbox">
391:                     <?php zp_apply_filter('admin_note', 'wordpress', ''); ?>
392:                     <h1><?php echo (gettext('Wordpress Importer')); ?></h1>
393:                     <?php if (!isset($_REQUEST['dbname']) && !isset($_REQUEST['dbuser']) && !isset($_REQUEST['dbpass']) && !isset($_REQUEST['dbhost']) && !isset($_GET['refresh'])) { ?>
394:                         <p><?php echo gettext("An importer for <strong>Wordpress 3.x or newer</strong> to the Zenpage CMS plugin that imports the following:"); ?></p>
395:                         <ul>
396:                             <li><?php echo gettext("<strong>Posts (post_status published and draft only) => Zenpage articles</strong>"); ?></li>
397:                             <li><?php echo gettext("<strong>Pages (post_status published and draft only) => Zenpage pages</strong>"); ?></li>
398:                             <li><?php echo gettext("<strong>Post categories => Zenpage categories including assignment to their article</strong>"); ?></li>
399:                             <li><?php echo gettext("<strong>Post tags => Zenphoto tags including assignment to their article</strong>"); ?></li>
400:                             <li><?php echo gettext("<strong>Post and page comments => Zenphoto comments including assignment to their article</strong>"); ?></li>
401:                         </ul>
402:                             <p class="notebox">
403:                             <?php echo gettext("<strong>IMPORTANT: </strong>MySQLi must be selected as the database handler on the Zenphoto options (generally the default)."); ?>
404:                         </p
405:                         <p class="notebox">
406:                             <?php echo gettext("<strong>IMPORTANT: </strong>If you are not using an fresh Zenphoto install it is <strong>strongly recommended to backup your database</strong> before running this importer. Make also sure that both databases use the same encoding so you do not get messed up character display."); ?>
407:                         </p>
408:                         <p class="notebox">
409:                             <?php echo gettext("<strong>Note:</strong> <em>Wordpress page and category nesting</em> is currently not preserved but can easily be recreated by drag and drop sorting."); ?>
410:                         </p>
411: 
412:                         <p><?php echo gettext("In case anything does not work as expected the query results from the Wordpress database are logged in <code>zp-data/debug.log</code>"); ?></p>
413:                         <?php if (!extensionEnabled('zenpage')) { ?>
414:                             <p class="errorbox"><?php echo gettext('<strong>ERROR: </strong>The Zenpage CMS plugin is not enabled.'); ?></p>
415:                             <?php
416:                             die();
417:                         }
418:                         ?>
419: 
420:                         <h2><?php echo gettext('Please enter your Wordpress database details:'); ?></h2>
421:                         <form action="" method="post" name="wordpress">
422:                             <?php XSRFToken('wordpress'); ?>
423:                             <input type="text" value="wordpress" id="dbname" name="dbname" /> <label for="dbname"><?php echo gettext("Database name"); ?></label><br />
424:                             <input type="text" value="root" id="dbuser" name="dbuser" /> <label for="dbuser"><?php echo gettext("Database user"); ?></label><br />
425:                             <input type="text" value="root" id="dbpass" name="dbpass" /> <label for="dbpass"><?php echo gettext("Database password"); ?></label><br />
426:                             <input type="text" value="localhost" id="dbhost" name="dbhost" /> <label for="dbhost"><?php echo gettext("Database host"); ?></label><br />
427:                             <input type="text" value="wp_" name="tableprefix" id="tableprefix" /> <label for="tableprefix"><?php echo gettext("Database table prefix"); ?></label><br />
428:                             <input type="checkbox" value="0" name="convertlinefeeds" id="convertlinefeeds" /> <label for="convertlinefeeds"><?php echo gettext('Convert linefeeds to new lines (br)'); ?></label><br />
429:                             <p class="buttons"><button class="submitbutton" type="submit" title="<?php echo gettext("Import"); ?>"><img src="../images/pass.png" alt="" /><strong><?php echo gettext("Import"); ?></strong></button></p>
430:                             <p class="buttons"><button class="submitbutton" type="reset"><img src="../images/reset.png" alt="" /><strong><?php echo gettext("Reset"); ?></strong></button></p>
431:                             <br style="clear:both" />
432:                         </form>
433:                         <?php
434:                     }
435: 
436:                     if (isset($_REQUEST['dbname']) || isset($_REQUEST['dbuser']) || isset($_REQUEST['dbpass']) || isset($_REQUEST['dbhost'])) {
437:                         // Wordpres DB connection check output
438:                         if ($dbinfo_incomplete) {
439:                             echo $dbinfo . $dbinfo_incomplete;
440:                             die();
441:                         }
442:                         if ($db_noconnection) {
443:                             echo $dbinfo . $db_noconnection;
444:                             die();
445:                         }
446:                         if ($db_notselected) {
447:                             echo $dbinfo . $db_notselected;
448:                             die();
449:                         }
450:                         if ($posttotalcount == $postcount) {
451:                             ?>
452:                             <p class="messagebox"><?php echo gettext('Import finished.'); ?></p>
453:                         <?php } else {
454:                             ?>
455:                             <p><?php echo gettext('Importing...patience please.'); ?></p>
456:                         <?php } ?>
457:                         <ul>
458:                             <?php
459:                             if (!isset($_GET['refresh'])) {
460:                                 ?>
461:                                 <li><strong><?php echo gettext('Categories'); ?></strong>
462:                                     <ol>
463:                                         <?php echo $catinfo; ?>
464:                                     </ol>
465:                                 </li>
466:                                 <?php
467:                             }
468:                             if (!isset($_GET['refresh'])) {
469:                                 ?>
470:                                 <li><strong><?php echo gettext('Tags'); ?></strong>
471:                                     <ol>
472:                                         <?php echo $taginfo; ?>
473:                                     </ol>
474:                                 </li>
475:                                 <?php
476:                             }
477:                             ?>
478:                             <li><strong><?php echo gettext('Pages and Articles'); ?></strong>
479:                                 <?php
480:                                 if (isset($_GET['refresh'])) {
481:                                     $startlist = ' start="' . $refresh . '"';
482:                                 } else {
483:                                     $startlist = '';
484:                                 }
485:                                 ?>
486:                                 <ol<?php echo $startlist; ?>>
487:                                     <?php echo $postinfo; ?>
488:                                 </ol>
489:                             </li>
490:                         </ul>
491:                         <?php if ($posttotalcount == $postcount) { ?>
492:                             <p class="buttons"><a href="wordpress_import.php"><?php echo gettext('New import'); ?></a></p>
493:                             <br style="clear:both" />
494:                             <?php
495:                         }
496:                     } // if form submit if
497:                     ?>
498:                 </div>
499:             </div><!-- content -->
500:         </div><!-- main -->
501:         <?php printAdminFooter(); ?>
502:     </body>
503:     </html>
504: 
505:     <?php
506: }
507: ?>
Zenphoto doc API documentation generated by ApiGen