本文整理汇总了PHP中cbimport函数的典型用法代码示例。如果您正苦于以下问题:PHP cbimport函数的具体用法?PHP cbimport怎么用?PHP cbimport使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cbimport函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptions
protected function getOptions() {
if ( ( ! file_exists( JPATH_SITE . '/libraries/CBLib/CBLib/Core/CBLib.php' ) ) || ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) ) {
return array();
}
/** @noinspection PhpIncludeInspection */
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
cbimport( 'language.front' );
$db = JFactory::getDBO();
$options = array();
$query = 'SELECT ' . $db->quoteName( 'element' ) . ' AS value'
. ', ' . $db->quoteName( 'name' ) . ' AS text'
. "\n FROM " . $db->quoteName( '#__comprofiler_plugin' )
. "\n WHERE " . $db->quoteName( 'type' ) . " NOT IN ( " . $db->quote( 'templates' ) . ", " . $db->quote( 'language' ) . " )"
. "\n ORDER BY " . $db->quoteName( 'ordering' );
$db->setQuery( $query );
$plugins = $db->loadObjectList();
if ( $plugins ) foreach ( $plugins as $plugin ) {
$options[] = JHtml::_( 'select.option', $plugin->value, CBTxt::T( $plugin->text ) );
}
return $options;
}
示例2: getGroups
/**
* @return array
*/
protected function getGroups()
{
global $_PLUGINS;
static $loaded = 0;
if ( ! $loaded++ ) {
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
cbimport( 'cb.html' );
cbimport( 'language.all' );
$_PLUGINS->loadPluginGroup( 'user' );
}
$groups = CBGroupJive::getGroupOptions();
$options = array();
$optGroup = 0;
foreach ( $groups as $group ) {
if ( is_array( $group->value ) ) {
$optGroup = $group->text;
continue;
}
$options[$optGroup][] = $group;
}
return $options;
}
示例3: execute
/**
* @param cbautoactionsActionTable $trigger
* @param UserTable $user
*/
public function execute( $trigger, $user )
{
$params = $trigger->getParams()->subTree( 'loginlogout' );
cbimport( 'cb.authentication' );
$cbAuthenticate = new CBAuthentication();
$isHttps = ( isset( $_SERVER['HTTPS'] ) && ( ! empty( $_SERVER['HTTPS'] ) ) && ( $_SERVER['HTTPS'] != 'off' ) );
$returnUrl = 'http' . ( $isHttps ? 's' : '' ) . '://' . $_SERVER['HTTP_HOST'];
if ( ( ! empty( $_SERVER['PHP_SELF'] ) ) && ( ! empty( $_SERVER['REQUEST_URI'] ) ) ) {
$returnUrl .= $_SERVER['REQUEST_URI'];
} else {
$returnUrl .= $_SERVER['SCRIPT_NAME'];
if ( isset( $_SERVER['QUERY_STRING'] ) && ( ! empty( $_SERVER['QUERY_STRING'] ) ) ) {
$returnUrl .= '?' . $_SERVER['QUERY_STRING'];
}
}
$returnUrl = cbUnHtmlspecialchars( preg_replace( '/[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']/', '""', preg_replace( '/eval\((.*)\)/', '', htmlspecialchars( urldecode( $returnUrl ) ) ) ) );
if ( preg_match( '/index.php\?option=com_comprofiler&task=confirm&confirmCode=|index.php\?option=com_comprofiler&view=confirm&confirmCode=|index.php\?option=com_comprofiler&task=login|index.php\?option=com_comprofiler&view=login/', $returnUrl ) ) {
$returnUrl = 'index.php';
}
$redirect = $trigger->getSubstituteString( $params->get( 'redirect', null, GetterInterface::STRING ), array( 'cbautoactionsClass', 'escapeURL' ) );
if ( $redirect ) {
$returnUrl = $redirect;
}
$message = $trigger->getSubstituteString( CBTxt::T( $params->get( 'message', null, GetterInterface::RAW ) ), false );
if ( $params->get( 'mode', 1, GetterInterface::BOOLEAN ) ) {
$messagesToUser = array();
$alertMessages = array();
if ( $params->get( 'method', 1, GetterInterface::BOOLEAN ) ) {
$credentials = $trigger->getSubstituteString( $params->get( 'username', null, GetterInterface::STRING ) );
$method = 0;
} else {
$credentials = $trigger->getSubstituteString( $params->get( 'email', null, GetterInterface::STRING ) );
$method = 1;
}
$resultError = $cbAuthenticate->login( $credentials, false, 0, 1, $returnUrl, $messagesToUser, $alertMessages, $method );
if ( $redirect ) {
cbRedirect( $redirect, ( $resultError ? $resultError : ( $message ? $message : ( $alertMessages ? stripslashes( implode( '<br />', $alertMessages ) ) : null ) ) ), ( $resultError ? 'error' : 'message' ) );
}
} else {
$resultError = $cbAuthenticate->logout( $returnUrl );
if ( $redirect ) {
cbRedirect( $redirect, ( $resultError ? $resultError : ( $message ? $message : CBTxt::T( 'LOGOUT_SUCCESS', 'You have successfully logged out' ) ) ), ( $resultError ? 'error' : 'message' ) );
}
}
}
示例4: getOptions
protected function getOptions()
{
global $_CB_database;
if (!file_exists(JPATH_SITE . '/libraries/CBLib/CBLib/Core/CBLib.php') || !file_exists(JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php')) {
return array();
}
/** @noinspection PhpIncludeInspection */
include_once JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
cbimport('cb.html');
cbimport('language.front');
$query = 'SELECT f.*' . "\n FROM " . $_CB_database->NameQuote('#__comprofiler_fields') . " AS f" . "\n LEFT JOIN " . $_CB_database->NameQuote('#__comprofiler_tabs') . " AS t" . ' ON t.' . $_CB_database->NameQuote('tabid') . ' = f.' . $_CB_database->NameQuote('tabid') . "\n WHERE f." . $_CB_database->NameQuote('published') . " = 1" . "\n AND f." . $_CB_database->NameQuote('name') . " != " . $_CB_database->Quote('NA') . "\n ORDER BY t." . $_CB_database->NameQuote('ordering') . ", f." . $_CB_database->NameQuote('ordering');
$_CB_database->setQuery($query);
$fields = $_CB_database->loadObjectList(null, '\\CB\\Database\\Table\\FieldTable', array(&$_CB_database));
$options = array();
/** @var FieldTable[] $fields */
if ($fields) {
foreach ($fields as $field) {
if (count($field->getTableColumns())) {
$title = CBTxt::T($field->title);
$options[] = JHtml::_('select.option', $field->name, $title ? $title . ' (' . $field->name . ')' : $field->name);
}
}
}
return $options;
}
示例5: getCBAvatar
public static function getCBAvatar($id)
{
$files = JPATH_SITE . 'administrator/components/com_comprofiler/plugin.foundation.php';
if (!JFile::exists($files)) {
$avatar = self::getDefaultAvatar();
return $avatar;
}
require_once $files;
cbimport('cb.database');
cbimport('cb.tables');
cbimport('cb.tabs');
$user = CBuser::getInstance($id);
if (!$id) {
$avatar = self::getDefaultAvatar();
return $avatar;
}
if (!$user) {
$user = CBuser::getInstance(null);
}
ob_start();
$source = $user->getField('avatar', null, 'php');
$reset = ob_get_contents();
ob_end_clean();
unset($reset);
$source = $source['avatar'];
$source = str_replace('/administrator/', '/', $source);
return $source;
}
示例6: __construct
/**
* Constructor
*/
public function __construct()
{
global $ueConfig;
// needed for the includes below, incl. ue_config.php
$_CB_joomla_path = JPATH_SITE;
$_CB_joomla_adminpath = JPATH_ADMINISTRATOR;
$_CB_adminpath = $_CB_joomla_adminpath . "/components/com_comprofiler";
if (!file_exists($_CB_adminpath . '/plugin.class.php')) {
if (is_callable(array('JError', 'raiseWarning'))) {
JError::raiseNotice('SOME_ERROR_CODE', 'Paid Subscriptions bot detected that Community Builder is not installed.', '');
} else {
trigger_error('Paid Subscriptions bot detected that Community Builder is not installed.', E_USER_WARNING);
}
return;
}
if (!file_exists($_CB_joomla_path . '/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/cbpaidsubscriptions.class.php')) {
if (is_callable(array('JError', 'raiseWarning'))) {
JError::raiseNotice('SOME_ERROR_CODE', 'Paid Subscriptions bot detected that Community Builder Paid Subscriptions plugin is not installed.', '');
} else {
trigger_error('Paid Subscriptions bot detected that Community Builder Paid Subscriptions plugin is not installed.', E_USER_WARNING);
}
return;
}
/** @noinspection PhpIncludeInspection */
include_once $_CB_adminpath . '/plugin.foundation.php';
cbimport('cb.plugins');
//cbimport( 'cb.tabs' ); // comprofiler.class.php is not needed for sure.
cbimport('cb.database');
cbimport('cb.tables');
/** @noinspection PhpIncludeInspection */
include_once $_CB_joomla_path . '/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/cbpaidsubscriptions.class.php';
$this->paidsubsManager = cbpaidSubscriptionsMgr::getInstance();
}
示例7: __construct
/**
* @param object $subject
* @param array $config
*/
public function __construct( &$subject, $config )
{
global $_PLUGINS;
parent::__construct( $subject, $config );
static $CB_loaded = 0;
if ( ! $CB_loaded++ ) {
if ( ( ! file_exists( JPATH_SITE . '/libraries/CBLib/CBLib/Core/CBLib.php' ) ) || ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) ) {
return;
}
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
cbimport( 'cb.html' );
cbimport( 'language.front' );
$_PLUGINS->loadPluginGroup( 'user' );
$this->_gjPlugin = $_PLUGINS->getLoadedPlugin( 'user', 'cbgroupjive' );
if ( ! $this->_gjPlugin ) {
return;
}
$this->_gjParams = $_PLUGINS->getPluginParams( $this->_gjPlugin );
}
}
示例8: emailUsers
/**
* Outputs legacy mass mailer display
*
* @deprecated 2.0
*
* @param UserTable[] $rows
* @param string $emailSubject
* @param string $emailBody
* @param string $emailAttach
* @param string $emailFromName
* @param string $emailFromAddr
* @param string $emailReplyName
* @param string $emailReplyAddr
* @param int $emailsPerBatch
* @param int $emailsBatch
* @param int $emailPause
* @param bool $simulationMode
* @param array $pluginRows
*/
public function emailUsers($rows, $emailSubject, $emailBody, $emailAttach, $emailFromName, $emailFromAddr, $emailReplyName, $emailReplyAddr, $emailsPerBatch, $emailsBatch, $emailPause, $simulationMode, $pluginRows)
{
global $_CB_framework, $_CB_Backend_Title;
_CBsecureAboveForm('showUsers');
cbimport('cb.validator');
outputCbTemplate(2);
outputCbJs(2);
$_CB_Backend_Title = array(0 => array('fa fa-envelope-o', CBTxt::T('Community Builder: Mass Mailer')));
$editorSave = $_CB_framework->saveCmsEditorJS('emailbody');
if ($editorSave) {
$js = "\$( '.cbEmailUsersForm' ).submit( function() { " . $editorSave . "});";
} else {
$js = null;
}
cbValidator::outputValidatorJs($js);
$emailsList = array();
foreach (array_slice($rows, 0, 100) as $row) {
$emailsList[] = htmlspecialchars($row->name) . ' <' . htmlspecialchars($row->email) . '>';
}
$return = '<form action="' . $_CB_framework->backendUrl('index.php') . '" method="post" name="adminForm" class="cb_form form-auto cbEmailUsersForm">' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('SEND_EMAIL_TO_TOTAL_USERS', 'Send Email to [total] users', array('[total]' => (int) count($rows))) . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . implode(', ', $emailsList) . (count($rows) > 100 ? ' <strong>' . CBTxt::Th('AND_COUNT_MORE_USERS', 'and [count] more users.', array('[count]' => (int) (count($rows) - 100))) . '</strong>' : null) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_SIMULATION_MODE_LABEL', 'Simulation Mode') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="checkbox" name="simulationmode" id="simulationmode"' . ($simulationMode ? ' checked="checked"' : null) . ' /> <label for="simulationmode">' . CBTxt::T('Do not send emails, just show me how it works') . '</label>' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_SIMULATION_MODE_TOOLTIP', 'Check this box to simulate email sending in a dry run mode. No emails are actually sent.'), CBTxt::T('MASS_MAILER_SIMULATION_MODE_LABEL', 'Simulation Mode'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_SUBJECT_LABEL', 'Email Subject') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailsubject" value="' . htmlspecialchars($emailSubject) . '" class="form-control required" size="60" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_SUBJECT_TOOLTIP', 'Type in the subject of the mass mailing (CB field substitutions are supported).'), CBTxt::T('MASS_MAILER_SUBJECT_LABEL', 'Email Subject'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_MESSAGE_LABEL', 'Email Message') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . $_CB_framework->displayCmsEditor('emailbody', $emailBody, 600, 200, 50, 7) . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_MESSAGE_TOOLTIP', 'Type in the main message body of your mass mailing (HTML editor and CB field substitutions are supported).'), CBTxt::T('MASS_MAILER_MESSAGE_LABEL', 'Email Message'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_ATTACHMENTS_LABEL', 'Email Attachments') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailattach" value="' . htmlspecialchars($emailAttach) . '" class="form-control" size="80" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_ATTACHMENTS_TOOLTIP', 'Absolute server path to file that should be attached to each email. Multiple files can be specified using a comma separator.'), CBTxt::T('MASS_MAILER_ATTACHMENTS_LABEL', 'Email Attachments'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('Substitutions for Subject, Message, and Attachments') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . CBTxt::T('You can use all CB substitutions as in most parts: e.g.: [cb:if team="winners"] Congratulations [cb:userfield field="name" /], you are in the winning team! [/cb:if]') . '</div>' . '</div>' . '</div>' . $this->_pluginRows($pluginRows) . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_FROM_NAME_LABEL', 'From Name') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailfromname" value="' . htmlspecialchars($emailFromName) . '" class="form-control" size="30" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_FROM_NAME_TOOLTIP', 'The name to be used in the From field of email. If left empty the CB and Joomla configuration defaults will be used.'), CBTxt::T('MASS_MAILER_FROM_NAME_LABEL', 'From Name'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_FROM_ADDRESS_LABEL', 'From Email Address') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailfromaddr" value="' . htmlspecialchars($emailFromAddr) . '" class="form-control" size="40" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_FROM_ADDRESS_TOOLTIP', 'The email address to be user in the From field of email. If left empty the CB and Joomla settings will be used.'), CBTxt::T('MASS_MAILER_FROM_ADDRESS_LABEL', 'From Email Address'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_REPLY_TO_NAME_LABEL', 'Reply-To Name') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailreplyname" value="' . htmlspecialchars($emailReplyName) . '" class="form-control" size="30" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_REPLY_TO_NAME_TOOLTIP', 'The Reply-To Name value to be used in the From field of email. If left empty the CB and Joomla settings will be used.'), CBTxt::T('MASS_MAILER_REPLY_TO_NAME_LABEL', 'Reply-To Name'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_REPLY_TO_ADDRESS_LABEL', 'Reply-To Email Address') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailreplyaddr" value="' . htmlspecialchars($emailReplyAddr) . '" class="form-control" size="40" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_REPLY_TO_ADDRESS_TOOLTIP', 'The Reply-To Email address to be used in the email.'), CBTxt::T('MASS_MAILER_REPLY_TO_ADDRESS_LABEL', 'Reply-To Email Address'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_EMAILS_PER_BATCH_LABEL', 'Emails per batch') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailsperbatch" value="' . htmlspecialchars($emailsPerBatch) . '" class="form-control required digits" size="12" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_EMAILS_PER_BATCH_TOOLTIP', 'The number of emails to be sent in each batch (default 50).'), CBTxt::T('MASS_MAILER_EMAILS_PER_BATCH_LABEL', 'Emails per batch'), false, 4) . '</div>' . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<label class="control-label col-sm-3">' . CBTxt::Th('MASS_MAILER_SECONDS_BETWEEN_BATCHES_LABEL', 'Seconds of pause between batches') . '</label>' . '<div class="cb_field col-sm-9">' . '<div>' . '<input type="text" name="emailpause" value="' . htmlspecialchars($emailPause) . '" class="form-control required digits" size="12" />' . getFieldIcons(2, false, false, CBTxt::T('MASS_MAILER_SECONDS_BETWEEN_BATCHES_TOOLTIP', 'The number of seconds to pause between batch sending (default is 30 sec).'), CBTxt::T('MASS_MAILER_SECONDS_BETWEEN_BATCHES_LABEL', 'Seconds of pause between batches'), false, 4) . '</div>' . '</div>' . '</div>' . '<input type="hidden" name="option" value="com_comprofiler" />' . '<input type="hidden" name="view" value="emailusers" />' . '<input type="hidden" name="boxchecked" value="0" />';
foreach ($rows as $row) {
$return .= '<input type="hidden" name="cid[]" value="' . (int) $row->id . '">';
}
$return .= cbGetSpoofInputTag('user') . '</form>';
echo $return;
}
示例9: display
function display()
{
$cbinclude = JPATH_ADMINISTRATOR . DS . "components" . DS . "com_comprofiler" . DS . "plugin.foundation.php";
if (!file_exists($cbinclude)) {
JError::raiseNotice(1, JText::_('FACTORY_CB_NOT_INSTALLED'));
return;
}
require_once $cbinclude;
cbimport('language.all');
$integrationFields = JTheFactoryIntegrationCB::getIntegrationFields();
$integrationArray = JTheFactoryIntegrationCB::getIntegrationArray();
$database = JFactory::getDBO();
$query = "SELECT `name` as value,`title` as text FROM #__comprofiler_fields order by `name`";
$database->setQuery($query);
$cbfields = $database->loadObjectList();
foreach ($cbfields as &$f) {
$f->text = defined($f->text) ? constant($f->text) : $f->text;
}
$cbfields = array_merge(array(JHTML::_("select.option", '', '-' . JText::_("FACTORY_NONE") . '-')), $cbfields);
$view = $this->getView();
$view->assignRef('integrationFields', $integrationFields);
$view->assignRef('integrationArray', $integrationArray);
$view->assignRef('cbfields', $cbfields);
$view->assign('cb_detected', JTheFactoryIntegrationCB::detectIntegration());
$view->display();
}
示例10: __construct
function __construct()
{
$fbConfig =& CKunenaConfig::getInstance();
$cbpath = KUNENA_ROOT_PATH_ADMIN . DS . 'components' . DS . 'com_comprofiler' . DS . 'plugin.foundation.php';
if (file_exists($cbpath)) {
include_once $cbpath;
cbimport('cb.database');
cbimport('cb.tables');
cbimport('language.front');
cbimport('cb.tabs');
define("KUNENA_CB_ITEMID_SUFFIX", getCBprofileItemid());
if ($fbConfig->fb_profile == 'cb') {
$params = array();
$this->trigger('onStart', $params);
}
}
if ($this->_detectIntegration() === false) {
$fbConfig->pm_component = $fbConfig->pm_component == 'cb' ? 'none' : $fbConfig->pm_component;
$fbConfig->avatar_src = $fbConfig->avatar_src == 'cb' ? 'kunena' : $fbConfig->avatar_src;
$fbConfig->fb_profile = $fbConfig->fb_profile == 'cb' ? 'kunena' : $fbConfig->fb_profile;
} else {
if ($this->useProfileIntegration() === false) {
$fbConfig->fb_profile = $fbConfig->fb_profile == 'cb' ? 'kunena' : $fbConfig->fb_profile;
}
}
}
示例11: __construct
public function __construct(&$subject, $config)
{
// Do not load if Kunena version is not supported or Kunena is offline
if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('3.0') && KunenaForum::installed())) {
return;
}
$app = JFactory::getApplication();
// Do not load if CommunityBuilder is not installed
$path = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
if (!is_file($path)) {
return;
}
require_once $path;
cbimport('cb.database');
cbimport('cb.tables');
cbimport('language.front');
cbimport('cb.tabs');
cbimport('cb.field');
global $ueConfig;
parent::__construct($subject, $config);
$this->loadLanguage('plg_kunena_comprofiler.sys', JPATH_ADMINISTRATOR) || $this->loadLanguage('plg_kunena_comprofiler.sys', KPATH_ADMIN);
require_once __DIR__ . "/integration.php";
if ($app->isAdmin() && (!isset($ueConfig['version']) || version_compare($ueConfig['version'], $this->minCBVersion) < 0)) {
$app->enqueueMessage(JText::sprintf('PLG_KUNENA_COMPROFILER_WARN_VERSION', $this->minCBVersion), 'notice');
}
}
示例12: logoutUser
public function logoutUser()
{
cbimport('cb.authentication');
$cbAuthenticate = new CBAuthentication();
$redirect_url = KunenaRoute::current();
$resultError = $cbAuthenticate->logout($redirect_url);
return $resultError ? $resultError : null;
}
示例13: plug_cbpaidsubscriptions_install
/**
* Installs CBSubs, final part (ECHOs banners)
*
* @return void
*/
function plug_cbpaidsubscriptions_install()
{
global $_CB_framework, $_CB_database;
$installedVersion = '4.0.0';
//CBSUBS_VERSION_AUTOMATICALLY_SET_DO_NOT_EDIT!!!
?>
<div style="width:100%;text-align:center">
<div>
<img alt="CBSubs Logo" height="300" width="300" src="<?php
echo $_CB_framework->getCfg('live_site');
?>
/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/icons/normal/cbsubs_logo_300.jpg" />
</div>
<h1>CBSubs <?php
echo $installedVersion;
?>
</h1>
<p><strong>Copyright © 2007-2015 and Trademark of Lightning MultiCom SA, Switzerland - www.joomlapolis.com - and its licensors, all rights reserved</strong></p>
<p><strong>CBSubs is a Trademark of Lightning MultiCom SA, Switzerland, and its licensors. CB, Community Builder and Joomlapolis are also a trademark of joomlapolis.com and may not be used without permission from the trademark holders.</strong></p>
<p>The copyright holders have spent massive time on this software and are continuing to improve it. A corresponding membership at Joomlapolis.com is required for ongoing maintenance and support.</p>
<p>All copyright statements must be kept.</p>
<p><em>Official site: <a href="http://www.joomlapolis.com?pk_campaign=in-cb&pk_kwd=installed-cbsubs">www.joomlapolis.com</a></em></p>
</div>
<?php
// Temporary fix in CBSubs 1.2.2 only for CBSubs 1.2.1 bug:
if (checkJversion() >= 1 && $installedVersion == '1.2.2') {
$sql = "UPDATE #__users" . " SET password = concat(md5(concat(password,'12345678901234567890123456789012')),':','12345678901234567890123456789012')" . " WHERE ( LENGTH(password) < 65 )" . " AND ( LENGTH(password) > 3 )" . " AND ( registerDate > '2011-07-13 12:00:00' )";
$_CB_database->setQuery($sql);
$_CB_database->query();
}
// Temporary fix in CBSubs 1.3.0 for CBSubs 1.2.x bug:
// Ogone gateway was not transfering address from basket:
$sql = 'UPDATE #__cbsubs_payments p' . ' LEFT JOIN #__cbsubs_payment_baskets b ON p.payment_basket_id = b.id' . ' SET ' . ' p.`address_street` = b.`address_street`,' . ' p.`address_city` = b.`address_city`,' . ' p.`address_state` = b.`address_state`,' . ' p.`address_zip` = b.`address_zip`,' . ' p.`address_country` = b.`address_country`,' . ' p.`address_country_code` = b.`address_country_code`,' . ' p.`payer_business_name` = b.`payer_business_name`,' . ' p.`payer_email` = b.`payer_email`,' . ' p.`contact_phone` = b.`contact_phone`,' . ' p.`vat_number` = b.`vat_number`' . " WHERE p.payment_method IN ('ogone','swisspostfinance')" . ' AND ISNULL(p.`address_country_code`);';
$_CB_database->setQuery($sql);
$_CB_database->query();
cbimport('cb.adminfilesystem');
$adminFS = cbAdminFileSystem::getInstance();
$cbsubsDir = $_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions';
// Remove old 2Checkout files if there is no 2Checkout gateway configured, as TwoCheckout is not part anymore in CBSubs 1.3:
$sql = 'SELECT COUNT(*) FROM #__cbsubs_gateway_accounts' . ' WHERE gateway_type = "processors.twocheckout";';
$_CB_database->setQuery($sql);
$hasTwoCheckoutInstalled = $_CB_database->loadResult();
$twocheckoutdir = $cbsubsDir . '/processors/twocheckout';
if ($hasTwoCheckoutInstalled == 0 && file_exists($twocheckoutdir)) {
$adminFS->deldir($twocheckoutdir . '/');
}
// Remove old 1.x and 2.x files:
$oldfiles = array('admin.cbpaidsubscriptions.ctrl.php', 'cbpaidsubscriptions.condition.php', 'cbpaidsubscriptions.countries.php', 'cbpaidsubscriptions.crosstotalizer.php', 'cbpaidsubscriptions.ctrl.php', 'cbpaidsubscriptions.currency.php', 'cbpaidsubscriptions.gui.php', 'cbpaidsubscriptions.guisubs.php', 'cbpaidsubscriptions.importer.php', 'cbpaidsubscriptions.scheduler.php', 'cbpaidsubscriptions.sql.php', 'cbpaidsubscriptions.userparams.php');
foreach ($oldfiles as $file) {
$pathFile = $cbsubsDir . '/' . $file;
if ($file && file_exists($pathFile)) {
$adminFS->unlink($pathFile);
}
}
}
示例14: __construct
public function __construct() {
$path = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
if (!is_file ( $path )) return;
require_once ($path);
cbimport ( 'cb.database' );
cbimport ( 'cb.tables' );
cbimport ( 'language.front' );
cbimport ( 'cb.tabs' );
cbimport ( 'cb.field' );
$this->loaded = self::detectErrors();
}
示例15: exists
public function exists()
{
$file = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
if (!JFile::exists($file)) {
return false;
}
require_once $file;
cbimport('cb.database');
cbimport('cb.tables');
cbimport('cb.tabs');
return true;
}