Problem with EasyUCP hack

Forum_easyUCP_Desc

Problem with EasyUCP hack

Beitragvon gwuk » 22. Jan 2005 02:44

I got stuck on a bit of this modification:

Find in usercp_register.php:
Code: Alles auswählen
         $sql = "UPDATE " . USERS_TABLE . "
            SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
            WHERE user_id = $user_id";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
         }


Replace with:
Code: Alles auswählen
// <!-- BEGIN easyUCP -->
         if ( isset($HTTP_GET_VARS['ucp_mode']) || isset($HTTP_POST_VARS['ucp_mode']) )
         {
            $ucp_mode = ( isset($HTTP_GET_VARS['ucp_mode']) ) ? $HTTP_GET_VARS['ucp_mode'] : $HTTP_POST_VARS['ucp_mode'];
            $ucp_mode = htmlspecialchars($ucp_mode);
         }
/*
         $sql = "UPDATE " . USERS_TABLE . "
            SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
            WHERE user_id = $user_id";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
         }
*/
// Registration Info
         if ( $ucp_mode == 'ucp_require' || $ucp_mode == '' )
         {
         $sql = "UPDATE " . USERS_TABLE . "
            SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'
            WHERE user_id = $user_id";
           if ( !($result = $db->sql_query($sql)) )
           {
              message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
           }
         }
// Profile Info
         if ( $ucp_mode == 'ucp_info' || $ucp_mode == '' )
         {
         $sql = "UPDATE " . USERS_TABLE . "
            SET user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "',user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "'
            WHERE user_id = $user_id";
           if ( !($result = $db->sql_query($sql)) )
           {
              message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
           }
         }
// Preferences
         if ( $ucp_mode == 'ucp_prefs' || $ucp_mode == '' )
         {
         $sql = "UPDATE " . USERS_TABLE . "
            SET user_viewemail = $viewemail, user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_allow_viewprofile = $allowviewprofile, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style
            WHERE user_id = $user_id";
           if ( !($result = $db->sql_query($sql)) )
           {
              message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
           }
         }
// Avatar
         if ( $ucp_mode == 'ucp_avatar' && $avatar_sql != '' || $ucp_mode == '' && $avatar_sql != '' )
         {
         $sql = "UPDATE " . USERS_TABLE . "
            SET " . substr($avatar_sql,2) . "
            WHERE user_id = $user_id";
           if ( !($result = $db->sql_query($sql)) )
           {
              message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
           }
         }
// Signature
         if ( $ucp_mode == 'ucp_signature' || $ucp_mode == '' )
         {
         $sql = "UPDATE " . USERS_TABLE . "
            SET user_sig_bbcode_uid = '$signature_bbcode_uid', user_sig = '" . str_replace("\'", "''", $signature) . "'
            WHERE user_id = $user_id";
           if ( !($result = $db->sql_query($sql)) )
           {
              message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
           }
         }
// <!-- END easyUCP -->


However this is whats in my code:
Code: Alles auswählen
         $sql = "UPDATE " . USERS_TABLE . "
            SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_from_flag = '$user_flag', user_interests = '" . str_replace("\'", "''", $interests) . "', user_realname = '" . str_replace("\'", "''", $realname) . "', user_experience = '" . str_replace("\'", "''", $experience) . "', user_experience_bbcode_uid = '$experience_bbcode_uid', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_allow_mass_pm = $allow_mass_pm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
            WHERE user_id = $user_id";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
         }


As you can see I have installed some hacks which include realname, mass pm, flags, add new field (the field is called "experience"),.

I really am lost as to how to complete this part of the modification. Please help, I really am lost here...way out of my depth.
gwuk
User
 
Beiträge: 49
Registriert: 22. Jan 2005 02:07

Beitragvon AmigaLink » 22. Jan 2005 08:26

That is not really a problem. The aditional entries of the existing mods must you only into the new SQL instructions insert. Gild it however to consider it in the correct part to be inserted.
See into yours profile_add_body.tpl where the selection fields are placed and insert their instruction into the appropriate SQL part in usercp_register.php.

For example the realname is placed between <!-- BEGIN switch_ucp_info --> and <!-- END switch_ucp_info -->
Thus you must set its SQL instruction
Code: Alles auswählen
, user_realname = '" . str_replace("\'", "''", $realname) . "'
in part
Code: Alles auswählen
// Profile Info

         if ( $ucp_mode == 'ucp_info' || $ucp_mode == '' )

         {

         $sql = "UPDATE " . USERS_TABLE . "

            SET user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "',user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "'

            WHERE user_id = $user_id";

           if ( !($result = $db->sql_query($sql)) )

           {

              message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);

           }

         }
so that ist looks like this
Code: Alles auswählen
// Profile Info

         if ( $ucp_mode == 'ucp_info' || $ucp_mode == '' )

         {

         $sql = "UPDATE " . USERS_TABLE . "

            SET user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_realname = '" . str_replace("\'", "''", $realname) . "',user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "'

            WHERE user_id = $user_id";

           if ( !($result = $db->sql_query($sql)) )

           {

              message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);

           }

         }
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon gwuk » 22. Jan 2005 17:53

Thanks Amiga :D
I've installed it, just 2 small problems Ive found so far, I will post them one at a time, this is the first I noticed:

There are 2 blank buttons with no text?
Dateianhänge
gwuk
User
 
Beiträge: 49
Registriert: 22. Jan 2005 02:07

Beitragvon AmigaLink » 22. Jan 2005 19:42

Did have you made this languange entrys?
Code: Alles auswählen
// <!-- BEGIN easyUCP -->
$lang['easyUCP'] = '<font color="red">easy</font> User Control Panel';
$lang['Profile_Admin'] = 'User Administration for %s'; // %s is username
$lang['Hide_profile'] = 'Allow Profileview for Guests';

//signature editor
$lang['sig_description'] = "Edit Signature (<b>Preview included</b>)";
$lang['sig_edit'] = "Edit Signature";
$lang['sig_current'] = "Current Signature";
$lang['sig_none'] = '<font color = "red">No Signature available</font>';
$lang['sig_save'] = "Save";
$lang['sig_save_message'] = "Signature saved successful !";
// <!-- END easyUCP -->


And do you have a test account, so that I can regard that times?
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon gwuk » 22. Jan 2005 20:39

Ooops, sorry. I forgot to upload the language file :P

The mod has also affected some of the hacks I installed:
My new field I added to the profile
The flags hack
Real name mod (I think Ive found this solution here though)

I have PMed you an admin test account.
gwuk
User
 
Beiträge: 49
Registriert: 22. Jan 2005 02:07

Beitragvon AmigaLink » 24. Jan 2005 02:40

Thanks for the test account. I will this evening times regard that.
For the realname it gives in the board a Addon is needed here. Did you install?
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon gwuk » 24. Jan 2005 07:18

Hello Amiga,
Yes I will now install that addon. I had already installed the realname hack on the forum, is this what this addon is for?

Also, will you be needing my FTP info? As I was wondering how I would add back the extra field into the profiles aswell as the flags?
gwuk
User
 
Beiträge: 49
Registriert: 22. Jan 2005 02:07

Beitragvon AmigaLink » 24. Jan 2005 13:05

Condemned, the server is slow! :?
gwuk hat geschrieben:Hello Amiga,
Yes I will now install that addon. I had already installed the realname hack on the forum, is this what this addon is for?

Yes
Also, will you be needing my FTP info? As I was wondering how I would add back the extra field into the profiles aswell as the flags?

For the time being not yet.

Please attach me your:
usercp_register.php
usercp_viewprofile.php
easyucp_body.tpl
profile_add_body.tpl
and
profile_view_body.tpl
as a zip, rar or ace file.

For what does the experience idt? I can find in addition no entry.
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon gwuk » 24. Jan 2005 19:10

HI,
I installed the addon, thanks. And here is the rar file.
The experience field was an extra field I added in which people place the experience they have had with which gecko species :)

[center][ Attachment gelöscht am 13.06.2005, 18:45 von AmigaLink ][/center]
gwuk
User
 
Beiträge: 49
Registriert: 22. Jan 2005 02:07

Beitragvon gwuk » 24. Jan 2005 19:11

Do you know how I can add the realname field to viewprofile? So we can see user's names when we view their profile?
gwuk
User
 
Beiträge: 49
Registriert: 22. Jan 2005 02:07

Nächste

Zurück zu easy UCP



Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 9 Gäste

cron