Page 1 of 1

Sponsorship Mod

PostPosted: Mon Mar 03, 2008 9:45 pm
Author: MWE_001
Hi everyone. Im working on a mod from Ozzie1's website and the pcp instructions included, resemble nothing that I have in my files.

Example, it says to edit profilcp/profilcp_register.php thats a can not do. That file dont exist. Where can I find the file that now takes care of registration?

Also it has some template edits that dont even come close to anything I have in any of the 3 files Im using.

Here is the PCP install part of the mod

Code: Select all
 ##-----[ OPEN ]------------------------------------------#profilcp/profilcp_register.php  ##-----[ FIND ]------------------------------------------#$unhtml_specialchars_replace = array('>', '<41>sql_query($sql)) )             {                 message_die(GENERAL_ERROR, 'Could not update sponsor gains', '', __LINE__, __FILE__, $sql);             }             $sql = " SELECT user_sponsor_id FROM " . USERS_TABLE . "                 WHERE user_id = $sponsor_id ";             if ( !($result = $db->sql_query($sql)) )             {                 message_die(GENERAL_ERROR, 'Could not update sponsor gains', '', __LINE__, __FILE__, $sql);             }             $sponsors = $db->sql_fetchrowset($result);             if ( $db->sql_numrows($result) )             {                 for ( $s = 0 ; $s <count>sql_query($sql)) )                     {                         message_die(GENERAL_ERROR, 'Could not update sponsors gains', '', __LINE__, __FILE__, $sql);                     }                 }             }         }    ##-----[ FIND ]------------------------------------------#         $sql = "INSERT INTO " . USERS_TABLE . "($sql_key) VALUES ($sql_val)";         if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )         {             message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);         }  ##-----[ AFTER, ADD ]------------------------------------------#         $sql = "UPDATE " . USERS_TABLE . "             SET user_sponsor_id = $sponsor_id             WHERE user_id = $user_id ";         if ( !$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Could not update sponsor gains', '', __LINE__, __FILE__, $sql);         }  ##-----[ FIND ]------------------------------------------#     // get the current password ?     if ( !$create_user )     {         $template->assign_block_vars('switch_get_cur_password', array() );     }  ##-----[ AFTER, ADD ]------------------------------------------#     else if ( $board_config['sponsor_enabled'] )     {         $template->assign_block_vars('switch_sponsor', array());           if ( intval($HTTP_GET_VARS['sponsor']) )         {             $sql = " SELECT username FROM " . USERS_TABLE . "                 WHERE user_id = $sponsor_id ";             if ( !$result = $db->sql_query($sql))             {                 message_die(GENERAL_ERROR, 'Could not obtain users list', "", __LINE__, __FILE__, $sql);             }             $users = $db->sql_fetchrow($result);             $users_list = '<b>'.trim(htmlspecialchars($users['username'])).'</b>';         }         else         {             $sql = " SELECT user_id , username FROM " . USERS_TABLE . "                 WHERE user_id > 1                 ORDER BY username ";             if ( !$result = $db->sql_query($sql))             {                 message_die(GENERAL_ERROR, 'Could not obtain users list', "", __LINE__, __FILE__, $sql);             }             $users = $db->sql_fetchrowset($result);             $users_list = '<select>';             $users_list .= '<option>' . $lang['Sponsor_none'] . '</option>';             for($i = 0; $i < count($users); $i++)             {                 $selected = ( $sponsor_id == $users[$i]['user_id'] ) ? 'selected' ]['user_id'].'" '.$selected.' >' . $users[$i]['username'] . '</option>';             }             $users_list .= '</select>';         }     }  ## Note:  The following additions are required to make the Sponsorship MOD work properly#        and are added by Ozzie < <a>Goster@OzziesWorld.com</a> >  website:  http://www.OzziesWorld.com##-----[ OPEN ]------------------------------------------#templates/subSilver/profilecp/register_body.tpl  ##-----[ FIND ]------------------------------------------#         <BEGIN>  ##-----[ BEFORE, ADD ]------------------------------------------#         <BEGIN>         <tr>             <td><span>{L_SELECT_SPONSOR}</span></td>             <td>{USERS_LIST}</td>         </tr>         <END>  # #--------------[ FIND ]------------- #         'L_PASSWORD_CONFIRM_IF_CHANGED'   => $lang['password_confirm_if_changed'],  # #--------------[ AFTER, ADD ]------------- #            'L_SELECT_SPONSOR'             => $lang['Sponsor_select'],  # #--------------[ FIND ]------------- #         'EMAIL_CONFIRM'      => $view_userdata['user_email'],  # #--------------[ AFTER, ADD ]------------- #            'USERS_LIST'       => $users_list,  ##-----[ SAVE/CLOSE ALL FILES ]------------------------------------------## EoM

As you can see, these edits make completely no sence what so ever.

I think if I can get past the registration part, I can work the template issues out easily......enough :grin:

Thanks in advance

Ray

Re: Sponsorship Mod

PostPosted: Tue Mar 04, 2008 8:11 am
Author: found it
Hi

Not being a good PCP user in fact I havnt touched it in 2 years.. but after searching through the whole of the integramod files... (got to love [url=http]powergrep[/url])

none of the code you are looking for exists the only piece of code I could find which was in profilcp/profilcp_board_config.php

Code: Select all
        $sql = "INSERT INTO " . USERS_TABLE . "($sql_key) VALUES ($sql_val)";         if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) ){             message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);         }


or close to it...

I dont know if that helps any ... probably not... maybe Helter has a better view on this...

:mrgreen:

Re: Sponsorship Mod

PostPosted: Tue Mar 04, 2008 11:15 am
Author: MWE_001
Yeah I searched and searched for hours on end and no such luck. Ozzie1 infact, has it installed on a 1.4.0 board but I have no clue how in the hell he pulled it off.

I have side lined it for now. Ill get it figured out sooner or later. Im guessing more later then sooner though <img>

Re: Sponsorship Mod

PostPosted: Wed Mar 05, 2008 12:16 pm
Author: obiku
Yes Found It, the registartion part of the ProfileCP is in the profilcp_board_config.php.

I have to do this out of my memory (I'm on my work at this moment), at the beginning of that file are some loopings. Those loops are for reading out the user table.

Also the function_profilcp.php is needed (I though it was that file, otherwise look for a function .script in the profilcp directory.

Re: Sponsorship Mod

PostPosted: Wed Mar 05, 2008 3:24 pm
Author: MWE_001
Ill have to have a look at my test site and see if I can do any good there. I hate to ruin a live site for experimenting. <img>

Thanks obiku for the pointers.