Overview

Namespaces

  • Composer
    • Autoload
  • Geekwright
    • RegDom
  • League
    • OAuth2
      • Client
        • Provider
  • None
  • Xmf
    • Database
    • Jwt
    • Key
    • Module
      • Helper

Classes

  • ArtObject
  • ArtObjectHandler
  • BloggerApi
  • CGIF
  • CGIFCOLORTABLE
  • CGIFFILEHEADER
  • CGIFIMAGE
  • CGIFIMAGEHEADER
  • CGIFLZW
  • Composer\Autoload\ClassLoader
  • Composer\Autoload\ComposerStaticInit274e5fff219a4f27a346e611b0580d6a
  • ComposerAutoloaderInit274e5fff219a4f27a346e611b0580d6a
  • Config_File
  • Cookie
  • Criteria
  • CriteriaCompo
  • CriteriaElement
  • Database
  • Db_manager
  • ErrorHandler
  • FormDhtmlTextArea
  • FormTextArea
  • Geekwright\RegDom\PublicSuffixList
  • Geekwright\RegDom\RegisteredDomain
  • HTMLPurifier
  • League\OAuth2\Client\Provider\Google
  • MetaWeblogApi
  • ModuleAdmin
  • MovableTypeApi
  • MyTextSanitizer
  • MyTextSanitizerExtended
  • MyTextSanitizerExtension
  • MytsCensor
  • MytsFlash
  • MytsIframe
  • MytsImage
  • MytsLi
  • MytsMms
  • MytsMp3
  • MytsRtsp
  • MytsSoundcloud
  • MytsSyntaxhighlight
  • MytsTextfilter
  • MytsUl
  • MytsWiki
  • MytsWmp
  • MytsYoutube
  • PathStuffController
  • PHPMailer
  • PHPMailerOAuth
  • PHPMailerOAuthGoogle
  • phpthumb
  • phpthumb_bmp
  • phpthumb_filters
  • phpthumb_functions
  • phpthumb_ico
  • phpUnsharpMask
  • PmCorePreload
  • PmMessage
  • PmMessageHandler
  • PmSystemPreload
  • POP3
  • ProfileCategory
  • ProfileCategoryHandler
  • ProfileCorePreload
  • ProfileField
  • ProfileFieldHandler
  • ProfileProfile
  • ProfileProfileHandler
  • ProfileRegstep
  • ProfileRegstepHandler
  • ProfileVisibility
  • ProfileVisibilityHandler
  • Protector
  • Protector_bruteforce_overrun_message
  • Protector_crawler_overrun_message
  • Protector_f5attack_overrun_message
  • Protector_postcommon_post_deny_by_httpbl
  • Protector_postcommon_post_deny_by_rbl
  • Protector_postcommon_post_htmlpurify4everyone
  • Protector_postcommon_post_htmlpurify4guest
  • Protector_postcommon_post_language_match
  • Protector_postcommon_post_need_multibyte
  • Protector_postcommon_post_register_moratorium
  • Protector_postcommon_post_stopforumspam
  • Protector_postcommon_register_insert_js_check
  • Protector_postcommon_register_stopforumspam
  • Protector_precommon_badip_errorlog
  • Protector_precommon_badip_message
  • Protector_precommon_badip_redirection
  • Protector_precommon_bwlimit_errorlog
  • Protector_precommon_bwlimit_message
  • Protector_prepurge_exit_message
  • Protector_spamcheck_overrun_message
  • ProtectorCorePreload
  • ProtectorFilterAbstract
  • ProtectorFilterHandler
  • ProtectorMySQLDatabase
  • ProtectorRegistry
  • ReCaptchaResponse
  • RpcArrayHandler
  • RpcBase64Handler
  • RpcBooleanHandler
  • RpcDateTimeHandler
  • RpcDoubleHandler
  • RpcIntHandler
  • RpcMemberHandler
  • RpcMethodNameHandler
  • RpcNameHandler
  • RpcStringHandler
  • RpcStructHandler
  • RpcValueHandler
  • RssAuthorHandler
  • RssCategoryHandler
  • RssChannelHandler
  • RssCommentsHandler
  • RssCopyrightHandler
  • RssDescriptionHandler
  • RssDocsHandler
  • RssGeneratorHandler
  • RssGuidHandler
  • RssHeightHandler
  • RssImageHandler
  • RssItemHandler
  • RssLanguageHandler
  • RssLastBuildDateHandler
  • RssLinkHandler
  • RssManagingEditorHandler
  • RssNameHandler
  • RssPubDateHandler
  • RssSourceHandler
  • RssTextInputHandler
  • RssTitleHandler
  • RssTtlHandler
  • RssUrlHandler
  • RssWebMasterHandler
  • RssWidthHandler
  • SaxParser
  • Smarty
  • Smarty_Compiler
  • SMTP
  • Snoopy
  • SqlUtility
  • SystemAvatar
  • SystemAvatarHandler
  • SystemBanner
  • SystemBannerclient
  • SystemBannerclientHandler
  • SystemBannerFinish
  • SystemBannerfinishHandler
  • SystemBannerHandler
  • SystemBlock
  • SystemBlockHandler
  • SystemBlockLinkModule
  • SystemBlockLinkModuleHandler
  • SystemBreadcrumb
  • SystemCorePreload
  • SystemFineAvatarUploadHandler
  • SystemFineImUploadHandler
  • SystemFineUploadHandler
  • SystemGroup
  • SystemGroupHandler
  • SystemMaintenance
  • SystemMenuHandler
  • SystemSmilies
  • SystemsmiliesHandler
  • SystemUserrank
  • SystemuserrankHandler
  • SystemUsers
  • SystemUsersHandler
  • Tar
  • ThemeSetAuthorHandler
  • ThemeSetDateCreatedHandler
  • ThemeSetDescriptionHandler
  • ThemeSetEmailHandler
  • ThemeSetFileTypeHandler
  • ThemeSetGeneratorHandler
  • ThemeSetImageHandler
  • ThemeSetLinkHandler
  • ThemeSetModuleHandler
  • ThemeSetNameHandler
  • ThemeSetTagHandler
  • ThemeSetTemplateHandler
  • TinyMCE
  • Xmf\Assert
  • Xmf\Database\Migrate
  • Xmf\Database\TableLoad
  • Xmf\Database\Tables
  • Xmf\Debug
  • Xmf\FilterInput
  • Xmf\Highlighter
  • Xmf\IPAddress
  • Xmf\Jwt\JsonWebToken
  • Xmf\Jwt\KeyFactory
  • Xmf\Jwt\TokenFactory
  • Xmf\Jwt\TokenReader
  • Xmf\Key\ArrayStorage
  • Xmf\Key\Basic
  • Xmf\Key\FileStorage
  • Xmf\Key\KeyAbstract
  • Xmf\Language
  • Xmf\Metagen
  • Xmf\Module\Admin
  • Xmf\Module\Helper
  • Xmf\Module\Helper\AbstractHelper
  • Xmf\Module\Helper\Cache
  • Xmf\Module\Helper\GenericHelper
  • Xmf\Module\Helper\Permission
  • Xmf\Module\Helper\Session
  • Xmf\Random
  • Xmf\Request
  • Xmf\StopWords
  • Xmf\Yaml
  • XmlTagHandler
  • XoopsApi
  • xoopsart
  • XoopsAuth
  • XoopsAuthAds
  • XoopsAuthFactory
  • XoopsAuthLdap
  • XoopsAuthProvisionning
  • XoopsAuthXoops
  • XoopsAvatar
  • XoopsAvatarHandler
  • XoopsBlock
  • XoopsBlockHandler
  • XoopsBlockInstance
  • XoopsBlockInstanceHandler
  • XoopsCache
  • XoopsCacheApc
  • XoopsCacheEngine
  • XoopsCacheFile
  • XoopsCacheMemcache
  • XoopsCacheModel
  • XoopsCacheModelHandler
  • XoopsCacheModelObject
  • XoopsCacheXcache
  • XoopsCaptcha
  • XoopsCaptchaImage
  • XoopsCaptchaImageHandler
  • XoopsCaptchaMethod
  • XoopsCaptchaRecaptcha
  • XoopsCaptchaRecaptcha2
  • XoopsCaptchaText
  • XoopsComment
  • XoopsCommentHandler
  • XoopsCommentRenderer
  • XoopsComments
  • XoopsConfigCategory
  • XoopsConfigCategoryHandler
  • XoopsConfigHandler
  • XoopsConfigItem
  • XoopsConfigItemHandler
  • XoopsConfigOption
  • XoopsConfigOptionHandler
  • XoopsDatabase
  • XoopsDatabaseFactory
  • XoopsDownloader
  • XoopsEditor
  • XoopsEditorHandler
  • XoopsErrorHandler
  • XoopsFile
  • XoopsFileHandler
  • XoopsFilterInput
  • XoopsFolderHandler
  • XoopsForm
  • XoopsFormButton
  • XoopsFormButtonTray
  • XoopsFormCaptcha
  • XoopsFormCheckBox
  • XoopsFormColorPicker
  • XoopsFormDateTime
  • XoopsFormDhtmlTextArea
  • XoopsFormEditor
  • XoopsFormElement
  • XoopsFormElementTray
  • XoopsFormFile
  • XoopsFormHidden
  • XoopsFormHiddenToken
  • XoopsFormLabel
  • XoopsFormPassword
  • XoopsFormRadio
  • XoopsFormRadioYN
  • XoopsFormRenderer
  • XoopsFormRendererBootstrap3
  • XoopsFormRendererLegacy
  • XoopsFormSelect
  • XoopsFormSelectCheckGroup
  • XoopsFormSelectCountry
  • XoopsFormSelectEditor
  • XoopsFormSelectGroup
  • XoopsFormSelectLang
  • XoopsFormSelectMatchOption
  • XoopsFormSelectTheme
  • XoopsFormSelectTimezone
  • XoopsFormSelectUser
  • XoopsFormText
  • XoopsFormTextArea
  • XoopsFormTextDateSelect
  • XoopsFormTinymce
  • XoopsGroup
  • XoopsGroupFormCheckBox
  • XoopsGroupHandler
  • XoopsGroupPerm
  • XoopsGroupPermForm
  • XoopsGroupPermHandler
  • XoopsGTicket
  • XoopsGuestUser
  • XoopsGuiDefault
  • XoopsGuiThadmin
  • XoopsGuiTransition
  • XoopsGuiZetadigme
  • XoopsHandlerRegistry
  • XoopsImage
  • XoopsImagecategory
  • XoopsImagecategoryHandler
  • XoopsImageHandler
  • XoopsImageSet
  • XoopsImagesetHandler
  • XoopsImagesetimg
  • XoopsImagesetimgHandler
  • XoopsInstallWizard
  • XoopsLists
  • XoopsLoad
  • XoopsLocal
  • XoopsLocalAbstract
  • XoopsLocalWrapper
  • XoopsLogger
  • XoopsMailer
  • XoopsMailerLocal
  • XoopsMediaUploader
  • XoopsMemberHandler
  • XoopsMembership
  • XoopsMembershipHandler
  • XoopsModelAbstract
  • XoopsModelFactory
  • XoopsModelJoint
  • XoopsModelRead
  • XoopsModelStats
  • XoopsModelSync
  • XoopsModelWrite
  • XoopsModule
  • XoopsModuleHandler
  • XoopsMultiMailer
  • XoopsMySQLDatabase
  • XoopsMySQLDatabaseProxy
  • XoopsMySQLDatabaseSafe
  • XoopsNotification
  • XoopsNotificationHandler
  • XoopsObject
  • XoopsObjectHandler
  • XoopsObjectTree
  • XoopsOnlineHandler
  • XoopsPageNav
  • XoopsPersistableObjectHandler
  • XoopsPreload
  • XoopsPreloadItem
  • XoopsPrivmessage
  • XoopsPrivmessageHandler
  • XoopsRank
  • XoopsRankHandler
  • XoopsRequest
  • XoopsSecurity
  • XoopsSessionHandler
  • XoopsSimpleForm
  • XoopsStory
  • XoopsSystemCpanel
  • XoopsSystemGui
  • XoopsTableForm
  • XoopsTarDownloader
  • XoopsThemeForm
  • XoopsThemeSetParser
  • XoopsTopic
  • XoopsTpl
  • XoopsTplfile
  • XoopsTplfileHandler
  • XoopsTplset
  • XoopsTplsetHandler
  • XoopsTree
  • XoopsUser
  • XoopsUserHandler
  • XoopsUserUtility
  • XoopsUtility
  • XoopsXmlRpcApi
  • XoopsXmlRpcArray
  • XoopsXmlRpcBase64
  • XoopsXmlRpcBoolean
  • XoopsXmlRpcDatetime
  • XoopsXmlRpcDocument
  • XoopsXmlRpcDouble
  • XoopsXmlRpcFault
  • XoopsXmlRpcInt
  • XoopsXmlRpcParser
  • XoopsXmlRpcRequest
  • XoopsXmlRpcResponse
  • XoopsXmlRpcString
  • XoopsXmlRpcStruct
  • XoopsXmlRpcTag
  • XoopsXmlRss2Parser
  • XoopsZipDownloader
  • xos_kernel_Xoops2
  • xos_logos_PageBuilder
  • xos_opal_AdminThemeFactory
  • xos_opal_Theme
  • xos_opal_ThemeFactory
  • XoUser
  • XoUserHandler
  • Zipfile

Interfaces

  • Xmf\Key\StorageInterface
  • XoopsFormRendererInterface

Exceptions

  • phpmailerException

Functions

  • __autoload
  • _recaptcha_aes_encrypt
  • _recaptcha_aes_pad
  • _recaptcha_http_post
  • _recaptcha_mailhide_email_parts
  • _recaptcha_mailhide_urlbase64
  • _recaptcha_qsencode
  • _smarty_regex_replace_check
  • _smarty_sort_length
  • admin_refcheck
  • b_system_comments_edit
  • b_system_comments_show
  • b_system_info_edit
  • b_system_info_show
  • b_system_login_show
  • b_system_main_show
  • b_system_newmembers_edit
  • b_system_newmembers_show
  • b_system_notification_show
  • b_system_online_show
  • b_system_search_show
  • b_system_themes_edit
  • b_system_themes_show
  • b_system_topposters_edit
  • b_system_topposters_show
  • b_system_user_show
  • b_system_waiting_show
  • bannerstats
  • change_banner_url_by_client
  • checkEmail
  • clickbanner
  • clientlogin
  • closeTable
  • closeThread
  • CloseWaitBox
  • Composer\Autoload\includeFile
  • composerRequire274e5fff219a4f27a346e611b0580d6a
  • createConfigform
  • createThemeform
  • doConditionalGet
  • emailStats
  • exit404BadReq
  • fatalPhpErrorHandler
  • file_get_contents
  • file_put_contents
  • findSharp
  • form_user
  • formatTimestamp
  • formatURL
  • gd_info
  • genPathCheckHtml
  • get_request_method
  • get_writeoks_from_protector
  • getcss
  • getDbCharsets
  • getDbCollations
  • getDirList
  • getMailer
  • getTheme
  • gif_getSize
  • gif_loadFile
  • gif_loadFileToGDimageResource
  • gif_outputAsBmp
  • gif_outputAsJpeg
  • gif_outputAsPng
  • HTMLPurifier
  • imagealphablending
  • imageBrowser
  • imageCreateCorners
  • imageFilenameCheck
  • imagesavealpha
  • install_acceptUser
  • install_finalize
  • is_executable
  • kses
  • langDropdown
  • load_functions
  • load_object
  • load_objectHandler
  • loadModuleAdminMenu
  • make_cblock
  • make_data
  • make_groups
  • make_sidebar
  • mod_clearCacheFile
  • mod_clearConfg
  • mod_clearConfig
  • mod_clearFile
  • mod_clearSmartyCache
  • mod_constant
  • mod_createCacheFile
  • mod_createCacheFile_byGroup
  • mod_createFile
  • mod_DB_prefix
  • mod_fetchConfg
  • mod_fetchConfig
  • mod_generateCacheId
  • mod_generateCacheId_byGroup
  • mod_getDirname
  • mod_getIP
  • mod_getMysqlVersion
  • mod_getUnameFromId
  • mod_getUnameFromIds
  • mod_isModuleAction
  • mod_loadCacheFile
  • mod_loadCacheFile_byGroup
  • mod_loadConfg
  • mod_loadConfig
  • mod_loadFile
  • mod_loadFunctions
  • mod_loadRenderer
  • mod_message
  • modify_chmod
  • myTextForm
  • notificationCategoryInfo
  • notificationCommentCategoryInfo
  • notificationEnabled
  • notificationEventEnabled
  • notificationEventInfo
  • notificationEvents
  • notificationGenerateConfig
  • notificationSubscribableCategoryInfo
  • openTable
  • openThread
  • OpenWaitBox
  • PHPMailerAutoload
  • phpThumbURL
  • preg_quote
  • profile_getFieldForm
  • profile_getRegisterForm
  • profile_getStepForm
  • profile_getUserForm
  • profile_install_addCategory
  • profile_install_addField
  • profile_install_addStep
  • profile_install_initializeProfiles
  • profile_install_setPermissions
  • protector_message_append_oninstall
  • protector_message_append_onuninstall
  • protector_message_append_onupdate
  • protector_notify_base
  • protector_oninstall_base
  • protector_onuninstall_base
  • protector_onupdate_base
  • protector_postcommon
  • protector_prepare
  • recaptcha_check_answer
  • recaptcha_get_html
  • recaptcha_get_signup_url
  • recaptcha_mailhide_html
  • recaptcha_mailhide_url
  • redirect_header
  • RedirectToCachedFile
  • SendSaveAsFileHeaderIfNeeded
  • showbanner
  • showThread
  • smarty_block_textformat
  • smarty_compiler_assign
  • smarty_compiler_foreachq
  • smarty_compiler_includeq
  • smarty_compiler_xoAdminIcons
  • smarty_compiler_xoAdminNav
  • smarty_compiler_xoAppUrl
  • smarty_compiler_xoImgUrl
  • smarty_compiler_xoModuleIcons16
  • smarty_compiler_xoModuleIcons32
  • smarty_compiler_xoModuleIconsBookmarks
  • smarty_core_assemble_plugin_filepath
  • smarty_core_assign_smarty_interface
  • smarty_core_create_dir_structure
  • smarty_core_display_debug_console
  • smarty_core_get_include_path
  • smarty_core_get_microtime
  • smarty_core_get_php_resource
  • smarty_core_is_secure
  • smarty_core_is_trusted
  • smarty_core_load_plugins
  • smarty_core_load_resource_plugin
  • smarty_core_process_cached_inserts
  • smarty_core_process_compiled_include
  • smarty_core_read_cache_file
  • smarty_core_rm_auto
  • smarty_core_rmdir
  • smarty_core_run_insert_handler
  • smarty_core_smarty_include_php
  • smarty_core_write_cache_file
  • smarty_core_write_compiled_include
  • smarty_core_write_compiled_resource
  • smarty_core_write_file
  • smarty_function_assign_debug_info
  • smarty_function_block
  • smarty_function_config_load
  • smarty_function_counter
  • smarty_function_cycle
  • smarty_function_debug
  • smarty_function_escape_special_chars
  • smarty_function_eval
  • smarty_function_fetch
  • smarty_function_html_checkboxes
  • smarty_function_html_checkboxes_output
  • smarty_function_html_image
  • smarty_function_html_options
  • smarty_function_html_options_optgroup
  • smarty_function_html_options_optoutput
  • smarty_function_html_radios
  • smarty_function_html_radios_output
  • smarty_function_html_select_date
  • smarty_function_html_select_time
  • smarty_function_html_table
  • smarty_function_html_table_cycle
  • smarty_function_mailto
  • smarty_function_math
  • smarty_function_popup
  • smarty_function_popup_init
  • smarty_function_securityToken
  • smarty_function_xoInboxCount
  • smarty_function_xoMemberInfo
  • smarty_function_xoops_link
  • smarty_function_xoPageNav
  • smarty_make_timestamp
  • smarty_modifier_capitalize
  • smarty_modifier_capitalize_ucfirst
  • smarty_modifier_cat
  • smarty_modifier_count_characters
  • smarty_modifier_count_paragraphs
  • smarty_modifier_count_sentences
  • smarty_modifier_count_words
  • smarty_modifier_date_format
  • smarty_modifier_debug_print_var
  • smarty_modifier_default
  • smarty_modifier_escape
  • smarty_modifier_indent
  • smarty_modifier_lower
  • smarty_modifier_nl2br
  • smarty_modifier_regex_replace
  • smarty_modifier_replace
  • smarty_modifier_spacify
  • smarty_modifier_string_format
  • smarty_modifier_strip
  • smarty_modifier_strip_tags
  • smarty_modifier_truncate
  • smarty_modifier_upper
  • smarty_modifier_wordwrap
  • smarty_outputfilter_trimwhitespace
  • smarty_outputfilter_trimwhitespace_replace
  • smarty_resource_db_secure
  • smarty_resource_db_source
  • smarty_resource_db_timestamp
  • smarty_resource_db_tplinfo
  • smarty_resource_db_trusted
  • synchronize
  • system_AdminIcons
  • system_adminVersion
  • system_CleanVars
  • system_loadLanguage
  • system_loadTemplate
  • themecenterposts
  • update_system_v211
  • userCheck
  • userTimeToServerTime
  • validateDbCharset
  • writeLicenseKey
  • xoBuildLicenceKey
  • xoDiag
  • xoDiagBoolSetting
  • xoDiagIfWritable
  • xoFormBlockCollation
  • xoFormField
  • xoFormFieldCharset
  • xoFormFieldCollation
  • xoFormSelect
  • xoops_aw_decode
  • xoops_aw_encode
  • xoops_bin2hex
  • xoops_comment_count
  • xoops_comment_delete
  • xoops_confirm
  • xoops_convert_decode
  • xoops_convert_encode
  • xoops_convert_encoding
  • xoops_cp_footer
  • xoops_cp_header
  • xoops_error
  • xoops_footer
  • xoops_getActiveModules
  • xoops_getbanner
  • xoops_getBaseDomain
  • xoops_getConfigOption
  • xoops_getcss
  • xoops_getenv
  • xoops_getHandler
  • xoops_getLinkedUnameFromId
  • xoops_getMailer
  • xoops_getModuleHandler
  • xoops_getModuleOption
  • xoops_getOption
  • xoops_getrank
  • xoops_getUrlDomain
  • xoops_getUserTimestamp
  • xoops_groupperm_deletebymoditem
  • xoops_header
  • xoops_hex2bin
  • xoops_isActiveModule
  • xoops_ishexstr
  • xoops_load
  • xoops_load_lang_file
  • xoops_loadLanguage
  • xoops_local
  • xoops_makepass
  • xoops_message
  • xoops_module_activate
  • xoops_module_change
  • xoops_module_deactivate
  • xoops_module_delayed_clean_cache
  • xoops_module_get_admin_menu
  • xoops_module_gettemplate
  • xoops_module_install
  • xoops_module_install_pm
  • xoops_module_install_profile
  • xoops_module_log_header
  • xoops_module_uninstall
  • xoops_module_update
  • xoops_module_update_pm
  • xoops_module_update_profile
  • xoops_module_update_system
  • xoops_module_write_admin_menu
  • xoops_notification_deletebyitem
  • xoops_notification_deletebymodule
  • xoops_notification_deletebyuser
  • xoops_refcheck
  • xoops_result
  • xoops_setActiveModules
  • xoops_setConfigOption
  • xoops_substr
  • xoops_template_clear_module_cache
  • xoops_template_touch
  • xoops_trim
  • xoops_utf8_encode
  • xoops_write_index_file
  • xoopsCodeTarea
  • xoopseditor_get_rootpath
  • XoopsErrorHandler_HandleError
  • xoopsfwrite
  • xoopsSmilies
  • xoPassField
  • xoPhpVersion
  • xoPutLicenseKey
  • xoStripeKey
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * XOOPS comment renderer
  4:  *
  5:  * You may not change or alter any portion of this comment or credits
  6:  * of supporting developers from this source code or any supporting source code
  7:  * which is considered copyrighted (c) material of the original comment or credit authors.
  8:  * This program is distributed in the hope that it will be useful,
  9:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 10:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 11:  *
 12:  * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
 13:  * @license             GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
 14:  * @package             kernel
 15:  * @subpackage          comment
 16:  * @since               2.0.0
 17:  * @author              Kazumi Ono <onokazu@xoops.org>
 18:  */
 19: 
 20: defined('XOOPS_ROOT_PATH') || exit('Restricted access');
 21: 
 22: /**
 23:  * Display comments
 24:  *
 25:  * @author Kazumi Ono <onokazu@xoops.org>
 26:  * @access public
 27:  */
 28: class XoopsCommentRenderer
 29: {
 30:     /**
 31:      * *#@+
 32:      *
 33:      * @access private
 34:      */
 35:     public $_tpl;
 36:     public $_comments;
 37:     public $_useIcons    = true;
 38:     public $_doIconCheck = false;
 39:     public $_memberHandler;
 40:     public $_statusText;
 41:     /**
 42:      * *#@-
 43:      */
 44: 
 45:     /**
 46:      * Constructor
 47:      *
 48:      * @param XoopsTpl $tpl
 49:      * @param boolean  $use_icons
 50:      * @param boolean  $do_iconcheck
 51:      *
 52:      */
 53:     public function __construct(XoopsTpl $tpl, $use_icons = true, $do_iconcheck = false)
 54:     {
 55:         $this->_tpl           = $tpl;
 56:         $this->_useIcons      = (bool)$use_icons;
 57:         $this->_doIconCheck   = (bool)$do_iconcheck;
 58:         /* @var $this->_memberHandler XoopsMemberHandler  */
 59:         $this->_memberHandler = xoops_getHandler('member');
 60:         $this->_statusText    = array(
 61:             XOOPS_COMMENT_PENDING => '<span style="text-decoration: none; font-weight: bold; color: #00ff00;">' . _CM_PENDING . '</span>',
 62:             XOOPS_COMMENT_ACTIVE  => '<span style="text-decoration: none; font-weight: bold; color: #ff0000;">' . _CM_ACTIVE . '</span>',
 63:             XOOPS_COMMENT_HIDDEN  => '<span style="text-decoration: none; font-weight: bold; color: #0000ff;">' . _CM_HIDDEN . '</span>');
 64:     }
 65: 
 66:     /**
 67:      * Access the only instance of this class
 68:      *
 69:      * @param  XoopsTpl $tpl reference to a {@link Smarty} object
 70:      * @param  boolean  $use_icons
 71:      * @param  boolean  $do_iconcheck
 72:      * @return \XoopsCommentRenderer
 73:      */
 74:     public static function instance(XoopsTpl $tpl, $use_icons = true, $do_iconcheck = false)
 75:     {
 76:         static $instance;
 77:         if (!isset($instance)) {
 78:             $instance = new XoopsCommentRenderer($tpl, $use_icons, $do_iconcheck);
 79:         }
 80: 
 81:         return $instance;
 82:     }
 83: 
 84:     /**
 85:      * Accessor
 86:      *
 87:      * @param array $comments_arr array of {@link XoopsComment} objects
 88:      */
 89:     public function setComments(&$comments_arr)
 90:     {
 91:         if (isset($this->_comments)) {
 92:             unset($this->_comments);
 93:         }
 94:         $this->_comments =& $comments_arr;
 95:     }
 96: 
 97:     /**
 98:      * Render the comments in flat view
 99:      *
100:      * @param boolean $admin_view
101:      */
102:     public function renderFlatView($admin_view = false)
103:     {
104:         $count = count($this->_comments);
105:         for ($i = 0; $i < $count; ++$i) {
106:             if (false !== $this->_useIcons) {
107:                 $title = $this->_getTitleIcon($this->_comments[$i]->getVar('com_icon')) . '&nbsp;' . $this->_comments[$i]->getVar('com_title');
108:             } else {
109:                 $title = $this->_comments[$i]->getVar('com_title');
110:             }
111:             // Start edit by voltan
112:             $poster = $this->_getPosterArray($this->_comments[$i]->getVar('com_uid'), $this->_comments[$i]->getVar('com_user'), $this->_comments[$i]->getVar('com_url'));
113:             if (false !== (bool)$admin_view) {
114:                 $com_email = $this->_comments[$i]->getVar('com_email');
115:                 $text      = $this->_comments[$i]->getVar('com_text');
116:                 $text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0; margin-right: 2px;">';
117:                 $text .= _CM_STATUS . ': ' . $this->_statusText[$this->_comments[$i]->getVar('com_status')] . '<br>';
118:                 $text .= 'IP: <span style="font-weight: bold;">' . $this->_comments[$i]->getVar('com_ip') . '</span>';
119:                 if (!empty($com_email)) {
120:                     $text .= '<br>' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>';
121:                 }
122:                 $text .= '</div>';
123:             } else {
124:                 // hide comments that are not active
125:                 if (XOOPS_COMMENT_ACTIVE != $this->_comments[$i]->getVar('com_status')) {
126:                     continue;
127:                 } else {
128:                     $text = $this->_comments[$i]->getVar('com_text');
129:                 }
130:             }
131:             // End edit by voltan
132:             $this->_tpl->append('comments', array(
133:                 'id'            => $this->_comments[$i]->getVar('com_id'),
134:                 'title'         => $title,
135:                 'text'          => $text,
136:                 'date_posted'   => formatTimestamp($this->_comments[$i]->getVar('com_created'), 'm'),
137:                 'date_modified' => formatTimestamp($this->_comments[$i]->getVar('com_modified'), 'm'),
138:                 'poster'        => $poster));
139:         }
140:     }
141: 
142:     /**
143:      * Render the comments in thread view
144:      *
145:      * This method calls itself recursively
146:      *
147:      * @param  integer $comment_id Should be "0" when called by client
148:      * @param  boolean $admin_view
149:      * @param  boolean $show_nav
150:      * @return void
151:      */
152:     public function renderThreadView($comment_id = 0, $admin_view = false, $show_nav = true)
153:     {
154:         include_once $GLOBALS['xoops']->path('class/tree.php');
155:         // construct comment tree
156:         $xot  = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid');
157:         $tree =& $xot->getTree();
158: 
159:         if (false !== $this->_useIcons) {
160:             $title = $this->_getTitleIcon($tree[$comment_id]['obj']->getVar('com_icon')) . '&nbsp;' . $tree[$comment_id]['obj']->getVar('com_title');
161:         } else {
162:             $title = $tree[$comment_id]['obj']->getVar('com_title');
163:         }
164:         if (false !== (bool)$show_nav && $tree[$comment_id]['obj']->getVar('com_pid') != 0) {
165:             $this->_tpl->assign('lang_top', _CM_TOP);
166:             $this->_tpl->assign('lang_parent', _CM_PARENT);
167:             $this->_tpl->assign('show_threadnav', true);
168:         } else {
169:             $this->_tpl->assign('show_threadnav', false);
170:         }
171:         $admin_view = (bool)$admin_view;
172:         if (false !== $admin_view) {
173:             // admins can see all
174:             $com_email = $tree[$comment_id]['obj']->getVar('com_email');
175:             $text      = $tree[$comment_id]['obj']->getVar('com_text');
176:             $text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0; margin-right: 2px;">';
177:             $text .= _CM_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')] . '<br>';
178:             $text .= 'IP: <span style="font-weight: bold;">' . $tree[$comment_id]['obj']->getVar('com_ip') . '</span>';
179:             if (!empty($com_email)) {
180:                 $text .= '<br>' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>';
181:             }
182:             $text .= '</div>';
183:         } else {
184:             // hide comments that are not active
185:             if (XOOPS_COMMENT_ACTIVE != $tree[$comment_id]['obj']->getVar('com_status')) {
186:                 // if there are any child comments, display them as root comments
187:                 if (isset($tree[$comment_id]['child']) && !empty($tree[$comment_id]['child'])) {
188:                     foreach ($tree[$comment_id]['child'] as $child_id) {
189:                         $this->renderThreadView($child_id, $admin_view, false);
190:                     }
191:                 }
192: 
193:                 return null;
194:             } else {
195:                 $text = $tree[$comment_id]['obj']->getVar('com_text');
196:             }
197:         }
198:         $replies = array();
199:         $this->_renderThreadReplies($tree, $comment_id, $replies, '&nbsp;&nbsp;', $admin_view);
200:         $show_replies = (count($replies) > 0);// ? true : false;
201:         // Start edit by voltan
202:         $this->_tpl->append('comments', array(
203:             'pid'           => $tree[$comment_id]['obj']->getVar('com_pid'),
204:             'id'            => $tree[$comment_id]['obj']->getVar('com_id'),
205:             'itemid'        => $tree[$comment_id]['obj']->getVar('com_itemid'),
206:             'rootid'        => $tree[$comment_id]['obj']->getVar('com_rootid'),
207:             'title'         => $title,
208:             'text'          => $text,
209:             'date_posted'   => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'),
210:             'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'),
211:             'poster'        => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid'), $tree[$comment_id]['obj']->getVar('com_user'), $tree[$comment_id]['obj']->getVar('com_url')),
212:             'replies'       => $replies,
213:             'show_replies'  => $show_replies));
214:         // End edit by voltan
215:     }
216: 
217:     /**
218:      * Render replies to a thread
219:      *
220:      * @param array   $thread
221:      * @param int     $key
222:      * @param array   $replies
223:      * @param string  $prefix
224:      * @param bool    $admin_view
225:      * @param integer $depth
226:      * @param string  $current_prefix
227:      * @access   private
228:      */
229:     public function _renderThreadReplies(&$thread, $key, &$replies, $prefix, $admin_view, $depth = 0, $current_prefix = '')
230:     {
231:         $admin_view = (bool)$admin_view;
232:         if ($depth > 0) {
233:             if (false !== $this->_useIcons) {
234:                 $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')) . '&nbsp;' . $thread[$key]['obj']->getVar('com_title');
235:             } else {
236:                 $title = $thread[$key]['obj']->getVar('com_title');
237:             }
238:             $title = (false !== $admin_view) ? $title . ' ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] : $title;
239:             // Start edit by voltan
240:             $replies[] = array(
241:                 'id'          => $key,
242:                 'prefix'      => $current_prefix,
243:                 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'),
244:                 'title'       => $title,
245:                 'root_id'     => $thread[$key]['obj']->getVar('com_rootid'),
246:                 'status'      => $this->_statusText[$thread[$key]['obj']->getVar('com_status')],
247:                 'poster'      => $this->_getPosterName($thread[$key]['obj']->getVar('com_uid'), $thread[$key]['obj']->getVar('com_user'), $thread[$key]['obj']->getVar('com_url')));
248:             // End edit by voltan
249:             $current_prefix .= $prefix;
250:         }
251:         if (isset($thread[$key]['child']) && !empty($thread[$key]['child'])) {
252:             ++$depth;
253:             foreach ($thread[$key]['child'] as $childkey) {
254:                 if (!$admin_view && $thread[$childkey]['obj']->getVar('com_status') != XOOPS_COMMENT_ACTIVE) {
255:                     // skip this comment if it is not active and continue on processing its child comments instead
256:                     if (isset($thread[$childkey]['child']) && !empty($thread[$childkey]['child'])) {
257:                         foreach ($thread[$childkey]['child'] as $childchildkey) {
258:                             $this->_renderThreadReplies($thread, $childchildkey, $replies, $prefix, $admin_view, $depth);
259:                         }
260:                     }
261:                 } else {
262:                     $this->_renderThreadReplies($thread, $childkey, $replies, $prefix, $admin_view, $depth, $current_prefix);
263:                 }
264:             }
265:         }
266:     }
267: 
268:     /**
269:      * Render comments in nested view
270:      *
271:      * Danger: Recursive!
272:      *
273:      * @param  integer $comment_id Always "0" when called by client.
274:      * @param  boolean $admin_view
275:      * @return void
276:      */
277:     public function renderNestView($comment_id = 0, $admin_view = false)
278:     {
279:         include_once $GLOBALS['xoops']->path('class/tree.php');
280:         $xot  = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid');
281:         $tree =& $xot->getTree();
282:         if (false !== $this->_useIcons) {
283:             $title = $this->_getTitleIcon($tree[$comment_id]['obj']->getVar('com_icon')) . '&nbsp;' . $tree[$comment_id]['obj']->getVar('com_title');
284:         } else {
285:             $title = $tree[$comment_id]['obj']->getVar('com_title');
286:         }
287:         $admin_view = (bool)$admin_view;
288:         if (false !== $admin_view) {
289:             $com_email = $tree[$comment_id]['obj']->getVar('com_email');
290:             $text      = $tree[$comment_id]['obj']->getVar('com_text');
291:             $text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0; margin-right: 2px;">';
292:             $text .= _CM_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')] . '<br>';
293:             $text .= 'IP: <span style="font-weight: bold;">' . $tree[$comment_id]['obj']->getVar('com_ip') . '</span>';
294:             if (!empty($com_email)) {
295:                 $text .= '<br>' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>';
296:             }
297:             $text .= '</div>';
298:         } else {
299:             // skip this comment if it is not active and continue on processing its child comments instead
300:             if (XOOPS_COMMENT_ACTIVE != $tree[$comment_id]['obj']->getVar('com_status')) {
301:                 // if there are any child comments, display them as root comments
302:                 if (isset($tree[$comment_id]['child']) && !empty($tree[$comment_id]['child'])) {
303:                     foreach ($tree[$comment_id]['child'] as $child_id) {
304:                         $this->renderNestView($child_id, $admin_view);
305:                     }
306:                 }
307: 
308:                 return null;
309:             } else {
310:                 $text = $tree[$comment_id]['obj']->getVar('com_text');
311:             }
312:         }
313:         $replies = array();
314:         $this->_renderNestReplies($tree, $comment_id, $replies, 25, $admin_view);
315:         // Start edit by voltan
316:         $this->_tpl->append('comments', array(
317:             'pid'           => $tree[$comment_id]['obj']->getVar('com_pid'),
318:             'id'            => $tree[$comment_id]['obj']->getVar('com_id'),
319:             'itemid'        => $tree[$comment_id]['obj']->getVar('com_itemid'),
320:             'rootid'        => $tree[$comment_id]['obj']->getVar('com_rootid'),
321:             'title'         => $title,
322:             'text'          => $text,
323:             'date_posted'   => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'),
324:             'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'),
325:             'poster'        => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid'), $tree[$comment_id]['obj']->getVar('com_user'), $tree[$comment_id]['obj']->getVar('com_url')),
326:             'replies'       => $replies));
327:         // End edit by voltan
328:     }
329: 
330:     /**
331:      * Render replies in nested view
332:      *
333:      * @param array   $thread
334:      * @param int     $key
335:      * @param array   $replies
336:      * @param string|int  $prefix
337:      * @param bool    $admin_view
338:      * @param integer $depth
339:      * @access private
340:      */
341:     public function _renderNestReplies(&$thread, $key, &$replies, $prefix, $admin_view, $depth = 0)
342:     {
343:         if ($depth > 0) {
344:             if (false !== $this->_useIcons) {
345:                 $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')) . '&nbsp;' . $thread[$key]['obj']->getVar('com_title');
346:             } else {
347:                 $title = $thread[$key]['obj']->getVar('com_title');
348:             }
349:             $admin_view = (bool)$admin_view;
350:             $text = (false !== $admin_view) ? $thread[$key]['obj']->getVar('com_text') . '<div style="text-align:right; margin-top: 2px; margin-right: 2px;">' . _CM_STATUS . ': ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] . '<br>IP: <span style="font-weight: bold;">' . $thread[$key]['obj']->getVar('com_ip') . '</span><br>' . _CM_EMAIL . ' :<span style="font-weight: bold;">' . $thread[$key]['obj']->getVar('com_email') . '</span></div>' : $thread[$key]['obj']->getVar('com_text');
351:             // Start edit by voltan
352:             $replies[] = array(
353:                 'id'            => $key,
354:                 'prefix'        => $prefix,
355:                 'pid'           => $thread[$key]['obj']->getVar('com_pid'),
356:                 'itemid'        => $thread[$key]['obj']->getVar('com_itemid'),
357:                 'rootid'        => $thread[$key]['obj']->getVar('com_rootid'),
358:                 'title'         => $title,
359:                 'text'          => $text,
360:                 'date_posted'   => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'),
361:                 'date_modified' => formatTimestamp($thread[$key]['obj']->getVar('com_modified'), 'm'),
362:                 'poster'        => $this->_getPosterArray($thread[$key]['obj']->getVar('com_uid'), $thread[$key]['obj']->getVar('com_user'), $thread[$key]['obj']->getVar('com_url')));
363:             // End edit by voltan
364:             $prefix += 25;
365:         }
366:         if (isset($thread[$key]['child']) && !empty($thread[$key]['child'])) {
367:             ++$depth;
368:             foreach ($thread[$key]['child'] as $childkey) {
369:                 if (!$admin_view && $thread[$childkey]['obj']->getVar('com_status') != XOOPS_COMMENT_ACTIVE) {
370:                     // skip this comment if it is not active and continue on processing its child comments instead
371:                     if (isset($thread[$childkey]['child']) && !empty($thread[$childkey]['child'])) {
372:                         foreach ($thread[$childkey]['child'] as $childchildkey) {
373:                             $this->_renderNestReplies($thread, $childchildkey, $replies, $prefix, $admin_view, $depth);
374:                         }
375:                     }
376:                 } else {
377:                     $this->_renderNestReplies($thread, $childkey, $replies, $prefix, $admin_view, $depth);
378:                 }
379:             }
380:         }
381:     }
382: 
383:     /**
384:      * Get the name of the poster
385:      *
386:      * @param  int    $poster_id
387:      * @param         $poster_user
388:      * @param         $poster_website
389:      * @return string
390:      * @access private
391:      */
392:     // Start edit by voltan
393:     public function _getPosterName($poster_id, $poster_user, $poster_website)
394:     {
395:         $poster['id'] = (int)$poster_id;
396:         if ($poster['id'] > 0) {
397:             $com_poster = $this->_memberHandler->getUser($poster_id);
398:             if (is_object($com_poster)) {
399:                 $poster['uname'] = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $poster['id'] . '">' . $com_poster->getVar('uname') . '</a>';
400:             }
401:         } elseif ($poster['id'] == 0 && $poster_user != '') {
402:             $poster['id'] = 0; // to cope with deleted user accounts
403:             if (!empty($poster_website)) {
404:                 $poster['uname'] = '<a href="' . $poster_website . '">' . $poster_user . '</a>';
405:             } else {
406:                 $poster['uname'] = $poster_user;
407:             }
408:         } else {
409:             $poster['id']    = 0; // to cope with deleted user accounts
410:             $poster['uname'] = $GLOBALS['xoopsConfig']['anonymous'];
411:         }
412: 
413:         return $poster;
414:     }
415:     // End edit by voltan
416: 
417:     /**
418:      * Get an array with info about the poster
419:      *
420:      * @param  int   $poster_id
421:      * @param        $poster_user
422:      * @param        $poster_website
423:      * @return array
424:      * @access private
425:      */
426:     // Start edit by voltan
427:     public function _getPosterArray($poster_id, $poster_user, $poster_website)
428:     {
429:         $poster['id'] = (int)$poster_id;
430:         if ($poster['id'] > 0) {
431:             /* @var  $com_poster XoopsUser */
432:             $com_poster = $this->_memberHandler->getUser($poster['id']);
433:             if (is_object($com_poster)) {
434:                 $poster['uname']      = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $poster['id'] . '">' . $com_poster->getVar('uname') . '</a>';
435:                 $poster_rank          = $com_poster->rank();
436:                 $poster['rank_image'] = ($poster_rank['image'] != '') ? $poster_rank['image'] : 'blank.gif';
437:                 $poster['rank_title'] = $poster_rank['title'];
438:                 $poster['avatar']     = $com_poster->getVar('user_avatar');
439:                 $poster['regdate']    = formatTimestamp($com_poster->getVar('user_regdate'), 's');
440:                 $poster['from']       = $com_poster->getVar('user_from');
441:                 $poster['postnum']    = $com_poster->getVar('posts');
442:                 $poster['status']     = $com_poster->isOnline() ? _CM_ONLINE : '';
443:             }
444:         } elseif ($poster['id'] == 0 && $poster_user != '') {
445:             if (!empty($poster_website)) {
446:                 $poster['uname'] = '<a href="' . $poster_website . '">' . $poster_user . '</a>';
447:             } else {
448:                 $poster['uname'] = $poster_user;
449:             }
450:             $poster['id']         = 0; // to cope with deleted user accounts
451:             $poster['rank_title'] = '';
452:             $poster['avatar']     = 'blank.gif';
453:             $poster['regdate']    = '';
454:             $poster['from']       = '';
455:             $poster['postnum']    = 0;
456:             $poster['status']     = '';
457:         } else {
458:             $poster['uname']      = $GLOBALS['xoopsConfig']['anonymous'];
459:             $poster['id']         = 0; // to cope with deleted user accounts
460:             $poster['rank_title'] = '';
461:             $poster['avatar']     = 'blank.gif';
462:             $poster['regdate']    = '';
463:             $poster['from']       = '';
464:             $poster['postnum']    = 0;
465:             $poster['status']     = '';
466:         }
467: 
468:         return $poster;
469:     }
470:     // End edit by voltan
471: 
472:     /**
473:      * Get the IMG tag for the title icon
474:      *
475:      * @param  string $icon_image
476:      * @return string HTML IMG tag
477:      * @access private
478:      */
479:     public function _getTitleIcon($icon_image)
480:     {
481:         $icon_image = htmlspecialchars(trim($icon_image));
482:         if ($icon_image != '') {
483:             if (false !== $this->_doIconCheck) {
484:                 if (!file_exists($GLOBALS['xoops']->path('images/subject/' . $icon_image))) {
485:                     return '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />';
486:                 } else {
487:                     return '<img src="' . XOOPS_URL . '/images/subject/' . $icon_image . '" alt="" />';
488:                 }
489:             } else {
490:                 return '<img src="' . XOOPS_URL . '/images/subject/' . $icon_image . '" alt="" />';
491:             }
492:         }
493: 
494:         return '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />';
495:     }
496: }
497: 
API documentation generated by ApiGen