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)
-   -   Greet Members' Xth posts via Email/PM/Thread automatically (https://vborg.vbsupport.ru/showthread.php?t=39821)

Logician 07-07-2002 07:30 AM

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..

Conroy 07-07-2002 10:29 PM

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?

Logician 07-08-2002 04:29 PM

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..

Me2Be 07-09-2002 01:48 AM

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) :)

Logician 07-10-2002 01:01 PM

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

Dean C 07-10-2002 05:20 PM

great hack...

Dynamic One 11-11-2002 08:47 AM

Good hack Logician. Thank you for this.

!!!cyr0n_k0r 11-22-2002 06:12 PM

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

Logician 11-22-2002 06:44 PM

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.

!!!cyr0n_k0r 11-22-2002 08:30 PM

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


All times are GMT. The time now is 05:34 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.01264 seconds
  • Memory Usage 1,807KB
  • 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
  • (5)bbcode_php_printable
  • (6)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
  • (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