Advertisement:

Custom Fields while Register

Aloittaja PokémonS, huhtikuu 11, 2014, 10:03:30 AP

« edellinen - seuraava »

PokémonS

SMF 2.0.7

Hi,

For example, this custom field is not shown in register.
How to generate/add this custom field to database while register? This field is set to '0' values, not an empty values.

Thanks!
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

PokémonS

It has been 24 hours 0 minutes and 1 second. :p

Bump.
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

margarett

LOL ;D

This is something I imagine a MOD for. If only I could get the time... :(
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

PokémonS

#3
Lainaus käyttäjältä: margarett - huhtikuu 12, 2014, 12:56:28 IP
LOL ;D

This is something I imagine a MOD for. If only I could get the time... :(

Okay, maybe I just need this: Where did the SMF insert custom field to database while register?
What PHP file and line?

Thanks!
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

PokémonS

Finally! I solved my problem :D
From Subs-Member.php

Find
// Theme variables too?
if (!empty($theme_vars))
{
$inserts = array();
foreach ($theme_vars as $var => $val)
$inserts[] = array($memberID, $var, $val);
$smcFunc['db_insert']('insert',
'{db_prefix}themes',
array('id_member' => 'int', 'variable' => 'string-255', 'value' => 'string-65534'),
$inserts,
array('id_member', 'variable')
);
}


Replace with
// Theme variables too?
if (!empty($theme_vars))
{

        $smcFunc['db_insert']('insert',
            '{db_prefix}themes',
            array(
                'id_member' => 'int', 'variable' => 'string-255', 'value' => 'string-65534',
            ),
            array(
                $memberID, 'cust_battle', '0',
            ),
            array('id_member', 'variable')
        );

        $smcFunc['db_insert']('insert',
            '{db_prefix}themes',
            array(
                'id_member' => 'int', 'variable' => 'string-255', 'value' => 'string-65534',
            ),
            array(
                $memberID, 'cust_t', '0',
            ),
            array('id_member', 'variable')
        );

$inserts = array();
foreach ($theme_vars as $var => $val)
$inserts[] = array($memberID, $var, $val);
$smcFunc['db_insert']('insert',
'{db_prefix}themes',
array('id_member' => 'int', 'variable' => 'string-255', 'value' => 'string-65534'),
$inserts,
array('id_member', 'variable')
);
}


But it semms odd because it takes many query.
At least this problem is solved. :3
きみと手をつなごう つらいときはもっと
ゼロからはじめよう ほら ほら 手をつなごう
みんな手をつなごう つらいときはもっと
力を合わせよう ほら ほら 手をつなごう

Advertisement: