Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Greet Members' Xth posts via Email/PM/Thread automatically Details »»
Greet Members' Xth posts via Email/PM/Thread automatically
Version: 1.00, by Logician Logician is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-13-2002 Last Update: Never Installs: 45
 
No support by the author.

Hiyas,

Greeting your board's contributing members when they reached some special post numbers like 500, 1000, 2000, 5000 can be nice to motivate them and this is what this hack does: It automatically greets your members when their posts reach to certain numbers, by sending them:
* Private Messages
* Emails
* or both

You can configure the hack to create a thread to greet your member's Xth post either.

Features:
* The hack will send PMs, emails (or both) or you can choose to send them PM if he can receive PM or else send email.
* The hack can create special greeting threads for your users. (optional)
* Greeted post numbers are set by you and you can set different numbers for email/pm greetings and thread greetings. So for example you can send a thank you email/pm to members for their every 100th message and create a special greeting thread for their every 500th messages.
* Admin can choose to receive a report via Email or PM about the greetings the hack performed. (optional)
* Special usergroups can be excluded from greetings. (optional)
* Greetings messages are template driven and easily customizable.
* Compatible with ALL vbulletin versions I know.
* Easy to install and highly customizable.

Although this hack is supposed to be a "time consuming" to code hack, I already had a similar algorithm for automatic threads/emails/pms for my Automatic Birthday Greetings Hack and I made a quick adaptation in that hack's structure to form this one.

Although I didnt test this hack for a long time, I dont expect any problems since its structure which is inherited from "birthday greetings hack" proved to be quite robust, stable and tested for a long time. If you come across any bugs, holler and I'll fix it. Holler anyway if it runs ok too..

One known issue: This version of the hack is not coded to detect their Xth posts if it is "moderated". So moderator approved posts may be missed. This also applies to thread's first message IF member choose to create a poll (technically vbulletin behaves these posts as if they are moderated). But all other posts will be detected by the hack wheather they are thread's first messages or reply messages and regardless of the board they are in. (public/private)

If you use it please click INSTALL , thank you! Enjoy the hack..

Logician \\=^))

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-07-2002, 07:30 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Conroy
I am having some trouble. Whenever I add alot of code to one of my files and then save it, it is all pushed to the top the next time I open that file. I am getting errors on my vB and I am pretty sure this is why. It has happened with other hacks besides this one too. Do you have any idea what could be wrong? It really doesn't make sense to me.
@Conroy: What program are you using for editing your codes? Try Notepad, your should be fine then. More info here

@squawell: Thx..
Reply With Quote
  #13  
Old 07-07-2002, 10:29 PM
Conroy Conroy is offline
 
Join Date: Jul 2002
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use notepad and wordpad. Sometimes this happens with notepad, but most of the time it happens with wordpad. A strange thing is, I just finished editing both the newreply and newthread files, I had to do the EXACT same thing to both of them, but for some reason on the newthread file, all the text was pushed up, but on the newreply file it was all ok. I used notepad for this one. Does any of this make sense?
Reply With Quote
  #14  
Old 07-08-2002, 04:29 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Conroy
I use notepad and wordpad. Sometimes this happens with notepad, but most of the time it happens with wordpad. A strange thing is, I just finished editing both the newreply and newthread files, I had to do the EXACT same thing to both of them, but for some reason on the newthread file, all the text was pushed up, but on the newreply file it was all ok. I used notepad for this one. Does any of this make sense?
No, definitely makes no sense.. Anyway if you cant insert it by yourself, send your unhacked file to me via PM and I can insert the code for you. Dont forget to mention the options you want to set..
Reply With Quote
  #15  
Old 07-09-2002, 01:48 AM
Me2Be's Avatar
Me2Be Me2Be is offline
 
Join Date: Oct 2001
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wonderful hack AGAIN

Two questions --
1] Can you send it so the PM is able to be seen on our message tracking?
2] Can you modify it to create an ongoing thread for post accomplisments instead of a separate thread? (want to use it for my moderators instead of separate threads)
Reply With Quote
  #16  
Old 07-10-2002, 01:01 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Me2Be
1] Can you send it so the PM is able to be seen on our message tracking?
Sure.. Find:

PHP Code:
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,showsignature,iconid,messageread,folderid) VALUES (NULL,$bbuserinfo[userid],$bbuserinfo[userid],$greeter,'".addslashes(htmlspecialchars($title2))."','".addslashes($post_greeting_pm)."',".time().",1,'$log_iconid',0,0)"); 
And replace it as:

PHP Code:
    $DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,showsignature,iconid,messageread,folderid, receipt) VALUES (NULL,$bbuserinfo[userid],$bbuserinfo[userid],$greeter,'".addslashes(htmlspecialchars($title2))."','".addslashes($post_greeting_pm)."',".time().",1,'$log_iconid',0,0,1)"); 
Quote:
2] Can you modify it to create an ongoing thread for post accomplisments instead of a separate thread? (want to use it for my moderators instead of separate threads)
Find:

PHP Code:
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES(NULL,'".addslashes(htmlspecialchars($title3))."','".time()."','$greetings_forum','1','0','".addslashes($greeter_name)."','".addslashes($greeter)."','".addslashes($greeter_name)."','".time()."','0','1','0')");
    
$log_threadid=$DB_site->insert_id(); 
Replace it AS:

PHP Code:
        $log_threadid=XXXX;
 
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,lastposter='".addslashes($greeter_name)."' WHERE threadid='$log_threadid'"); 
(Replace XXX with your thread id)

Dont forget to modify BOTH files (newthread.php & newreply.php)

That should work..

Enjoy.
Logician
Reply With Quote
  #17  
Old 07-10-2002, 05:20 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great hack...
Reply With Quote
  #18  
Old 11-11-2002, 08:47 AM
Dynamic One's Avatar
Dynamic One Dynamic One is offline
 
Join Date: Nov 2001
Location: Somewhere on the net
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good hack Logician. Thank you for this.
Reply With Quote
  #19  
Old 11-22-2002, 06:12 PM
!!!cyr0n_k0r !!!cyr0n_k0r is offline
 
Join Date: Apr 2002
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here are my settings. I set my post count to 24 and made a new thread and I didnt get a PM or an e-mail. I even posted replies making my post count like 27.. and still no pm or e-mail.
Quote:
//Logician Greet Users Xth post via Email/PM/Create Thread hack
###########################################
## OPTIONS ##
###########################################
// How to send the greeting to the user:
// 0 --> Neither PM nor Email (Disables PM/email Greeting)
// 1 --> PM Only (If he can receive pms)
// 2 --> Email Only
// 3 --> PM Only (Whether he can receive PMs or not)
// 4 --> BOTH PM and email
// 5 --> If he can receive send PM, if not send Email.
$greeting_type=5;

// Which post numbers will be greeted via email or PM?
// The hack will greet send greetings email/PM for every number of posts you specified here
// Usage Examples: To greet only 1000th post use: $greetpost_pm=array('1000');
// To greet only 1000th and 2000th post use: $greetpost_pm=array('1000','2000');
$greetpost_pm=array('25');

//if send pm, will he get a pop up alert? set to 1 for yes, 0 for no.
$pop_alert=1;

// Do you want the hack to automatically create a thread to greet his post?
// 1-- > Yes, 0 --> No
$thread_create=0;

// Which post numbers will be greeted via a greeting Thread?
// The hack will create a greeting threadfor every number of posts you specified here
// Usage Examples: To greet only 1000th post use: $greetpost_thread=array('1000');
// To greet only 1000th and 2000th post use: $greetpost_thread=array('1000', '2000');
$greetpost_thread=array('1000', '1500', '2000', '2500', '3000', '5000');

// If you choose to create a new thread in your board, enter the forum id:
$greetings_forum = 2;

// Greeter's user id, username, email:
// Who will celebrate the user?
// He will be sender of the PM's or emails sent to your member:
$greeter=1; //His User ID
$greeter_name="PaintballForums.net Administrator"; //His User Name
$greeter_email="admin@paintballforums.net"; //His Email

// Subject/Title of the Email or PM users get.
// use ??post?? variable to refer their post number
// use ??name?? variable to refer their username
$title2= "Your post number has reached ??post??!! ";

// Icon ID of the PMs
$log_iconid=0;

// If you choose to create a new thread in your board, what's Thread Title?
// use ??post?? variable to refer their post number
// use ??name?? variable to refer their username
$title3= "??name??'s ??post??th Messages!!";

// Excluded User groups. (That is Usergroup ID, NOT userid!)
// If you dont want to sent greetings for some usergroups enter their usergroups id:
// Usage Examples: To exlude user group 12 use: $excluded_usergroups=array('12');
// To exclude user group 12 AND 13 use: $excluded_usergroups=array('12', '13');
// To NOT to exclude any usergroups, set it to $excluded_usergroups=array('0');
$excluded_usergroups=array('0');

// Report to Admin: Notifies the admin daily about the greetings
// 0 -> Dont notify Admin
// 1 -> Notify Admin via PM
// 2 -> Notify Admin via Email
$admin_report=0;

// Admin email (to send the greeting report via email, if set)
$admin__email="admin@paintballforums.net";

// Admin userid (to send the greeting report via PM, if set)
$admin__userid=1;

########## END OF OPTIONS #################
$greeteduserid=$bbuserinfo[userid];
$greetedusername=$bbuserinfo[username];

$greeteduserposts=$bbuserinfo[posts]+1;
$greetedemailusername=unhtmlspecialchars($bbuserin fo['username']); //for email title

if ($bbuserinfo[userid]!=0 AND $foruminfo[countposts] AND (in_array($greeteduserposts, $greetpost_thread) OR in_array($greeteduserposts, $greetpost_pm)) AND ($greeting_type>0 OR $thread_create>0 OR $admin_report>0) AND !(in_array($bbuserinfo[usergroupid], $excluded_usergroups)))
{
$greeteduserpostsstring=(string)$greeteduserposts;
$title3=ereg_replace('??name??', $bbuserinfo[username], $title3);
$title3=ereg_replace('??post??', "$greeteduserpostsstring", $title3);
$title2=ereg_replace('??post??', "$greeteduserpostsstring", $title2);
$title2=ereg_replace('??name??', $bbuserinfo[username], $title2);

$admin_report_text="Your member $greetedusername posted his ".$greeteduserposts."th message at ".date("F j, Y, g:i a")." (Server Time)\n\nActions Taken by the hack (if any):\n\n";

##############################################
if (in_array($greeteduserposts, $greetpost_thread) AND $thread_create>0)
{ //Lets Create a Thread for this user

// Creating Thread
eval("\$post_greeting_thread = \"".gettemplate("post_greeting_thread",1,0)."\";") ;

$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,postuserid,lastposter,dateline,iconid, visible,attach) VALUES(NULL,'".addslashes(htmlspecialchars($title3 ))."','".time()."','$greetings_forum','1','0','".a ddslashes($greeter_name)."','".addslashes($greeter )."','".addslashes($greeter_name)."','".time()."', '0','1','0')");
$log_threadid=$DB_site->insert_id();

// Creating Post
$DB_site->query("INSERT INTO post(postid,threadid,title,username,userid,datelin e,pagetext,allowsmilie,showsignature,ipaddress,ico nid,visible) VALUES (NULL,'$log_threadid','".addslashes(htmlspecialcha rs($title3))."','".addslashes($greeter_name)."','$ greeter','".time()."','".addslashes($post_greeting _thread)."','1','0','127.0.0.1','0','1')");
$log_postid=$DB_site->insert_id();

// Updating Forum
$DB_site->query("UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1, lastpost='".time()."',lastposter='".addslashes($gr eeter_name)."' WHERE forumid =$greetings_forum");

// Updating User's Post
$DB_site->query("UPDATE user SET posts=posts+1 WHERE userid=$greeter");

// Admin Report Text
$admin_report_text.="[*] Thread Created\n $bburl/showthread.php?threadid=".$log_threadid."\n\n";
}

##############################################
if ($greeting_type==3 OR $greeting_type==4 OR ($greeting_type==1 AND $bbuserinfo[receivepm]==1))
//Send PM
{
eval("\$post_greeting_pm = \"".gettemplate("post_greeting_pm",1,0)."\";");

$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title ,message,dateline,showsignature,iconid,messageread ,folderid) VALUES (NULL,$bbuserinfo[userid],$bbuserinfo[userid],$greeter,'".addslashes(htmlspecialchars($title2)) ."','".addslashes($post_greeting_pm)."',".time()." ,1,'$log_iconid',0,0)");

$admin_report_text.="[*] PM Sent\n\n";

if ($pop_alert==1)
//pop up alert set, lets send pm popup alert..
{
if ($noshutdownfunc) {$DB_site->query("UPDATE user SET pmpopup=2 WHERE userid=$bbuserinfo[userid]");}
else {$shutdownqueries[]="UPDATE LOW_PRIORITY user SET pmpopup=2 WHERE userid=$bbuserinfo[userid]";}
}
} //send PM

##############################################
if ($greeting_type==2 OR $greeting_type==4 OR ($greeting_type==5 AND $bbuserinfo[receivepm]!=1))
//Send Email
{
eval("\$post_greeting_email = \"".gettemplate("post_greeting_email",1,0)."\"; ");
mail($bbuserinfo[email],$title2,$post_greeting_email,"From: \"$bbtitle \"<$webmasteremail>");
$admin_report_text.="[*] Email Sent";

}// Send Email

$admin_report_text.="\n\n << Greet Members Xth Post Hack by Logician >> \n";

#############################################
if ($admin_report==1)
// Sending Greetings Report to Admin By PM
{
$admin_pm_title= $greetedusername."'s ".$greeteduserposts."th post!";
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title ,message,dateline,showsignature,iconid,messageread ,folderid) VALUES(NULL,$admin__userid,$admin__userid,$admin__ userid,'".addslashes(htmlspecialchars($admin_pm_ti tle))."','".addslashes($admin_report_text)."',".ti me().",1,'$log_iconid',0,0)");
}
if ($admin_report==2)
// Sending Greetings Report to Admin By Email
{
$admin_report_title = $greeteduserposts."th post of $greetedemailusername!";
mail($admin__email, $admin_report_title ,$admin_report_text,"From: \"$bbtitle \"<$webmasteremail>");
}

}

//exit;
//Logician Greet Users Xth post via Email/PM/Create Thread hack
Reply With Quote
  #20  
Old 11-22-2002, 06:44 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by !!!cyr0n_k0r
here are my settings. I set my post count to 24 and made a new thread and I didnt get a PM or an e-mail. I even posted replies making my post count like 27.. and still no pm or e-mail.
1- Is "accept pm" settings in your user cp is ON?
2- Did you applied the hack code BOTH to newthread.php AND newreply.php?
3- Did your hack settings are exactly same in newthread.php and newreply.php?
4- Did you create templates correctly? (Check especially exact names)
5- If you have more than 1 style sets, did you create your templates in ALL stylesets?
6- Does hack work if you change the settings to "Send Email", "create a thread"?
7- Does hack send you an admin report mentioning that pm is sent, if you set admin notification ON? (Try it)
8- Set the first 2 settings as:
PHP Code:
// How to send the greeting to the user:
// 0 --> Neither PM nor Email (Disables PM/email Greeting)
// 1 --> PM Only (If he can receive pms)
// 2 --> Email Only
// 3 --> PM Only (Whether he can receive PMs or not)
// 4 --> BOTH PM and email
// 5 --> If he can receive send PM, if not send Email.
$greeting_type=4;

// Which post numbers will be greeted via email or PM?
// The hack will greet send greetings email/PM for every number of posts you specified here
// Usage Examples: To greet only 1000th post use: $greetpost_pm=array('1000');
// To greet only 1000th and 2000th post use: $greetpost_pm=array('1000','2000');
$greetpost_pm=array('1','2','3','4','5','6','7','8'); 
Register as a new user (with post number 0) and try to send a few posts and see if the hack is working.

And make sure you dont choose "create a poll" option while you send your post or send the post into a "moderated" forum.
Reply With Quote
  #21  
Old 11-22-2002, 08:30 PM
!!!cyr0n_k0r !!!cyr0n_k0r is offline
 
Join Date: Apr 2002
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

im not going to fill up my board with useless user names.
All my options are correct and your hack doesnt work.
accept it.

1-5 . YES
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:44 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.04524 seconds
  • Memory Usage 2,352KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete