Home arrow Forum Latest posts of: Denney
  Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2008, 02:51:46 PM
Home New Posts Search Calendar


Login with username, password and session length
  Show Posts
Pages: [1]
1  Joomla Hacks / Joomla-SMF 2.0.x / Re: Change SMF's user information through CB interface on: November 11, 2006, 08:43:56 AM
To fix this so it works with RC2, instead of using the above code, use this code:

Find:
Code:
$_PLUGINS->registerFunction( 'onBeforeUserUpdate', 'updateUser', 'jsmfCB');

Add After:
Code:
$_PLUGINS->registerFunction( 'onAfterUserUpdate', 'updateAfterUser', 'jsmfCB');

Find:
Code:
function updateUser($data, $extras, $status) {

Add After END OF FUNCTION!:
Code:
function updateAfterUser($data, $extras, $status) {
global $_PLUGINS;
        global $jsmfConfig;
        $jsmf = new jsmfFrontend();
        $jsmfConfig = $jsmf->loadParams();

//Mike's hack
//Update smf_members with optional info like gender, MSN, website, location etc
global $database, $user;
$sql = "SELECT * FROM #__comprofiler WHERE `id` = '".$data->id."'";
$database->setQuery($sql);
$cbData = null;
$database->loadObject( $cbData );
if (!empty($cbData->cb_website)) {
$website = explode("|*|", $cbData->cb_website);
if (substr(htmlspecialchars($website[0], ENT_QUOTES),0,7) != "http://")
$websiteUrl .= "http://";
$websiteUrl .= htmlspecialchars($website[0], ENT_QUOTES);
$websiteTitle = ($website[1] != "") ? htmlspecialchars($website[1], ENT_QUOTES) : $websiteUrl;
}
        $uid = $jsmf->getSMFid($data->id, $data->username);

$query =
"UPDATE {$jsmfConfig->smf_prefix}members SET " .
"\n `personalText` = '".htmlspecialchars($cbData->cb_personaltext, ENT_QUOTES)."', " .
"\n `gender` = '".(($cbData->cb_gender == 'Female') ? '2' : '1')."', " .
"\n `birthdate` = '".$cbData->cb_birthdate."', " .
"\n `websiteTitle` = '".$websiteTitle."', " .
"\n `websiteUrl` = '".$websiteUrl."', " .
"\n `location` = '".htmlspecialchars($cbData->cb_location, ENT_QUOTES)."', " .
"\n `ICQ` = '".htmlspecialchars($cbData->cb_icq, ENT_QUOTES)."', " .
"\n `AIM` = '".htmlspecialchars($cbData->cb_aim, ENT_QUOTES)."', " .
"\n `YIM` = '".htmlspecialchars($cbData->cb_yim, ENT_QUOTES)."', " .
"\n `MSN` = '".htmlspecialchars($cbData->cb_msn, ENT_QUOTES)."', " .
"\n `signature` = '".htmlspecialchars($cbData->cb_signature, ENT_QUOTES)."', " .
"\n `usertitle` = '".htmlspecialchars($cbData->cb_usertitle, ENT_QUOTES)."' " .
"\n WHERE `ID_MEMBER` = '".$uid."'";
$database->setQuery($query);

if (!$database->query()) {
$jsmf->err = $database->getErrorMsg().' ~~~ FROM::'.__FILE__.' || '.__FUNCTION__.' || '.__LINE__;
return false;
}

return true;
}
2  Joomla Hacks / Joomla-SMF 2.0.x / Re: Hide Email in Joomla-SMF 2.0 RC3 + CBE on: November 11, 2006, 06:45:13 AM
I'm having the same problem in RC2... The settings are not saved when editing the profile.

I edit the profile, click "change" and then it redirects back to the original profile page. Checking the profile again shows that the profile options ARE NOT being saved.

They save fine in unwrapped mode... Kinda defeats the purpose though.

Edit: As a temporary workaround, check this code out:

http://www.joomlahacks.com/component/option,com_smf/Itemid,94/topic,2591.msg12948#msg12948

You just have to add extra code for the additional fields.
Pages: [1]


Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
Search Contact About Advertise Blogs Topsites Submit News Register Login