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 Functions
   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:  * @since               2.0.0
  16:  */
  17: 
  18: defined('XOOPS_ROOT_PATH') || exit('Restricted access');
  19: 
  20: /**
  21:  * xoops_getHandler()
  22:  *
  23:  * @param mixed $name
  24:  * @param mixed $optional
  25:  *
  26:  * @return XoopsObjectHandler|false
  27:  */
  28: function xoops_getHandler($name, $optional = false)
  29: {
  30:     static $handlers;
  31:     $name = strtolower(trim($name));
  32:     if (!isset($handlers[$name])) {
  33:         if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/kernel/' . $name . '.php')) {
  34:             require_once $hnd_file;
  35:         }
  36:         $class = 'Xoops' . ucfirst($name) . 'Handler';
  37:         if (class_exists($class)) {
  38:             $xoopsDB         = XoopsDatabaseFactory::getDatabaseConnection();
  39:             $handlers[$name] = new $class($xoopsDB);
  40:         }
  41:     }
  42:     if (!isset($handlers[$name])) {
  43:         trigger_error('Class <strong>' . $class . '</strong> does not exist<br>Handler Name: ' . $name, $optional ? E_USER_WARNING : E_USER_ERROR);
  44:     }
  45:     if (isset($handlers[$name])) {
  46:         return $handlers[$name];
  47:     }
  48:     $inst = false;
  49: 
  50:     return $inst;
  51: }
  52: 
  53: /**
  54:  * xoops_getModuleHandler()
  55:  *
  56:  * @param mixed $name
  57:  * @param mixed $module_dir
  58:  * @param mixed $optional
  59:  * @return XoopsObjectHandler|false
  60:  */
  61: function xoops_getModuleHandler($name = null, $module_dir = null, $optional = false)
  62: {
  63:     static $handlers;
  64:     // if $module_dir is not specified
  65:     if (!isset($module_dir)) {
  66:         // if a module is loaded
  67:         if (isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule'])) {
  68:             $module_dir = $GLOBALS['xoopsModule']->getVar('dirname', 'n');
  69:         } else {
  70:             trigger_error('No Module is loaded', E_USER_ERROR);
  71:         }
  72:     } else {
  73:         $module_dir = trim($module_dir);
  74:     }
  75:     $name = (!isset($name)) ? $module_dir : trim($name);
  76:     if (!isset($handlers[$module_dir][$name])) {
  77:         if (file_exists($hnd_file = XOOPS_ROOT_PATH . "/modules/{$module_dir}/class/{$name}.php")) {
  78:             include_once $hnd_file;
  79:         }
  80:         $class = ucfirst(strtolower($module_dir)) . ucfirst($name) . 'Handler';
  81:         if (class_exists($class)) {
  82:             $xoopsDB                      = XoopsDatabaseFactory::getDatabaseConnection();
  83:             $handlers[$module_dir][$name] = new $class($xoopsDB);
  84:         }
  85:     }
  86:     if (!isset($handlers[$module_dir][$name])) {
  87:         trigger_error('Handler does not exist<br>Module: ' . $module_dir . '<br>Name: ' . $name, $optional ? E_USER_WARNING : E_USER_ERROR);
  88:     }
  89:     if (isset($handlers[$module_dir][$name])) {
  90:         return $handlers[$module_dir][$name];
  91:     }
  92:     $inst = false;
  93: 
  94:     return $inst;
  95: }
  96: 
  97: /**
  98:  * XOOPS class loader wrapper
  99:  *
 100:  * Temporay solution for XOOPS 2.3
 101:  *
 102:  * @param string $name                                          Name of class to be loaded
 103:  * @param string $type                                          domain of the class, potential values:   core - located in /class/;
 104:  *                                                              framework - located in /Frameworks/;
 105:  *                                                              other - module class, located in /modules/[$type]/class/
 106:  *
 107:  * @return boolean
 108:  */
 109: function xoops_load($name, $type = 'core')
 110: {
 111:     if (!class_exists('XoopsLoad')) {
 112:         require_once XOOPS_ROOT_PATH . '/class/xoopsload.php';
 113:     }
 114: 
 115:     return XoopsLoad::load($name, $type);
 116: }
 117: 
 118: /**
 119:  * XOOPS language loader wrapper
 120:  *
 121:  * Temporay solution, not encouraged to use
 122:  *
 123:  * @param   string $name     Name of language file to be loaded, without extension
 124:  * @param   string $domain   Module dirname; global language file will be loaded if $domain is set to 'global' or not specified
 125:  * @param   string $language Language to be loaded, current language content will be loaded if not specified
 126:  * @return  boolean
 127:  * @todo    expand domain to multiple categories, e.g. module:system, framework:filter, etc.
 128:  *
 129:  */
 130: function xoops_loadLanguage($name, $domain = '', $language = null)
 131: {
 132:     /**
 133:      * Set pageType
 134:      */
 135:     if ($name === 'pagetype') {
 136:         $name = xoops_getOption('pagetype');
 137:     }
 138:     /**
 139:      * We must check later for an empty value. As xoops_getOption could be empty
 140:      */
 141:     if (empty($name)) {
 142:         return false;
 143:     }
 144:     $language = empty($language) ? $GLOBALS['xoopsConfig']['language'] : $language;
 145:     $path     = ((empty($domain) || 'global' === $domain) ? '' : "modules/{$domain}/") . 'language';
 146:     if (!file_exists($fileinc = $GLOBALS['xoops']->path("{$path}/{$language}/{$name}.php"))) {
 147:         if (!file_exists($fileinc = $GLOBALS['xoops']->path("{$path}/english/{$name}.php"))) {
 148:             return false;
 149:         }
 150:     }
 151:     $ret = include_once $fileinc;
 152: 
 153:     return $ret;
 154: }
 155: 
 156: /**
 157:  * YOU SHOULD BE CAREFUL WITH USING THIS METHOD SINCE IT WILL BE DEPRECATED
 158:  */
 159: /**
 160:  * xoops_getActiveModules()
 161:  *
 162:  * Get active modules from cache file
 163:  *
 164:  * @return array
 165:  */
 166: function xoops_getActiveModules()
 167: {
 168:     static $modules_active;
 169:     if (is_array($modules_active)) {
 170:         return $modules_active;
 171:     }
 172:     xoops_load('XoopsCache');
 173:     if (!$modules_active = XoopsCache::read('system_modules_active')) {
 174:         $modules_active = xoops_setActiveModules();
 175:     }
 176: 
 177:     return $modules_active;
 178: }
 179: 
 180: /**
 181:  * YOU SHOULD BE CAREFUL WITH USING THIS METHOD SINCE IT WILL BE DEPRECATED
 182:  */
 183: /**
 184:  * xoops_setActiveModules()
 185:  *
 186:  * Write active modules to cache file
 187:  *
 188:  * @return array
 189:  */
 190: function xoops_setActiveModules()
 191: {
 192:     xoops_load('XoopsCache');
 193:     /* @var $module_handler XoopsModuleHandler */
 194:     $module_handler = xoops_getHandler('module');
 195:     $modules_obj    = $module_handler->getObjects(new Criteria('isactive', 1));
 196:     $modules_active = array();
 197:     foreach (array_keys($modules_obj) as $key) {
 198:         $modules_active[] = $modules_obj[$key]->getVar('dirname');
 199:     }
 200:     unset($modules_obj);
 201:     XoopsCache::write('system_modules_active', $modules_active);
 202: 
 203:     return $modules_active;
 204: }
 205: 
 206: /**
 207:  * YOU SHOULD BE CAREFUL WITH USING THIS METHOD SINCE IT WILL BE DEPRECATED
 208:  */
 209: /**
 210:  * xoops_isActiveModule()
 211:  *
 212:  * Checks is module is installed and active
 213:  *
 214:  * @param $dirname
 215:  * @return bool
 216:  */
 217: function xoops_isActiveModule($dirname)
 218: {
 219:     return isset($dirname) && in_array($dirname, xoops_getActiveModules());
 220: }
 221: 
 222: /**
 223:  * xoops_header()
 224:  *
 225:  * @param mixed $closehead
 226:  * @return void
 227:  */
 228: function xoops_header($closehead = true)
 229: {
 230:     global $xoopsConfig;
 231: 
 232:     $themeSet = $xoopsConfig['theme_set'];
 233:     $themePath = XOOPS_THEME_PATH . '/' . $themeSet . '/';
 234:     $themeUrl = XOOPS_THEME_URL . '/' . $themeSet . '/';
 235:     include_once XOOPS_ROOT_PATH . '/class/template.php';
 236:     $headTpl = new \XoopsTpl();
 237:     $headTpl->assign(array(
 238:         'closeHead'      => (bool) $closehead,
 239:         'themeUrl'       => $themeUrl,
 240:         'xoops_langcode' => _LANGCODE,
 241:         'xoops_charset'  => _CHARSET,
 242:         'xoops_sitename' => $xoopsConfig['sitename'],
 243:         'xoops_url'      => XOOPS_URL,
 244:     ));
 245: 
 246:     if (file_exists($themePath . 'theme_autorun.php')) {
 247:         include_once($themePath . 'theme_autorun.php');
 248:     }
 249: 
 250:     $headItems = array();
 251:     $headItems[] = '<script type="text/javascript" src="' . XOOPS_URL . '/include/xoops.js"></script>';
 252:     $headItems[] = '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/xoops.css">';
 253:     $headItems[] = '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/media/font-awesome/css/font-awesome.min.css">';
 254:     $languageFile = 'language/' . $GLOBALS['xoopsConfig']['language'] . '/style.css';
 255:     if (file_exists($GLOBALS['xoops']->path($languageFile))) {
 256:         $headItems[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $GLOBALS['xoops']->url($languageFile) . '">';
 257:     }
 258:     $themecss = xoops_getcss($xoopsConfig['theme_set']);
 259:     if ($themecss!=='') {
 260:         $headItems[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $themecss . '">';
 261:     }
 262:     $headTpl->assign('headItems', $headItems);
 263: 
 264:     if (!headers_sent()) {
 265:         header('Content-Type:text/html; charset=' . _CHARSET);
 266:         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
 267:         header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
 268:         header('Cache-Control: no-store, no-cache, max-age=1, s-maxage=1, must-revalidate, post-check=0, pre-check=0');
 269:         header('Pragma: no-cache');
 270:     }
 271: 
 272:     $output = $headTpl->fetch('db:system_popup_header.tpl');
 273:     echo $output;
 274: }
 275: 
 276: /**
 277:  * xoops_footer
 278:  *
 279:  * @return void
 280:  */
 281: function xoops_footer()
 282: {
 283:     global $xoopsConfig;
 284: 
 285:     $themeSet = $xoopsConfig['theme_set'];
 286:     $themePath = XOOPS_THEME_URL . '/' . $themeSet . '/';
 287:     include_once XOOPS_ROOT_PATH . '/class/template.php';
 288:     $footTpl = new \XoopsTpl();
 289:     $footTpl->assign(array(
 290:         'themePath'      => $themePath,
 291:         'xoops_langcode' => _LANGCODE,
 292:         'xoops_charset'  => _CHARSET,
 293:         'xoops_sitename' => $xoopsConfig['sitename'],
 294:         'xoops_url'      => XOOPS_URL,
 295:     ));
 296:     $output = $footTpl->fetch('db:system_popup_footer.tpl');
 297:     echo $output;
 298:     ob_end_flush();
 299: }
 300: 
 301: /**
 302:  * xoops_error
 303:  *
 304:  * @param mixed  $msg
 305:  * @param string $title
 306:  * @return void
 307:  */
 308: function xoops_error($msg, $title = '')
 309: {
 310:     echo '<div class="errorMsg">';
 311:     if ($title != '') {
 312:         echo '<strong>' . $title . '</strong><br><br>';
 313:     }
 314:     if (is_object($msg)) {
 315:         $msg = (array)$msg;
 316:     }
 317:     if (is_array($msg)) {
 318:         foreach ($msg as $key => $value) {
 319:             if (is_numeric($key)) {
 320:                 $key = '';
 321:             }
 322:             xoops_error($value, $key);
 323:         }
 324:     } else {
 325:         echo "<div>{$msg}</div>";
 326:     }
 327:     echo '</div>';
 328: }
 329: 
 330: /**
 331:  * xoops_result
 332:  *
 333:  * @param mixed  $msg
 334:  * @param string $title
 335:  * @return void
 336:  */
 337: function xoops_result($msg, $title = '')
 338: {
 339:     echo '<div class="resultMsg">';
 340:     if ($title != '') {
 341:         echo '<strong>' . $title . '</strong><br><br>';
 342:     }
 343:     if (is_object($msg)) {
 344:         $msg = (array)$msg;
 345:     }
 346:     if (is_array($msg)) {
 347:         foreach ($msg as $key => $value) {
 348:             if (is_numeric($key)) {
 349:                 $key = '';
 350:             }
 351:             xoops_result($value, $key);
 352:         }
 353:     } else {
 354:         echo "<div>{$msg}</div>";
 355:     }
 356:     echo '</div>';
 357: }
 358: 
 359: /**
 360:  * xoops_confirm()
 361:  *
 362:  * @param mixed  $hiddens
 363:  * @param mixed  $action
 364:  * @param mixed  $msg
 365:  * @param string $submit
 366:  * @param mixed  $addtoken
 367:  * @return void
 368:  */
 369: function xoops_confirm($hiddens, $action, $msg, $submit = '', $addtoken = true)
 370: {
 371:     $submit = ($submit != '') ? trim($submit) : _SUBMIT;
 372:     echo '<div class="confirmMsg">' . $msg . '<br>
 373:           <form method="post" action="' . $action . '">';
 374:     foreach ($hiddens as $name => $value) {
 375:         if (is_array($value)) {
 376:             foreach ($value as $caption => $newvalue) {
 377:                 echo '<input type="radio" name="' . $name . '" value="' . htmlspecialchars($newvalue) . '" /> ' . $caption;
 378:             }
 379:             echo '<br>';
 380:         } else {
 381:             echo '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
 382:         }
 383:     }
 384:     if ($addtoken != false) {
 385:         echo $GLOBALS['xoopsSecurity']->getTokenHTML();
 386:     }
 387:     echo '<input type="submit" class="btn btn-default" name="confirm_submit" value="' . $submit . '" title="' . $submit . '"/>
 388:           <input type="button" class="btn btn-default" name="confirm_back" value="' . _CANCEL . '" onclick="history.go(-1);" title="' . _CANCEL . '" />
 389:           </form>
 390:           </div>';
 391: }
 392: 
 393: /**
 394:  * xoops_getUserTimestamp()
 395:  *
 396:  * @param mixed  $time
 397:  * @param string $timeoffset
 398:  * @return int
 399:  */
 400: function xoops_getUserTimestamp($time, $timeoffset = '')
 401: {
 402:     global $xoopsConfig, $xoopsUser;
 403:     if ($timeoffset == '') {
 404:         if ($xoopsUser) {
 405:             $timeoffset = $xoopsUser->getVar('timezone_offset');
 406:         } else {
 407:             $timeoffset = $xoopsConfig['default_TZ'];
 408:         }
 409:     }
 410:     $usertimestamp = (int)$time + ((float)$timeoffset - $xoopsConfig['server_TZ']) * 3600;
 411: 
 412:     return $usertimestamp;
 413: }
 414: 
 415: /**
 416:  * Function to display formatted times in user timezone
 417:  * @param        $time
 418:  * @param string $format
 419:  * @param string $timeoffset
 420:  * @return string
 421:  */
 422: function formatTimestamp($time, $format = 'l', $timeoffset = '')
 423: {
 424:     xoops_load('XoopsLocal');
 425: 
 426:     return XoopsLocal::formatTimestamp($time, $format, $timeoffset);
 427: }
 428: 
 429: /**
 430:  * Function to calculate server timestamp from user entered time (timestamp)
 431:  * @param      $timestamp
 432:  * @param null $userTZ
 433:  * @return
 434:  */
 435: function userTimeToServerTime($timestamp, $userTZ = null)
 436: {
 437:     global $xoopsConfig;
 438:     if (!isset($userTZ)) {
 439:         $userTZ = $xoopsConfig['default_TZ'];
 440:     }
 441:     $timestamp -= (($userTZ - $xoopsConfig['server_TZ']) * 3600);
 442: 
 443:     return $timestamp;
 444: }
 445: 
 446: /**
 447:  * xoops_makepass()
 448:  *
 449:  * @return string
 450:  */
 451: function xoops_makepass()
 452: {
 453:     $makepass  = '';
 454:     $syllables = array(
 455:         'er',
 456:         'in',
 457:         'tia',
 458:         'wol',
 459:         'fe',
 460:         'pre',
 461:         'vet',
 462:         'jo',
 463:         'nes',
 464:         'al',
 465:         'len',
 466:         'son',
 467:         'cha',
 468:         'ir',
 469:         'ler',
 470:         'bo',
 471:         'ok',
 472:         'tio',
 473:         'nar',
 474:         'sim',
 475:         'ple',
 476:         'bla',
 477:         'ten',
 478:         'toe',
 479:         'cho',
 480:         'co',
 481:         'lat',
 482:         'spe',
 483:         'ak',
 484:         'er',
 485:         'po',
 486:         'co',
 487:         'lor',
 488:         'pen',
 489:         'cil',
 490:         'li',
 491:         'ght',
 492:         'wh',
 493:         'at',
 494:         'the',
 495:         'he',
 496:         'ck',
 497:         'is',
 498:         'mam',
 499:         'bo',
 500:         'no',
 501:         'fi',
 502:         've',
 503:         'any',
 504:         'way',
 505:         'pol',
 506:         'iti',
 507:         'cs',
 508:         'ra',
 509:         'dio',
 510:         'sou',
 511:         'rce',
 512:         'sea',
 513:         'rch',
 514:         'pa',
 515:         'per',
 516:         'com',
 517:         'bo',
 518:         'sp',
 519:         'eak',
 520:         'st',
 521:         'fi',
 522:         'rst',
 523:         'gr',
 524:         'oup',
 525:         'boy',
 526:         'ea',
 527:         'gle',
 528:         'tr',
 529:         'ail',
 530:         'bi',
 531:         'ble',
 532:         'brb',
 533:         'pri',
 534:         'dee',
 535:         'kay',
 536:         'en',
 537:         'be',
 538:         'se');
 539:     mt_srand((double)microtime() * 1000000);
 540:     for ($count = 1; $count <= 4; ++$count) {
 541:         if (mt_rand() % 10 == 1) {
 542:             $makepass .= sprintf('%0.0f', (mt_rand() % 50) + 1);
 543:         } else {
 544:             $makepass .= sprintf('%s', $syllables[mt_rand() % 62]);
 545:         }
 546:     }
 547: 
 548:     return $makepass;
 549: }
 550: 
 551: /**
 552:  * checkEmail()
 553:  *
 554:  * @param mixed $email
 555:  * @param mixed $antispam
 556:  * @return bool|mixed
 557:  */
 558: function checkEmail($email, $antispam = false)
 559: {
 560:     if (!$email || !preg_match('/^[^@]{1,64}@[^@]{1,255}$/', $email)) {
 561:         return false;
 562:     }
 563:     $email_array      = explode('@', $email);
 564:     $local_array      = explode('.', $email_array[0]);
 565:     $local_arrayCount = count($local_array);
 566:     for ($i = 0; $i < $local_arrayCount; ++$i) {
 567:         if (!preg_match("/^(([A-Za-z0-9!#$%&'*+\/\=?^_`{|}~-][A-Za-z0-9!#$%&'*+\/\=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$/", $local_array[$i])) {
 568:             return false;
 569:         }
 570:     }
 571:     if (!preg_match("/^\[?[0-9\.]+\]?$/", $email_array[1])) {
 572:         $domain_array = explode('.', $email_array[1]);
 573:         if (count($domain_array) < 2) {
 574:             return false; // Not enough parts to domain
 575:         }
 576:         for ($i = 0; $i < count($domain_array); ++$i) {
 577:             if (!preg_match("/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$/", $domain_array[$i])) {
 578:                 return false;
 579:             }
 580:         }
 581:     }
 582:     if ($antispam) {
 583:         $email = str_replace('@', ' at ', $email);
 584:         $email = str_replace('.', ' dot ', $email);
 585:     }
 586: 
 587:     return $email;
 588: }
 589: 
 590: /**
 591:  * formatURL()
 592:  *
 593:  * @param mixed $url
 594:  * @return mixed|string
 595:  */
 596: function formatURL($url)
 597: {
 598:     $url = trim($url);
 599:     if ($url != '') {
 600:         if ((!preg_match('/^http[s]*:\/\//i', $url)) && (!preg_match('/^ftp*:\/\//i', $url)) && (!preg_match('/^ed2k*:\/\//i', $url))) {
 601:             $url = 'http://' . $url;
 602:         }
 603:     }
 604: 
 605:     return $url;
 606: }
 607: 
 608: /**
 609:  * Function to get banner html tags for use in templates
 610:  */
 611: function xoops_getbanner()
 612: {
 613:     global $xoopsConfig;
 614: 
 615:     $db      = XoopsDatabaseFactory::getDatabaseConnection();
 616:     $bresult = $db->query('SELECT COUNT(*) FROM ' . $db->prefix('banner'));
 617:     list($numrows) = $db->fetchRow($bresult);
 618:     if ($numrows > 1) {
 619:         --$numrows;
 620:         mt_srand((double)microtime() * 1000000);
 621:         $bannum = mt_rand(0, $numrows);
 622:     } else {
 623:         $bannum = 0;
 624:     }
 625:     if ($numrows > 0) {
 626:         $bresult = $db->query('SELECT * FROM ' . $db->prefix('banner'), 1, $bannum);
 627:         list($bid, $cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $date, $htmlbanner, $htmlcode) = $db->fetchRow($bresult);
 628:         if ($xoopsConfig['my_ip'] == xoops_getenv('REMOTE_ADDR')) {
 629:             // EMPTY
 630:         } else {
 631:             ++$impmade;
 632:             $db->queryF(sprintf('UPDATE %s SET impmade = %u WHERE bid = %u', $db->prefix('banner'), $impmade, $bid));
 633:             /**
 634:              * Check if this impression is the last one
 635:              */
 636:             if ($imptotal > 0 && $impmade >= $imptotal) {
 637:                 $newid = $db->genId($db->prefix('bannerfinish') . '_bid_seq');
 638:                 $sql   = sprintf('INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES (%u, %u, %u, %u, %u, %u)', $db->prefix('bannerfinish'), $newid, $cid, $impmade, $clicks, $date, time());
 639:                 $db->queryF($sql);
 640:                 $db->queryF(sprintf('DELETE FROM %s WHERE bid = %u', $db->prefix('banner'), $bid));
 641:             }
 642:         }
 643:         /**
 644:          * Print the banner
 645:          */
 646:         $bannerobject = '';
 647:         if ($htmlbanner) {
 648:             if ($htmlcode) {
 649:                 $bannerobject = $htmlcode;
 650:             } else {
 651:                 $bannerobject = $bannerobject . '<div id="xo-bannerfix">';
 652:                 // $bannerobject = $bannerobject . '<div id="xo-fixbanner">';
 653:                 $bannerobject = $bannerobject . ' <iframe src=' . $imageurl . ' border="0" scrolling="no" allowtransparency="true" width="480px" height="60px" style="border:0" alt="' . $clickurl . ';"> </iframe>';
 654:                 $bannerobject .= '</div>';
 655:                 // $bannerobject .= '</div>';
 656:             }
 657:         } else {
 658:             $bannerobject = '<div id="xo-bannerfix">';
 659:             if (false !== stripos($imageurl, '.swf')) {
 660:                 $bannerobject = $bannerobject . '<div id ="xo-fixbanner">' . '<a href="' . XOOPS_URL . '/banners.php?op=click&amp;bid=' . $bid . '" rel="external" title="' . $clickurl . '"></a></div>' . '<object type="application/x-shockwave-flash" width="468" height="60" data="' . $imageurl . '" style="z-index:100;">' . '<param name="movie" value="' . $imageurl . '" />' . '<param name="wmode" value="opaque" />' . '</object>';
 661:             } else {
 662:                 $bannerobject = $bannerobject . '<a href="' . XOOPS_URL . '/banners.php?op=click&amp;bid=' . $bid . '" rel="external" title="' . $clickurl . '"><img src="' . $imageurl . '" alt="' . $clickurl . '" /></a>';
 663:             }
 664: 
 665:             $bannerobject .= '</div>';
 666:         }
 667: 
 668:         return $bannerobject;
 669:     }
 670:     return null;
 671: }
 672: 
 673: /**
 674:  * Function to redirect a user to certain pages
 675:  * @param        $url
 676:  * @param int    $time
 677:  * @param string $message
 678:  * @param bool   $addredirect
 679:  * @param bool   $allowExternalLink
 680:  */
 681: function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false)
 682: {
 683:     global $xoopsConfig, $xoopsLogger, $xoopsUserIsAdmin;
 684: 
 685:     $xoopsPreload = XoopsPreload::getInstance();
 686:     $xoopsPreload->triggerEvent('core.include.functions.redirectheader.start', array($url, $time, $message, $addredirect, $allowExternalLink));
 687:     // under normal circumstance this event will exit, so listen for the .start above
 688:     $xoopsPreload->triggerEvent('core.include.functions.redirectheader', array($url, $time, $message, $addredirect, $allowExternalLink));
 689: 
 690:     if (preg_match("/[\\0-\\31]|about:|script:/i", $url)) {
 691:         if (!preg_match('/^\b(java)?script:([\s]*)history\.go\(-\d*\)([\s]*[;]*[\s]*)$/si', $url)) {
 692:             $url = XOOPS_URL;
 693:         }
 694:     }
 695:     if (!$allowExternalLink && $pos = strpos($url, '://')) {
 696:         $xoopsLocation = substr(XOOPS_URL, strpos(XOOPS_URL, '://') + 3);
 697:         if (strcasecmp(substr($url, $pos + 3, strlen($xoopsLocation)), $xoopsLocation)) {
 698:             $url = XOOPS_URL;
 699:         }
 700:     }
 701:     if (defined('XOOPS_CPFUNC_LOADED')) {
 702:         $theme = 'default';
 703:     } else {
 704:         $theme = $xoopsConfig['theme_set'];
 705:     }
 706: 
 707:     require_once XOOPS_ROOT_PATH . '/class/template.php';
 708:     require_once XOOPS_ROOT_PATH . '/class/theme.php';
 709:     $xoopsThemeFactory                = null;
 710:     $xoopsThemeFactory                = new xos_opal_ThemeFactory();
 711:     $xoopsThemeFactory->allowedThemes = $xoopsConfig['theme_set_allowed'];
 712:     $xoopsThemeFactory->defaultTheme  = $theme;
 713:     $xoTheme                          = $xoopsThemeFactory->createInstance(array(
 714:                                                                                 'plugins'      => array(),
 715:                                                                                 'renderBanner' => false));
 716:     $xoopsTpl                         = $xoTheme->template;
 717:     $xoopsTpl->assign(array(
 718:                           'xoops_theme'      => $theme,
 719:                           'xoops_imageurl'   => XOOPS_THEME_URL . '/' . $theme . '/',
 720:                           'xoops_themecss'   => xoops_getcss($theme),
 721:                           'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES),
 722:                           'xoops_sitename'   => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES),
 723:                           'xoops_slogan'     => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES),
 724:                           'xoops_dirname'    => isset($xoopsModule) && is_object($xoopsModule) ? $xoopsModule->getVar('dirname') : 'system',
 725:                           'xoops_pagetitle'  => isset($xoopsModule) && is_object($xoopsModule) ? $xoopsModule->getVar('name') : htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
 726:     if ($xoopsConfig['debug_mode'] == 2 && $xoopsUserIsAdmin) {
 727:         $xoopsTpl->assign('time', 300);
 728:         $xoopsTpl->assign('xoops_logdump', $xoopsLogger->dump());
 729:     } else {
 730:         $xoopsTpl->assign('time', (int)$time);
 731:     }
 732:     if (!empty($_SERVER['REQUEST_URI']) && $addredirect && false !== strpos($url, 'user.php')) {
 733:         if (false === strpos($url, '?')) {
 734:             $url .= '?xoops_redirect=' . urlencode($_SERVER['REQUEST_URI']);
 735:         } else {
 736:             $url .= '&amp;xoops_redirect=' . urlencode($_SERVER['REQUEST_URI']);
 737:         }
 738:     }
 739:     if (defined('SID') && SID && (!isset($_COOKIE[session_name()]) || ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '' && !isset($_COOKIE[$xoopsConfig['session_name']])))) {
 740:         if (false === strpos($url, '?')) {
 741:             $url .= '?' . SID;
 742:         } else {
 743:             $url .= '&amp;' . SID;
 744:         }
 745:     }
 746:     $url = preg_replace('/&amp;/i', '&', htmlspecialchars($url, ENT_QUOTES));
 747:     $xoopsTpl->assign('url', $url);
 748:     $message = trim($message) != '' ? $message : _TAKINGBACK;
 749:     $xoopsTpl->assign('message', $message);
 750:     $xoopsTpl->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD, $url));
 751: 
 752:     $xoopsTpl->display('db:system_redirect.tpl');
 753:     exit();
 754: }
 755: 
 756: /**
 757:  * xoops_getenv()
 758:  *
 759:  * @param mixed $key
 760:  * @return string
 761:  */
 762: function xoops_getenv($key)
 763: {
 764:     $ret = '';
 765:     if (array_key_exists($key, $_SERVER) && isset($_SERVER[$key])) {
 766:         $ret = $_SERVER[$key];
 767: 
 768:         return $ret;
 769:     }
 770:     if (array_key_exists($key, $_ENV) && isset($_ENV[$key])) {
 771:         $ret = $_ENV[$key];
 772: 
 773:         return $ret;
 774:     }
 775: 
 776:     return $ret;
 777: }
 778: 
 779: /**
 780:  * Function to get css file for a certain themeset
 781:  * @param string $theme
 782:  * @return string
 783:  */
 784: function xoops_getcss($theme = '')
 785: {
 786:     if ($theme == '') {
 787:         $theme = $GLOBALS['xoopsConfig']['theme_set'];
 788:     }
 789:     $uagent  = xoops_getenv('HTTP_USER_AGENT');
 790:     $str_css = 'styleNN.css';
 791:     if (false !== stripos($uagent, 'mac')) {
 792:         $str_css = 'styleMAC.css';
 793:     } elseif (preg_match("/MSIE (\d\.\d{1,2})/i", $uagent)) {
 794:         $str_css = 'style.css';
 795:     }
 796:     if (is_dir(XOOPS_THEME_PATH . '/' . $theme)) {
 797:         if (file_exists(XOOPS_THEME_PATH . '/' . $theme . '/' . $str_css)) {
 798:             return XOOPS_THEME_URL . '/' . $theme . '/' . $str_css;
 799:         } elseif (file_exists(XOOPS_THEME_PATH . '/' . $theme . '/style.css')) {
 800:             return XOOPS_THEME_URL . '/' . $theme . '/style.css';
 801:         }
 802:     }
 803:     if (is_dir(XOOPS_THEME_PATH . '/' . $theme . '/css')) {
 804:         if (file_exists(XOOPS_THEME_PATH . '/' . $theme . '/css/' . $str_css)) {
 805:             return XOOPS_THEME_URL . '/' . $theme . '/css/' . $str_css;
 806:         } elseif (file_exists(XOOPS_THEME_PATH . '/' . $theme . '/css/style.css')) {
 807:             return XOOPS_THEME_URL . '/' . $theme . '/css/style.css';
 808:         }
 809:     }
 810: 
 811:     return '';
 812: }
 813: 
 814: /**
 815:  * xoops_getMailer()
 816:  *
 817:  * @return \XoopsMailer|\XoopsMailerLocal
 818:  */
 819: function xoops_getMailer()
 820: {
 821:     static $mailer;
 822:     global $xoopsConfig;
 823:     if (is_object($mailer)) {
 824:         return $mailer;
 825:     }
 826:     include_once XOOPS_ROOT_PATH . '/class/xoopsmailer.php';
 827:     if (file_exists($file = XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/xoopsmailerlocal.php')) {
 828:         include_once $file;
 829:     } elseif (file_exists($file = XOOPS_ROOT_PATH . '/language/english/xoopsmailerlocal.php')) {
 830:         include_once $file;
 831:     }
 832:     unset($mailer);
 833:     if (class_exists('XoopsMailerLocal')) {
 834:         $mailer = new XoopsMailerLocal();
 835:     } else {
 836:         $mailer = new XoopsMailer();
 837:     }
 838: 
 839:     return $mailer;
 840: }
 841: 
 842: /**
 843:  * xoops_getrank()
 844:  *
 845:  * @param integer $rank_id
 846:  * @param mixed   $posts
 847:  * @return
 848:  */
 849: function xoops_getrank($rank_id = 0, $posts = 0)
 850: {
 851:     $db      = XoopsDatabaseFactory::getDatabaseConnection();
 852:     $myts    = MyTextSanitizer::getInstance();
 853:     $rank_id = (int)$rank_id;
 854:     $posts   = (int)$posts;
 855:     if ($rank_id != 0) {
 856:         $sql = 'SELECT rank_title AS title, rank_image AS image FROM ' . $db->prefix('ranks') . ' WHERE rank_id = ' . $rank_id;
 857:     } else {
 858:         $sql = 'SELECT rank_title AS title, rank_image AS image FROM ' . $db->prefix('ranks') . ' WHERE rank_min <= ' . $posts . ' AND rank_max >= ' . $posts . ' AND rank_special = 0';
 859:     }
 860:     $rank          = $db->fetchArray($db->query($sql));
 861:     $rank['title'] = $myts->htmlspecialchars($rank['title']);
 862:     $rank['id']    = $rank_id;
 863: 
 864:     return $rank;
 865: }
 866: 
 867: /**
 868:  * Returns the portion of string specified by the start and length parameters. If $trimmarker is supplied, it is appended to the return string. This function works fine with multi-byte characters if mb_* functions exist on the server.
 869:  *
 870:  * @param string $str
 871:  * @param int    $start
 872:  * @param int    $length
 873:  * @param string $trimmarker
 874:  * @return string
 875:  */
 876: function xoops_substr($str, $start, $length, $trimmarker = '...')
 877: {
 878:     xoops_load('XoopsLocal');
 879: 
 880:     return XoopsLocal::substr($str, $start, $length, $trimmarker);
 881: }
 882: 
 883: // RMV-NOTIFY
 884: // ################ Notification Helper Functions ##################
 885: // We want to be able to delete by module, by user, or by item.
 886: // How do we specify this??
 887: /**
 888:  * @param $module_id
 889:  *
 890:  * @return mixed
 891:  */
 892: function xoops_notification_deletebymodule($module_id)
 893: {
 894:     $notification_handler = xoops_getHandler('notification');
 895: 
 896:     return $notification_handler->unsubscribeByModule($module_id);
 897: }
 898: 
 899: /**
 900:  * xoops_notification_deletebyuser()
 901:  *
 902:  * @param mixed $user_id
 903:  * @return
 904:  */
 905: function xoops_notification_deletebyuser($user_id)
 906: {
 907:     $notification_handler = xoops_getHandler('notification');
 908: 
 909:     return $notification_handler->unsubscribeByUser($user_id);
 910: }
 911: 
 912: /**
 913:  * xoops_notification_deletebyitem()
 914:  *
 915:  * @param mixed $module_id
 916:  * @param mixed $category
 917:  * @param mixed $item_id
 918:  * @return
 919:  */
 920: function xoops_notification_deletebyitem($module_id, $category, $item_id)
 921: {
 922:     $notification_handler = xoops_getHandler('notification');
 923: 
 924:     return $notification_handler->unsubscribeByItem($module_id, $category, $item_id);
 925: }
 926: 
 927: /**
 928:  * xoops_comment_count()
 929:  *
 930:  * @param mixed $module_id
 931:  * @param mixed $item_id
 932:  * @return
 933:  */
 934: function xoops_comment_count($module_id, $item_id = null)
 935: {
 936:     $comment_handler = xoops_getHandler('comment');
 937:     $criteria        = new CriteriaCompo(new Criteria('com_modid', (int)$module_id));
 938:     if (isset($item_id)) {
 939:         $criteria->add(new Criteria('com_itemid', (int)$item_id));
 940:     }
 941: 
 942:     return $comment_handler->getCount($criteria);
 943: }
 944: 
 945: /**
 946:  * xoops_comment_delete()
 947:  *
 948:  * @param mixed $module_id
 949:  * @param mixed $item_id
 950:  * @return bool
 951:  */
 952: function xoops_comment_delete($module_id, $item_id)
 953: {
 954:     if ((int)$module_id > 0 && (int)$item_id > 0) {
 955:         $comment_handler = xoops_getHandler('comment');
 956:         $comments        = $comment_handler->getByItemId($module_id, $item_id);
 957:         if (is_array($comments)) {
 958:             $count       = count($comments);
 959:             $deleted_num = array();
 960:             for ($i = 0; $i < $count; ++$i) {
 961:                 if (false !== $comment_handler->delete($comments[$i])) {
 962:                     // store poster ID and deleted post number into array for later use
 963:                     $poster_id = $comments[$i]->getVar('com_uid');
 964:                     if ($poster_id != 0) {
 965:                         $deleted_num[$poster_id] = !isset($deleted_num[$poster_id]) ? 1 : ($deleted_num[$poster_id] + 1);
 966:                     }
 967:                 }
 968:             }
 969:             /* @var $member_handler XoopsMemberHandler */
 970:             $member_handler = xoops_getHandler('member');
 971:             foreach ($deleted_num as $user_id => $post_num) {
 972:                 // update user posts
 973:                 $com_poster = $member_handler->getUser($user_id);
 974:                 if (is_object($com_poster)) {
 975:                     $member_handler->updateUserByField($com_poster, 'posts', $com_poster->getVar('posts') - $post_num);
 976:                 }
 977:             }
 978: 
 979:             return true;
 980:         }
 981:     }
 982: 
 983:     return false;
 984: }
 985: 
 986: /**
 987:  * xoops_groupperm_deletebymoditem()
 988:  *
 989:  * Group Permission Helper Functions
 990:  *
 991:  * @param mixed $module_id
 992:  * @param mixed $perm_name
 993:  * @param mixed $item_id
 994:  * @return bool
 995:  */
 996: function xoops_groupperm_deletebymoditem($module_id, $perm_name, $item_id = null)
 997: {
 998:     // do not allow system permissions to be deleted
 999:     if ((int)$module_id <= 1) {
1000:         return false;
1001:     }
1002:     /* @var  $gperm_handler XoopsGroupPermHandler */
1003:     $gperm_handler = xoops_getHandler('groupperm');
1004: 
1005:     return $gperm_handler->deleteByModule($module_id, $perm_name, $item_id);
1006: }
1007: 
1008: /**
1009:  * xoops_utf8_encode()
1010:  *
1011:  * @param mixed $text
1012:  * @return string
1013:  */
1014: function xoops_utf8_encode(&$text)
1015: {
1016:     xoops_load('XoopsLocal');
1017: 
1018:     return XoopsLocal::utf8_encode($text);
1019: }
1020: 
1021: /**
1022:  * xoops_convert_encoding()
1023:  *
1024:  * @param mixed $text
1025:  * @return string
1026:  */
1027: function xoops_convert_encoding(&$text)
1028: {
1029:     return xoops_utf8_encode($text);
1030: }
1031: 
1032: /**
1033:  * xoops_trim()
1034:  *
1035:  * @param mixed $text
1036:  * @return string
1037:  */
1038: function xoops_trim($text)
1039: {
1040:     xoops_load('XoopsLocal');
1041: 
1042:     return XoopsLocal::trim($text);
1043: }
1044: 
1045: /**
1046:  * YOU SHOULD NOT USE THIS METHOD, IT WILL BE REMOVED
1047:  */
1048: /**
1049:  * xoops_getOption()
1050:  *
1051:  * @param mixed $option
1052:  * @internal param string $type
1053:  * @deprecated
1054:  * @return string
1055:  */
1056: function xoops_getOption($option)
1057: {
1058:     $ret = '';
1059:     if (isset($GLOBALS['xoopsOption'][$option])) {
1060:         $ret = $GLOBALS['xoopsOption'][$option];
1061:     }
1062: 
1063:     return $ret;
1064: }
1065: 
1066: /**
1067:  * YOU SHOULD NOT USE THIS METHOD, IT WILL BE REMOVED
1068:  */
1069: /**
1070:  * xoops_getConfigOption()
1071:  *
1072:  * @param mixed  $option
1073:  * @param array|string $type
1074:  * @internal param string $dirname
1075:  * @deprecated
1076:  * @return bool
1077:  */
1078: function xoops_getConfigOption($option, $type = 'XOOPS_CONF')
1079: {
1080:     static $coreOptions = array();
1081: 
1082:     if (is_array($coreOptions) && array_key_exists($option, $coreOptions)) {
1083:         return $coreOptions[$option];
1084:     }
1085:     $ret            = false;
1086:     /* @var $config_handler XoopsConfigHandler  */
1087:     $config_handler = xoops_getHandler('config');
1088:     $configs        = $config_handler->getConfigsByCat(is_array($type) ? $type : constant($type));
1089:     if ($configs) {
1090:         if (isset($configs[$option])) {
1091:             $ret = $configs[$option];
1092:         }
1093:     }
1094:     $coreOptions[$option] = $ret;
1095: 
1096:     return $ret;
1097: }
1098: 
1099: /**
1100:  * YOU SHOULD NOT USE THIS METHOD, IT WILL BE REMOVED
1101:  */
1102: /**
1103:  * xoops_setConfigOption()
1104:  *
1105:  * @param mixed $option
1106:  * @param null  $new
1107:  * @return void
1108: @deprecated
1109:  */
1110: function xoops_setConfigOption($option, $new = null)
1111: {
1112:     if (isset($GLOBALS['xoopsConfig'][$option]) && null !== $new) {
1113:         $GLOBALS['xoopsConfig'][$option] = $new;
1114:     }
1115: }
1116: 
1117: /**
1118:  * YOU SHOULD NOT USE THIS METHOD, IT WILL BE REMOVED
1119:  */
1120: /**
1121:  * xoops_getModuleOption
1122:  *
1123:  * Method for module developers getting a module config item. This could be from any module requested.
1124:  *
1125:  * @param mixed  $option
1126:  * @param string $dirname
1127:  * @return bool
1128: @deprecated
1129:  */
1130: function xoops_getModuleOption($option, $dirname = '')
1131: {
1132:     static $modOptions = array();
1133:     if (is_array($modOptions) && isset($modOptions[$dirname][$option])) {
1134:         return $modOptions[$dirname][$option];
1135:     }
1136: 
1137:     $ret            = false;
1138:     /* @var $module_handler XoopsModuleHandler */
1139:     $module_handler = xoops_getHandler('module');
1140:     $module         = $module_handler->getByDirname($dirname);
1141:     /* @var $config_handler XoopsConfigHandler  */
1142:     $config_handler = xoops_getHandler('config');
1143:     if (is_object($module)) {
1144:         $moduleConfig = $config_handler->getConfigsByCat(0, $module->getVar('mid'));
1145:         if (isset($moduleConfig[$option])) {
1146:             $ret = $moduleConfig[$option];
1147:         }
1148:     }
1149:     $modOptions[$dirname][$option] = $ret;
1150: 
1151:     return $ret;
1152: }
1153: 
1154: /**
1155:  * Determine the base domain name for a URL. The primary use for this is to set the domain
1156:  * used for cookies to represent any subdomains.
1157:  *
1158:  * The registrable domain is determined using the public suffix list. If the domain is not
1159:  * registrable, an empty string is returned. This empty string can be used in setcookie()
1160:  * as the domain, which restricts cookie to just the current host.
1161:  *
1162:  * @param string $url URL or hostname to process
1163:  *
1164:  * @return string the registrable domain or an empty string
1165:  */
1166: function xoops_getBaseDomain($url)
1167: {
1168:     $parts = parse_url($url);
1169:     $host = '';
1170:     if (!empty($parts['host'])) {
1171:         $host = $parts['host'];
1172:         if (strtolower($host) === 'localhost') {
1173:             return 'localhost';
1174:         }
1175:         // bail if this is an IPv4 address (IPv6 will fail later)
1176:         if (false !== filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
1177:             return '';
1178:         }
1179:         $regdom = new \Geekwright\RegDom\RegisteredDomain();
1180:         $host = $regdom->getRegisteredDomain($host);
1181:     }
1182:     return (null === $host) ? '' : $host;
1183: }
1184: 
1185: /**
1186:  * YOU SHOULD NOT USE THIS METHOD, IT WILL BE REMOVED
1187:  */
1188: /**
1189:  * Function to get the domain from a URL.
1190:  *
1191:  * @param string $url the URL to be stripped.
1192:  * @return string
1193:  * @deprecated
1194:  */
1195: function xoops_getUrlDomain($url)
1196: {
1197:     $domain = '';
1198:     $_URL   = parse_url($url);
1199: 
1200:     if (!empty($_URL) || !empty($_URL['host'])) {
1201:         $domain = $_URL['host'];
1202:     }
1203: 
1204:     return $domain;
1205: }
1206: 
1207: include_once __DIR__ . '/functions.encoding.php';
1208: include_once __DIR__ . '/functions.legacy.php';
1209: 
API documentation generated by ApiGen