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 04-07-2004 09:56 PM

Wouldn't mind at all; to that same extent: when I release the automatic installer could I include those updates?

Boofo 04-07-2004 10:18 PM

Quote:

Originally Posted by rob_daemon
Wouldn't mind at all; to that same extent: when I release the automatic installer could I include those updates?

Rob, you might want to do a TXT file, too, for those of us who like to know what code we're adding and don't like auto-installers. ;)

AN-net 04-11-2004 04:49 AM

um, im getting errors when i register on my site now after a registration is done. it says there seems to be a problem with our database. and the option to edit the setting for new user pm does not show up in my user registration setting page.

rob_daemon 04-11-2004 06:26 AM

Quote:

Originally Posted by AN-net
um, im getting errors when i register on my site now after a registration is done. it says there seems to be a problem with our database. and the option to edit the setting for new user pm does not show up in my user registration setting page.

Try these instructions: https://vborg.vbsupport.ru/showpost....2&postcount=72

joeychgo 04-11-2004 12:46 PM

Probably a stupid question ---

in the instructions it says to open phpMyAdmin and run queries.....

Is that the same as running queries from EXECUTE SQL QUERY in my admin cp?

rob_daemon 04-11-2004 04:25 PM

Quote:

Originally Posted by joeychgo
Probably a stupid question ---

in the instructions it says to open phpMyAdmin and run queries.....

Is that the same as running queries from EXECUTE SQL QUERY in my admin cp?

If you want to do the queries via the Admin CP, you need to run them individually as it can't split MySQL queries. And, there is a security limitation in the mysql_query() function that prevents more than one query from being executed at a time.

So, either do each query individually or do them all at once in phpMyAdmin.

AN-net 04-11-2004 09:49 PM

Quote:

Originally Posted by rob_daemon

i have alrdy run the queries in the instructs. what should i do then?

SaN-DeeP 04-12-2004 06:43 PM

nice mod.

please update UR INSTRUCTIONS in file.

or someone else DO IT. for THE author.

Instructions in THE file do not WORK on Gold VErsion.
and lead users to SQL ERRORS.

although reading the post no. 72 helped.. and works now after 6 hours ;)
[high]* SaN-DeeP clicks INSTALL. ;0
[/high]

Sandy...

rob_daemon 04-13-2004 02:30 AM

Quote:

i have alrdy run the queries in the instructs. what should i do then?
If those instructions do not work, then I'm not sure what the cause of them not showing up would be.

Go to here: yourdomain.com/admincp/options.php?do=editsetting&varname=regpmfrom and tell me what you see.

Quote:

Instructions in THE file do not WORK on Gold VErsion.
Yes, actually they do (but they do not appear to work on all installations)... I'll be updating the file tonight or tomorrow afternoon.

achtungbaby 04-13-2004 04:31 AM

Quote:

Originally Posted by rob_daemon
If those instructions do not work, then I'm not sure what the cause of them not showing up would be.

Go to here: yourdomain.com/admincp/options.php?do=editsetting&varname=regpmfrom and tell me what you see.



Yes, actually they do (but they do not appear to work on all installations)... I'll be updating the file tonight or tomorrow afternoon.

I wasn't able to install this hack either...although it is a good idea

SaN-DeeP 04-13-2004 12:24 PM

Quote:

Originally Posted by achtungbaby
I wasn't able to install this hack either...although it is a good idea

Hack is PERFECT.
Follow the POST NO. 72 of rob.

Delete all the queries, upload ur ORIGINAl register.php file and then FOLLOW the Queires in post no. 72, then run all phrase manage queries.

after then goto ADMINCP.... and click save.

then edit ur register.php file again.

It is GONNA WORK FOR 100% SURE.

I had probs, too BUT its INSTALLED PERFECT now.

thnx rob.
nice mod.

although, i am still tricket, i have set that new users, should get an email message once when they receive private messages.

This is the PROCEDURE. on my site.
User register -> auth code is send to his mail
User clicks on the link in mail, and comes to board.
Welcome email is send to user.

Even the WELCOME PM appears in USERS, mail box.
But the email is not send about this NEW PM.. in there mail..

Not really wanted, but IT should WORK. technically.

Sandy..

AN-net 04-13-2004 03:22 PM

when i go to: admincp/options.php?do=editsetting&varname=regpmfrom

it takes me to what it is susposed to be i think. um but for some reason it doesnt show up on the drop down list for settings. im using vb3 gold:)

rob_daemon 04-14-2004 01:39 AM

Quote:

Originally Posted by AN-net
when i go to: admincp/options.php?do=editsetting&varname=regpmfrom

it takes me to what it is susposed to be i think. um but for some reason it doesnt show up on the drop down list for settings. im using vb3 gold:)

Does it look like this? https://vborg.vbsupport.ru/attachmen...chmentid=17874

If so, what does the 'Setting Group' dropdown menu say for yours?

Updated file to include instructions from post number 27. Also, added Boofo's addslashes() fix and Cloudrunner's table prefix to the code. Upgrade is not mandatory, but recommended to protect against users with a ' or a " in their name.

LilPimp 04-17-2004 12:06 AM

I dont get tha directions

rob_daemon 04-17-2004 07:07 AM

Quote:

Originally Posted by LilPimp
I dont get tha directions

What specifically don't you get?

You run the nine queries in phpMyAdmin, go into your Admin CP and save one setting, and then apply the file edit.

Boofo 04-17-2004 07:30 AM

Rob, in your updated instructions, you have it to show the signature and smilies are set to off. You need to switch the numbers (0 and 1) around. ;)

joeychgo 04-17-2004 11:00 AM

Question. I installed the other version of this hack, LAST UPDATED: Tue Apr 13 2004 19:34 PST ........

So I need to do another update now? If so, what are the update instructions?

Looks like a great hack...... Very nice job. I can only hope my fist hack will be this good.

rob_daemon 04-17-2004 03:43 PM

Quote:

Originally Posted by joeychgo
Question. I installed the other version of this hack, LAST UPDATED: Tue Apr 13 2004 19:34 PST ........


So I need to do another update now? If so, what are the update instructions?

Looks like a great hack...... Very nice job. I can only hope my fist hack will be this good.

For upgrading, find the old version of the hack, by searching for:

Code:

                // ###################################################################
                // # WELCOME PM HACK BY rob_daemon
                // ###################################################################

And then look for the end of it:

Code:

                $DB_site->query(
                "INSERT INTO " . TABLE_PREFIX . "pm
                        (
                                pmtextid,
                                userid,
                                folderid,
                                messageread
                        )
                        VALUES
                        (
                                '$pmtextid',
                                '$userid',
                                '0',
                                '0'
                        )"
                );
                // ###################################################################

And replace that and everything in-between with the updated code in the file. There are no new queries to run.

Quote:

Originally Posted by Boofo
Rob, in your updated instructions, you have it to show the signature and smilies are set to off. You need to switch the numbers (0 and 1) around.

And I even double-checked this, too :p I'll just turn 'em both on.

Boofo 04-17-2004 03:47 PM

I don't think I'd turn sigs on, but it is your hack. Just make the last 0 in that column a 1 and the smilies will work. That's how I have mine and the smilies show and the sig does not. ;)

Kwak 04-24-2004 05:34 AM

What are queries and how do you run them?

rob_daemon 04-24-2004 07:55 AM

Queries are commands that add to/change the database. You can run queries in phpMyAdmin (which is generally found in your webhost's control panel).

SnowBot 04-24-2004 10:56 PM

installed with no problems, edited the "0" to "1" works fine :) Great hack and thanks.

Kwak 04-25-2004 03:20 AM

When it says run the following queries, do you go to phpadmin --> click SQL --> and copy and paste all the queries onto the large white textbox?

rob_daemon 04-25-2004 08:41 AM

Yup... exactly.

Fluous 05-02-2004 03:27 PM

Okay, I'm having a bit of trouble. I open the welcome hack txt, and it doesnt really give instructions. Just has a big glob of php. So erm.... lol.

Also an idea, that would really be nice to take into consideration is. In your admincp, if you can just edit the text there, instead of having to open up the php file to do it. And if you can tell me how to do a "x" username, like the php code that woudl be cool.

This is what I mean by messy, and I can't tell where the seperate queries are. :speechless:

Edit: NVM, my notepad must have been really messy, I'll just work right off of this post. (I had turned on word wrap but meh)

PHP Code:

################################################################### ||
|| # Welcome PM Hack by rob_daemon                                   # ||
|| #     LAST UPDATED: Tue Apr 13 2004 19:34 PST                         # ||
|| # --------------------------------------------------------------- # ||
|| # VARIOUS MODIDIFICATIONS:
|| #     Boofo - Addslashes to username
|| #     Cloudrunner - Table prefix in SQL queries
|| ################################################################### ||
\*=====================================================================*/

INSTRUCTIONS:

------------ 
Open phpMyAdmin and run the following queries:

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

INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmfrom''register''1''1'''14000);
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0''setting_regpmfrom_title''User Who Sends Automatic PM Upon Registration''5000');
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0',  'setting_regpmfrom_desc''Enter the user ID of the person whose account you\'d like to be used when sending new users a welcome PM upon registering.''5000');


INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmtext''register''Hi $username and welcome to $bbtitle!\r\n\r\nWe appreciate you taking the time to register on our site and we hope you enjoy your stay.\r\n\r\nIf you have any questions, you can ask an administrator for assistance.\r\n\r\nWe hope to see you around.\r\n\r\nSincerely,\r\nThe $bbtitle staff''Hi $username and welcome to $bbtitle!\r\n\r\nWe appreciate you taking the time to register on our site and we hope you enjoy your stay.\r\n\r\nIf you have any questions, you can ask an administrator for assistance.\r\n\r\nWe hope to see you around.\r\n\r\nSincerely,\r\nThe $bbtitle staff''textarea'15001);
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0''setting_regpmtext_title''Welcome PM Text''5000');
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0',  'setting_regpmtext_desc''Set the text of the PM sent to all new users.<br />\r<br />\rNote: You can use the following variables to specify the <b>user\'s</b> information: $username, $userid, $email. And you can use the $bbtitle to specify the board\'s name.''5000');


INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmtitle''register''Welcome to $bbtitle!''Welcome to $bbtitle!'''16000);
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0''setting_regpmtitle_title''Title Of the PM That is Automatically Sent to New Users''5000');
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0',  'setting_regpmtitle_desc''Set the title of the PM that is sent to all new users automatically. You can use the same variables as the ones that you can use for the PM text (see above).''5000');

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

------------ Nextyou MUST goAdmin CP --> Options --> vBulletin Options --> User Registration Options --> Save
    
-------- If you don't do this, you will get SQL errors when a user registers!


------------ Next, open ./register.php and look for:

// ##############################################################################################
        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";
                 }
            }

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

            vbmail($vboptions['
newuseremail'], $subject, $message);
        }
// ##############################################################################################

------------ AFTER ADD:

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

        // ###################################################################
        // # 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']) . "',
                '" . 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
        // ###################################################################

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



You are done :)

?> 

k, i got it all, installed perfectly,

[high]* Fluous clicked install.
[/high]

But can you tell me where to find the customize to edit the message? I tried the register.php and searching all the templates.

mtha 05-02-2004 04:33 PM

wondering how this one related to the version for vB2.x

https://vborg.vbsupport.ru/showthrea...fault+PM+users

rob_daemon 05-02-2004 04:53 PM

Quote:

Originally Posted by Fluous
But can you tell me where to find the customize to edit the message? I tried the register.php and searching all the templates.

It is in the vBulletin Options --> User Registration Settings --> Registration PM Text

Also, Notepad doesn't understand UNIX line-breaks well (which is why you were having the problem). Use WordPad or JEdit (or something similar) to edit PHP files.

Quote:

Originally Posted by mtha
wondering how this one related to the version for vB2.x

https://vborg.vbsupport.ru/showthrea...fault+PM+users

It isn't... I wrote this one myself without even knowing the other version existed.

Fluous 05-02-2004 04:59 PM

Thank you, after I posted I got my lazy self up to search through the pages and found that screenshot in there. This is a great hack to include so that I can tell my users about the skin options when they register.

CharlieBrownDE 05-06-2004 08:42 AM

how safe is the installation in 3.0.1? are there problems with that or can one install this expansion without problems?

rob_daemon 05-07-2004 04:38 AM

Well, as of the most recent there haven't been any reported problems. This hack works with 3.0.0 and greater. I haven't had any problems with this hack, but if you do run into a problem I will try to help you work it out.

SmartGnome 05-08-2004 11:00 AM

Quote:

Originally Posted by rob_daemon
Well, as of the most recent there haven't been any reported problems. This hack works with 3.0.0 and greater. I haven't had any problems with this hack, but if you do run into a problem I will try to help you work it out.

I run a multiple language board. Any idea how to vbphrase this beauty ?

BTW:
It runs like a charm now :ermm:

sabret00the 05-08-2004 01:51 PM

is there anyway i can get this to use all the existing settings that were made to the database via this hack?

https://vborg.vbsupport.ru/showthread.php?t=34498

rob_daemon 05-08-2004 02:12 PM

Quote:

Originally Posted by sabret00the
is there anyway i can get this to use all the existing settings that were made to the database via this hack?

https://vborg.vbsupport.ru/showthread.php?t=34498

No, not at this time. And I don't expect there to be a way in the future.

Quote:

I run a multiple language board. Any idea how to vbphrase this beauty ?
If you want to run a multi-language board and have the text be different per-language, I'd create a new vB phrase in your system with the text you want. Then, find in the insert code the $vboptions['regpm*'] and replace it with your vB phrase.

Chriss74 05-08-2004 10:59 PM

@rob_daemon: The attached txt-file seems to be corrupt. Could you please attach it again?

Thanks,
Chriss

Kwak 05-09-2004 05:37 AM

Installed and clicked Installed.

rob_daemon 05-09-2004 06:35 AM

Quote:

Originally Posted by Chriss74
@rob_daemon: The attached txt-file seems to be corrupt. Could you please attach it again?

Thanks,
Chriss

The file isn't corrupt... I just checked. Make sure that you aren't using NotePad to edit the file, if you are either open it in WordPad or get another text editor that understands UNIX linebreaks.

Quote:

Installed and clicked Installed.
Thanks :D

Chriss74 05-09-2004 06:53 PM

Quote:

Originally Posted by rob_daemon
The file isn't corrupt... I just checked. Make sure that you aren't using NotePad to edit the file, if you are either open it in WordPad or get another text editor that understands UNIX linebreaks.

Yes, that was the problem. Thanks for the hint and the hack!

Greetings,
Chriss

Rick Sample 05-09-2004 09:24 PM

quick question, when it says: ------------ Open phpMyAdmin and run the following queries:

I don't have PHPMYADMIN. So how would I do this? I tried to install phpmyadmin, but was unsuccessful. So I gave up. I forget what I'm using now, its on our server located at another place.

rob_daemon 05-09-2004 09:51 PM

Then run queries from the vB admin panel. You just have to break them up individually.

Rick Sample 05-09-2004 09:56 PM

Quote:

Originally Posted by rob_daemon
Then run queries from the vB admin panel. You just have to break them up individually.

Thanks man! In that page it says they cant be undone, so if you done them and your forum returns errors, then what?

Also, should I use the automatic or manual?

Thanks,


All times are GMT. The time now is 08:54 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.01842 seconds
  • Memory Usage 1,912KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (21)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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