vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   New User Welcome PM [v2] (https://vborg.vbsupport.ru/showthread.php?t=63269)

rob_daemon 06-30-2004 05:59 AM

Hmm... I'm not sure why that would be happening. I'll see if I can recreate this tomorrow and if I am able to, I'll see if I can't come up with a fix.

SnowBot 06-30-2004 08:24 AM

Cool that will be great :) Thanks for the fast responce :)

Osterling 07-05-2004 05:56 AM

the attachement seems to be messed up.. can some one send me the instructions?

Onkel_Tom 07-06-2004 09:11 PM

Small update to find the correct place to put the code in register.php for vB3.0.2 or 3.0.3:

find:
PHP Code:

$username $_POST['username'];
            
$email $_POST['email'];
            eval(
fetch_email_phrases('newuser'0));

            
$newemails explode(' '$vboptions['newuseremail']);
            foreach (
$newemails AS $toemail)
            {
                if (
trim($toemail))
                {
                    
vbmail($toemail$subject$message);
                }
            }
        } 

after add:
PHP Code:

// ##############################################################################################

        // ###################################################################
        // # WELCOME PM HACK BY rob_daemon
        // ###################################################################
        
        
$username $_POST['username'];
        
        
// Process each one of the replacement vars
        
$vars = array(
            
'$bbtitle' => $vboptions['bbtitle'], 
            
'$username' => $username
            
'$email' => $email
            
'$userid' => $userid
        
);
        
        
$pmoptions['regpmtext'] = $vboptions['regpmtext'];
        
$pmoptions['regpmtitle'] = $vboptions['regpmtitle'];
        
$pmoptions['regpmfrom'] = $vboptions['regpmfrom'];
        
        
// Now that we have the options, we need to process eaach of the 
        // vars we can use
        
foreach($vars AS $_key => $_value)
        {
            
$pmoptions['regpmtext'] = str_replace($_key$_value$pmoptions['regpmtext']);
            
$pmoptions['regpmtitle'] = str_replace($_key$_value$pmoptions['regpmtitle']);
        }

        
$get_pm_from $DB_site->query_first("SELECT username,userid FROM " TABLE_PREFIX "user WHERE userid=$pmoptions[regpmfrom]");
        
        
// Send the new owner a PM
        
$DB_site->query(
            
"INSERT INTO " TABLE_PREFIX "pmtext
            (
                fromuserid,
                fromusername,
                title,
                message,
                touserarray,
                iconid,
                dateline,
                showsignature,
                allowsmilie
            )
            VALUES
            (
                
$get_pm_from[userid],
                '" 
addslashes($get_pm_from['username']) . "',
                '" 
addslashes($pmoptions['regpmtitle']) . "',
                '" 
addslashes($pmoptions['regpmtext']) . "',
                '" 
addslashes(serialize(array($userid => $username))) . "',
                0,
                " 
TIMENOW ",
                1,
                1
            )"
        
);
        
        
$pmtextid $DB_site->insert_id();
        
        
$DB_site->query("UPDATE " TABLE_PREFIX "user SET pmtotal=pmtotal+1, pmunread=pmunread+1, pmpopup=2 WHERE userid=$userid");
        
$DB_site->query(
        
"INSERT INTO " TABLE_PREFIX "pm 
            (
                pmtextid, 
                userid, 
                folderid, 
                messageread
            ) 
            VALUES 
            (
                '
$pmtextid', 
                '
$userid', 
                '0', 
                '0'
            )"
        
);
        
// ###################################################################
        // # END WELCOME PM HACK
        // ###################################################################
// ############################################################################################## 

@ rob_daemon
Please update the installation instruction ;)

Kwak 07-07-2004 12:03 AM

[QUOTE=Onkel_Tom]Small update to find the correct place to put the code in register.php for vB3.0.2 or 3.0.3:

find:
PHP Code:

$username $_POST['username'];
            
$email $_POST['email'];
            eval(
fetch_email_phrases('newuser'0));

            
$newemails explode(' '$vboptions['newuseremail']);
            foreach (
$newemails AS $toemail)
            {
                if (
trim($toemail))
                {
                    
vbmail($toemail$subject$message);
                }
            }
        } 



On the register.php file for 3.0.3, I can't find $username = $_POST['username'];

This is the part I think you are talking about:
Code:

$email = $_POST['email'];
                        eval(fetch_email_phrases('newuser', 0));

                        $newemails = explode(' ', $vboptions['newuseremail']);
                        foreach ($newemails AS $toemail)
                        {
                                if (trim($toemail))
                                {
                                        vbmail($toemail, $subject, $message);
                                }
                        }
                }


On top of that code is:
Code:

                if ($vboptions['newuseremail'] != '')
                {
                        if ($havefields)
                        {
                                $DB_site->data_seek(0, $profilefields);
                                while ($profilefield = $DB_site->fetch_array($profilefields))
                                {
                                        $varname = "field$profilefield[profilefieldid]";
                                        $cfield = $$varname;
                                        $customfields .= "$profilefield[title] : $cfield\n";
                                }
                        }


Any idea?

Onkel_Tom 07-07-2004 12:55 AM

In the original file register.php it's line 743 with
$username = $_POST['username'];

rob_daemon 07-08-2004 06:30 PM

Quote:

Originally Posted by exasko
the attachement seems to be messed up.. can some one send me the instructions?

What are you using to view the file? See here.

The file has been updated with the new instructions.

Kwak 07-08-2004 07:40 PM

Code:

Error

SQL-query :

INSERT INTO `setting` ( `varname` , `grouptitle` , `value` , `defaultvalue` , `optioncode` , `displayorder` , `advanced` , `volatile` )
VALUES (
'regpmfrom', 'register', '1', '1', '', 140, 0, 0
)

MySQL said:
#1062 - Duplicate entry 'regpmfrom' for key 1

[Documentation] ? [Back]

Getting that error message when I query the provided codes on phpmyadmin.
vB 3.0.3.

rob_daemon 07-08-2004 10:02 PM

You don't need to redo the queries if you have already installed the mod.

Quote:

Originally Posted by Upgrade Instructions in the First Post
Upgrade Instructions:

Open ./register.php and remove the hack (to find the old hack see below). And re-add the updated hack found in the Installation Instructions file.


Onkel_Tom 07-08-2004 10:07 PM

Quote:

Originally Posted by iKwak
Code:

Error

SQL-query :

INSERT INTO `setting` ( `varname` , `grouptitle` , `value` , `defaultvalue` , `optioncode` , `displayorder` , `advanced` , `volatile` )
VALUES (
'regpmfrom', 'register', '1', '1', '', 140, 0, 0
)

MySQL said:
#1062 - Duplicate entry 'regpmfrom' for key 1

[Documentation] ? [Back]

Getting that error message when I query the provided codes on phpmyadmin.
vB 3.0.3.

that means that you have already the needed setting for regpmfrom in your database !
You can't add a setting twice with the same name.
If you have installed the hack before all is fine and you can proceed with the other instructions. If not you have to check which hack also uses a varname called regpmfrom in the settings table.


All times are GMT. The time now is 12:41 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01610 seconds
  • Memory Usage 1,797KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete