Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vB Mail Reply Details »»
vB Mail Reply
Version: 0.7Beta, by Colin F Colin F is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 08-07-2004 Last Update: 11-02-2004 Installs: 37
Re-useable Code Translations Is in Beta Stage  
No support by the author.

vB Email Reply 0.7BETA


What it does:
This allows your members (and you of course) to reply to threads by email. All they have to do is wirte to a specific email address (that you specify) and include a special code in the email subject.

How it works:
A script (vbemailreply.php) is run using the vB3 Cronsystem every minute. This checks a pop3 or imap account for emails and then processes these emails, inserting the data into the database. Then a reply is sent to the sender, stating that either the post/thread got entered correctly or that there was some kind of error.

Is it complicated?
Actually no. There is an install script that does most of the work as well as two small file changes. If you do have problems installing it, contact me for help.

Changes:
New files (2):
/includes/cron/vbmailreply.php
/includes/mimeDecode.php

Changed files(1):
/includes/functions_newpost.php

New database fields/tables(1):
New userfield added by installscript

New templates(0):

Changed templates(0):

New phrases(3):
emailreplyerror
emailreplydone
emailnewthreaddone

Changed phrases(1):
notify

Screenshots:
none

Credits:
The idea and small parts of the script are based on Chen 'FireFly' Avinadav's Email posts into forum hack, found here: https://vborg.vbsupport.ru/showthrea...threadid=40595

Instructions:
  • Backup all your files as well as your database.
    For help backing up your database, look here: http://www.vbulletin.com/docs/html/m...atabase_backup
  • Upload vbmailreply.php to your /includes/cron/ folder
  • Upload mimeDecode.php to your /includes/ folder
  • Open the file /includes/functions_newpost.php in your favourite PHP editing program.
  • Code:
    FIND (around line 196):
     
    $post['poststarttime'] = trim($post['poststarttime']);
     
    ADD BELOW:
     
    if ($post['isemail']) { $bbuserinfo = $post['userinfo']; }
     
     
    FIND (around line 273):
     
    if ($vboptions['logip'])
     
    REPLACE WITH:
     
    if ($vboptions['logip'] AND !$post['isemail'])
     
     
    FIND (around line 321):
     
    if ($prevpostfound)
    {
     
    ADD BELOW:
     
    if ($post['isemail'])
    {
    return ('dupepost');
    }
    else
    {
     
     
    FIND:
     
    }
    else
    {
    if ($parentid == 0 AND $type != 'thread')
     
    REPLACE WITH:
     
    }
    }
    if (!$prevpostfound)
    {
    if ($parentid == 0 AND $type != 'thread')
     
     
    FIND:
     
    	$useremails = $DB_site->query("
    		SELECT user.*, subscribethread.emailupdate
    		FROM " . TABLE_PREFIX . "subscribethread AS subscribethread, " . TABLE_PREFIX . "user AS user
    		LEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (usergroup.usergroupid = user.usergroupid)
    		WHERE subscribethread.threadid = $threadid AND
    			subscribethread.emailupdate IN (1, 4) AND
    			subscribethread.userid = user.userid AND
    			user.usergroupid <> 3 AND
    			user.userid <> " . intval($userid) . " AND
    			user.lastactivity > " . intval($lastposttime['dateline']) . " AND
    			(usergroup.genericoptions & " . ISBANNEDGROUP . ") = 0
    	");
     
    REPLACE WITH:
     
    	$useremails = $DB_site->query("
    		SELECT user.*, userfield.*, subscribethread.emailupdate
    		FROM " . TABLE_PREFIX . "subscribethread AS subscribethread, " . TABLE_PREFIX . "user AS user
    		LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON (userfield.userid = user.userid)
    		LEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (usergroup.usergroupid = user.usergroupid)
    		WHERE subscribethread.threadid = $threadid AND
    			subscribethread.emailupdate IN (1, 4) AND
    			subscribethread.userid = user.userid AND
    			user.usergroupid <> 3 AND
    			user.userid <> " . intval($userid) . " AND
    			user.lastactivity > " . intval($lastposttime['dateline']) . " AND
    			(usergroup.genericoptions & " . ISBANNEDGROUP . ") = 0
    	");
     
     
    FIND:
     
    $evalemail["$languageid"] = '$message = "' . str_replace("\\'", "'", addslashes(iif(empty($email_text[PHRASETYPEID_MAILMSG]), $emails['-1'][PHRASETYPEID_MAILMSG],$email_text[PHRASETYPEID_MAILMSG]))) . '";'.
     
    ADD ABOVE:
     
    $touserfieldcode = "field".$vboptions[mailserver_profilefieldid];
    $subjectcode_reply = "[thread-".$threadinfo[threadid]."-".$touser[$touserfieldcode]."]";
    $subjectcode_newthread = "[newthread-".$foruminfo[forumid]."-".$touser[$touserfieldcode]."]";
  • Add the following as a translation of the phrase notify:
    Code:
    Hello $touser[username],
     
    $bbuserinfo[username] has just replied to a thread you have subscribed to entitled - $threadinfo[title] - in the $foruminfo[title] forum of $vboptions[bbtitle].
     
    This thread is located at:
    $vboptions[bburl]/showthread.php?t=$threadinfo[threadid]&goto=newpost
     
    ~~~~~ NEW ~~~~~
    New at $vboptions[bbtitle]!
    You can now reply to the thread by replying to this message. All you need to do is to make sure this code appears in the email subject:
    $subjectcode_reply
    You should also remove this text to ensure your reply is readable by other forum users.
    Additionaly, you can start a new thread in the $foruminfo[title] Forum simply by sending a mail to $vboptions[mailserver_emailaddress] with this code in the subject: $subjectcode_newthread
    ~~~~~ NEW ~~~~~
     
    Here is the message that has just been posted:
    ***************
    $pagetext
    ***************
     
    There may be other replies also, but you will not receive any more notifications until you visit the forum again.
     
    Yours,
    $vboptions[bbtitle] team
     
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Unsubscription information:
     
    To unsubscribe from this thread, please visit this page:
    $vboptions[bburl]/subscription.php?do=usub&t=$threadinfo[threadid]
     
    To unsubscribe from ALL threads, please visit this page:
    $vboptions[bburl]/subscription.php?do=viewsubscription&folderid=all
  • Upload the file vbmailreply_install.php to your admincp folder
  • Be sure to either have a POP3 or IMAP email account ready before running the installation. The data will need to be entered.
  • Open your browser and go to http://www.yourforums.com/admincp/vb...ly_install.php and follow the instructions.
  • Delete the vbmailreply_install.php file from your webserver.
Donations:
This hack will always be free, however your donations are kindly accepted and will help towards further development. If you donate, please leave me some info (either your forum site or username at vB.org) so that I can thank you.

Install:
Don't feel like donating, but still want to thank me for my work? Click the install button to show your appreciation. As a great side effect, you'll get an email update once there is a bigger update or important security fix!

Updates:
09.08.2004 - I've updated the vbemailreply_install.php file, as there was an wrong value while entering the settings.
Also added support for SSL (untested)
Fixed the whole install routine.
03.11.2004 - Updated the installation as well as the vbemailreply.php file.

Show Your Support

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

Comments
  #132  
Old 03-23-2005, 09:29 AM
Freezerator Freezerator is offline
 
Join Date: Nov 2001
Location: Den Haag
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there still any development on this great hack? I really want to use it, but i rather don't use something beta.

Willing to donate if someone repairs the bugs and makes it a final?
Reply With Quote
  #133  
Old 03-23-2005, 12:09 PM
nexialys
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Freezerator
Willing to donate if someone repairs the bugs and makes it a final?
you can always ask in the Services Requests forum if you want this made by a commercial coder$$$... else, you have low chances these guys pass across your request!
Reply With Quote
  #134  
Old 03-30-2005, 05:54 AM
Aylwin Aylwin is offline
 
Join Date: Mar 2005
Location: Finland
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone got this working with version 3.0.7? The main reason I decided on vBulletin was because of this hack. Yes, I realize it's still in Beta version but it's nevertheless very frustrating that I can't get it to work.

First, I was getting blank emails. After removing the code below, emails arrive correctly:
Code:
Additionaly, you can start a new thread in the $foruminfo[title] Forum simply by sending a mail to $vboptions[mailserver_emailaddress] with this code in the subject: $subjectcode_newthread
This means I can't start new threads but that's okay... for now. By the way, I also tried the correction posted by freeshares1 but that didn't work either.

Then, when I try to reply I get the error "No permission: you do not have permission to post in this forum." This is exactly the same as Lionel's error where the forumID is empty for some reason (I, too, commented out the part that checks permissions). However, in my case I have no other hacks installed so this is probably related to the version.

Could Colin or someone please please give some advice?

Thanks!
Aylwin

P.S. Is there any way to configure this so that it only processes emails with the code in the subject? The email address I'm using is also used for other purposes.
Reply With Quote
  #135  
Old 04-01-2005, 02:20 PM
Aylwin Aylwin is offline
 
Join Date: Mar 2005
Location: Finland
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Finally got it working! :banana: Now I can say that this is a truly wonderful mod! In my opinion, it should be a standard feature on all commercial forum software!

Here's how I got it to work on my forums:

In vbemailreply.php, find this:
Code:
	###### GET THE THREAD OR POSTID  AND OTHER INFO ######
		if (preg_match('#\[post-([0-9]+)-([a-z0-9]+)\]#i', $subject, $subjectparts)) {
			$postid = intval($subjectparts[1]);
		} else if (preg_match('#\[thread-([0-9]+)-([a-z0-9]+)\]#i', $subject, $subjectparts)) {
			$threadid = intval($subjectparts[1]);
		} else {
			preg_match('#\[newthread-([0-9]+)-([a-z0-9]+)\]#i', $subject, $subjectparts);
			$forumid = intval($subjectparts[1]);
			$type = "thread";
		}
and replace with this:
Code:
		###### GET THE THREAD OR POSTID  AND OTHER INFO ######
		if (preg_match('/\[post-([0-9]+)-([a-z0-9]+)\]/i', $subject, $subjectparts)) {
			$postid = intval($subjectparts[1]);
		} else if (preg_match('/\[thread-([0-9]+)-([a-z0-9]+)\]/i', $subject, $subjectparts)) {
			$threadid = intval($subjectparts[1]);
		} else if (preg_match('/\[newthread-([0-9]+)-([a-z0-9]+)\]/i', $subject, $subjectparts)) {
			$forumid = intval($subjectparts[1]);
			$type = "thread";
		}
I also had a few problems with the confirmation emails. So a few changes to vbemailreply_install.php are needed.

Around line 440, find:
Code:
\$vboptions[bburl]/showthread.php?p=$newpost[postid]#post\$newpost[postid]
and replace with:
Code:
\$vboptions[bburl]/showthread.php?p=$newpost[postid]
Around line 447, find:
Code:
Your thread \"\$threadinfo[title]\" was succesfully received and entered in the forum \$foruminfo[title]!
Here is a direct link to your post:
\$vboptions[bburl]/showthread.php?t=\$threadinfo[threadid]
and replace with:
Code:
Your thread entitled "$title" was successfully received and entered in the forum $foruminfo[title].

Here is a direct link to your post: $vboptions[bburl]/showthread.php?t=$newpost[threadid]
Or in my case, I simply modified the necessary phrases after the installation.

A few things I wish it could do though:
1) If I reply via email, I would like to resume receiving the reply notification email (as if I had visited the forum and viewed the subscribed thread)).
2) If I start a new thread via email, I would like to be automatically subscribed to that thread if that is the default setting in my profile.
3) Long lines of text are automatically cut and continued on the next line after about 70 characters. That's fine but there also a "=" added at the end of each line. I wish it wouldn't do that.

I think there were one or two more but I can't remember.

Anyway, great mod! I hope further development is done this.
Reply With Quote
  #136  
Old 04-01-2005, 03:58 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can confirm that works
Reply With Quote
  #137  
Old 04-04-2005, 09:26 AM
Aylwin Aylwin is offline
 
Join Date: Mar 2005
Location: Finland
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've fixed the problem about lines being automatically cut and the "=" sign showing up!

In vbemailreply.php, at around line 92, find:
Code:
		$mailmessage = imap_body($mailbox,$msgno);
after it, add a new line:
Code:
		$mailmessage = quoted_printable_decode ($mailmessage);
Reply With Quote
  #138  
Old 04-08-2005, 01:37 AM
Viks Viks is offline
 
Join Date: Sep 2004
Location: Toronto
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a place for admins to switch the option ON/OFF for users to start and stop vBmail Reply option for members/usrgroups.
Reply With Quote
  #139  
Old 04-10-2005, 11:48 PM
Viks Viks is offline
 
Join Date: Sep 2004
Location: Toronto
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone.. !?

please reply..

I just want to know if there is a way to send emails out to members with each new post that is made on the board.. but TURN off vBMail Reply option.

WILL APPRECIATE ANY REPLY
Reply With Quote
  #140  
Old 04-12-2005, 05:40 PM
Eternal2u Eternal2u is offline
 
Join Date: Feb 2004
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

a couple questions..

will this slow a large forum down..since it has to draw each email reply that has been sent in..

my concern is a slow down of my forums which happened before with vB on a slower server, but since upgrading to dual xeon's, i've had no problems, and don't want to install mods that will cause issues with my boards speed..

Also, is it admin cp configurable, in other words, on off like said above, and do you have to make a new email address on your site to allow this to work, or use an email address of your own..

Also, is email virus going to cause issues, and cause for the server to become infected with email virus etc, which would in turn screw over your vB forum with using a email reply system like this?

Just some concerns of mine, if you'd please answer them I would much appreciate it..

Thanks

-Eternal2u
Reply With Quote
  #141  
Old 04-13-2005, 05:33 AM
Aylwin Aylwin is offline
 
Join Date: Mar 2005
Location: Finland
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm probably not the best person to answer this but...

I'm not sure if this will really slow down a large forum that much. For each email reply that is sent, it means one less user visiting the site. That means less clicks, less page generations, less MySQL queries, etc.

At the moment, there's no easy way to turn it on and off. And yes, you do need a dedicated email address because it processes every single email that arrives. I though tabout using a shared email address too but I'm too lazy (and probably too incompetent) to make the necessary changes. It was much easier to simply setup a dedicated email address.

As for viruses and other malicious code sent via email, I doubt you'll have any problems. This system is text based and any attachments are ignored and eventually deleted along with the email after processing. The only issue I see is if the dedicated email address somehow got on a spam list. It won't show up on the site but it will be a lot of useless work for the server since it processes all incoming emails. But this can be fixed by changing the email account.

Someone please correct me if anything I've said above is nonsense.

Aylwin
Reply With Quote
Reply


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 08:17 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04780 seconds
  • Memory Usage 2,325KB
  • 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
  • (11)bbcode_code
  • (1)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
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (10)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