Subject: do not understand custom registration example(step4)

Posted on: 03/05/05 05:42am
By: Anonymous

actually I have read the notes on custom registration but i don't understand this part:
4) Update your theme templates
- See the files under the included "themefiles" directory
what does it means?do we need to copy this file into the current public_html folder that we use now or just replacing it?
4.1) Add a new directory called "custom" to your theme(s) directory
Add the template memberdetail.thtml to this custom folder.
Example: layout/professional/custom/memberdetail.thtml

4.2) Update the User Profile templates to include the custom fields
In the included archive - under themefiles, there is a "users" and "preferences" folder.
They each contain one template that needs to replace the file already in the corresponding
Theme directory. Note: These updated template files don't include the PGP Key field for the
user profile - as it's most likly not wanted anyways. Add it from the existing one if required.

I don't even understand all these..
for someone who understand please help me..!!









do not understand custom registration example(step4)

Posted on: 14/05/05 04:21pm
By: ofey

I am also trying to do this and find step four confusing.
Pity you post anonymously.
Are you still working on this?

do not understand custom registration example(step4)

Posted on: 14/05/05 05:58pm
By: machinari

point 4 just tells you generally what needs to happen.
point 4.1 and 4.2 elaborate and are very specific.

In your theme directory, create a folder called "custom" and place the memberdetail.thtml file in the newly created folder.

In your preexisting yourtheme/admin/user/ and yourtheme/preferences/ folders (within your theme directory) you need to replace or just edit the two files mentioned, ie, profile.thtml in the yourtheme/preferences/ dir, and edituser.thtml in the yourtheme/admin/user/ dir.

If you choose to edit, rather than replace, you'll be adding the {customfields} variable to those two template files. If you choose to replace, well, that is self-explanatory.

hope that helps a bit.

do not understand custom registration example(step4)

Posted on: 14/05/05 06:49pm
By: ofey

Thanks Machinari,
I got it to work. I've successfully added a new field. Luckily the field I want to add is the easiest field, 'fullname'.
I want the registration form to look the same as it was, but just with the extra field.(I use gameserver).
I don't seem to be able to use the same variables. For instance previously I used {lang_username}, but now have to use, {USERNAME}. Is there anyway to be able to use the same variables?

Shane

do not understand custom registration example(step4)

Posted on: 14/05/05 09:19pm
By: machinari

AFAICS, in profile.thtml the variable {lang_username} is replaced by a label, and {username} is replaced by the actual user's name from the database.
...and the new user form is the same except that there is no {username} variable to be replaced--no user name yet.

So, I must not understand what you are doing.


---nope , i'm wrong.. hang on

I wasn't looking at the custom function... yup, that's strange that the variables are changed and the language file is not used... easy to fix however. just edit the function to reflect those variables that you have always used and also to make use of the language file.

You can use the newuserform() function in users.php as an example.

do not understand custom registration example(step4)

Posted on: 15/05/05 03:01am
By: ofey

So should I change in public/users.php the following,
function newuserform($msg = '')
{
    global $LANG04, $_CONF;

    $retval = '';
    
    if (!empty ($msg)) {
        $retval .= COM_startBlock ($LANG04[21], '',
                           COM_getBlockTemplate ('_msg_block', 'header'))
                . $msg
                . COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
    }
    $user_templates = new Template($_CONF['path_layout'] . 'users');
    $user_templates->set_file('regform','registrationform.thtml');
    $user_templates->set_var('site_url', $_CONF['site_url']);
    $user_templates->set_var('start_block', COM_startBlock($LANG04[22]));
    $user_templates->set_var('lang_instructions', $LANG04[23]);
    $user_templates->set_var('lang_username', $LANG04[2]);
    $user_templates->set_var('lang_email', $LANG04[5]);
    $user_templates->set_var('lang_warning', $LANG04[24]);
    $user_templates->set_var('lang_register', $LANG04[27]);
    $user_templates->set_var('end_block', COM_endBlock());
    $user_templates->parse('output', 'regform');
    $retval .= $user_templates->finish($user_templates->get_var('output')); 

    return $retval;
}


I don't know how I should change this to
edit the function to reflect those variables that you have always used and also to make use of the language file.

Just to be sure I'm explaining myself right.
I was using the form, from public/layout/gameserver/users/registrationform.thtml
                            {start_block}
                            <table border="0" cellpadding="3" cellspacing="0" width="100%">
                                <tr>
                                    <td>
                                        <form action="{site_url}/users.php" method="post">
                                            <table border="0" cellspacing="0" cellpadding="3">
                                                <tr>
                                                    <td colspan="2">{lang_instructions}</td>
                                                </tr>
                                                <tr>
                                                    <td align="right"><b>{lang_username}:</b></td>
                                                    <td><input type="text" size="16" maxlength="16" name="username"></td>
                                                </tr>
                                                <tr>
                                                    <td align="right"><b>{lang_email}:</b></td>
                                                    <td><input type="text" size="16" maxlength="96" name="email"></td>
                                                </tr>
                                                <tr>
                                                    <td align="center" class="warning" colspan="2">{lang_warning}</td>
                                                </tr>
                                                <tr>
                                                    <td align="center" colspan="2">
                                                        <input type="hidden" name="mode" value="create">
                                                        <input type="submit" value="{lang_register}">
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>                               
                                    </td>
                                </tr>
                            </table>
                            {end_block}

The new form from public/layout/gameserver/custom/memberdetail.thtml
<!-- This is an example template file for the Custom User Registration Feature -->
<!-- To be located under theme/custom directory - Example professional/custom/memberdetail.thtml -->
{start_block}
                            <table border="0" cellpadding="3" cellspacing="0" width="100%">
                                <tr>
                                    <td>
                                        <form action="{site_url}/users.php" method="post">
                                            <table border="0" cellspacing="0" cellpadding="3">
                                                <tr>
                                                    <td colspan="2">{lang_instructions}</td>
                                                </tr>
                                                <tr>
                                                    <td align="right"><b>{USERNAME}:</b></td>
                                                    <td><input type="text" size="16" maxlength="16" name="username"></td>
                                                </tr>
                                                <tr>
                                                    <td align="right"><b>{lang_email}:</b></td>
                                                    <td><input type="text" size="16" maxlength="96" name="email"></td>
                                                </tr>
                                                <tr>
                                                    <td align="center" class="warning" colspan="2">{lang_warning}</td>
                                                </tr>
                                                <tr>
                                                    <td align="center" colspan="2">
                                                        <input type="hidden" name="mode" value="create">
                                                        <input type="submit" value="{lang_register}">
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>                               
                                    </td>
                                </tr>
                            </table>
                            {end_block}

I'd like to use the original form registrationform.thtml, adding this row to the table,
<tr>
                                                    <td align="right"><b>{fullname}:</b></td>
                                                    <td><input type="text" size="16" maxlength="16" name="fullname"></td>
                                                </tr>

Clearly it isn't that simple. so what should I do next?

do not understand custom registration example(step4)

Posted on: 15/05/05 03:55am
By: machinari

sorry, when I said to edit the function, I didn't mean to edit the one in users.php, but the one in lib-custom.php, which will be called instead of newuserform() if $_CONF['custom_registration'] is set to 'true' in config.php.

have you seen Blaines latest post?

...anyway, I would compare registrationform.thtml and memberdetail.thtml and just edit memberdetail.thtml to suit my desires. If you're intent on using the same variable names, then copy them over from newuserform() to custom_userform(). For example, if you still wanted to use {lang_username}, then copy $user_templates->set_var('lang_username', $LANG04[2]);
from newuserform() over to custom_userform(), and ensure that the variable finds its way into memberdetail.thtml.

I think Blaine's downloadable examples are probably going to be less confusing than my blithering.

do not understand custom registration example(step4)

Posted on: 15/05/05 05:27am
By: ofey

Yes, I've been working with Blaine's download. That's where I got memberdetail.thtml from.
I copied variable names over from newuserform() to custom_userform(). In lib-custom.php I now have edited the function to this,(a lot of unnecessary variables)
function custom_userform($uid="",$msg="") {
    global $_CONF,$_TABLES, $LANG04;
    if (!empty($msg)) {
        $retval .= COM_startBlock($LANG04[21]) . $msg . COM_endBlock();
                           COM_getBlockTemplate ('_msg_block', 'header'))
                . $msg
                . COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
    }

    $post_url = $_CONF['site_url']."/users.php";
    $postmode = "create";
    $submitbutton = '';
    $passwd_input = "";
    $message = "<br><b>Please complete the application below. Once you have completed the application, click the Submit button and the application will be processed immediately.</b>";
    $A=array();

    $user_templates->set_var('site_url', $_CONF['site_url']);
    $user_templates->set_var('start_block', COM_startBlock($LANG04[22]));
    $user_templates->set_var('lang_instructions', $LANG04[23]);
    $user_templates->set_var('lang_username', $LANG04[2]);
    $user_templates->set_var('lang_email', $LANG04[5]);
    $user_templates->set_var('lang_warning', $LANG04[24]);
    $user_templates->set_var('lang_register', $LANG04[27]);
    $user_templates->set_var('end_block', COM_endBlock());

    $user_templates = new Template ($_CONF['path_layout'] . 'custom');
    $user_templates->set_file('memberdetail', 'memberdetail.thtml');
    $user_templates->set_var('layout_url', $_CONF['layout_url']);
    $user_templates->set_var('post_url', $post_url);
    // $user_templates->set_var('startblock', COM_startBlock("Custom Registration Example"));
    $user_templates->set_var('message', $message);    
    $user_templates->set_var('USERNAME', "Username");
    $user_templates->set_var('USERNAME_HELP', "Name to be used when accessing this site");
    $user_templates->set_var('username', $A['username']);
    $user_templates->set_var('passwd_input', $passwd_input);
    $user_templates->set_var('EMAIL', "Email Address");
    $user_templates->set_var('EMAIL_HELP', "");
    $user_templates->set_var('email', $A['email']);
    $user_templates->set_var('FULLNAME', "Full Name");
    $user_templates->set_var('FULLNAME_HELP', "First and Last Name");
    $user_templates->set_var('fullname', $A['fullname']);
    $user_templates->set_var('user_id', $user);
    $user_templates->set_var('postmode', $postmode);
    $user_templates->set_var('submitbutton', $submitbutton);
    // $user_templates->set_var('endblock', COM_endBlock());
    $user_templates->parse('output', 'memberdetail');
    $retval .= $user_templates->finish($user_templates->get_var('output'));

    return $retval;
}


I'm getting an error from line 240 of custom-lib above, which is somewhere in the 'if loop' of the function. Perhaps I should have only edited this by adding the variables and not touched what's above that?

do not understand custom registration example(step4)

Posted on: 15/05/05 01:56pm
By: machinari

yes, lots of variables... but I think this function gets used not only in creating the form for new registrants, but also for displaying info in the profile.. so better not to delete any variables just in case.

as for the if statement, just replace it entirely with
    if (!empty ($msg)) {
        $retval .= COM_startBlock ($LANG04[21], '',
                           COM_getBlockTemplate ('_msg_block', 'header'))
                . $msg
                . COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
    }



or else leave it as it was originally. Basically, to fix your error you just need to replace a semicolon with a concatenation operator (a period).

do not understand custom registration example(step4)

Posted on: 15/05/05 03:12pm
By: ofey

Thanks, I must be almost there. It would help if I could read php. I followed your instructions. The function is now,
function custom_userform($uid="",$msg="") {
    global $_CONF,$_TABLES, $LANG04;
    if (!empty ($msg)) {
        $retval .= COM_startBlock ($LANG04[21], '',
                           COM_getBlockTemplate ('_msg_block', 'header'))
                . $msg
                . COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
    }
                
    $post_url = $_CONF['site_url']."/users.php";
    $postmode = "create";
    $submitbutton = '';
    $passwd_input = "";
    $message = "<br><b>Please complete the application below. Once you have completed the application, 

click the Submit button and the application will be processed immediately.</b>";
    $A=array();

    $user_templates->set_var('site_url', $_CONF['site_url']);
    $user_templates->set_var('start_block', COM_startBlock($LANG04[22]));
    $user_templates->set_var('lang_instructions', $LANG04[23]);
    $user_templates->set_var('lang_username', $LANG04[2]);
    $user_templates->set_var('lang_email', $LANG04[5]);
    $user_templates->set_var('lang_warning', $LANG04[24]);
    $user_templates->set_var('lang_register', $LANG04[27]);
    $user_templates->set_var('end_block', COM_endBlock());

    $user_templates = new Template ($_CONF['path_layout'] . 'custom');
    $user_templates->set_file('memberdetail', 'memberdetail.thtml');
    $user_templates->set_var('layout_url', $_CONF['layout_url']);
    $user_templates->set_var('post_url', $post_url);
    // $user_templates->set_var('startblock', COM_startBlock("Custom Registration Example"));
    $user_templates->set_var('message', $message);    
    $user_templates->set_var('USERNAME', "Username");
    $user_templates->set_var('USERNAME_HELP', "Name to be used when accessing this site");
    $user_templates->set_var('username', $A['username']);
    $user_templates->set_var('passwd_input', $passwd_input);
    $user_templates->set_var('EMAIL', "Email Address");
    $user_templates->set_var('EMAIL_HELP', "");
    $user_templates->set_var('email', $A['email']);
    $user_templates->set_var('FULLNAME', "Full Name");
    $user_templates->set_var('FULLNAME_HELP', "First and Last Name");
    $user_templates->set_var('fullname', $A['fullname']);
    $user_templates->set_var('user_id', $user);
    $user_templates->set_var('postmode', $postmode);
    $user_templates->set_var('submitbutton', $submitbutton);
    // $user_templates->set_var('endblock', COM_endBlock());
    $user_templates->parse('output', 'memberdetail');
    $retval .= $user_templates->finish($user_templates->get_var('output'));

    return $retval;
}


I get the following error:
Fatal error: Call to a member function on a non-object in /hsphere/local/home/fjryanio/geeklog/system/lib-custom.php on line 252

Line 252, is the following line or at least very close to it,
$user_templates->set_var('lang_instructions', $LANG04[23]);

So it looks like there's problems with anything 'lang_*'.
Actually after a recount I think the line with the problem is,
$A=array();


Thanks for all your help so far, but what do you think?

Shane

do not understand custom registration example(step4)

Posted on: 15/05/05 03:22pm
By: ofey

Is there any way to number the lines so I can quickly see exactly where a problem is? I normally open files with Wordpad or Notepad, or I could go use emacs on linux.

do not understand custom registration example(step4)

Posted on: 15/05/05 04:42pm
By: machinari

sorry, I just assumed you could do PHP...

I moved the variables for you...
function custom_userform($uid="",$msg="") {
global $_CONF,$_TABLES, $LANG04;
    if (!empty ($msg)) {
        $retval .= COM_startBlock ($LANG04[21], '', COM_getBlockTemplate ('_msg_block', 'header'))
        . $msg
        . COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
    }

    $post_url = $_CONF['site_url']."/users.php";
    $postmode = "create";
    $submitbutton = '';
    $passwd_input = "";
    $message = "<br><b>Please complete the application below. Once you have completed the application, click the Submit button and the application will be processed immediately.</b>";

    $A=array();
    $user_templates = new Template ($_CONF['path_layout'] . 'custom');
    $user_templates->set_file('memberdetail', 'memberdetail.thtml');

    $user_templates->set_var('site_url', $_CONF['site_url']);
    $user_templates->set_var('start_block', COM_startBlock($LANG04[22]));
    $user_templates->set_var('lang_instructions', $LANG04[23]);
    $user_templates->set_var('lang_username', $LANG04[2]);
    $user_templates->set_var('lang_email', $LANG04[5]);
    $user_templates->set_var('lang_warning', $LANG04[24]);
    $user_templates->set_var('lang_register', $LANG04[27]);
    $user_templates->set_var('end_block', COM_endBlock());

    $user_templates->set_var('layout_url', $_CONF['layout_url']);
    $user_templates->set_var('post_url', $post_url);
    $user_templates->set_var('message', $message);
    $user_templates->set_var('USERNAME', "Username");
    $user_templates->set_var('USERNAME_HELP', "Name to be used when accessing this site");
    $user_templates->set_var('username', $A['username']);
    $user_templates->set_var('passwd_input', $passwd_input);
    $user_templates->set_var('EMAIL', "Email Address");
    $user_templates->set_var('EMAIL_HELP', "");
    $user_templates->set_var('email', $A['email']);
    $user_templates->set_var('FULLNAME', "Full Name");
    $user_templates->set_var('FULLNAME_HELP', "First and Last Name");
    $user_templates->set_var('fullname', $A['fullname']);
    $user_templates->set_var('user_id', $user);
    $user_templates->set_var('postmode', $postmode);
    $user_templates->set_var('submitbutton', $submitbutton);
    $user_templates->parse('output', 'memberdetail');
    $retval .= $user_templates->finish($user_templates->get_var('output'));

    return $retval;
}


do not understand custom registration example(step4)

Posted on: 15/05/05 05:37pm
By: ofey

I shouldn't be messing around trying to do this stuff if I don't know PHP.
Anyway, form looks correct now and works. The extra field 'fullname' goes into the persons profile. And i get my email saying there's an account submission. I can approve it as usual. Problem when I go to delete it I get an error:
An SQL error has occured. Please see error.log for details.

The memberdetail.thtml looks like this.
                            {start_block}
                            <table border="0" cellpadding="3" cellspacing="0" width="100%">
                                <tr>
                                    <td>
                                        <form action="{site_url}/users.php" method="post">
                                            <table border="0" cellspacing="0" cellpadding="3">
                                                <tr>
                                                    <td colspan="2">{lang_instructions}</td>
                                                </tr>
								<tr>
            						    <td align="right" ><b>{FULLNAME}:</b></td>
            						    <td><input type="text" size="25" maxlength="40" name="cust_fullname"></td> 
								</tr>
                                                <tr>
                                                    <td align="right"><b>{lang_username}:</b></td>
                                                    <td><input type="text" size="16" maxlength="16" name="username"></td>
                                                </tr>
                                                <tr>
                                                    <td align="right"><b>{lang_email}:</b></td>
                                                    <td><input type="text" size="16" maxlength="96" name="email"></td>
                                                </tr>
                                                <tr>
                                                    <td align="center" class="warning" colspan="2">{lang_warning}</td>
                                                </tr>
                                                <tr>
                                                    <td align="center" colspan="2">
                                                        <input type="hidden" name="mode" value="create">
                                                        <input type="submit" value="{lang_register}">
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>                               
                                    </td>
                                </tr>
                            </table>
                            {end_block}

Again thanks for all your help, but again what do you think?

Shane

do not understand custom registration example(step4)

Posted on: 15/05/05 05:46pm
By: Dirk

[QUOTE BY= ofey] what do you think?[/QUOTE]
I really think you should start using the CODE tag instead of the QUOTE tag.

SCNR

bye, Dirk

do not understand custom registration example(step4)

Posted on: 15/05/05 06:29pm
By: machinari

[QUOTE BY= ofey] Problem when I go to delete it I get an error:
An SQL error has occured. Please see error.log for details.
[/QUOTE]can you report the error from your error.log?

do not understand custom registration example(step4)

Posted on: 16/05/05 02:48am
By: ofey

Here's the last few lines from error.log. (Should I post it all?)
Wed May 11 19:08:12 2005 - Could not open the file. /hsphere/local/home/fjryanio/trojanswimclub.ie/backend/geeklog.rdf 
Wed May 11 19:39:00 2005 - Could not open the file. /hsphere/local/home/fjryanio/trojanswimclub.ie/backend/geeklog.rdf 
Wed May 11 19:41:33 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%Dave%' OR Quoted like '%Dave%' OR username like '%Dave%' OR Source like '%Dave%') ORDER BY Date DESC 
Wed May 11 19:44:49 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%%' OR Quoted like '%%' OR username like '%%' OR Source like '%%') AND q.UID='41' ORDER BY Date DESC 
Thu May 12 16:40:50 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%24 hour swim%' OR Quoted like '%24 hour swim%' OR username like '%24 hour swim%' OR Source like '%24 hour swim%') ORDER BY Date DESC 
Thu May 12 16:43:32 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%Aishling McHugh%' OR Quoted like '%Aishling McHugh%' OR username like '%Aishling McHugh%' OR Source like '%Aishling McHugh%') ORDER BY Date DESC 
Thu May 12 16:43:57 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%24 hour swin%' OR Quoted like '%24 hour swin%' OR username like '%24 hour swin%' OR Source like '%24 hour swin%') ORDER BY Date DESC 
Thu May 12 16:44:06 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%24 hour swim%' OR Quoted like '%24 hour swim%' OR username like '%24 hour swim%' OR Source like '%24 hour swim%') ORDER BY Date DESC 
Fri May 13 09:51:05 2005 - [pear_error: message="unable to connect to smtp server mail.hosting365.ie:25" code=0 mode=return level=notice prefix="" info=""] 
Fri May 13 15:19:30 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%dave%' OR Quoted like '%dave%' OR username like '%dave%' OR Source like '%dave%') ORDER BY Date DESC 
Fri May 13 17:38:28 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%banahan%' OR Quoted like '%banahan%' OR username like '%banahan%' OR Source like '%banahan%') ORDER BY Date DESC 
Sat May 14 20:38:10 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%photographs%' OR Quoted like '%photographs%' OR username like '%photographs%' OR Source like '%photographs%') ORDER BY Date DESC 
Sat May 14 20:43:44 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%ben murphy%' OR Quoted like '%ben murphy%' OR username like '%ben murphy%' OR Source like '%ben murphy%') ORDER BY Date DESC 
Sat May 14 20:43:53 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%paul murohy%' OR Quoted like '%paul murohy%' OR username like '%paul murohy%' OR Source like '%paul murohy%') ORDER BY Date DESC 
Sat May 14 20:44:03 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%paul murphy%' OR Quoted like '%paul murphy%' OR username like '%paul murphy%' OR Source like '%paul murphy%') ORDER BY Date DESC 
Sat May 14 21:03:21 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%under 16 age group%' OR Quoted like '%under 16 age group%' OR username like '%under 16 age group%' OR Source like '%under 16 age group%') ORDER BY Date DESC 
Sat May 14 21:03:32 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%%' OR Quoted like '%%' OR username like '%%' OR Source like '%%') ORDER BY Date DESC 
Sat May 14 21:04:08 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%%' OR Quoted like '%%' OR username like '%%' OR Source like '%%') ORDER BY Date DESC 
Sat May 14 21:07:35 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%ben murphy%' OR Quoted like '%ben murphy%' OR username like '%ben murphy%' OR Source like '%ben murphy%') ORDER BY Date DESC 
Sat May 14 21:07:44 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%ben murphy%' OR Quoted like '%ben murphy%' OR username like '%ben murphy%' OR Source like '%ben murphy%') ORDER BY Date DESC 
Sat May 14 21:07:49 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%ben%' OR Quoted like '%ben%' OR username like '%ben%' OR Source like '%ben%') ORDER BY Date DESC 
Sun May 15 19:27:46 2005 - Could not open the file. /hsphere/local/home/fjryanio/trojanswimclub.ie/backend/geeklog.rdf 
Sun May 15 21:11:31 2005 - dailyquote Search: SELECT DISTINCT ID, Quotes, Quoted, q.UID, username FROM gl_dailyquote_quotes q, gl_dailyquote_lookup l, gl_users gl WHERE (q.Status='1' AND q.UID=gl.uid AND l.QID=ID AND l.Status='1') AND (Quotes like '%florry%' OR Quoted like '%florry%' OR username like '%florry%' OR Source like '%florry%') ORDER BY Date DESC 
Sun May 15 22:29:25 2005 - 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE uid='74'' at line 1. SQL in question: DELETE FROM  WHERE uid='74' 
Sun May 15 22:29:32 2005 - 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE uid='74'' at line 1. SQL in question: DELETE FROM  WHERE uid='74' 
Sun May 15 22:29:44 2005 - 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE uid='73'' at line 1. SQL in question: DELETE FROM  WHERE uid='73' 
Sun May 15 22:30:08 2005 - 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE uid='74'' at line 1. SQL in question: DELETE FROM  WHERE uid='74'



Sorry Dirk for not using code. I corrected all my posts here.

do not understand custom registration example(step4)

Posted on: 16/05/05 04:59am
By: machinari

well, that's a pretty straight forward error. no table has been specified from which to delete the relevant user data.

So, assuming that you haven't edited the core function, USER_deleteAccount(), that means we'll have to have a look at your custom_userdelete() function or at any plugins that have incorporated the plugin_user_delete_pluginName() function.

Jjust copy/paste your custom_userdelete() here and we'll have a look. It's probably just a missing global, e.g., global $_CONF, $_TABLES, $_USER; and the error would be caused by not having $_TABLES listed..

do not understand custom registration example(step4)

Posted on: 16/05/05 05:33am
By: ofey

Here's custom_usercreate and custom_userdelete from custom-lib.php
function custom_usercreate($uid) {
    global $_CONF,$_TABLES,$HTTP_POST_VARS;

    $fullname  = COM_applyFilter($_POST['cust_fullname']);

    // Ensure all data is prepared correctly before inserts, quotes may need to be escaped with addslashes()
    DB_query("UPDATE {$_TABLES['users']} SET email='{$HTTP_POST_VARS['email']}',homepage='{$HTTP_POST_VARS['homepage']}', fullname='{$HTTP_POST_VARS['fullname']}' WHERE uid=$uid");
    DB_query("UPDATE {$_TABLES['users']} SET fullname = '$fullname' WHERE uid='$uid'");
    return true;

}


// Delete any records from custom tables you may have used
function custom_userdelete($uid) {
    global $_TABLES;

    DB_query("DELETE FROM {$_TABLES['localuserinfo']} WHERE uid='$uid'");
    return true;
}






Just to let you know I've never changed anything in these two functions or USER_deleteAccount(). Perhaps the globals $_USER and $_CONF are missing?

Shane

do not understand custom registration example(step4)

Posted on: 16/05/05 11:58am
By: machinari

k, here's the deal...

if you haven't created any custom tables to store custom registration info then you can use this delete function (just replace yours with this one):
function custom_userdelete($uid) {
    //global $_TABLES;
    //DB_query("DELETE FROM {$_TABLES['localuserinfo']} WHERE uid='$uid'");
    return true;
}
Just commented the delete statements because they are unnecessary ATM. The function still needs to return "true" however.

do not understand custom registration example(step4)

Posted on: 16/05/05 03:03pm
By: ofey

Hey Machinari,

Thanks a lot for all your help. And thanks for sticking with me I really appreciate it.

Needless to say, all is behaving itself now, doing exactly what I want it to do.

Obviously with my very limited knowledge of PHP and Geeklog, I wouldn't have got anywhere without your help and patience. But I'm learning all the time and enjoying the process.

Sincerely thanks again,

Shane

do not understand custom registration example(step4)

Posted on: 25/10/05 04:38pm
By: richardpitt

Don't know if this thread is still active - but I've just gone through the same exercise and found a (minor) bug in the example custom_userform function. There is an extra calling arg ($uid="") that seems to confuse things so error messages don't show up. If it is removed, then the "new" arg sent by the case 'new' code in users.php when first called shows up as an error message. I had to add a check for this to the code

if (!empty ($msg) && ($msg != 'new')) ...


hope this helps someone

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=52072