Index: administrator/components/com_comprofiler/library/cb/cb.params.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/library/cb/cb.params.php +++ administrator/components/com_comprofiler/library/cb/cb.params.php @@ -110,7 +110,7 @@ * @param mixed $params $_POST array or string escaped only if MAGIC_QUOTES are ON * @return string The raw parms text always addslash-ESCAPED */ - function getRawParamsMagicgpcEscaped( $params ) { + static function getRawParamsMagicgpcEscaped( $params ) { $ret = self::getRawParamsUnescaped( $params, true ); if ( get_magic_quotes_gpc() ) { return addslashes( $ret ); @@ -125,7 +125,7 @@ * @param boolean $checkMagicSlashes TRUE: if magic_quotes are ON, remove slashes, FALSE: never remove slashes * @return string The raw parms text NEVER addslash-ESCAPED */ - function getRawParamsUnescaped( $params, $checkMagicSlashes ) { + static function getRawParamsUnescaped( $params, $checkMagicSlashes ) { if( is_array( $params ) ) { $txt = array(); foreach ( $params as $k => $v ) { @@ -191,26 +191,26 @@ if ( $this->_xml ) { $element =& $this->_xml; - if ( $element && $element->name() == $this->_maintagname && $element->attributes( $this->_attrname ) == $this->_attrvalue) { + if ( $element != null && $element->name() == $this->_maintagname && $element->attributes( $this->_attrname ) == $this->_attrvalue) { if ( $grand_parent_path != null ) { $element =& $element->getElementByPath( $grand_parent_path ); - if ( ! $element ) { + if ( $element == null ) { return null; } } if ( $parent_tag != null && $parent_attr != null && $parent_attrvalue != null ) { $element =& $element->getChildByNameAttr( $parent_tag, $parent_attr, $parent_attrvalue ); - if ( $element ) { + if ( $element != null ) { if ( $tag_path ) { $element =& $element->getElementByPath( $tag_path ); } - if ( $element ) { + if ( $element != null ) { $this->_xmlElem =& $element; } } } else { $element =& $element->getElementByPath( $tag_path ); - if ( $element ) { + if ( $element != null ) { $this->_xmlElem =& $element; } } @@ -219,7 +219,7 @@ } } - if ( $this->_xmlElem ) { + if ( $this->_xmlElem != null ) { $controllerView = new cbDrawController( $this->_xmlElem, $this->_actions, $this->_options ); $controllerView->setControl_name( $control_name ); @@ -2257,7 +2257,7 @@ /** * special handling for textarea param */ - function textareaHandling( &$txt ) { + static function textareaHandling( &$txt ) { $total = count( $txt ); for( $i=0; $i < $total; $i++ ) { if ( strstr( $txt[$i], "\n" ) ) { Index: components/com_comprofiler/plugin/user/plug_cbmenu/cb.menu.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- components/com_comprofiler/plugin/user/plug_cbmenu/cb.menu.php +++ components/com_comprofiler/plugin/user/plug_cbmenu/cb.menu.php @@ -72,7 +72,7 @@ $this->menuid = $menuid; } // to be overriden: - function displayMenuItem($level, $idCounter) { + function displayMenuItem($level, $idCounter, $key=null) { } } // end class cbMenu @@ -298,7 +298,7 @@ function cbMenuBest ( &$db ) { $this->cbMenu($db); } - function displayMenuItem($level, $idCounter, $key) { + function displayMenuItem($level, $idCounter, $key=null) { $ret = ''; switch ($level) { case 0: @@ -410,7 +410,7 @@ function cbMenuCSS ( &$db ) { $this->cbMenu($db); } - function displayMenuItem($level, $idCounter) { + function displayMenuItem($level, $idCounter, $key=null) { $ret = ''; switch ($level) { case 0: @@ -513,7 +513,7 @@ * @author Beat */ class cbMenuSucker extends cbMenu { // later: extends mosMenu - function displayMenuItem($level, $idCounter) { + function displayMenuItem($level, $idCounter, $key=null) { $ret = ''; switch ($level) { case 0: @@ -603,7 +603,7 @@ function cbMenuTabList ( &$db ) { $this->cbMenu($db); } - function displayMenuItem($level, $idCounter) { + function displayMenuItem($level, $idCounter, $key=null) { global $cbMenuTabListLastTopName; $ret = ''; switch ($level) { @@ -689,7 +689,7 @@ function cbMenuDivsList ( &$db ) { $this->cbMenu($db); } - function displayMenuItem($level, $idCounter) { + function displayMenuItem($level, $idCounter, $key=null) { $ret = ''; switch ($level) { case 0: // when only a text to diplay as whole menu! @@ -753,7 +753,7 @@ } // end class cbDivsMenuHandler class cbMenuULlist extends cbMenu { - function displayMenuItem($level, $idCounter) { + function displayMenuItem($level, $idCounter, $key=null) { $ret = ''; $menuidClass = ' class="cbMenuItem cbMenuEogr' . ( $idCounter & 1 ? 2 : 1 ) . ( $this->menuid ? ' cbMenu' . $this->menuid : '' ) \ No newline at end of file Index: administrator/components/com_comprofiler/plugin.foundation.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/plugin.foundation.php +++ administrator/components/com_comprofiler/plugin.foundation.php @@ -156,7 +156,7 @@ * @param array $array in/out * @return array */ -function & cbArrayToInts( &$array ) { +function & cbArrayToInts( $array ) { foreach ( $array as $k => $v ) { $array[$k] = (int) $v; } @@ -955,7 +955,7 @@ * @param moscomprofilerUser $user * @return CBuser */ - function & setUserGetCBUserInstance( & $user ) { + public static function & setUserGetCBUserInstance( & $user ) { if ( is_object( $user ) ) { return CBuser::_getOrSetInstance( $user ); } else { @@ -2417,16 +2417,17 @@ $result = ! in_array( false, $login, true ); } if ( $result ) { - $user =& JFactory::getUser(); + $user = JFactory::getUser(); $this->_myId = (int) $user->id; $this->_myUsername = $user->username; - $this->_myUserType = $user->usertype; if ( checkJversion() >= 2 ) { $this->_myCmsGid = null; // triggers re-load of access levels if even needed + $this->_myUserType = null; } else { $this->_myCmsGid = $user->get('aid', 0); + $this->_myUserType = $user->get('usertype', null); } - $lang =& JFactory::getLanguage(); + $lang = JFactory::getLanguage(); if ( checkJversion() == 2 ) { $this->_myLanguage = strtolower( preg_replace( '/^(\w+).*$/i', '\1', $lang->getName() ) ); @@ -2561,14 +2562,10 @@ case 'useractivation': case 'new_usertype': if ( checkJversion() >= 1 ) { - $usersConfig = &JComponentHelper::getParams( 'com_users' ); + $usersConfig = JComponentHelper::getParams( 'com_users' ); $setting = $usersConfig->get( $config ); if ( ( $config == 'new_usertype' ) && ( checkJversion() == 2 ) ) { - $query = 'SELECT ' . $this->_cmsDatabase->NameQuote( 'title' ) - . "\n FROM " . $this->_cmsDatabase->NameQuote( '#__usergroups' ) - . "\n WHERE " . $this->_cmsDatabase->NameQuote( 'id' ) . " = " . (int) $setting; - $this->_cmsDatabase->setQuery( $query ); - $setting = $this->_cmsDatabase->loadResult(); + $setting = $this->acl->get_group_name( (int) $setting ); } if ( ( $config == 'new_usertype' ) && ! $setting ) { $setting = 'Registered'; @@ -2583,7 +2580,7 @@ case 'hits': case 'vote': if ( checkJversion() >= 1 ) { - $contentConfig = &JComponentHelper::getParams( 'com_content' ); + $contentConfig = JComponentHelper::getParams( 'com_content' ); return $contentConfig->get( 'show_' . $config ); } break; @@ -3581,7 +3578,7 @@ /** * @deprecated CB 1.2.2 : keep in CB 1.x, remove in 2.0, but use without _ as of 1.2.2 */ - function _unhtmlentities( $string, $quotes = ENT_COMPAT, $charset = "ISO-8859-1" ) { + static function _unhtmlentities( $string, $quotes = ENT_COMPAT, $charset = "ISO-8859-1" ) { $phpv = phpversion(); if ( version_compare( $phpv, '4.4.3', '<' ) || ( version_compare( $phpv, '5.0.0', '>=' ) && version_compare( $phpv, '5.1.3', '<' ) ) @@ -3620,22 +3617,23 @@ case 2: global $mainframe; - $mainframe =& JFactory::getApplication(); - $tmpDatabase =& JFactory::getDBO(); - $my =& JFactory::getUser(); - $acl =& JFactory::getACL(); + $mainframe = JFactory::getApplication(); + $tmpDatabase = JFactory::getDBO(); + $my = JFactory::getUser(); + $acl = JFactory::getACL(); $myAid = null; + $myUsertype = null; $sefFunc = array( 'JRoute', '_' ); $sefFuncHtmlEnt = false; $cmsUser = 'JUser'; $cmsUserNeedsDb = false; $cmsRedirectFunc = array( $mainframe, 'redirect' ); - $lang =& JFactory::getLanguage(); + $lang = JFactory::getLanguage(); $myLanguage = strtolower( preg_replace( '/^(\w+).*$/i', '\1', $lang->getName() ) ); $myLanguageTag = $lang->getTag(); $outputCharst = 'UTF-8'; $getVarFunction = array( 'JRequest', 'getVar' ); - $Jdocument =& JFactory::getDocument(); + $Jdocument = JFactory::getDocument(); if ( $Jdocument->getType() == 'html' ) { $getDocFunction = array( 'JFactory', 'getDocument' ); @@ -3643,7 +3641,7 @@ $getDocFunction = false; } - $editor =& JFactory::getEditor(); + $editor = JFactory::getEditor(); $editorDisplay = array( 'display' => array( 'call' => array( $editor , 'display' ), 'args' => 'noid' ), 'save' => array( 'call' => array( $editor , 'save' ), 'args' => 'noid' ), 'returns' => true @@ -3651,28 +3649,29 @@ break; case 1: global $mainframe; // $mainframe =& JFactory::getApplication(); - $tmpDatabase =& JFactory::getDBO(); - $my =& JFactory::getUser(); - $acl =& JFactory::getACL(); + $tmpDatabase = JFactory::getDBO(); + $my = JFactory::getUser(); + $acl = JFactory::getACL(); $myAid = $my->get('aid', 0); + $myUsertype = $my->get('usertype', null); $sefFunc = array( 'JRoute', '_' ); $sefFuncHtmlEnt = false; $cmsUser = 'JUser'; $cmsUserNeedsDb = false; $cmsRedirectFunc = array( $mainframe, 'redirect' ); - $lang =& JFactory::getLanguage(); + $lang = JFactory::getLanguage(); $myLanguage = $lang->getBackwardLang(); $myLanguageTag = $lang->getTag(); $outputCharst = 'UTF-8'; $getVarFunction = array( 'JRequest', 'getVar' ); - $Jdocument =& JFactory::getDocument(); + $Jdocument = JFactory::getDocument(); if ( $Jdocument->getType() == 'html' ) { $getDocFunction = array( 'JFactory', 'getDocument' ); } else { $getDocFunction = false; } - $editor =& JFactory::getEditor(); + $editor = JFactory::getEditor(); //$editor->initialise(); $editorDisplay = array( 'display' => array( 'call' => array( $editor , 'display' ), 'args' => 'noid' ), 'save' => array( 'call' => array( $editor , 'save' ), 'args' => 'noid' ), @@ -3683,6 +3682,7 @@ global $mainframe, $database, $my, $acl; $tmpDatabase =& $database; $myAid = $my->gid; + $myUsertype = $my->usertype; $sefFunc = 'sefRelToAbs'; $sefFuncHtmlEnt = true; $cmsUser = 'mosUser'; @@ -3702,6 +3702,7 @@ global $mainframe, $database, $my, $acl; $tmpDatabase =& $database; $myAid = $my->gid; + $myUsertype = $my->usertype; $sefFunc = 'sefRelToAbs'; $sefFuncHtmlEnt = true; $cmsUser = 'mosUser'; @@ -3762,7 +3763,7 @@ */ global $_CB_framework; $optionOfCb = 'com_comprofiler'; // cbGetParam( $_REQUEST, 'option', 'com_comprofiler' ) -$_CB_framework = new CBframework( $mainframe, $tmpDatabase, $acl, $aclParams, $sefFunc, $sefFuncHtmlEnt, $cmsUser, $cmsUserNeedsDb, $cmsRedirectFunc, $my->id, $my->username, $my->usertype, $myAid, $myLanguage, $myLanguageTag, array( 'option' => $optionOfCb ), $getVarFunction, $getDocFunction, $outputCharst, $editorDisplay ); +$_CB_framework = new CBframework( $mainframe, $tmpDatabase, $acl, $aclParams, $sefFunc, $sefFuncHtmlEnt, $cmsUser, $cmsUserNeedsDb, $cmsRedirectFunc, $my->id, $my->username, $myUsertype, $myAid, $myLanguage, $myLanguageTag, array( 'option' => $optionOfCb ), $getVarFunction, $getDocFunction, $outputCharst, $editorDisplay ); cbimport( 'cb.acl' ); $_CB_framework->acl = new CBACL( $acl ); Index: administrator/components/com_comprofiler/install.comprofiler.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/install.comprofiler.php +++ administrator/components/com_comprofiler/install.comprofiler.php @@ -9,19 +9,17 @@ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU/GPL version 2 */ -// ensure this file is being included by a parent file +// Ensure is being included by Joomla installer and not accessed directly: if ( ! ( defined( '_VALID_CB' ) || defined( '_JEXEC' ) || defined( '_VALID_MOS' ) ) ) { die( 'Direct Access to this location is not allowed.' ); } -// Try extending time, as unziping/ftping took already quite some... : +// Try to set timeout limit and memory limit to ensure a complete install as could take awhile: @set_time_limit( 240 ); -if ( version_compare( phpversion(), '5.0.0', '<' ) ) { - return; -} - -$memMax = trim( @ini_get( 'memory_limit' ) ); +$memMax = trim( @ini_get( 'memory_limit' ) ); + if ( $memMax ) { $last = strtolower( $memMax{strlen( $memMax ) - 1} ); + switch( $last ) { case 'g': $memMax *= 1024; @@ -30,18 +28,23 @@ case 'k': $memMax *= 1024; } + if ( $memMax < 16000000 ) { @ini_set( 'memory_limit', '16M' ); } + if ( $memMax < 32000000 ) { @ini_set( 'memory_limit', '32M' ); } + if ( $memMax < 48000000 ) { @ini_set( 'memory_limit', '48M' ); } + if ( $memMax < 64000000 ) { @ini_set( 'memory_limit', '64M' ); } + if ( $memMax < 80000000 ) { @ini_set( 'memory_limit', '80M' ); } @@ -49,533 +52,678 @@ ignore_user_abort( true ); -/** - * CB framework - * @global CBframework $_CB_framework - */ -global $_CB_framework; +// Define J1.6 and greater installer class; does nothing on other versions: +class Com_ComprofilerInstallerScript { -/** @global string $_CB_adminpath - * @global string $_CB_joomla_adminpath - * @global array $ueConfig - */ -global $_CB_adminpath, $ueConfig, $mainframe; -if ( defined( 'JPATH_ADMINISTRATOR' ) ) { - $_CB_adminpath = JPATH_ADMINISTRATOR . '/components/com_comprofiler/'; -} else { - $_CB_adminpath = $mainframe->getCfg( 'absolute_path' ). '/administrator/components/com_comprofiler/'; + public function install( $parent ) { + return com_install(); -} + } -if ( ! file_exists( $_CB_adminpath . 'ue_config.php' ) ) { - // CB configuration file does not exist ! we need to copy default to it ! - include_once( $_CB_adminpath . 'library/cb/cb.adminfilesystem.php'); - $adminFS =& cbAdminFileSystem::getInstance(); - if ( ! $adminFS->copy( $_CB_adminpath . 'ue_config_first.php', $_CB_adminpath . 'ue_config.php' ) ) { - echo sprintf( 'Error copying initial configuration file in place from %s to %s', $_CB_adminpath . 'ue_config_first.php', $_CB_adminpath . 'ue_config.php' ) . "

\n"; + + public function discover_install( $parent ) { + return $this->install( $parent ); } -} -include_once( $_CB_adminpath . 'plugin.foundation.php' ); -$_CB_framework->cbset( '_ui', 2 ); // : we're in 1: frontend, 2: admin back-end - -if( $_CB_framework->getCfg( 'debug' ) ) { - ini_set( 'display_errors', true ); - error_reporting( E_ALL ); + public function update( $parent ) { + return $this->install( $parent ); -} + } + public function preflight( $type, $parent ) { + // Fix "Can not build admin menus" error on upgrades: + if ( ! in_array($type, array( 'install', 'discover_install' ) ) ) { + $db = JFactory::getDbo(); -// Plugins are not yet installed: cbimport( 'language.front' ); -cbimport( 'cb.tabs' ); -cbimport( 'cb.adminfilesystem' ); -cbimport( 'cb.xml.simplexml' ); -cbimport( 'cb.dbchecker' ); + $query = $db->getQuery( true ); + $query->select( 'id' ); + $query->from( '#__menu' ); + $query->where( $db->qn( 'type' ) . ' = ' . $db->q( 'component' ) ); + $query->where( $db->qn( 'menutype' ) . ' = ' . $db->q( 'main' ) ); + $query->where( $db->qn( 'client_id' ) . ' = ' . $db->q( '1' ) ); + $query->where( $db->qn( 'link' ) .' LIKE ' . $db->q( 'index.php?option=com_comprofiler%' ) ); + $db->setQuery( $query ); + $ids = $db->loadColumn(); + if ( $ids ) foreach( $ids as $id ) { + $query = $db->getQuery( true ); + $query->delete( '#__menu' ); + $query->where( $db->qn( 'id' ) . ' = ' . $db->q( $id ) ); + $db->setQuery( $query ); + $db->query(); + } + } + } +} function cbInstaller_field_exists( $table, $field ) { global $_CB_database; - static $cache = array(); + static $cache = array(); if ( ! isset( $cache[$table] ) ) { - $tableDesc = $_CB_database->getTableFields( array( $table ) ); + $tableDesc = $_CB_database->getTableFields( array( $table ) ); + if ( isset( $tableDesc[$table] ) && is_array( $tableDesc[$table] ) ) { $cache[$table] = $tableDesc[$table]; } } + if ( isset( $cache[$table] ) ) { return isset( $cache[$table][$field] ); } + return false; } +// Complete install and upgrade of CB component: function com_install() { - global $_CB_database, $_CB_framework; + global $_CB_framework, $_CB_database, $_CB_adminpath, $ueConfig, $mainframe; + // Ensure PHP version is adaquete for CB: if ( version_compare( phpversion(), '5.0.0', '<' ) ) { echo '
' . htmlspecialchars( sprintf( "As stated in README and prerequisites list, PHP Version %s, which is obsolete since 2008-08-08 and insecure, is not compatible with %s: Please upgrade to PHP %s or greater (CB is also compatible with PHP 5.3.x) as soon as possible.", phpversion(), 'Community Builder', sprintf( "at least version %s, recommended version %s", '5.0.0', '5.2.6' ) ) ) . '
'; echo '
' . htmlspecialchars( sprintf( 'Installation failed. In all cases, please require your hoster to upgrade your PHP version as soon as possible.' ) ) . '
'; return; } - ob_start(); + // Determine path to CBs backend file structure: + if ( defined( 'JPATH_ADMINISTRATOR' ) ) { + $_CB_adminpath = JPATH_ADMINISTRATOR . '/components/com_comprofiler/'; + } else { + $_CB_adminpath = $mainframe->getCfg( 'absolute_path' ). '/administrator/components/com_comprofiler/'; + } - # Show installation result to user - ?> -
- - - - - - - - - ' + . '' + . '
- CB Logo -
-
Copyright 2004-2012 MamboJoe/JoomlaJoe, Beat and CB team on joomlapolis.com . This component is released under the GNU/GPL version 2 License. All copyright statements must be kept. Derivate work must prominently duly acknowledge original work and include visible online links. Official site: www.joomlapolis.com -
-
- Installation Process:
- "; - if ( checkJversion() >= 1 ) { - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='js/ThemeOffice/static.png' WHERE admin_menu_link='option=com_comprofiler&task=showLists'"); - } else { - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='js/ThemeOffice/content.png' WHERE admin_menu_link='option=com_comprofiler&task=showLists'"); + $adminFS =& cbAdminFileSystem::getInstance(); + + if ( ! $adminFS->copy( $_CB_adminpath . 'ue_config_first.php', $_CB_adminpath . 'ue_config.php' ) ) { + echo sprintf( 'Error copying initial configuration file in place from %s to %s', $_CB_adminpath . 'ue_config_first.php', $_CB_adminpath . 'ue_config.php' ) . "

\n"; + return; - } + } - $iconresult[0] = $_CB_database->query(); - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='js/ThemeOffice/content.png' WHERE admin_menu_link='option=com_comprofiler&task=showField'"); - $iconresult[1] = $_CB_database->query(); + } + + include_once( $_CB_adminpath . 'plugin.foundation.php' ); + + // Set location to backend: + $_CB_framework->cbset( '_ui', 2 ); + + if ( $_CB_framework->getCfg( 'debug' ) ) { + ini_set( 'display_errors', true ); + error_reporting( E_ALL ); + } + + // Load in CB API: + cbimport( 'cb.tabs' ); + cbimport( 'cb.adminfilesystem' ); + cbimport( 'cb.xml.simplexml' ); + cbimport( 'cb.dbchecker' ); + + // Define CB backend filesystem API: + $adminFS =& cbAdminFileSystem::getInstance(); + + // If J1.6 or greater ensure XML and backend root component file is present: + if ( checkJversion() >= 2 ) { + if ( ! $adminFS->copy( $_CB_adminpath . 'comprofileg.xml', $_CB_adminpath . 'comprofiler.xml' ) ) { + echo sprintf( 'Error copying initial xml file in place from %s to %s', $_CB_adminpath . 'comprofileg.xml', $_CB_adminpath . 'comprofiler.xml' ) . "

\n"; + return false; + } + + if ( ! $adminFS->copy( $_CB_adminpath . 'admin.comprofiler.php', $_CB_adminpath . 'comprofiler.php' ) ) { + echo sprintf( 'Error copying admin file in place from %s to %s', $_CB_adminpath . 'admin.comprofiler.php', $_CB_adminpath . 'comprofiler.php' ) . "

\n"; + return false; + } + } + + $return = '
' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . ' - - - ' + . '' + . '' + . ' - -
' + . 'CB Logo' + . '
' + . '
Copyright 2004-2012 MamboJoe/JoomlaJoe, Beat and CB team on joomlapolis.com . This component is released under the GNU/GPL version 2 License. All copyright statements must be kept. Derivate work must prominently duly acknowledge original work and include visible online links. Official site: www.joomlapolis.com
' + . '
' + . '' + . 'Installation Process:
'; + + // Fix admin menu links: + if ( checkJversion() >= 2 ) { + $query = 'SELECT ' . $_CB_database->NameQuote( 'extension_id' ) + . "\n FROM " . $_CB_database->NameQuote( '#__extensions' ) + . "\n WHERE " . $_CB_database->NameQuote( 'type' ) . " = " . $_CB_database->Quote( 'component' ) + . "\n AND " . $_CB_database->NameQuote( 'element' ) . " = " . $_CB_database->Quote( 'com_comprofiler' ) + . "\n ORDER BY " . $_CB_database->NameQuote( 'extension_id' ) . " DESC"; + $_CB_database->setQuery( $query, 0, 1 ); + $componentId = $_CB_database->loadResult(); + + if ( $componentId ) { + $query = 'UPDATE ' . $_CB_database->NameQuote( '#__menu' ) + . "\n SET " . $_CB_database->NameQuote( 'component_id' ) . " = " . (int) $componentId + . "\n WHERE " . $_CB_database->NameQuote( 'type' ) . " = " . $_CB_database->Quote( 'component' ) + . "\n AND " . $_CB_database->NameQuote( 'link' ) . " LIKE " . $_CB_database->Quote( '%option=com_comprofiler%' ); + $_CB_database->setQuery( $query ); + $_CB_database->query(); + } + } elseif ( checkJversion() <= 1 ) { + $iconResults = array(); + + // Userlist Management icon: - if ( checkJversion() >= 1 ) { + if ( checkJversion() >= 1 ) { - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='js/ThemeOffice/article.png' WHERE admin_menu_link='option=com_comprofiler&task=showTab'"); + $icon = 'js/ThemeOffice/static.png'; - } else { + } else { - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='js/ThemeOffice/content.png' WHERE admin_menu_link='option=com_comprofiler&task=showTab'"); + $icon = 'js/ThemeOffice/content.png'; - } + } - $iconresult[2] = $_CB_database->query(); - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='js/ThemeOffice/config.png' WHERE admin_menu_link='option=com_comprofiler&task=showconfig'"); - $iconresult[3] = $_CB_database->query(); + + $query = 'UPDATE ' . $_CB_database->NameQuote( '#__components' ) + . "\n SET " . $_CB_database->NameQuote( 'admin_menu_img' ) . " = " . $_CB_database->Quote( $icon ) + . "\n WHERE " . $_CB_database->NameQuote( 'admin_menu_link' ) . " = " . $_CB_database->Quote( 'option=com_comprofiler&task=showLists' ); + $_CB_database->setQuery( $query ); + $iconResults[0] = $_CB_database->query(); + + // Field Management icon: + $query = 'UPDATE ' . $_CB_database->NameQuote( '#__components' ) + . "\n SET " . $_CB_database->NameQuote( 'admin_menu_img' ) . " = " . $_CB_database->Quote( 'js/ThemeOffice/content.png' ) + . "\n WHERE " . $_CB_database->NameQuote( 'admin_menu_link' ) . " = " . $_CB_database->Quote( 'option=com_comprofiler&task=showField' ); + $_CB_database->setQuery( $query ); + $iconResults[1] = $_CB_database->query(); + + // Tab Management iocn: - if ( checkJversion() >= 1 ) { + if ( checkJversion() >= 1 ) { - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='js/ThemeOffice/user.png' WHERE admin_menu_link='option=com_comprofiler&task=showusers'"); + $icon = 'js/ThemeOffice/article.png'; - } else { + } else { - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='js/ThemeOffice/users.png' WHERE admin_menu_link='option=com_comprofiler&task=showusers'"); + $icon = 'js/ThemeOffice/content.png'; - } + } - $iconresult[4] = $_CB_database->query(); + + $query = 'UPDATE ' . $_CB_database->NameQuote( '#__components' ) + . "\n SET " . $_CB_database->NameQuote( 'admin_menu_img' ) . " = " . $_CB_database->Quote( $icon ) + . "\n WHERE " . $_CB_database->NameQuote( 'admin_menu_link' ) . " = " . $_CB_database->Quote( 'option=com_comprofiler&task=showTab' ); + $_CB_database->setQuery( $query ); + $iconResults[2] = $_CB_database->query(); + + // Configuration icon: + $query = 'UPDATE ' . $_CB_database->NameQuote( '#__components' ) + . "\n SET " . $_CB_database->NameQuote( 'admin_menu_img' ) . " = " . $_CB_database->Quote( 'js/ThemeOffice/config.png' ) + . "\n WHERE " . $_CB_database->NameQuote( 'admin_menu_link' ) . " = " . $_CB_database->Quote( 'option=com_comprofiler&task=showconfig' ); + $_CB_database->setQuery( $query ); + $iconResults[3] = $_CB_database->query(); + + // User Management icon: - if ( checkJversion() >= 1 ) { + if ( checkJversion() >= 1 ) { - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='js/ThemeOffice/plugin.png' WHERE admin_menu_link='option=com_comprofiler&task=showPlugins'"); + $icon = 'js/ThemeOffice/user.png'; - } else { + } else { - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='js/ThemeOffice/install.png' WHERE admin_menu_link='option=com_comprofiler&task=showPlugins'"); + $icon = 'js/ThemeOffice/users.png'; - } + } - $iconresult[5] = $_CB_database->query(); - $_CB_database->setQuery("UPDATE #__components SET admin_menu_img='../components/com_comprofiler/plugin/templates/luna/images/header/icon-16-cb.png' WHERE admin_menu_link='option=com_comprofiler'"); - $iconresult[6] = $_CB_database->query(); -/* Despite numerous abstractions-level, the name of the component isn't taken from SQL but from xml , same field as used to find comprofiler, so we can't display nicely: + + $query = 'UPDATE ' . $_CB_database->NameQuote( '#__components' ) + . "\n SET " . $_CB_database->NameQuote( 'admin_menu_img' ) . " = " . $_CB_database->Quote( $icon ) + . "\n WHERE " . $_CB_database->NameQuote( 'admin_menu_link' ) . " = " . $_CB_database->Quote( 'option=com_comprofiler&task=showusers' ); + $_CB_database->setQuery( $query ); + $iconResults[4] = $_CB_database->query(); + + // Plugin Management icon: - if ( checkJversion() >= 1 ) { + if ( checkJversion() >= 1 ) { - $_CB_database->setQuery("UPDATE #__components SET name='Community Builder' WHERE admin_menu_link='option=com_comprofiler'"); - $iconresult[7] = $_CB_database->query(); - } -*/ - foreach ($iconresult as $i=>$icresult) { - if ($icresult) { - // echo "FINISHED: Image of menu entry $i has been corrected.
"; + $icon = 'js/ThemeOffice/plugin.png'; - } else { + } else { - echo "ERROR: Image of administration menu entry $i could not be corrected.
"; + $icon = 'js/ThemeOffice/install.png'; - } + } + + $query = 'UPDATE ' . $_CB_database->NameQuote( '#__components' ) + . "\n SET " . $_CB_database->NameQuote( 'admin_menu_img' ) . " = " . $_CB_database->Quote( $icon ) + . "\n WHERE " . $_CB_database->NameQuote( 'admin_menu_link' ) . " = " . $_CB_database->Quote( 'option=com_comprofiler&task=showPlugins' ); + $_CB_database->setQuery( $query ); + $iconResults[5] = $_CB_database->query(); + + // Community Builder icon: + $query = 'UPDATE ' . $_CB_database->NameQuote( '#__components' ) + . "\n SET " . $_CB_database->NameQuote( 'admin_menu_img' ) . " = " . $_CB_database->Quote( '../components/com_comprofiler/plugin/templates/luna/images/header/icon-16-cb.png' ) + . "\n WHERE " . $_CB_database->NameQuote( 'admin_menu_link' ) . " = " . $_CB_database->Quote( 'option=com_comprofiler' ); + $_CB_database->setQuery( $query ); + $iconResults[6] = $_CB_database->query(); + + foreach ( $iconResults as $i => $iconResult ) { + if ( ! $iconResult ) { + $return .= 'ERROR: Image of administration menu entry $i could not be corrected.
'; - } + } - $_CB_database->setQuery("SELECT COUNT(*) FROM #__components WHERE link = 'option=com_comprofiler'"); - $components = $_CB_database->loadresult(); - IF($components >= 1) { - $_CB_database->setQuery("SELECT id FROM #__components WHERE link = 'option=com_comprofiler' ORDER BY id DESC", 0, 1); - $comid = (int) $_CB_database->loadresult(); - $_CB_database->setQuery("DELETE FROM #__components WHERE link = 'option=com_comprofiler' AND id != $comid "); + } + + // Delete invalid components: + $query = 'SELECT COUNT(*)' + . "\n FROM " . $_CB_database->NameQuote( '#__components' ) + . "\n WHERE " . $_CB_database->NameQuote( 'link' ) . " = " . $_CB_database->Quote( 'option=com_comprofiler' ); + $_CB_database->setQuery( $query ); + $components = $_CB_database->loadResult(); + + if ( $components >= 1 ) { + $query = 'SELECT ' . $_CB_database->NameQuote( 'id' ) + . "\n FROM " . $_CB_database->NameQuote( '#__components' ) + . "\n WHERE " . $_CB_database->NameQuote( 'link' ) . " = " . $_CB_database->Quote( 'option=com_comprofiler' ) + . "\n ORDER BY " . $_CB_database->NameQuote( 'id' ) . " DESC"; + $_CB_database->setQuery( $query, 0, 1 ); + $componentId = $_CB_database->loadResult(); + + if ( $componentId ) { + $query = 'DELETE ' + . "\n FROM " . $_CB_database->NameQuote( '#__components' ) + . "\n WHERE " . $_CB_database->NameQuote( 'link' ) . " = " . $_CB_database->Quote( 'option=com_comprofiler' ) + . "\n AND " . $_CB_database->NameQuote( 'id' ) . " != " . (int) $componentId; + $_CB_database->setQuery( $query ); - $_CB_database->query(); + $_CB_database->query(); - $_CB_database->setQuery("DELETE FROM #__components WHERE #__components.option = 'com_comprofiler' AND parent != $comid AND id != $comid "); + + $query = 'DELETE ' + . "\n FROM " . $_CB_database->NameQuote( '#__components' ) + . "\n WHERE " . $_CB_database->NameQuote( 'option' ) . " = " . $_CB_database->Quote( 'com_comprofiler' ) + . "\n AND " . $_CB_database->NameQuote( 'id' ) . " != " . (int) $componentId + . "\n AND " . $_CB_database->NameQuote( 'parent' ) . " != " . (int) $componentId; + $_CB_database->setQuery( $query ); - $_CB_database->query(); + $_CB_database->query(); - // update front-end menus component id: - $_CB_database->setQuery("UPDATE #__menu SET componentid=" . $comid . " WHERE type = 'component' AND link LIKE '%option=com_comprofiler%'"); + + $query = 'UPDATE ' . $_CB_database->NameQuote( '#__menu' ) + . "\n SET " . $_CB_database->NameQuote( 'componentid' ) . " = " . (int) $componentId + . "\n WHERE " . $_CB_database->NameQuote( 'type' ) . " = " . $_CB_database->Quote( 'component' ) + . "\n AND " . $_CB_database->NameQuote( 'link' ) . " LIKE " . $_CB_database->Quote( '%option=com_comprofiler%' ); + $_CB_database->setQuery( $query ); - $_CB_database->query(); + $_CB_database->query(); - echo "Administrator and frontend menus corrected.
"; - } + } + + $return .= 'Administrator and frontend menus corrected.
'; - } + } + } - //Manage Database Upgrades - $MCBUpgrades = array(); + $dbUpgrades = array(); - //Beta 3 Upgrade - $MCBUpgrades[0]['test'] = array( 'default', '#__comprofiler_lists' ); - $MCBUpgrades[0]['updates'][0] = "ALTER TABLE `#__comprofiler_lists`" + // Beta 3 upgrades: + $dbUpgrades[0]['test'] = array( 'default', '#__comprofiler_lists' ); + $dbUpgrades[0]['updates'][0] = "ALTER TABLE `#__comprofiler_lists`" - ."\n ADD `default` TINYINT( 1 ) DEFAULT '0' NOT NULL," + . "\n ADD `default` TINYINT( 1 ) DEFAULT '0' NOT NULL," - ."\n ADD `usergroupids` VARCHAR( 255 )," + . "\n ADD `usergroupids` VARCHAR( 255 )," - ."\n ADD `sortfields` VARCHAR( 255 )," + . "\n ADD `sortfields` VARCHAR( 255 )," - ."\n ADD `ordering` INT( 11 ) DEFAULT '0' NOT NULL AFTER `published`"; + . "\n ADD `ordering` INT( 11 ) DEFAULT '0' NOT NULL AFTER `published`"; - $MCBUpgrades[0]['updates'][1] = "UPDATE #__comprofiler_lists SET `default`=1 WHERE published =1"; - $MCBUpgrades[0]['updates'][2] = "UPDATE #__comprofiler_lists SET usergroupids = '29, 18, 19, 20, 21, 30, 23, 24, 25', sortfields = '`username` ASC'"; - $MCBUpgrades[0]['updates'][3] = "ALTER TABLE `#__comprofiler` ADD `acceptedterms` TINYINT( 1 ) DEFAULT '0' NOT NULL AFTER `bannedreason`"; - $MCBUpgrades[0]['message'] = "1.0 Beta 2 to 1.0 Beta 3"; + $dbUpgrades[0]['updates'][1] = "UPDATE #__comprofiler_lists SET `default`=1 WHERE published =1"; + $dbUpgrades[0]['updates'][2] = "UPDATE #__comprofiler_lists SET usergroupids = '29, 18, 19, 20, 21, 30, 23, 24, 25', sortfields = '`username` ASC'"; + $dbUpgrades[0]['updates'][3] = "ALTER TABLE `#__comprofiler` ADD `acceptedterms` TINYINT( 1 ) DEFAULT '0' NOT NULL AFTER `bannedreason`"; + $dbUpgrades[0]['message'] = "1.0 Beta 2 to 1.0 Beta 3"; - - //Beta 4 Upgrade - $MCBUpgrades[1]['test'] = array( 'firstname', '#__comprofiler' ); - $MCBUpgrades[1]['updates'][0] = "ALTER TABLE #__comprofiler ADD `firstname` VARCHAR( 100 ) AFTER `user_id` ," + // Beta 4 upgrades: + $dbUpgrades[1]['test'] = array( 'firstname', '#__comprofiler' ); + $dbUpgrades[1]['updates'][0] = "ALTER TABLE #__comprofiler ADD `firstname` VARCHAR( 100 ) AFTER `user_id` ," - ."\n ADD `middlename` VARCHAR( 100 ) AFTER `firstname` ," + . "\n ADD `middlename` VARCHAR( 100 ) AFTER `firstname` ," - ."\n ADD `lastname` VARCHAR( 100 ) AFTER `middlename` "; + . "\n ADD `lastname` VARCHAR( 100 ) AFTER `middlename` "; - $MCBUpgrades[1]['updates'][1] = "ALTER TABLE `#__comprofiler_fields` ADD `readonly` TINYINT( 1 ) DEFAULT '0' NOT NULL AFTER `profile`"; - $MCBUpgrades[1]['updates'][3] = "ALTER TABLE `#__comprofiler_tabs` ADD `width` VARCHAR( 10 ) DEFAULT '.5' NOT NULL AFTER `ordering` ," + $dbUpgrades[1]['updates'][1] = "ALTER TABLE `#__comprofiler_fields` ADD `readonly` TINYINT( 1 ) DEFAULT '0' NOT NULL AFTER `profile`"; + $dbUpgrades[1]['updates'][3] = "ALTER TABLE `#__comprofiler_tabs` ADD `width` VARCHAR( 10 ) DEFAULT '.5' NOT NULL AFTER `ordering` ," - ."\n ADD `enabled` TINYINT( 1 ) DEFAULT '1' NOT NULL AFTER `width` ," + . "\n ADD `enabled` TINYINT( 1 ) DEFAULT '1' NOT NULL AFTER `width` ," - ."\n ADD `plugin` VARCHAR( 255 ) DEFAULT NULL AFTER `enabled`" ; + . "\n ADD `plugin` VARCHAR( 255 ) DEFAULT NULL AFTER `enabled`" ; + $dbUpgrades[1]['message'] = "1.0 Beta 3 to 1.0 Beta 4"; - $MCBUpgrades[1]['message'] = "1.0 Beta 3 to 1.0 Beta 4"; - - //RC 1 Upgrade - $MCBUpgrades[2]['test'] = array( 'fields', '#__comprofiler_tabs' ); - $MCBUpgrades[2]['updates'][0] = "ALTER TABLE #__comprofiler_tabs ADD `plugin_include` VARCHAR( 255 ) AFTER `plugin` ," + // RC 1 upgrades: + $dbUpgrades[2]['test'] = array( 'fields', '#__comprofiler_tabs' ); + $dbUpgrades[2]['updates'][0] = "ALTER TABLE #__comprofiler_tabs ADD `plugin_include` VARCHAR( 255 ) AFTER `plugin` ," - ."\n ADD `fields` TINYINT( 1 ) DEFAULT '1' NOT NULL AFTER `plugin_include` "; + . "\n ADD `fields` TINYINT( 1 ) DEFAULT '1' NOT NULL AFTER `plugin_include` "; - $MCBUpgrades[2]['updates'][1] = "INSERT INTO `#__comprofiler_tabs` ( `title`, `description`, `ordering`, `width`, `enabled`, `plugin`, `plugin_include`, `fields`, `sys`) VALUES " + $dbUpgrades[2]['updates'][1] = "INSERT INTO `#__comprofiler_tabs` ( `title`, `description`, `ordering`, `width`, `enabled`, `plugin`, `plugin_include`, `fields`, `sys`) VALUES " - ."\n ( '_UE_CONTACT_INFO_HEADER', '', -4, '1', 1, 'getContactTab', NULL, 1, 1)," + . "\n ( '_UE_CONTACT_INFO_HEADER', '', -4, '1', 1, 'getContactTab', NULL, 1, 1)," - ."\n ( '_UE_AUTHORTAB', '', -3, '1', 0, 'getAuthorTab', NULL, 0, 1)," + . "\n ( '_UE_AUTHORTAB', '', -3, '1', 0, 'getAuthorTab', NULL, 0, 1)," - ."\n ( '_UE_FORUMTAB', '', -2, '1', 0, 'getForumTab', NULL, 0, 1)," + . "\n ( '_UE_FORUMTAB', '', -2, '1', 0, 'getForumTab', NULL, 0, 1)," - ."\n ( '_UE_BLOGTAB', '', -1, '1', 0, 'getBlogTab', NULL, 0, 1);"; + . "\n ( '_UE_BLOGTAB', '', -1, '1', 0, 'getBlogTab', NULL, 0, 1);"; - $MCBUpgrades[2]['updates'][2] = "ALTER TABLE `#__comprofiler_lists` ADD `filterfields` VARCHAR( 255 ) AFTER `sortfields`;"; - $MCBUpgrades[2]['message'] = "1.0 Beta 4 to 1.0 RC 1"; + $dbUpgrades[2]['updates'][2] = "ALTER TABLE `#__comprofiler_lists` ADD `filterfields` VARCHAR( 255 ) AFTER `sortfields`;"; + $dbUpgrades[2]['message'] = "1.0 Beta 4 to 1.0 RC 1"; - //RC 2 Upgrade - $MCBUpgrades[3]['test'] = array( 'description', '#__comprofiler_fields' ); - $MCBUpgrades[3]['updates'][0] = "ALTER TABLE `#__comprofiler_fields` ADD `description` MEDIUMTEXT NOT NULL default '' AFTER `title` "; - $MCBUpgrades[3]['updates'][1] = "ALTER TABLE `#__comprofiler_fields` CHANGE `title` `title` VARCHAR( 255 ) NOT NULL"; - $MCBUpgrades[3]['updates'][2] = "INSERT INTO `#__comprofiler_tabs` (`title`, `description`, `ordering`, `width`, `enabled`, `plugin`, `plugin_include`, `fields`, `sys`) VALUES " + // RC 2 Part 1 upgrades: + $dbUpgrades[3]['test'] = array( 'description', '#__comprofiler_fields' ); + $dbUpgrades[3]['updates'][0] = "ALTER TABLE `#__comprofiler_fields` ADD `description` MEDIUMTEXT NOT NULL default '' AFTER `title` "; + $dbUpgrades[3]['updates'][1] = "ALTER TABLE `#__comprofiler_fields` CHANGE `title` `title` VARCHAR( 255 ) NOT NULL"; + $dbUpgrades[3]['updates'][2] = "INSERT INTO `#__comprofiler_tabs` (`title`, `description`, `ordering`, `width`, `enabled`, `plugin`, `plugin_include`, `fields`, `sys`) VALUES " - ."\n ( '_UE_CONNECTION', '',99, '1', 0, 'getConnectionTab', NULL, 0, 1);"; + . "\n ( '_UE_CONNECTION', '',99, '1', 0, 'getConnectionTab', NULL, 0, 1);"; - $MCBUpgrades[3]['updates'][3] = "INSERT INTO `#__comprofiler_tabs` (`title`, `description`, `ordering`, `width`, `enabled`, `plugin`, `plugin_include`, `fields`, `sys`) VALUES " + $dbUpgrades[3]['updates'][3] = "INSERT INTO `#__comprofiler_tabs` (`title`, `description`, `ordering`, `width`, `enabled`, `plugin`, `plugin_include`, `fields`, `sys`) VALUES " - ."\n ( '_UE_NEWSLETTER_HEADER', '_UE_NEWSLETTER_INTRODCUTION', 99, '1', 0, 'getNewslettersTab', NULL, 0, 1);"; + . "\n ( '_UE_NEWSLETTER_HEADER', '_UE_NEWSLETTER_INTRODCUTION', 99, '1', 0, 'getNewslettersTab', NULL, 0, 1);"; - $MCBUpgrades[3]['updates'][4] = "UPDATE `#__comprofiler_tabs` SET sys=2, enabled=1 WHERE plugin='getContactTab' "; - $MCBUpgrades[3]['updates'][5] = "ALTER TABLE `#__comprofiler_lists` ADD `useraccessgroupid` INT( 9 ) DEFAULT '18' NOT NULL AFTER `usergroupids` "; - $MCBUpgrades[3]['message'] = "1.0 RC 1 to 1.0 RC 2 part 1"; + $dbUpgrades[3]['updates'][4] = "UPDATE `#__comprofiler_tabs` SET sys=2, enabled=1 WHERE plugin='getContactTab' "; + $dbUpgrades[3]['updates'][5] = "ALTER TABLE `#__comprofiler_lists` ADD `useraccessgroupid` INT( 9 ) DEFAULT '18' NOT NULL AFTER `usergroupids` "; + $dbUpgrades[3]['message'] = "1.0 RC 1 to 1.0 RC 2 part 1"; - $MCBUpgrades[4]['test'] = array( 'params', '#__comprofiler_tabs' ); - $MCBUpgrades[4]['updates'][0] = "ALTER TABLE `#__comprofiler_tabs` CHANGE `plugin` `pluginclass` VARCHAR( 255 ) DEFAULT NULL , " + // RC 2 Part 2 upgrades: + $dbUpgrades[4]['test'] = array( 'params', '#__comprofiler_tabs' ); + $dbUpgrades[4]['updates'][0] = "ALTER TABLE `#__comprofiler_tabs` CHANGE `plugin` `pluginclass` VARCHAR( 255 ) DEFAULT NULL , " - ."\n CHANGE `plugin_include` `pluginid` INT( 11 ) DEFAULT NULL "; + . "\n CHANGE `plugin_include` `pluginid` INT( 11 ) DEFAULT NULL "; - $MCBUpgrades[4]['updates'][1] = "ALTER TABLE `#__comprofiler_tabs` ADD `params` MEDIUMTEXT AFTER `fields` ;"; - $MCBUpgrades[4]['updates'][2] = "ALTER TABLE `#__comprofiler_fields` ADD `pluginid` INT( 11 ) , " + $dbUpgrades[4]['updates'][1] = "ALTER TABLE `#__comprofiler_tabs` ADD `params` MEDIUMTEXT AFTER `fields` ;"; + $dbUpgrades[4]['updates'][2] = "ALTER TABLE `#__comprofiler_fields` ADD `pluginid` INT( 11 ) , " - ."\n ADD `params` MEDIUMTEXT; "; + . "\n ADD `params` MEDIUMTEXT; "; - $MCBUpgrades[4]['updates'][3] = "UPDATE `#__comprofiler_tabs` SET pluginid=1 WHERE pluginclass='getContactTab' "; - $MCBUpgrades[4]['updates'][4] = "UPDATE `#__comprofiler_tabs` SET pluginid=1 WHERE pluginclass='getConnectionTab' "; - $MCBUpgrades[4]['updates'][5] = "UPDATE `#__comprofiler_tabs` SET pluginid=3 WHERE pluginclass='getAuthorTab' "; - $MCBUpgrades[4]['updates'][6] = "UPDATE `#__comprofiler_tabs` SET pluginid=4 WHERE pluginclass='getForumTab' "; - $MCBUpgrades[4]['updates'][7] = "UPDATE `#__comprofiler_tabs` SET pluginid=5 WHERE pluginclass='getBlogTab' "; - $MCBUpgrades[4]['updates'][8] = "UPDATE `#__comprofiler_tabs` SET pluginid=6 WHERE pluginclass='getNewslettersTab' "; - $MCBUpgrades[4]['message'] = "1.0 RC 1 to 1.0 RC 2 part 2"; + $dbUpgrades[4]['updates'][3] = "UPDATE `#__comprofiler_tabs` SET pluginid=1 WHERE pluginclass='getContactTab' "; + $dbUpgrades[4]['updates'][4] = "UPDATE `#__comprofiler_tabs` SET pluginid=1 WHERE pluginclass='getConnectionTab' "; + $dbUpgrades[4]['updates'][5] = "UPDATE `#__comprofiler_tabs` SET pluginid=3 WHERE pluginclass='getAuthorTab' "; + $dbUpgrades[4]['updates'][6] = "UPDATE `#__comprofiler_tabs` SET pluginid=4 WHERE pluginclass='getForumTab' "; + $dbUpgrades[4]['updates'][7] = "UPDATE `#__comprofiler_tabs` SET pluginid=5 WHERE pluginclass='getBlogTab' "; + $dbUpgrades[4]['updates'][8] = "UPDATE `#__comprofiler_tabs` SET pluginid=6 WHERE pluginclass='getNewslettersTab' "; + $dbUpgrades[4]['message'] = "1.0 RC 1 to 1.0 RC 2 part 2"; - $MCBUpgrades[5]['test'] = array( 'position', '#__comprofiler_tabs' ); - $MCBUpgrades[5]['updates'][1] = "ALTER TABLE `#__comprofiler_tabs`" + // RC 2 Part 3 upgrades: + $dbUpgrades[5]['test'] = array( 'position', '#__comprofiler_tabs' ); + $dbUpgrades[5]['updates'][1] = "ALTER TABLE `#__comprofiler_tabs`" - ."\n ADD `position` VARCHAR( 255 ) DEFAULT '' NOT NULL," + . "\n ADD `position` VARCHAR( 255 ) DEFAULT '' NOT NULL," - ."\n ADD `displaytype` VARCHAR( 255 ) DEFAULT '' NOT NULL AFTER `sys`"; + . "\n ADD `displaytype` VARCHAR( 255 ) DEFAULT '' NOT NULL AFTER `sys`"; - $MCBUpgrades[5]['updates'][2] = "UPDATE `#__comprofiler_tabs` SET position='cb_tabmain', displaytype='tab' "; - $MCBUpgrades[5]['updates'][3] = "INSERT INTO `#__comprofiler_tabs` (`title`, `description`, `ordering`, `width`, `enabled`, `pluginclass`, `pluginid`, `fields`, `sys`, `position`, `displaytype`) VALUES " + $dbUpgrades[5]['updates'][2] = "UPDATE `#__comprofiler_tabs` SET position='cb_tabmain', displaytype='tab' "; + $dbUpgrades[5]['updates'][3] = "INSERT INTO `#__comprofiler_tabs` (`title`, `description`, `ordering`, `width`, `enabled`, `pluginclass`, `pluginid`, `fields`, `sys`, `position`, `displaytype`) VALUES " - ."\n ( '_UE_MENU', '', -10, '1', 1, 'getMenuTab', 14, 0, 1, 'cb_head', 'html')," + . "\n ( '_UE_MENU', '', -10, '1', 1, 'getMenuTab', 14, 0, 1, 'cb_head', 'html')," - ."\n ( '_UE_CONNECTIONPATHS', '', -9, '1', 1, 'getConnectionPathsTab', 2, 0, 1, 'cb_head', 'html')," + . "\n ( '_UE_CONNECTIONPATHS', '', -9, '1', 1, 'getConnectionPathsTab', 2, 0, 1, 'cb_head', 'html')," - ."\n ( '_UE_PROFILE_PAGE_TITLE', '', -8, '1', 1, 'getPageTitleTab', 1, 0, 1, 'cb_head', 'html')," + . "\n ( '_UE_PROFILE_PAGE_TITLE', '', -8, '1', 1, 'getPageTitleTab', 1, 0, 1, 'cb_head', 'html')," - ."\n ( '_UE_PORTRAIT', '', -7, '1', 1, 'getPortraitTab', 1, 0, 1, 'cb_middle', 'html')," + . "\n ( '_UE_PORTRAIT', '', -7, '1', 1, 'getPortraitTab', 1, 0, 1, 'cb_middle', 'html')," - ."\n ( '_UE_USER_STATUS', '', -6, '.5', 1, 'getStatusTab', 14, 0, 1, 'cb_right', 'html')," + . "\n ( '_UE_USER_STATUS', '', -6, '.5', 1, 'getStatusTab', 14, 0, 1, 'cb_right', 'html')," - ."\n ( '_UE_PMSTAB', '', -5, '.5', 0, 'getmypmsproTab', 15, 0, 1, 'cb_right', 'html');"; + . "\n ( '_UE_PMSTAB', '', -5, '.5', 0, 'getmypmsproTab', 15, 0, 1, 'cb_right', 'html');"; - $MCBUpgrades[5]['updates'][5] = "UPDATE `#__comprofiler_tabs` SET pluginid=2 WHERE pluginclass='getConnectionTab' "; - $MCBUpgrades[5]['updates'][6] = "ALTER TABLE `#__comprofiler_members` ADD `reason` MEDIUMTEXT default NULL AFTER `membersince` "; - $MCBUpgrades[5]['updates'][7] = "UPDATE `#__comprofiler_tabs` SET `pluginclass`=NULL, `pluginid`=NULL WHERE `pluginclass` != 'getContactTab' AND `fields` = 1"; - // this is from build 10 to 11: - // changed back sys=3 -> 1 for _UE_MENU and _UE_USER_STATUS - // $MCBUpgrades[5]['updates'][8] = "ALTER TABLE `#__comprofiler_fields` CHANGE `default` `default` MEDIUMTEXT DEFAULT NULL"; - // this last one is only for upgrades from build 8 to 9. - $MCBUpgrades[5]['message'] = "1.0 RC 1 to 1.0 RC 2 part 3"; + $dbUpgrades[5]['updates'][5] = "UPDATE `#__comprofiler_tabs` SET pluginid=2 WHERE pluginclass='getConnectionTab' "; + $dbUpgrades[5]['updates'][6] = "ALTER TABLE `#__comprofiler_members` ADD `reason` MEDIUMTEXT default NULL AFTER `membersince` "; + $dbUpgrades[5]['updates'][7] = "UPDATE `#__comprofiler_tabs` SET `pluginclass`=NULL, `pluginid`=NULL WHERE `pluginclass` != 'getContactTab' AND `fields` = 1"; + $dbUpgrades[5]['message'] = "1.0 RC 1 to 1.0 RC 2 part 3"; - // from 1.0.1 to 1.0.2: (includes RC2 to 1.0): - $MCBUpgrades[6]['test'] = array( 'cbactivation', '#__comprofiler' ); - // from RC2 to 1.0 stable: in fact did it always up to now, since we can alter tables indefinitely. - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_fields` CHANGE `default` `default` MEDIUMTEXT DEFAULT NULL;"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_fields` CHANGE `tabid` `tabid` int(11) DEFAULT NULL;"; - $MCBUpgrades[6]['updates'][] = "UPDATE `#__users` SET usertype='Registered' WHERE usertype='';"; // fix effect of previous bug in CB registration - // $MCBUpgrades[6]['message'] = "1.0 RC 2 to 1.0 stable"; - // from 1.0.1 to 1.0.2: (includes RC2 to 1.0): - $MCBUpgrades[6]['updates'][] = "UPDATE `#__comprofiler_fields` SET `table`='#__users' WHERE name='email';"; - $MCBUpgrades[6]['updates'][] = "UPDATE `#__comprofiler_fields` SET `table`='#__users' WHERE name='lastvisitDate';"; - $MCBUpgrades[6]['updates'][] = "UPDATE `#__comprofiler_fields` SET `table`='#__users' WHERE name='registerDate';"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE #__comprofiler ADD `registeripaddr` VARCHAR( 50 ) DEFAULT '' NOT NULL AFTER `lastupdatedate`;"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE #__comprofiler ADD `cbactivation` VARCHAR( 50 ) DEFAULT '' NOT NULL AFTER `registeripaddr`;"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE #__comprofiler ADD `message_last_sent` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `hits`;"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE #__comprofiler ADD `message_number_sent` INT( 11 ) DEFAULT 0 NOT NULL AFTER `message_last_sent`;"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_field_values` ADD INDEX fieldid_ordering (`fieldid`, `ordering` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_fields` ADD INDEX `tabid_pub_prof_order` ( `tabid` , `published` , `profile` , `ordering` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_fields` ADD INDEX `readonly_published_tabid` ( `readonly` , `published` , `tabid` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_fields` ADD INDEX `registration_published_order` ( `registration` , `published` , `ordering` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_members` ADD INDEX `pamr` ( `pending` , `accepted` , `memberid` , `referenceid` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_members` ADD INDEX `aprm` ( `accepted` , `pending` , `referenceid` , `memberid` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_members` ADD INDEX `membrefid` ( `memberid` , `referenceid` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_plugin` ADD INDEX `type_pub_order` ( `type` , `published` , `ordering` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_tabs` ADD INDEX `enabled_position_ordering` ( `enabled` , `position` , `ordering` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_lists` ADD INDEX `pub_ordering` ( `published` , `ordering` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_lists` ADD INDEX `default_published` ( `default` , `published` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_userreports` ADD INDEX `status_user_date` ( `reportedstatus` , `reporteduser` , `reportedondate` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_userreports` ADD INDEX `reportedbyuser_ondate` ( `reportedbyuser` , `reportedondate` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_views` ADD INDEX `lastview` ( `lastview` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_views` ADD INDEX `profile_id_lastview` (`profile_id`,`lastview`);"; - $MCBUpgrades[6]['updates'][] = "UPDATE `#__comprofiler` SET `user_id`=`id` WHERE 1>0;"; // fix in case something corrupt for unique key - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler` ADD UNIQUE KEY user_id (`user_id`);"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler` ADD INDEX `apprconfbanid` ( `approved` , `confirmed` , `banned` , `id` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler` ADD INDEX `avatappr_apr_conf_ban_avatar` ( `avatarapproved` , `approved` , `confirmed` , `banned` , `avatar` );"; - $MCBUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler` ADD INDEX `lastupdatedate` ( `lastupdatedate` );"; - $MCBUpgrades[6]['message'] = "1.0 RC 2, 1.0 and 1.0.1 to 1.0.2"; + // 1.0.2 upgrades: + $dbUpgrades[6]['test'] = array( 'cbactivation', '#__comprofiler' ); + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_fields` CHANGE `default` `default` MEDIUMTEXT DEFAULT NULL;"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_fields` CHANGE `tabid` `tabid` int(11) DEFAULT NULL;"; - // from 1.0.2 to 1.1: - $MCBUpgrades[7]['test'] = array( 'ordering_register', '#__comprofiler_tabs' ); - $MCBUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler_plugin` ADD `backend_menu` VARCHAR(255) NOT NULL DEFAULT '' AFTER `folder`;"; - $MCBUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler_tabs` ADD `ordering_register` int(11) NOT NULL DEFAULT 10 AFTER `ordering`;"; - $MCBUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler_tabs` ADD `useraccessgroupid` int(9) DEFAULT -2 NOT NULL AFTER `position`;"; - $MCBUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler_tabs` ADD INDEX `orderreg_enabled_pos_order` ( `enabled` , `ordering_register` , `position` , `ordering` );"; - $MCBUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler` ADD `unbannedby` int(11) default NULL AFTER `bannedby`;"; - $MCBUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler` ADD `unbanneddate` datetime default NULL AFTER `banneddate`;"; - $MCBUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler_field_values` CHANGE `fieldtitle` `fieldtitle` VARCHAR(255) NOT NULL DEFAULT '';"; - $MCBUpgrades[7]['message'] = "1.0.2 to 1.1"; + if ( checkJversion() < 2 ) { + $dbUpgrades[6]['updates'][] = "UPDATE `#__users` SET usertype='Registered' WHERE usertype='';"; + } - // from 1.1 to 1.2: uses new method... + $dbUpgrades[6]['updates'][] = "UPDATE `#__comprofiler_fields` SET `table`='#__users' WHERE name='email';"; + $dbUpgrades[6]['updates'][] = "UPDATE `#__comprofiler_fields` SET `table`='#__users' WHERE name='lastvisitDate';"; + $dbUpgrades[6]['updates'][] = "UPDATE `#__comprofiler_fields` SET `table`='#__users' WHERE name='registerDate';"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE #__comprofiler ADD `registeripaddr` VARCHAR( 50 ) DEFAULT '' NOT NULL AFTER `lastupdatedate`;"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE #__comprofiler ADD `cbactivation` VARCHAR( 50 ) DEFAULT '' NOT NULL AFTER `registeripaddr`;"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE #__comprofiler ADD `message_last_sent` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `hits`;"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE #__comprofiler ADD `message_number_sent` INT( 11 ) DEFAULT 0 NOT NULL AFTER `message_last_sent`;"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_field_values` ADD INDEX fieldid_ordering (`fieldid`, `ordering` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_fields` ADD INDEX `tabid_pub_prof_order` ( `tabid` , `published` , `profile` , `ordering` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_fields` ADD INDEX `readonly_published_tabid` ( `readonly` , `published` , `tabid` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_fields` ADD INDEX `registration_published_order` ( `registration` , `published` , `ordering` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_members` ADD INDEX `pamr` ( `pending` , `accepted` , `memberid` , `referenceid` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_members` ADD INDEX `aprm` ( `accepted` , `pending` , `referenceid` , `memberid` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_members` ADD INDEX `membrefid` ( `memberid` , `referenceid` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_plugin` ADD INDEX `type_pub_order` ( `type` , `published` , `ordering` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_tabs` ADD INDEX `enabled_position_ordering` ( `enabled` , `position` , `ordering` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_lists` ADD INDEX `pub_ordering` ( `published` , `ordering` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_lists` ADD INDEX `default_published` ( `default` , `published` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_userreports` ADD INDEX `status_user_date` ( `reportedstatus` , `reporteduser` , `reportedondate` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_userreports` ADD INDEX `reportedbyuser_ondate` ( `reportedbyuser` , `reportedondate` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_views` ADD INDEX `lastview` ( `lastview` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler_views` ADD INDEX `profile_id_lastview` (`profile_id`,`lastview`);"; + $dbUpgrades[6]['updates'][] = "UPDATE `#__comprofiler` SET `user_id`=`id` WHERE 1>0;"; // fix in case something corrupt for unique key + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler` ADD UNIQUE KEY user_id (`user_id`);"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler` ADD INDEX `apprconfbanid` ( `approved` , `confirmed` , `banned` , `id` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler` ADD INDEX `avatappr_apr_conf_ban_avatar` ( `avatarapproved` , `approved` , `confirmed` , `banned` , `avatar` );"; + $dbUpgrades[6]['updates'][] = "ALTER TABLE `#__comprofiler` ADD INDEX `lastupdatedate` ( `lastupdatedate` );"; + $dbUpgrades[6]['message'] = "1.0 RC 2, 1.0 and 1.0.1 to 1.0.2"; - //Apply Upgrades - foreach ($MCBUpgrades AS $MCBUpgrade) { - //if it fails test then apply upgrade - if ( ! cbInstaller_field_exists( $MCBUpgrade['test'][1], $MCBUpgrade['test'][0] ) ) { - foreach( $MCBUpgrade['updates'] as $MCBScript ) { - $_CB_database->setQuery( $MCBScript ); + // 1.1 upgrades: + $dbUpgrades[7]['test'] = array( 'ordering_register', '#__comprofiler_tabs' ); + $dbUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler_plugin` ADD `backend_menu` VARCHAR(255) NOT NULL DEFAULT '' AFTER `folder`;"; + $dbUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler_tabs` ADD `ordering_register` int(11) NOT NULL DEFAULT 10 AFTER `ordering`;"; + $dbUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler_tabs` ADD `useraccessgroupid` int(9) DEFAULT -2 NOT NULL AFTER `position`;"; + $dbUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler_tabs` ADD INDEX `orderreg_enabled_pos_order` ( `enabled` , `ordering_register` , `position` , `ordering` );"; + $dbUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler` ADD `unbannedby` int(11) default NULL AFTER `bannedby`;"; + $dbUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler` ADD `unbanneddate` datetime default NULL AFTER `banneddate`;"; + $dbUpgrades[7]['updates'][] = "ALTER TABLE `#__comprofiler_field_values` CHANGE `fieldtitle` `fieldtitle` VARCHAR(255) NOT NULL DEFAULT '';"; + $dbUpgrades[7]['message'] = "1.0.2 to 1.1"; + + // Perform database upgrades: + foreach ( $dbUpgrades as $dbUpgrade ) { + if ( ! cbInstaller_field_exists( $dbUpgrade['test'][1], $dbUpgrade['test'][0] ) ) { + foreach( $dbUpgrade['updates'] as $query ) { + $_CB_database->setQuery( $query ); + - if( ! $_CB_database->query() ) { + if ( ! $_CB_database->query() ) { - //Upgrade failed - print("".$MCBUpgrade['message']." failed! SQL error:" . $_CB_database->stderr(true)."
"); - // return; + $return .= '' . $dbUpgrade['message'] . ' failed! Error: ' . $_CB_database->stderr( true ) . '
'; } } - //Upgrade was successful - print "".$MCBUpgrade['message']." Upgrade Applied Successfully.
"; + + $return .= '' . $dbUpgrade['message'] . ' Upgrade Applied Successfully.
'; } } - $sql="SELECT listid FROM #__comprofiler_lists ORDER BY ordering asc, published desc"; - $_CB_database->setQuery($sql); + // Correct userlist orders: + $query = 'SELECT ' . $_CB_database->NameQuote( 'listid' ) + . "\n FROM " . $_CB_database->NameQuote( '#__comprofiler_lists' ) + . "\n ORDER BY " . $_CB_database->NameQuote( 'ordering' ) . " ASC, " . $_CB_database->NameQuote( 'published' ) . " DESC"; + $_CB_database->setQuery( $query ); - $lists = $_CB_database->loadObjectList(); + $lists = $_CB_database->loadObjectList(); + - $order=0; + $order = 0; - if ( ! $_CB_database->getErrorNum() ) { - foreach($lists AS $list) { - $_CB_database->setQuery("UPDATE #__comprofiler_lists SET ordering = $order WHERE listid='".$list->listid."'"); + + if ( $lists ) foreach ( $lists AS $list ) { + $query = 'UPDATE ' . $_CB_database->NameQuote( '#__comprofiler_lists' ) + . "\n SET " . $_CB_database->NameQuote( 'ordering' ) . " = " . (int) $order + . "\n WHERE " . $_CB_database->NameQuote( 'listid' ) . " = " . (int) $list->listid; + $_CB_database->setQuery( $query ); - $_CB_database->query(); + $_CB_database->query(); + - $order++; - } + $order++; + } - } - // fixing the tabid of installs before CB 1.0 RC 2: - + // Core database fixes: - $dbChecker = new CBdbChecker( $_CB_database ); + $dbChecker = new CBdbChecker( $_CB_database ); - $result = $dbChecker->checkCBMandatoryDb( false ); + $result = $dbChecker->checkCBMandatoryDb( false ); + if ( ! $result ) { - $dbChecker = new CBdbChecker( $_CB_database ); + $dbChecker = new CBdbChecker( $_CB_database ); - $result = $dbChecker->checkCBMandatoryDb( true, false ); + $result = $dbChecker->checkCBMandatoryDb( true, false ); if ( $result == true ) { - echo "

Automatic database fixes of old core tabs and fields applied successfully.

"; + $return .= '

Automatic database fixes of old core tabs and fields applied successfully.

'; } elseif ( is_string( $result ) ) { - echo "

" . $result . "

"; + $return .= '

' . $result . '

'; } else { - echo "
"; - echo "

Database fixing errors:

"; - $errors = $dbChecker->getErrors( false ); + $errors = $dbChecker->getErrors( false ); - foreach ( $errors as $err ) { - echo '
' . $err[0]; - if ( $err[1] ) { - echo '
' . $err[1] . '
'; + + if ( $errors ) { + $return .= '
' + . '

Database fixing errors:

'; + + foreach ( $errors as $error ) { + $return .= '
' . $error[0]; + + if ( $error[1] ) { + $return .= '
' . $error[1] . '
'; - } + } - echo '
'; + + $return .= '
'; - } + } - echo "
"; + + $return .= '
'; - } + } + } + if ( ( checkJversion() < 1 ) || ( $_CB_framework->getCfg( 'session_handler' ) != 'database' ) ) { - // joomla 1.5 and 1.6 database session storage limited to 20kb, so do not display details in that case: - $logs = $dbChecker->getLogs( false ); + $logs = $dbChecker->getLogs( false ); + if ( count( $logs ) > 0 ) { - echo ""; - echo "'; } } } - // now missing core tabs will be inserted in the new 1.2 upgrader in next step: - // from CB 1.2 upwards: - $dbChecker = new CBdbChecker( $_CB_database ); + $dbChecker = new CBdbChecker( $_CB_database ); - $result = $dbChecker->checkDatabase( true, false ); + $result = $dbChecker->checkDatabase( true, false ); + if ( $result == true ) { - echo "

Automatic database upgrade to current version applied successfully.

"; + $return .= '

Automatic database upgrade to current version applied successfully.

'; } elseif ( is_string( $result ) ) { - echo "

" . $result . "

"; + $return .= '

' . $result . '

'; } else { - echo "
"; - echo "

Database fixing errors:

"; - $errors = $dbChecker->getErrors( false ); + $errors = $dbChecker->getErrors( false ); - foreach ( $errors as $err ) { - echo '
' . $err[0]; - if ( $err[1] ) { - echo '
' . $err[1] . '
'; + + if ( $errors ) { + $return .= '
' + . '

Database fixing errors:

'; + + foreach ( $errors as $error ) { + $return .= '
' . $error[0]; + + if ( $error[1] ) { + $return .= '
' . $error[1] . '
'; - } + } - echo '
'; + + $return .= '
'; - } + } - echo "
"; + + $return .= '
'; - } + } + } + if ( ( checkJversion() < 1 ) || ( $_CB_framework->getCfg( 'session_handler' ) != 'database' ) ) { - // joomla 1.5 and 1.6 database session storage limited to 20kb, so do not display details in that case: - $logs = $dbChecker->getLogs( false ); + $logs = $dbChecker->getLogs( false ); + if ( count( $logs ) > 0 ) { - echo ""; - echo "'; } } - echo "

Core CB database upgrades done. If all lines above are in green, database upgrade completed successfully. Otherwise, please report exact errors and queries to forum, and try checking database again in components : community builder : tools : check database.

"; - ?> -
-
- Core CB database upgrades done. If all lines above are in green, database upgrade completed successfully. Otherwise, please report exact errors and queries to forum, and try checking database again in components : community builder : tools : check database.

' + . '' + . '
'; -$adminFS =& cbAdminFileSystem::getInstance(); -$imagesPath = $_CB_framework->getCfg( 'absolute_path' ) . "/images"; + // Fix images: + $imagesPath = $_CB_framework->getCfg( 'absolute_path' ) . '/images'; -$cbImages = $imagesPath . '/comprofiler'; + $cbImages = $imagesPath . '/comprofiler'; -$cbImagesGallery = $cbImages . '/gallery'; + $cbImagesGallery = $cbImages . '/gallery'; -if ( $adminFS->isUsingStandardPHP() && ( ! $adminFS->file_exists( $cbImages ) ) && ! $adminFS->is_writable( $_CB_framework->getCfg( 'absolute_path' ) . "/images/" ) ) { - print "". $imagesPath . "/ is not writable !
"; + if ( $adminFS->isUsingStandardPHP() && ( ! $adminFS->file_exists( $cbImages ) ) && ( ! $adminFS->is_writable( $_CB_framework->getCfg( 'absolute_path' ) . '/images/' ) ) ) { + $return .= '' . $imagesPath . '/ is not writable!
'; -} else { - if ( ! $adminFS->file_exists( $cbImages ) ) { - if ( $adminFS->mkdir( $cbImages ) ) { + } else { + if ( ! $adminFS->file_exists( $cbImages ) ) { + if ( $adminFS->mkdir( $cbImages ) ) { - print "" . $cbImages . "/ Successfully added.
"; + $return .= '' . $cbImages . '/ Successfully added.
'; - } else { + } else { - print "" . $cbImages . "/ Failed to be to be created, please do so manually !
"; + $return .= '' . $cbImages . '/ failed to be to be created, please do so manually!
'; - } + } - } else { - // print "" . $cbImages . "/ already exists.
"; - } + } + - if ( ! $adminFS->file_exists( $cbImagesGallery ) ) { - if ( $adminFS->mkdir( $cbImagesGallery ) ) { + if ( ! $adminFS->file_exists( $cbImagesGallery ) ) { + if ( $adminFS->mkdir( $cbImagesGallery ) ) { - print "" . $cbImagesGallery ."/ Successfully added.
"; + $return .= '' . $cbImagesGallery . '/ Successfully added.
'; - } else { + } else { - print "" . $cbImagesGallery . "/ Failed to be to be created, please do so manually !
"; + $return .= '' . $cbImagesGallery . '/ failed to be to be created, please do so manually!
'; - } + } - } else { - // print "" . $cbImagesGallery . "/ already exists.
"; - } + } + - if( $adminFS->file_exists( $cbImages ) ) { + if ( $adminFS->file_exists( $cbImages ) ) { - if ( ! is_writable( $cbImages ) ) { + if ( ! is_writable( $cbImages ) ) { - if( ! $adminFS->chmod( $cbImages, 0775 ) ) { + if ( ! $adminFS->chmod( $cbImages, 0775 ) ) { - if ( ! @chmod( $cbImages, 0775 ) ) { + if ( ! @chmod( $cbImages, 0775 ) ) { - print "" . $cbImages . "/ Failed to be chmod'd to 775 please do so manually !
"; + $return .= '' . $cbImages . '/ failed to chmod to 775 please do so manually!
'; - } - } - } + } + } + } + - if( ! is_writable( $cbImages ) ) { + if ( ! is_writable( $cbImages ) ) { - print "" . $cbImages . "/ is not writable and failed to be chmod'd to 775 please do so manually !
"; + $return .= '' . $cbImages . '/ is not writable and failed to chmod to 775 please do so manually!
'; - } - } + } + } + - if ( $adminFS->file_exists( $cbImagesGallery ) ) { + if ( $adminFS->file_exists( $cbImagesGallery ) ) { - if( ! is_writable( $cbImagesGallery ) ) { + if ( ! is_writable( $cbImagesGallery ) ) { - if( ! $adminFS->chmod( $cbImagesGallery, 0775 ) ) { + if ( ! $adminFS->chmod( $cbImagesGallery, 0775 ) ) { - if ( ! @chmod( $cbImagesGallery, 0775 ) ) { + if ( ! @chmod( $cbImagesGallery, 0775 ) ) { - print "" . $cbImagesGallery . "/ Failed to be chmod'd to 775 please do so manually !
"; + $return .= '' . $cbImagesGallery . '/ failed to chmod to 775 please do so manually!
'; - } - } - } + } + } + } + - if( ! is_writable( $cbImagesGallery ) ) { + if ( ! is_writable( $cbImagesGallery ) ) { - print "" . $cbImagesGallery . "/ is not writable and failed to be chmod'd to 755 please do so manually !
"; + $return .= '' . $cbImagesGallery . '/ is not writable and failed to chmod to 775 please do so manually!
'; - } + } - $galleryFiles = array("airplane.gif" - ,"ball.gif" - ,"butterfly.gif" - ,"car.gif" - ,"dog.gif" - ,"duck.gif" - ,"fish.gif" - ,"frog.gif" - ,"guitar.gif" - ,"kick.gif" - ,"pinkflower.gif" - ,"redflower.gif" - ,"skater.gif" - ,"index.html"); - foreach( $galleryFiles AS $galleryFile ) { + + $galleryFiles = array( 'airplane.gif', 'ball.gif', 'butterfly.gif', 'car.gif', + 'dog.gif', 'duck.gif', 'fish.gif', 'frog.gif', 'guitar.gif', + 'kick.gif', 'pinkflower.gif', 'redflower.gif', 'skater.gif', 'index.html' + ); + + foreach ( $galleryFiles as $galleryFile ) { - if ( ! ( file_exists( $cbImagesGallery . '/' . $galleryFile ) && is_readable( $cbImagesGallery . '/' . $galleryFile ) ) ) { + if ( ! ( file_exists( $cbImagesGallery . '/' . $galleryFile ) && is_readable( $cbImagesGallery . '/' . $galleryFile ) ) ) { - // try by www: we try it this way, as we can silence errors in php, but not in FTP: - $result = @copy( $_CB_framework->getCfg( 'absolute_path' ) . "/components/com_comprofiler/images/gallery/".$galleryFile, $cbImagesGallery . '/' . $galleryFile ); + $result = @copy( $_CB_framework->getCfg( 'absolute_path' ) . '/components/com_comprofiler/images/gallery/' . $galleryFile, $cbImagesGallery . '/' . $galleryFile ); + - if ( ! $result ) { + if ( ! $result ) { - // otherwise try by FTP: - $result = $adminFS->copy( $_CB_framework->getCfg( 'absolute_path' ) . "/components/com_comprofiler/images/gallery/".$galleryFile, $cbImagesGallery . '/' . $galleryFile ); + $result = $adminFS->copy( $_CB_framework->getCfg( 'absolute_path' ) . '/components/com_comprofiler/images/gallery/' . $galleryFile, $cbImagesGallery . '/' . $galleryFile ); - } + } - if ( $result ) { - // print "" . $galleryFile . " Successfully added to the gallery.
"; - } else { - print "" . $galleryFile . " Failed to be added to the gallery please do so manually !
"; + + if ( ! $result ) { + $return .= '' . $galleryFile . ' failed to be added to the gallery please do so manually!
'; - } - } - } - } -} + } + } + } + } + } + -if ( ! ( $adminFS->file_exists( $cbImages ) && is_writable( $cbImages ) && $adminFS->file_exists( $cbImagesGallery ) ) ) { + if ( ! ( $adminFS->file_exists( $cbImages ) && is_writable( $cbImages ) && $adminFS->file_exists( $cbImagesGallery ) ) ) { - print "
Manually do the following:
1.) create ".$cbImages . "/ directory
2.) chmod it to 755 or if needed to 775
3.) create ". $cbImagesGallery . "/
4.) chmod it to 755 or if needed to 775
5.) copy " . $_CB_framework->getCfg( 'absolute_path' ) . "/components/com_comprofiler/images/gallery/ and its contents to ". $cbImagesGallery . "/

"; + $return .= '
Manually do the following:
1.) create ' . $cbImages . '/ directory
2.) chmod it to 755 or if needed to 775
3.) create ' . $cbImagesGallery . '/
4.) chmod it to 755 or if needed to 775
5.) copy ' . $_CB_framework->getCfg( 'absolute_path' ) . '/components/com_comprofiler/images/gallery/ and its contents to ' . $cbImagesGallery . '/

'; -} + } -?> -
-
- setUserState( "com_comprofiler_install", $ret ); - // now treat special case of CB 1.2.2- installed and a plugin/mambot/module already loaded and the new function doesn't exist: + + $return .= '
' + . '
'; + + $_CB_framework->setUserState( 'com_comprofiler_install', $return ); + - if ( is_callable( array( $_CB_framework, 'backendUrl' ) ) ) { + if ( is_callable( array( $_CB_framework, 'backendUrl' ) ) ) { - $stepTwoUrl = $_CB_framework->backendUrl( 'index.php?option=com_comprofiler&task=finishinstallation', false ); + $stepTwoUrl = $_CB_framework->backendUrl( 'index.php?option=com_comprofiler&task=finishinstallation', false ); - } else { + } else { - $stepTwoUrl = ( checkJversion() < 1 ? 'index2.php' : 'index.php' ) . '?option=com_comprofiler&task=finishinstallation'; + $stepTwoUrl = ( checkJversion() < 1 ? 'index2.php' : 'index.php' ) . '?option=com_comprofiler&task=finishinstallation'; - } + } -?> -
WAIT PLEASE: DO NOT INTERRUPT INSTALLATION PROCESS: PERFORMING SECOND INSTALLATION STEP: UNCOMPRESSING CORE PLUGINS: THIS CAN TAKE UP TO 2 MINUTES. If this screen stays for over 2 minutes, please click here to continue next and last installation step.
-WAIT PLEASE: DO NOT INTERRUPT INSTALLATION PROCESS: PERFORMING SECOND INSTALLATION STEP: UNCOMPRESSING CORE PLUGINS: THIS CAN TAKE UP TO 2 MINUTES.' + . $return; + + echo $return; + + $jsStepTwo = "$( '#cbInstallNextStep' ).hide().fadeIn( '1500', function() {" + . "$( this ).fadeOut( '1000', function() {" + . "$( this ).fadeIn( '1500', function() {" + . "window.location = '" . addslashes( $stepTwoUrl ) . "';" + . "})" + . "})" + . "});"; + - $_CB_framework->document->_outputToHeadCollectionStart(); + $_CB_framework->document->_outputToHeadCollectionStart(); + - if ( checkJversion() > 1 ) { + if ( checkJversion() > 1 ) { - // there is a redirect in j1.6 not buffering headers, so we have to output scripts in body: - $_CB_framework->document->setCmsDoc( null ); - } + $_CB_framework->document->setCmsDoc( null ); + } + - $_CB_framework->outputCbJQuery( $jsStepTwo ); - $_CB_framework->getAllJsPageCodes(); + $_CB_framework->outputCbJQuery( $jsStepTwo ); + $_CB_framework->getAllJsPageCodes(); + - echo $_CB_framework->document->_outputToHead(); + echo $_CB_framework->document->_outputToHead(); -} + return true; +} -?> +?> \ No newline at end of file Index: components/com_comprofiler/comprofiler.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- components/com_comprofiler/comprofiler.php +++ components/com_comprofiler/comprofiler.php @@ -70,7 +70,7 @@ cbimport( 'cb.imgtoolbox' ); if ( class_exists( 'JFactory' ) ) { // Joomla 1.5 : for string WARNREG_EMAIL_INUSE used in error js popup. - $lang =& JFactory::getLanguage(); + $lang = JFactory::getLanguage(); $lang->load( "com_user" ); } Index: administrator/components/com_comprofiler/controller/controller.plugin.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/controller/controller.plugin.php +++ administrator/components/com_comprofiler/controller/controller.plugin.php @@ -17,7 +17,7 @@ cbimport( 'cb.tabs' ); if ( class_exists( 'JFactory' ) ) { // Joomla 1.5 : for string WARNREG_EMAIL_INUSE used in error js popup. - $lang =& JFactory::getLanguage(); + $lang = JFactory::getLanguage(); $lang->load( "com_users" ); } cbimport( 'cb.params' ); \ No newline at end of file Index: components/com_comprofiler/comprofiler.html.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- components/com_comprofiler/comprofiler.html.php +++ components/com_comprofiler/comprofiler.html.php @@ -1684,11 +1684,7 @@ type)); - $k = array(); - foreach($ks as $kv) { - $k[]->value=$kv; - } + $k = explode( '|*|', trim( $connection->type ) ); $list=array(); $list['connectionType'] = moscomprofilerHTML::selectList( $connectionTypes, $connection->id.'connectiontype[]', 'class="inputbox" multiple="multiple" size="5"', 'value', 'text', $k,0 ); $conAvatar = null; Index: administrator/components/com_comprofiler/controller/controller.user.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/controller/controller.user.php +++ administrator/components/com_comprofiler/controller/controller.user.php @@ -17,7 +17,7 @@ cbimport( 'cb.tabs' ); if ( class_exists( 'JFactory' ) ) { // Joomla 1.5 : for string WARNREG_EMAIL_INUSE used in error js popup. - $lang =& JFactory::getLanguage(); + $lang = JFactory::getLanguage(); $lang->load( "com_users" ); } cbimport( 'cb.params' ); @@ -72,7 +72,7 @@ } $_PLUGINS->loadPluginGroup('user'); - + $cbUser =& CBuser::getInstance( $uid ); $cmsUserExists = ( $uid != 0 ) && ( $cbUser !== null ); if ( ! $cmsUserExists ) { \ No newline at end of file Index: administrator/components/com_comprofiler/library/cb/cb.database.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/library/cb/cb.database.php +++ administrator/components/com_comprofiler/library/cb/cb.database.php @@ -526,7 +526,7 @@ */ class CBdatabase { /** Host CMS database class - * @var database */ + * @var database|JDatabase|JDatabaseDriver */ var $_db; /* @var string Holds database prefix replacer (replacing the $prefix (default '#__')). */ var $_table_prefix = ''; @@ -548,8 +548,12 @@ * @param int */ function debug( $level ) { + if ( checkJversion() >= 2 ) { + $this->_db->setDebug( $level ); + } else { - $this->_db->debug( $level ); - } + $this->_db->debug( $level ); + } + } /** * @return int The error number for the most recent query */ @@ -588,12 +592,18 @@ * @return string */ function getEscaped( $text, $escapeForLike = false ) { - if ( $escapeForLike ) { - return str_replace(array('%','_'),array("\\%","\\_"), $this->_db->getEscaped( $text ) ); + if ( checkJversion() >= 2 ) { + $result = $this->_db->escape( $text ); } else { - return $this->_db->getEscaped( $text ); + $result = $this->_db->getEscaped( $text ); } + + if ( $escapeForLike ) { + $result = str_replace( array( '%', '_' ), array( "\\%", "\\_" ), $result ); - } + } + + return $result; + } /** * Get a quoted database escaped string * @@ -602,7 +612,7 @@ * @return string */ function Quote( $text, $escape = true ) { - return '\'' . ( $escape ? $this->_db->getEscaped( $text ) : $text ) . '\''; + return '\'' . ( $escape ? $this->getEscaped( $text ) : $text ) . '\''; } /** * Quote an identifier name (field, table, etc) @@ -755,8 +765,13 @@ * Load an array of single field results into an array */ function loadResultArray( $numinarray = 0 ) { - $resultArray = $this->_db->loadResultArray( $numinarray ); - return $this->_nullToArray( $resultArray ); + if ( checkJversion() >= 2 ) { + $result = $this->_db->loadColumn( $numinarray ); + } else { + $result = $this->_db->loadResultArray( $numinarray ); + } + + return $this->_nullToArray( $result ); } /** * Fetch a result row as an associative array Index: administrator/components/com_comprofiler/controller/controller.users.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/controller/controller.users.php +++ administrator/components/com_comprofiler/controller/controller.users.php @@ -17,7 +17,7 @@ cbimport( 'cb.tabs' ); if ( class_exists( 'JFactory' ) ) { // Joomla 1.5 : for string WARNREG_EMAIL_INUSE used in error js popup. - $lang =& JFactory::getLanguage(); + $lang = JFactory::getLanguage(); $lang->load( "com_users" ); } \ No newline at end of file Index: administrator/components/com_comprofiler/comprofileg.xml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/comprofileg.xml +++ administrator/components/com_comprofiler/comprofileg.xml @@ -26,7 +26,7 @@ install.comprofiler.sql install.comprofiler.sql - + COM_COMPROFILER @@ -38,6 +38,7 @@ COM_COMPROFILER_TOOLS COM_COMPROFILER_SHOWCONFIG + comprofileg.xml admin.comprofiler.php admin.comprofiler.controller.php admin.comprofiler.html.php @@ -63,8 +64,7 @@ language - install.comprofiler.php - uninstall.comprofiler.php + install.comprofiler.php http://update.joomlapolis.net/versions/comprofiler-1_8-update.xml \ No newline at end of file Index: administrator/components/com_comprofiler/controller/controller.field.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/controller/controller.field.php +++ administrator/components/com_comprofiler/controller/controller.field.php @@ -17,7 +17,7 @@ cbimport( 'cb.tabs' ); if ( class_exists( 'JFactory' ) ) { // Joomla 1.5 : for string WARNREG_EMAIL_INUSE used in error js popup. - $lang =& JFactory::getLanguage(); + $lang = JFactory::getLanguage(); $lang->load( "com_users" ); } cbimport( 'cb.params' ); \ No newline at end of file Index: administrator/components/com_comprofiler/library/cb/xml/cb.xml.xml.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/library/cb/xml/cb.xml.xml.php +++ administrator/components/com_comprofiler/library/cb/xml/cb.xml.xml.php @@ -41,7 +41,7 @@ * boolean Null if attribute is given but doesn't exist * array If no attribute is given will return the complete attributes array */ - function attributes( $attribute = null ) + function attributes( $attribute = null, $is_prefix = false ) { if( isset( $attribute ) ) { return ( isset( $this[$attribute]) ? (string) $this[$attribute] : null ); @@ -69,7 +69,7 @@ * @param string $name * @param array $attrs */ - function addAttribute( $name, $value ) { + function addAttribute( $name, $value = null, $ns = null ) { $this[$name] = $value; // it seems that php 5.1.6 requires htmlspecialchars() here to be happy, but stores the htmlspecialchars ! didn't find php changelog/bug report for that. } @@ -119,7 +119,7 @@ if ( $attrs === null ) { $attrs = array(); } - $child =& parent::addChild( $name, htmlspecialchars( $value ), $nameSpace ); + $child = parent::addChild( $name, htmlspecialchars( $value ), $nameSpace ); foreach ( $attrs as $k => $v ) { $child->addAttribute( $k, $v ); } Index: administrator/components/com_comprofiler/library/cb/cb.session.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/library/cb/cb.session.php +++ administrator/components/com_comprofiler/library/cb/cb.session.php @@ -65,7 +65,7 @@ * @param boolean $httponly * @return boolean */ - function setcookie( $name, $value = '', $expire = false, $path = null, $domain = null, $secure = false, $httponly = false ) { + static function setcookie( $name, $value = '', $expire = false, $path = null, $domain = null, $secure = false, $httponly = false ) { global $_CB_framework, $_SERVER; static $PrivacyHeaderSent = false; Index: administrator/components/com_comprofiler/controller/controller.default.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/controller/controller.default.php +++ administrator/components/com_comprofiler/controller/controller.default.php @@ -597,7 +597,7 @@ cbimport( 'cb.pagination' ); $pageNav = new cbPageNav( $total, $limitstart, $limit ); - if ( checkJversion() == 2 ) { + if ( checkJversion() >= 2 ) { $title = 'title'; } else { $title = 'name'; @@ -606,7 +606,7 @@ $query = "SELECT a.listid, a.title, a.description, a.published, a.`default`, a.ordering, a.viewaccesslevel, al.$title AS viewaccesslevelname, a.useraccessgroupid" . "\nFROM #__comprofiler_lists a"; - if ( checkJversion() == 2 ) { + if ( checkJversion() >= 2 ) { $query .= "\n LEFT JOIN #__viewlevels AS al ON al.id = a.viewaccesslevel"; } else { $query .= "\n LEFT JOIN #__groups AS al ON al.id + 1 = a.viewaccesslevel"; // fix J1.5-'s wrong access levels, same as g.id = IF( m.access = 0, 1, IF( m.access = 1, 2, IF( m.access = 2, 3, m.access ) ) ) @@ -1004,7 +1004,7 @@ cbimport( 'cb.pagination' ); $pageNav = new cbPageNav( $total, $limitstart, $limit ); - if ( checkJversion() == 2 ) { + if ( checkJversion() >= 2 ) { $title = 'title'; } else { $title = 'name'; @@ -1014,7 +1014,7 @@ . "\n FROM #__comprofiler_tabs AS a" . "\n LEFT JOIN #__comprofiler_plugin AS p ON p.id = a.pluginid"; - if ( checkJversion() == 2 ) { + if ( checkJversion() >= 2 ) { $query .= "\n LEFT JOIN #__viewlevels AS al ON al.id = a.viewaccesslevel"; } else { $query .= "\n LEFT JOIN #__groups AS al ON al.id + 1 = a.viewaccesslevel"; // fix J1.5-'s wrong access levels, same as g.id = IF( m.access = 0, 1, IF( m.access = 1, 2, IF( m.access = 2, 3, m.access ) ) ) \ No newline at end of file Index: administrator/components/com_comprofiler/controller/controller.tab.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/controller/controller.tab.php +++ administrator/components/com_comprofiler/controller/controller.tab.php @@ -17,7 +17,7 @@ cbimport( 'cb.tabs' ); if ( class_exists( 'JFactory' ) ) { // Joomla 1.5 : for string WARNREG_EMAIL_INUSE used in error js popup. - $lang =& JFactory::getLanguage(); + $lang = JFactory::getLanguage(); $lang->load( "com_users" ); } cbimport( 'cb.params' ); \ No newline at end of file Index: components/com_comprofiler/router.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- components/com_comprofiler/router.php +++ components/com_comprofiler/router.php @@ -25,7 +25,7 @@ if ( isset( $query['user'] ) && $query['user'] ) { if ( is_numeric( $query['user'] ) ) { $sql = 'SELECT username FROM #__users WHERE id = '. (int) $query['user']; - $database =& JFactory::getDBO(); + $database = JFactory::getDBO(); $database->setQuery( $sql, 0, 1 ); $username = $database->loadResult(); if ( $username && ! ( preg_match( '+[@:/\n\r\t\a\e\f\v\x00_]+', $username ) || is_numeric( $username ) ) ) { @@ -42,9 +42,13 @@ if ( isset( $query['listid'] ) && $query['listid'] ) { if ( is_numeric( $query['listid'] ) ) { $sql = 'SELECT title FROM #__comprofiler_lists WHERE listid = '. (int) $query['listid'] . ' AND published = 1'; - $database =& JFactory::getDBO(); + $database = JFactory::getDBO(); $database->setQuery( $sql, 0, 2 ); + if ( is_callable( array( $database, 'loadColumn' ) ) ) { + $listNames = $database->loadColumn(); + } else { - $listNames = $database->loadResultArray(); + $listNames = $database->loadResultArray(); + } if ( is_array( $listNames ) && ( count( $listNames ) == 1 ) ) { $query['listid'] = $listNames[0]; } @@ -91,10 +95,14 @@ // so we do what we can as usernames with '-' are more common than usernames with ':': $user = str_replace( array( ':', '_' ), array( '-', '.' ), $segments[1] ); if ( ! is_numeric( $user ) ) { - $database =& JFactory::getDBO(); + $database = JFactory::getDBO(); $sql = 'SELECT id FROM #__users WHERE username = '. $database->Quote( $user ); $database->setQuery( $sql, 0, 2 ); + if ( is_callable( array( $database, 'loadColumn' ) ) ) { + $userIds = $database->loadColumn(); + } else { - $userIds = $database->loadResultArray(); + $userIds = $database->loadResultArray(); + } if ( is_array( $userIds ) && ( count( $userIds ) == 1 ) ) { $user = $userIds[0]; } @@ -107,10 +115,14 @@ if ( $count > 1 ) { $listid = $segments[1]; if ( ! is_numeric( $listid ) ) { - $database =& JFactory::getDBO(); + $database = JFactory::getDBO(); $sql = 'SELECT listid FROM #__comprofiler_lists WHERE title = '. $database->Quote( $listid ) . ' AND published = 1'; $database->setQuery( $sql, 0, 2 ); + if ( is_callable( array( $database, 'loadColumn' ) ) ) { + $listIds = $database->loadColumn(); + } else { - $listIds = $database->loadResultArray(); + $listIds = $database->loadResultArray(); + } if ( is_array( $listIds ) && ( count( $listIds ) == 1 ) ) { $listid = $listIds[0]; } \ No newline at end of file Index: components/com_comprofiler/plugin/templates/luna/template.css IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- components/com_comprofiler/plugin/templates/luna/template.css +++ components/com_comprofiler/plugin/templates/luna/template.css @@ -129,12 +129,12 @@ position: relative; background-color: #ee5526; - background-image: -webkit-gradient(linear, 0% 0%, 0% 85%, from(rgba(246, 132, 36, 0.8)), to(rgba(239, 97, 49, 0.9))); + background-image: -webkit-gradient(linear, 0% 0%, 0% 85%, from(rgba(246, 132, 36, 0.8)), to(rgba(239, 97, 49, 0.9))); background-image: -moz-linear-gradient(rgba(246, 132, 36, 0.8) 0%, rgba(239, 97, 49, 0.9) 85%); border-top-color: #f7a250; border-right-color: #f7a050; border-bottom-color: #ef925e; - border-left-color: #f6a460; + border-left-color: #f6a460; -webkit-box-shadow: rgba(237, 96, 46, 0.5) 0px 10px 16px; -moz-box-shadow: rgba(237, 96, 46, 0.5) 0px 10px 16px; @@ -194,7 +194,7 @@ display: inline; float: left; overflow: hidden; - + cursor: Default; margin: 1px -1px 1px 2px; @@ -364,10 +364,10 @@ } div.cbclearboth:after { - content: "."; - display: block; - height: 0; - clear: both; + content: "."; + display: block; + height: 0; + clear: both; visibility: hidden; } div.cbclearboth {display:inline-block;} @@ -514,7 +514,7 @@ display: none; } /*************************************** - =cluetipClass: 'default' + =cluetipClass: 'default' -------------------------------------- */ .cluetip-default { @@ -536,11 +536,11 @@ .cluetip-default #cluetip-title a { color: #d9d9c2; font-size: 0.95em; -} +} .cluetip-default #cluetip-inner { padding: 10px; } -.cluetip-default div#cluetip-close { +.cluetip-default div#cluetip-close { text-align: right; margin: 0 5px 5px; color: #900; @@ -562,8 +562,8 @@ left: 50%; margin-left: -11px; height: 11px; - width: 22px; -} + width: 22px; +} .clue-bottom-default .cluetip-arrows { background-image: url(images/cluetip/darrowup.gif); top: -11px; @@ -599,7 +599,7 @@ display: inline-block; width: 100%; /* BBFIX bug 3359 */ } -.cluetip-jtip div#cluetip-close { +.cluetip-jtip div#cluetip-close { text-align: right; margin: 0 5px 5px; color: #900; @@ -621,8 +621,8 @@ left: 50%; margin-left: -11px; height: 11px; - width: 22px; -} + width: 22px; +} .clue-bottom-jtip .cluetip-arrows { background-image: url(images/cluetip/arrowup.gif); top: -11px; @@ -670,7 +670,7 @@ position: relative; } -.cluetip-rounded div#cluetip-close { +.cluetip-rounded div#cluetip-close { text-align: right; margin: 0 5px 5px; color: #009; @@ -696,8 +696,8 @@ left: 50%; margin-left: -11px; height: 11px; - width: 22px; -} + width: 22px; +} .clue-bottom-rounded .cluetip-arrows { background-image: url(images/cluetip/rarrowup.gif); top: -23px; @@ -846,66 +846,10 @@ color: #0B55C4; text-decoration: none; } -.cbicon-32-adduser { background-image:url(images/toolbar/icon-32-adduser.png); } -.cbicon-32-apply { background-image:url(images/toolbar/icon-32-apply.png); } -.cbicon-32-archive { background-image:url(images/toolbar/icon-32-archive.png); } -.cbicon-32-assign { background-image:url(images/toolbar/icon-32-publish.png); } -.cbicon-32-audio { background-image:url(images/toolbar/icon-32-audio.png); } -.cbicon-32-back { background-image:url(images/toolbar/icon-32-back.png); } -.cbicon-32-calculator { background-image:url(images/toolbar/icon-32-calculator.png); } -.cbicon-32-calendar { background-image:url(images/toolbar/icon-32-calendar.png); } -.cbicon-32-cancel { background-image:url(images/toolbar/icon-32-cancel.png); } -.cbicon-32-config { background-image:url(images/toolbar/icon-32-config.png); } -.cbicon-32-copy { background-image:url(images/toolbar/icon-32-copy.png); } -.cbicon-32-css { background-image:url(images/toolbar/icon-32-css.png); } -.cbicon-32-datetime { background-image:url(images/toolbar/icon-32-datetime.png); } -.cbicon-32-default { background-image:url(images/toolbar/icon-32-default.png); } -.cbicon-32-delete { background-image:url(images/toolbar/icon-32-delete.png); } -.cbicon-32-download { background-image:url(images/toolbar/icon-32-download.png); } -.cbicon-32-edit { background-image:url(images/toolbar/icon-32-edit.png); } -.cbicon-32-export { background-image:url(images/toolbar/icon-32-export.png); } -.cbicon-32-forward { background-image:url(images/toolbar/icon-32-forward.png); } -.cbicon-32-globe { background-image:url(images/toolbar/icon-32-globe.png); } -.cbicon-32-help { background-image:url(images/toolbar/icon-32-help.png); } -.cbicon-32-home { background-image:url(images/toolbar/icon-32-home.png); } -.cbicon-32-html { background-image:url(images/toolbar/icon-32-html.png); } -.cbicon-32-idea { background-image:url(images/toolbar/icon-32-idea.png); } -.cbicon-32-lock { background-image:url(images/toolbar/icon-32-lock.png); } -.cbicon-32-logout { background-image:url(images/toolbar/icon-32-logout.png); } -.cbicon-32-mail { background-image:url(images/toolbar/icon-32-mail.png); } -.cbicon-32-menus { background-image:url(images/toolbar/icon-32-menu.png); } -.cbicon-32-move { background-image:url(images/toolbar/icon-32-move.png); } -.cbicon-32-new { background-image:url(images/toolbar/icon-32-new.png); } -.cbicon-32-package { background-image:url(images/toolbar/icon-32-package.png); } -.cbicon-32-pdf { background-image:url(images/toolbar/icon-32-pdf.png); } -.cbicon-32-pictures { background-image:url(images/toolbar/icon-32-pictures.png); } -.cbicon-32-preview { background-image:url(images/toolbar/icon-32-preview.png); } -.cbicon-32-print { background-image:url(images/toolbar/icon-32-print.png); } -.cbicon-32-publish { background-image:url(images/toolbar/icon-32-publish.png); } -.cbicon-32-refresh { background-image:url(images/toolbar/icon-32-refresh.png); } -.cbicon-32-restore { background-image:url(images/toolbar/icon-32-revert.png); } -.cbicon-32-save { background-image:url(images/toolbar/icon-32-save.png); } -.cbicon-32-send { background-image:url(images/toolbar/icon-32-send.png); } -.cbicon-32-settings { background-image:url(images/toolbar/icon-32-settings.png); } -.cbicon-32-tasks { background-image:url(images/toolbar/icon-32-tasks.png); } -.cbicon-32-time { background-image:url(images/toolbar/icon-32-time.png); } -.cbicon-32-trash { background-image:url(images/toolbar/icon-32-trash.png); } -.cbicon-32-unarchive { background-image:url(images/toolbar/icon-32-unarchive.png); } -.cbicon-32-unpublish { background-image:url(images/toolbar/icon-32-unpublish.png); } -.cbicon-32-upload { background-image:url(images/toolbar/icon-32-upload.png); } -.cbicon-32-users { background-image:url(images/toolbar/icon-32-users.png); } -.cbicon-32-xml { background-image:url(images/toolbar/icon-32-xml.png); } -.cbicon-48-user { background-image:url(images/header/icon-48-user.png); } -.cbicon-48-massmail { background-image:url(images/header/icon-48-massmail.png); } -.cbicon-48-tabs { background-image:url(images/header/icon-48-user-tabs.png); } -.cbicon-48-fields { background-image:url(images/header/icon-48-user-fields.png); } -.cbicon-48-lists { background-image:url(images/header/icon-48-userslist.png); } -.cbicon-48-plugins { background-image:url(images/header/icon-48-library.png); } -.cbicon-48-tools { background-image:url(images/header/icon-48-tools.png); } -.cbicon-48-settings { background-image:url(images/header/icon-48-settings.png); } - -.header { +#cbAdminMainWrapper .header { + background-color: transparent; + background-image: none; background-repeat: no-repeat; font-size: 22px; font-weight: bold; @@ -915,6 +859,65 @@ text-align: left; } +#cbAdminMainWrapper .cbicon-32-adduser { background-image:url(images/toolbar/icon-32-adduser.png); } +#cbAdminMainWrapper .cbicon-32-apply { background-image:url(images/toolbar/icon-32-apply.png); } +#cbAdminMainWrapper .cbicon-32-archive { background-image:url(images/toolbar/icon-32-archive.png); } +#cbAdminMainWrapper .cbicon-32-assign { background-image:url(images/toolbar/icon-32-publish.png); } +#cbAdminMainWrapper .cbicon-32-audio { background-image:url(images/toolbar/icon-32-audio.png); } +#cbAdminMainWrapper .cbicon-32-back { background-image:url(images/toolbar/icon-32-back.png); } +#cbAdminMainWrapper .cbicon-32-calculator { background-image:url(images/toolbar/icon-32-calculator.png); } +#cbAdminMainWrapper .cbicon-32-calendar { background-image:url(images/toolbar/icon-32-calendar.png); } +#cbAdminMainWrapper .cbicon-32-cancel { background-image:url(images/toolbar/icon-32-cancel.png); } +#cbAdminMainWrapper .cbicon-32-config { background-image:url(images/toolbar/icon-32-config.png); } +#cbAdminMainWrapper .cbicon-32-copy { background-image:url(images/toolbar/icon-32-copy.png); } +#cbAdminMainWrapper .cbicon-32-css { background-image:url(images/toolbar/icon-32-css.png); } +#cbAdminMainWrapper .cbicon-32-datetime { background-image:url(images/toolbar/icon-32-datetime.png); } +#cbAdminMainWrapper .cbicon-32-default { background-image:url(images/toolbar/icon-32-default.png); } +#cbAdminMainWrapper .cbicon-32-delete { background-image:url(images/toolbar/icon-32-delete.png); } +#cbAdminMainWrapper .cbicon-32-download { background-image:url(images/toolbar/icon-32-download.png); } +#cbAdminMainWrapper .cbicon-32-edit { background-image:url(images/toolbar/icon-32-edit.png); } +#cbAdminMainWrapper .cbicon-32-export { background-image:url(images/toolbar/icon-32-export.png); } +#cbAdminMainWrapper .cbicon-32-forward { background-image:url(images/toolbar/icon-32-forward.png); } +#cbAdminMainWrapper .cbicon-32-globe { background-image:url(images/toolbar/icon-32-globe.png); } +#cbAdminMainWrapper .cbicon-32-help { background-image:url(images/toolbar/icon-32-help.png); } +#cbAdminMainWrapper .cbicon-32-home { background-image:url(images/toolbar/icon-32-home.png); } +#cbAdminMainWrapper .cbicon-32-html { background-image:url(images/toolbar/icon-32-html.png); } +#cbAdminMainWrapper .cbicon-32-idea { background-image:url(images/toolbar/icon-32-idea.png); } +#cbAdminMainWrapper .cbicon-32-lock { background-image:url(images/toolbar/icon-32-lock.png); } +#cbAdminMainWrapper .cbicon-32-logout { background-image:url(images/toolbar/icon-32-logout.png); } +#cbAdminMainWrapper .cbicon-32-mail { background-image:url(images/toolbar/icon-32-mail.png); } +#cbAdminMainWrapper .cbicon-32-menus { background-image:url(images/toolbar/icon-32-menu.png); } +#cbAdminMainWrapper .cbicon-32-move { background-image:url(images/toolbar/icon-32-move.png); } +#cbAdminMainWrapper .cbicon-32-new { background-image:url(images/toolbar/icon-32-new.png); } +#cbAdminMainWrapper .cbicon-32-package { background-image:url(images/toolbar/icon-32-package.png); } +#cbAdminMainWrapper .cbicon-32-pdf { background-image:url(images/toolbar/icon-32-pdf.png); } +#cbAdminMainWrapper .cbicon-32-pictures { background-image:url(images/toolbar/icon-32-pictures.png); } +#cbAdminMainWrapper .cbicon-32-preview { background-image:url(images/toolbar/icon-32-preview.png); } +#cbAdminMainWrapper .cbicon-32-print { background-image:url(images/toolbar/icon-32-print.png); } +#cbAdminMainWrapper .cbicon-32-publish { background-image:url(images/toolbar/icon-32-publish.png); } +#cbAdminMainWrapper .cbicon-32-refresh { background-image:url(images/toolbar/icon-32-refresh.png); } +#cbAdminMainWrapper .cbicon-32-restore { background-image:url(images/toolbar/icon-32-revert.png); } +#cbAdminMainWrapper .cbicon-32-save { background-image:url(images/toolbar/icon-32-save.png); } +#cbAdminMainWrapper .cbicon-32-send { background-image:url(images/toolbar/icon-32-send.png); } +#cbAdminMainWrapper .cbicon-32-settings { background-image:url(images/toolbar/icon-32-settings.png); } +#cbAdminMainWrapper .cbicon-32-tasks { background-image:url(images/toolbar/icon-32-tasks.png); } +#cbAdminMainWrapper .cbicon-32-time { background-image:url(images/toolbar/icon-32-time.png); } +#cbAdminMainWrapper .cbicon-32-trash { background-image:url(images/toolbar/icon-32-trash.png); } +#cbAdminMainWrapper .cbicon-32-unarchive { background-image:url(images/toolbar/icon-32-unarchive.png); } +#cbAdminMainWrapper .cbicon-32-unpublish { background-image:url(images/toolbar/icon-32-unpublish.png); } +#cbAdminMainWrapper .cbicon-32-upload { background-image:url(images/toolbar/icon-32-upload.png); } +#cbAdminMainWrapper .cbicon-32-users { background-image:url(images/toolbar/icon-32-users.png); } +#cbAdminMainWrapper .cbicon-32-xml { background-image:url(images/toolbar/icon-32-xml.png); } + +#cbAdminMainWrapper .cbicon-48-user { background-image:url(images/header/icon-48-user.png); } +#cbAdminMainWrapper .cbicon-48-massmail { background-image:url(images/header/icon-48-massmail.png); } +#cbAdminMainWrapper .cbicon-48-tabs { background-image:url(images/header/icon-48-user-tabs.png); } +#cbAdminMainWrapper .cbicon-48-fields { background-image:url(images/header/icon-48-user-fields.png); } +#cbAdminMainWrapper .cbicon-48-lists { background-image:url(images/header/icon-48-userslist.png); } +#cbAdminMainWrapper .cbicon-48-plugins { background-image:url(images/header/icon-48-library.png); } +#cbAdminMainWrapper .cbicon-48-tools { background-image:url(images/header/icon-48-tools.png); } +#cbAdminMainWrapper .cbicon-48-settings { background-image:url(images/header/icon-48-settings.png); } + ul#fieldValuesList { list-style-type: none; border: 1px solid #999; margin: 5px; padding: 5px; width:210px; } ul#fieldValuesList li { height: 2em; line-height: 1.0em; background-image:url(images/mini-icons/icon-18-sort_up_down.png); background-position:right center; background-repeat:no-repeat; margin-left: 20px; margin-bottom: 4px; cursor: move; } ul#fieldValuesList li input { cursor: text; } @@ -941,6 +944,170 @@ } .cbbejeoptionsintro.cbbejeoptionsintrocomusers { top: -80px; +} + +/* J3.0 backend fixes: */ +body.com_comprofiler #cbAdminMainWrapper input, +body.com_comprofiler #cbAdminMainWrapper textarea, +body.com_comprofiler #cbAdminMainWrapper select { + width: auto; +} + +body.com_comprofiler #cbAdminMainWrapper .btn-toolbar { + display: none; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist { + width: 100%; + max-width: 100%; + background-color: transparent; + border-spacing: 0; + margin-bottom: 10px; + border: 1px solid #dddddd; + border-collapse: separate; + *border-collapse: collapsed; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist th, +body.com_comprofiler #cbAdminMainWrapper .adminlist td { + padding: 8px; + line-height: 18px; + border-right: 0; + border-bottom: 0; + border-top: 1px solid #dddddd; + border-left: 0; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist th { + font-weight: bold; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist caption + thead tr:first-child th, +body.com_comprofiler #cbAdminMainWrapper .adminlist caption + thead tr:first-child td, +body.com_comprofiler #cbAdminMainWrapper .adminlist colgroup + thead tr:first-child th, +body.com_comprofiler #cbAdminMainWrapper .adminlist colgroup + thead tr:first-child td, +body.com_comprofiler #cbAdminMainWrapper .adminlist thead:first-child tr:first-child th, +body.com_comprofiler #cbAdminMainWrapper .adminlist thead:first-child tr:first-child td { + border-top: 0; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody + tbody { + border-top: 2px solid #dddddd; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist caption + thead tr:first-child th, +body.com_comprofiler #cbAdminMainWrapper .adminlist caption + tbody tr:first-child th, +body.com_comprofiler #cbAdminMainWrapper .adminlist caption + tbody tr:first-child td, +body.com_comprofiler #cbAdminMainWrapper .adminlist colgroup + thead tr:first-child th, +body.com_comprofiler #cbAdminMainWrapper .adminlist colgroup + tbody tr:first-child th, +body.com_comprofiler #cbAdminMainWrapper .adminlist colgroup + tbody tr:first-child td, +body.com_comprofiler #cbAdminMainWrapper .adminlist thead:first-child tr:first-child th, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody:first-child tr:first-child th, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody:first-child tr:first-child td { + border-top: 0; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist thead:first-child tr:first-child th:first-child, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody:first-child tr:first-child td:first-child { + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist thead:first-child tr:first-child th:last-child, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody:first-child tr:first-child td:last-child { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist thead:last-child tr:last-child th:first-child, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody:last-child tr:last-child td:first-child { + -webkit-border-radius: 0 0 0 4px; + -moz-border-radius: 0 0 0 4px; + border-radius: 0 0 0 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist thead:last-child tr:last-child th:last-child, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody:last-child tr:last-child td:last-child { + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr:nth-child(odd) td, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr:nth-child(odd) th { + background-color: #f9f9f9; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr:nth-child(even) td, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr:nth-child(even) th { + background-color: transparent; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr:nth-child(even) td, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr:nth-child(even) th { + background-color: transparent; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr:hover td, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr:hover th { + background-color: #f5f5f5; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr.sectiontableheader td, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr.sectiontableheader td:hover, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr.sectiontableheader th, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr.sectiontableheader th:hover, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr td.sectiontableheader, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr td.sectiontableheader:hover, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr th.sectiontableheader, +body.com_comprofiler #cbAdminMainWrapper .adminlist tbody tr th.sectiontableheader:hover { + background-color: transparent; +} + +body.com_comprofiler #cbAdminMainWrapper .pagenav { + font-size: 14px; + display: inline-block; + margin: 0 0 0 -4px; + padding: 0 14px; + line-height: 26px; + text-decoration: none; + background-color: #ffffff; + border: 1px solid #dddddd; + border-left-width: 0; +} + +body.com_comprofiler #cbAdminMainWrapper .pagenav:first-child { + border-left-width: 1px; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} + +body.com_comprofiler #cbAdminMainWrapper .pagenav:last-child { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} + +body.com_comprofiler #cbAdminMainWrapper .adminlist input { + margin: 0; +} + +body.com_comprofiler #cbAdminMainWrapper .fltrt { + float: right; +} + +body.com_comprofiler header.header { + height: 0; + visibility: hidden; } /* CB module Menu */ Index: components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php +++ components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php @@ -3640,7 +3640,7 @@ $results = null; if ( class_exists( 'JFactory' ) ) { // Joomla 1.5 : - $lang =& JFactory::getLanguage(); + $lang = JFactory::getLanguage(); $lang->load( 'com_users' ); } @@ -3869,14 +3869,16 @@ if ( checkJversion() == 2 ) { $registry = new JRegistry( $params ); $value = $registry->toArray(); + $valueString = $registry->toString(); } else { $txt = array(); foreach ( $params as $k => $v) { $txt[] = $k . '=' . $v; } $value = implode( "\n", $txt ); + $valueString = $value; } - if ( ( (string) $user->params ) !== (string) $value ) { + if ( ( (string) $user->params ) !== (string) $valueString ) { $this->_logFieldUpdate( $field, $user, $reason, $user->params, $value ); } $user->params = $value; @@ -3898,7 +3900,7 @@ if (class_exists("JUser")) { // Joomla 1.5 and 1.6: if ( $user->id ) { - $juser =& JUser::getInstance( $user->id ); + $juser = JUser::getInstance( $user->id ); } else { $juser =& JUser::getInstance(); } \ No newline at end of file Index: administrator/components/com_comprofiler/comprofiler.class.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/comprofiler.class.php +++ administrator/components/com_comprofiler/comprofiler.class.php @@ -3482,6 +3482,9 @@ break; case "tab": default: + if ( ! isset( $tabNavJS[$pos][$i] ) ) { + $tabNavJS[$pos][$i] = new stdClass(); + } //$results .= $this->startPane($pos); done at the end below if ( $ueConfig['nesttabs'] && $oTab->fields && ( ( $oTab->pluginclass == null ) || ( $oTab->sys == 2 ) ) ) { $oNest[$pos] .= $this->startTab("CBNest".$pos, $tabTitle,$oTab->tabid) Index: administrator/components/com_comprofiler/library/cb/cb.tables.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- administrator/components/com_comprofiler/library/cb/cb.tables.php +++ administrator/components/com_comprofiler/library/cb/cb.tables.php @@ -643,7 +643,7 @@ function moscomprofilerUser( &$db ) { parent::moscomprofiler( $db ); if ( checkJversion() == 2 ) { - $this->_cmsUserTableGid = 'usertype'; + $this->_cmsUserTableGid = null; } $this->_reinitNonComprofileVars(); } @@ -1111,15 +1111,10 @@ $oldGid = null; $oldBlock = null; - //TOOD //FIXME Somehow the constructor does not get called in j1.6, so need to redo this here: - if ( checkJversion() == 2 ) { - $this->_cmsUserTableGid = 'usertype'; - } - if ( ! $isNew ) { // get actual username to update sessions in case: $sql = 'SELECT ' . $_CB_database->NameQuote( $this->_cmsUserTableUsername ) - . ', ' . $_CB_database->NameQuote( $this->_cmsUserTableGid ) + . ( checkJversion() < 2 ? ', ' . $_CB_database->NameQuote( $this->_cmsUserTableGid ) : null ) . ', ' . $_CB_database->NameQuote( 'block' ) . ' FROM ' . $_CB_database->NameQuote( $this->_cmsUserTable ) . ' WHERE ' . $_CB_database->NameQuote( $this->_cmsUserTableKey ) . ' = ' . (int) $this->user_id; $_CB_database->setQuery( $sql ); @@ -1159,23 +1154,22 @@ } */ if ( checkJversion() == 2 ) { - $query = 'SELECT title AS name' - . "\n FROM #__usergroups" - . "\n WHERE id = " . (int) $this->gid - ; - } elseif ( checkJversion() == 1 ) { + $this->usertype = null; + } else { + if ( checkJversion() == 1 ) { - $query = 'SELECT name' + $query = 'SELECT name' . "\n FROM #__core_acl_aro_groups" . "\n WHERE id = " . (int) $this->gid ; - } else { + } else { - $query = 'SELECT name' + $query = 'SELECT name' . "\n FROM #__core_acl_aro_groups" . "\n WHERE group_id = " . (int) $this->gid ; - } - $_CB_database->setQuery( $query ); + } + $_CB_database->setQuery( $query ); - $this->usertype = $_CB_database->loadResult(); + $this->usertype = $_CB_database->loadResult(); + } if ( ( ! $isNew ) && ( $this->confirmed == 0 ) && ( $this->cbactivation == '' ) && ( $ueConfig['reg_confirmation'] != 0 ) ) { $this->_setActivationCode(); @@ -1283,15 +1277,17 @@ $sessionGid = 2; } $query = 'UPDATE #__session ' - . "\n SET usertype = " . $_CB_database->Quote( $this->usertype ); + . "\n SET username = " . $_CB_database->Quote( $this->username ); + if ( checkJversion() < 2 ) { + $query .= ', usertype = ' . $_CB_database->Quote( $this->usertype ); + } + if ( checkJversion() <= 1 ) { $query .= ', gid = ' . (int) $sessionGid; } - $query .= ', username = ' . $_CB_database->Quote( $this->username ) - . "\n WHERE userid = " . (int) $this->id - ; + $query .= "\n WHERE userid = " . (int) $this->id; //TBD: here maybe jaclplus fields update if JACLplus installed.... $_CB_database->setQuery( $query ); $result = $_CB_database->query();