vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Send default PM to all new users (https://vborg.vbsupport.ru/showthread.php?t=34498)

Sparkz 01-25-2002 10:00 PM

Small hack to automatically send PM to new users
after they have activated account.

Requested by Xelation
Tested on 2.2.5

UPDATED - v2.1 - 2002-05-02

Version 2.1 only fixes some problems with installation. Now it checks to see if the settings are already present in the DB, it has an option to remove the settings if you wish to uninstall and it has an option to remove any surplus settings you may have as a result of running the old install file.

If you have version 2.0 up and running problem-free, there is absolutely no need to upgrade.

You should uninstall version 1.0 before installing this one.
This version facilitates vB's built in setting system, and no longer requires a writable file on the server.

It also supports popup on PM.

Follow the instructions in install.txt

-- If you are running MySQL 3.22.xx, you might need to use this installfile instead.

DelusionalMind 01-26-2002 01:13 AM

nice :)

would be a good feature at my board :)

DelusionalMind 01-26-2002 01:18 AM

will be installing in a few...the first one also. haha

Sparkz 01-26-2002 01:19 AM

Heh - it would be cool if someone was actually able to use it :)

*looks at the time*hmm - 05.20... Time to get home, I guess. Should probably be thinking of getting up in - err - 3 hours

Xelation 01-26-2002 01:25 AM

Oh first time someone actually created a hack I requested! I'm gonna install it right now... I'll tell you how it went.

DelusionalMind 01-26-2002 01:26 AM

okie. i just installed. it would be cool if you made it show the input area under the vb options...but hey, this is nice also

I don't feel like editing the hack so i'll leave it as is. heh

I installed it at teencribs.com .... please register only if you plan on being part of the board...not just for the sake of trying out the hack!

Sparkz 01-26-2002 01:30 AM

Quote:

Originally posted by DelusionalMind
okie. i just installed. it would be cool if you made it show the input area under the vb options...but hey, this is nice also

I'm not quite sure I understand what you mean here...

Xelation 01-26-2002 01:38 AM

Works perfectly! Thank you very much! :D

Xelation 01-26-2002 01:49 AM

Just though I would make a screen shot for everyone. :D oh and I just made a temporary message for now... that will change later.

Admin 01-26-2002 04:21 AM

Nice hack, just installed this here (another good way to tell people to enter their license). :)

FWC 01-26-2002 04:23 AM

Quote:

Originally posted by FireFly
Nice hack, just installed this here (another good way to tell people to enter their license). :)
LOL!!!!! :D

Admin 01-26-2002 04:40 AM

Ok works a treat, I did make one change though, to use the username of the user in the message:
Code:

                        $PM_content = str_replace('$username',$username,fread($fp, 50000));

Lesane 01-26-2002 10:34 AM

Great feature, gonna install this hack later. Thnx

Sparkz 01-26-2002 11:38 AM

Quote:

Originally posted by FireFly
Ok works a treat, I did make one change though, to use the username of the user in the message:
Code:

                        $PM_content = str_replace('$username',$username,fread($fp, 50000));

Thx for the idea - I uploaded an updated zip with this feature for both the title and the content.

I also changed
PHP Code:

fread($fp50000

to
PHP Code:

fread($fpfilesize ($PM_file)) 

(where the variable $PM_file contains the filename, of course)

Just in case someone wants an incredibly long default PM

Admin 01-26-2002 11:48 AM

Why not store it in the database, as a setting?

Sparkz 01-26-2002 12:02 PM

Quote:

Originally posted by FireFly
Why not store it in the database, as a setting?
Mainly because I haven't touched that part of the system before.
This was kind of a quick&dirty done in the wee hours.

But I guess by saying that you just gave me a reason to play some more with the DB :)

aldamon 01-30-2002 02:14 PM

Hey,

How do I change who the PM comes from? I have two identities, my Administrator ID and my anonymous "Moderator" ID. I'd like the welcome PM to come from moderator and it's coming from my Administrator ID.

Thanks!

Admin 01-30-2002 02:47 PM

Quote:

Originally posted by Sparkz
All messages will originate from userid 1 - this can be changed by assigning $originating_user another userid in register.php

aldamon 01-31-2002 11:01 AM

LOL.

OK, here's another one. I have "pmpopup" and PM e-mail notification set to YES to during registration. However, I have created a new ID to test the system, and when I clicked the activation link there was no popup or E-mail notification of the new PM when I returned to the main menu.

What could cause that? It's almost like vB is not recognizing the automated PM as a "new" message.

This concerns me because my users are very computer illiterate and I want them to have a reason to go into the user cp. If there is no popup, then most people won't even notice the first new message. Heck, most of my users don't even know PMs exist, so the popup, or at the very least E-mail notification, on the first message would be really sweet.

Thanks!

Sparkz 01-31-2002 12:45 PM

I'd have to look in to this when I get back home from this business trip.

I'll change it so it uses the settings table as well, in stead of storing the default message in a file.
Have had a lot to do at work lately, so I haven't had time to implement this yet...

neal 02-07-2002 01:25 AM

Doesn't seem to be working on 2.2.2... anyone else have this installed or have to modify anything?

c-pr0mpt 02-10-2002 12:26 AM

neal> Doesnt work for me either. :(

Sparkz 02-11-2002 12:31 PM

I'll see if I have time to install 2.2.2 on my testserver today and see if there is anything special that needs to be done there.

As I still have craploads of work to do, I can't promise that I have the time today, but I'll try.

Xelation 02-18-2002 03:13 PM

Quote:

Originally posted by Sparkz
I'll see if I have time to install 2.2.2 on my testserver today and see if there is anything special that needs to be done there.

As I still have craploads of work to do, I can't promise that I have the time today, but I'll try.

I just tested it on 2.2.2 and eveything seems to be working fine, it sent a pm to the new user. :D

jvv 02-18-2002 05:35 PM

Yes it works, don't forget that the user has to activate the account before he receives the PM.

nafae 02-18-2002 08:43 PM

mine doesn't work either. Note that I don't have email activation turned on, if that would have anything to do with it?

nafae 02-19-2002 06:30 PM

bump? :(

jvv 02-19-2002 08:52 PM

Yes it has to do with that. If you look closely at where you need to insert the code, you'll notice that it is when the user activates. If you want to change this you'll have to place it at where the user registers if I am making any sense (I'm actually too lazy to look it up right now... maybe tomorrow)

nafae 02-19-2002 10:54 PM

yeah that makes sense, if you can find where that is in the code I would be soo appreciative~ Thanks :]

SaintDog 02-20-2002 05:25 AM

I would love to use this hack if you were to adapt it to work with vB 2.2.2, it would help control a few things on my board as well (I believe, at least)

SaintDog

Sparkz 02-20-2002 10:30 AM

I have been really swamped in work lately, so I haven't even gotten around to upgrading my own boards to 2.2.2 yet.
At the moment, I am not sure when I will get around to look at it.
Sorry. Will do it as soon as I find the time, tho.

SaintDog 02-20-2002 04:44 PM

That's cool, I can wait (for a little ;))

mav 02-28-2002 02:58 AM

Awesome!

Supernature 02-28-2002 08:35 PM

Very nice Hack, I would love to use it, but I also have the Email verification turned off and don't know where to put the code in register.php :(
Please help

ForKmaN 03-02-2002 12:00 PM

Quote:

Originally posted by Supernature
Very nice Hack, I would love to use it, but I also have the Email verification turned off and don't know where to put the code in register.php :(
Please help

*bump*

I'd like to know aswell

neal 03-03-2002 03:03 AM

same here. anyone?

Overgrow 03-03-2002 06:57 AM

I hope Sparkz doesn't mind, but I updated this hack since I wanted to use it.

-works with 2.2.1 and 2.2.2 no problem
-works whether or not you have email activation turned on
-uses templates instead of text files

https://vborg.vbsupport.ru/showthrea...threadid=35647

camoboy 03-07-2002 01:18 PM

There is a slight issue with this hack;

if a user who registers chooses not to receive stuff from admins, it still sends a PM to them upon activiation. I received a rather rude message from a user about this; is there any fix?

aldamon 03-07-2002 01:31 PM

If a user is going to write rude messages to you about a welcome PM, then they are not worth having around any way. How lame.

Anyway, I don't think the option you are referring to will limit Private Messages in any way.



*****2.2.3 Issue*****

Anyone get this to work in 2.2.3 yet? It's giving me errors on line 593 in register.php. Here is the line that's giving it fits. There could be more but I have to fix this one first (Line is IN BOLD):

// send default PM to new user
$originating_user = 1;
$PM_file = "admin/default_pm.txt";
$fp = fopen <http://www.php.net/fopen>($PM_file, 'r');
$PM_title = str_replace <http://www.php.net/str_replace> ('$username', $username, fgets <http://www.php.net/fgets>($fp, 4096));
$PM_content = str_replace <http://www.php.net/str_replace> ('$username',$username,fread <http://www.php.net/fread>($fp, filesize <http://www.php.net/filesize> ($PM_file)));

$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title ,message,dateline,messageread,folderid) VALUES (NULL,$u,$u,$originating_user,'".addslashes <http://www.php.net/addslashes>(htmlspecialchars <http://www.php.net/htmlspecialchars>($PM_title))."','".addslashes <http://www.php.net/addslashes>($PM_content)."',".time <http://www.php.net/time>().",0,0)");
// send default PM to new user

mas404 03-12-2002 08:40 AM

can it modified to send the PM to the normal user depend on his post NO.?

ex.
if the user get 50 post >> he will get defult PM
" thank you for your posts after another 20 post more your titel will be chang to Tyro Hacker and you will get star "

thank you


All times are GMT. The time now is 08:06 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.01575 seconds
  • Memory Usage 1,819KB
  • 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
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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