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)

blubber12 04-02-2004 09:55 PM

Well i've done everything over..as you recommended to nemesis, and still have the same problems, also running gold and clean reg.php

rob_daemon 04-02-2004 10:06 PM

I'm running it on Gold (I wrote it on my test board which is running Gold).

I'm not sure why those settings won't show up in the Admin CP... can you run this query in the Admin CP and tell me what you see as the results?

Code:

SELECT * FROM setting WHERE varname LIKE 'regpm%';

nemesis01 04-03-2004 04:19 AM

regpmfrom register 1 1 140 0 0
regpmtext register Hi $username and welcome to $bbtitle! We appreciate you taking the time to register on our site and we hope you enjoy your stay. If you have any questions, you can ask an administrator for assistance. We hope to see you around. Sincerely, The $bbtitle staff 0 textarea 150 0 1
regpmtitle register Welcome to $bbtitle! 0 160 0 0

After running the above query.....

rob_daemon 04-03-2004 07:02 AM

Hmm... how very odd... that should mean that the settings come up in the Admin CP... are you sure that you don't have the settings at the bottom of the User Registration Options page in the vB Options part of the Admin CP?

Even if the phrases didn't work out, you should at least have blank options at the bottom of that page.

nemesis01 04-03-2004 07:24 AM

I'm quite sure yes, covered all the bases, cleared temp inet files, cookies, heck I even tried using a different browser but they are simply not there.

Cloudrunner 04-03-2004 11:11 AM

Just a quick note...

For those of you who are using a table prefix for your VB installation, you'll need to adjust the code provided for your register.php.

instead of:
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 user WHERE userid=$pmoptions[regpmfrom]");
               
                // Send the new owner a PM
                $DB_site->query(
                        "INSERT INTO pmtext
                        (
                                fromuserid,
                                fromusername,
                                title,
                                message,
                                touserarray,
                                iconid,
                                dateline,
                                showsignature,
                                allowsmilie
                        )
                        VALUES
                        (
                                $get_pm_from[userid],
                                '$get_pm_from[username]',
                                '$pmoptions[regpmtitle]',
                                '" . addslashes($pmoptions['regpmtext']) . "',
                                '" . serialize(array($userid => $username)) . "',
                                0,
                                " . TIMENOW . ",
                                0,
                                0
                        )"
                );
               
                $pmtextid = $DB_site->insert_id();
               
                $DB_site->query("UPDATE user SET pmtotal=pmtotal+1, pmunread=pmunread+1, pmpopup=2 WHERE userid=$userid");
                $DB_site->query(
                "INSERT INTO pm
                        (
                                pmtextid,
                                userid,
                                folderid,
                                messageread
                        )
                        VALUES
                        (
                                '$pmtextid',
                                '$userid',
                                '0',
                                '0'
                        )"
                );
                // ###################################################################

use this:
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],
                                '$get_pm_from[username]',
                                '$pmoptions[regpmtitle]',
                                '" . addslashes($pmoptions['regpmtext']) . "',
                                '" . serialize(array($userid => $username)) . "',
                                0,
                                " . TIMENOW . ",
                                0,
                                0
                        )"
                );
               
                $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
                // ###################################################################

Other than that, Great hack!

[high]* Cloudrunner clicks install
[/high]

Thank you!

)O( Cloudrunner )O(

poetic 04-03-2004 01:05 PM

I too have had problems that nemesis has. He's explained them exactly as I've recieved them.

rob_daemon 04-03-2004 04:14 PM

Unfortunately I can't recreate these problems... I've tried doing various things to try and break it but I just can't do it... if they're there in the database they should be showing up in the Admin CP.

Try going to this link for me: yourdomain.com/admincp/options.php?do=editsetting&varname=regpmfrom

That should edit one of the settings.... if it exists, it will be there.

nemesis01 04-03-2004 10:40 PM

Quote:

Originally Posted by rob_daemon
Unfortunately I can't recreate these problems... I've tried doing various things to try and break it but I just can't do it... if they're there in the database they should be showing up in the Admin CP.

Try going to this link for me: yourdomain.com/admincp/options.php?do=editsetting&varname=regpmfrom

That should edit one of the settings.... if it exists, it will be there.

Did that, the result was interesting.

rob_daemon 04-03-2004 11:49 PM

There's your problem... they're stuck in the Version Info and Other Untouchables (for a reason which I can not comprehend).

Pull down the "Setting Group" option and put it in User Registration Options.

Try doing the same for:
yourdomain.com/admincp/options.php?do=editsetting&varname=regpmtext
yourdomain.com/admincp/options.php?do=editsetting&varname=regpmtitle


All times are GMT. The time now is 07:23 AM.

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.01348 seconds
  • Memory Usage 1,780KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)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