vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   E-mail users when their thread is moved (https://vborg.vbsupport.ru/showthread.php?t=7049)

01-20-2001 08:30 PM

Wrote this hack because people on my forum were complaining that there was no closed thread saying "Your thread was moved because of ....", so I decided to have the forum e-mail them when a mod/admin moved their thread.

EDIT POSTINGS.PHP


Find (around ln 287)
Code:

  $threadinfo=$DB_site->query_first("SELECT forumid FROM thread WHERE threadid=$threadid");
  $curforumid=$threadinfo[forumid];

Add after it
Code:

  $threadtitle=$threadinfo[title];
  $curforum=$DB_site->query_first("SELECT title FROM forum WHERE forumid=$curforumid");
  $targetforum=$DB_site->query_first("SELECT title FROM forum WHERE forumid=$forumid");
  $curforumtitle=$curforum[title];
  $targetforumtitle=$targetforum[title];


Find (around ln 334)
Code:

  $DB_site->query("UPDATE forum SET replycount=$numberposts,threadcount=threadcount-1,lastpost=$lastpost,lastposter='".addslashes($lastposter)."' WHERE forumid=$curforumid");
Add after it
Code:

  $firstpostinfo=$DB_site->query_first("SELECT userid FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1");
  $threadstarter=$DB_site->query_first("SELECT email FROM user WHERE userid=$firstpostinfo[userid]");

  $emailsubject=$bbtitle;
  $emailmsg="Your thread on the $bbtitle, " . $threadtitle . ", has been moved from the " . $curforumtitle . " forum to the " . $targetforumtitle . " forum. Do not respond to this e-mail, as it will not yield any follow-up answers.";
  mail($threadstarter[email],$emailsubject,$emailmsg,"From: \"$bbtitle Post Manager\" <$webmasteremail>");

hope this helps somebody :)

[Edited by Emul8or on 01-20-2001 at 05:34 PM]

01-20-2001 09:40 PM

nice hack. :)

01-20-2001 10:46 PM

hi Emul8or
the ver1.1.5 do not work "$threadtitle"
thanks

01-20-2001 11:06 PM

Oh, sorry, I was working off the 1.1.2 codebase.

01-20-2001 11:13 PM

thanks

Only Vars $threadtitle not working

01-20-2001 11:26 PM

Quote:

Originally posted by Emul8or
Oh, sorry, I was working off the 1.1.2 codebase.
You need to pirate a more recent copy.

01-20-2001 11:28 PM

lol......................

01-21-2001 12:46 AM

Quote:

You need to pirate a more recent copy.
I think the correct spelling is pir8

01-25-2001 02:25 AM

Be nice to have it for 1.1.4


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.01023 seconds
  • Memory Usage 1,731KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete