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

Reply
 
Thread Tools
User Away Messages Details »»
User Away Messages
Version: 1.00, by Gamingforce Gamingforce is offline
Developer Last Online: Jan 2007 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 07-15-2004 Last Update: Never Installs: 67
 
No support by the author.

[ Feature Description ]
This hack allows users to easily set themselves as away via the Edit Profile page. An optional away message can be added along with the away status. Away messages are viewable at the top of the user profile (by the avatar/user picture). If a post is made when a user is in away mode, the user is automatically set off away mode.

[ Hack Concept ]
Credits to bira for making the original away message hack for vBulletin 2. This is a complete remake however.

[ Future Plans ]
  • Show away status in postbit. (If you want, you can add this right now by using an xhtml conditional ($bbuserinfo[awaystatus] == 1)).
[ Example ]
http://www.gamingforce.com/forums/member.php?u=852


Enjoy!

Show Your Support

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

Comments
  #42  
Old 10-01-2004, 10:09 PM
Dan's Avatar
Dan Dan is offline
 
Join Date: Dec 2002
Location: Titusville, Florida
Posts: 1,787
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice hack very useful! thanks for sharing it with us all
Reply With Quote
  #43  
Old 10-01-2004, 11:06 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

About letting the PM go and then display the message?
Reply With Quote
  #44  
Old 10-02-2004, 01:56 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried the below with
$sendto["$username"] = true;
$tostring["$user[userid]"] = $user['username'];
before and after the actual error message
or without it at all, like your code

I get no error messages and all PM went thru.

else if ($user['awaystatus'] == 1)
{
$awaysincedate = vbdate($vboptions['dateformat'], $user['awaysince']);
if ($user['awaymessage'] == "")
{
$awaymsg = "not given";
}
else
{
$awaymsg = $user['awaymessage'];
}
$sendto["$username"] = true;
$tostring["$user[userid]"] = $user['username'];
eval('$pmuseraway[] = "' . fetch_phrase('userawaynopm', PHRASETYPEID_ERROR) . '";');

}
Reply With Quote
  #45  
Old 10-02-2004, 10:28 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, try this if you can. Use the original private.php file and find:

PHP Code:
        foreach ($checkedusers AS $username => $user)
        {
            if (!(
$user['options'] & $_USEROPTIONS['receivepm']))
            {
                
// recipient has private messaging disabled
                
eval('$errors[] = "' fetch_phrase('pmrecipturnedoff'PHRASETYPEID_ERROR) . '";');
            } 
Right below it, add:

PHP Code:
            else if ($user['awaystatus'] == 1)
            {
                
$awaysincedate vbdate($vboptions['dateformat'], $user['awaysince']);
                if (
$user['awayuntildate'] == "")
                {
                    
$awayuntilmsg "not given";
                }
                else
                {
                    
$awayuntilmsg $user['awayuntildate'];
                }
                eval(
'$pmuseraway[] = "' fetch_phrase('userawaynopm'PHRASETYPEID_ERROR) . '";');
            } 
Then find:

PHP Code:
            $url "private.php?$session[sessionurl]";
            eval(
print_standard_redirect('pm_messagesent')); 
and replace it with :

PHP Code:
        if (!empty($pmuseraway))
        {
            
define('PMPREVIEW'1);
            
$preview construct_errors($pmuseraway); // this will take the preview's place
            
$_REQUEST['do'] = 'newpm';
        }
        else
        {
            
$url "private.php?$session[sessionurl]";
            eval(
print_standard_redirect('pm_messagesent'));
        } 
Let me know if it works.
----------
John
Reply With Quote
  #46  
Old 10-02-2004, 10:38 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lionel
Thanks. But rather than prevent the PM from being sent, I'd rather the autoresponder option, so no PM get lost or prevented.
I would like that too, but I just do not have the time to code this functionality. It's more involved, since it requires you to scan the recipients for those who are away, and then create a PM back to the sender. This requires the same checks as the ones performed when the original PM is send, and you have to change the recipient with the sender.

Sorry, not enough time here for that. I admit though, if someone can come up with it, I'll use it too.

Rgds
----------
John
Reply With Quote
  #47  
Old 10-02-2004, 02:23 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lionel
Thanks. But rather than prevent the PM from being sent, I'd rather the autoresponder option, so no PM get lost or prevented.
Would you mind if instead of a PM, you get an e-mail when the user you PMed is away?

If not, here is the code you can use. In your private.php, find:

PHP Code:
        }

        
// process errors if there are any
        
if (!empty($errors))
        { 
Replace that with:

PHP Code:
            if ($user['awaystatus'] ==1)
            {
                
mail ($bbuserinfo[email],"One of your PMs was send to a user who is away","The PM you send to $username was not delivered, because this user is currently away.","From: \"$vboptions[bbtitle] Mailer\" <$vboptions[webmasteremail]>");
            }
        }

        
// process errors if there are any
        
if (!empty($errors))
                { 
You may customize the above, to use a template for the e-mail send. If you want help on this, please let me know.

I hope this helps.

Rgds
--------------
John
Reply With Quote
  #48  
Old 10-03-2004, 07:15 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sv1cec
OK, try this if you can. Use the original private.php file and find:

PHP Code:
        foreach ($checkedusers AS $username => $user)
        {
            if (!(
$user['options'] & $_USEROPTIONS['receivepm']))
            {
                
// recipient has private messaging disabled
                
eval('$errors[] = "' fetch_phrase('pmrecipturnedoff'PHRASETYPEID_ERROR) . '";');
            } 
Right below it, add:

PHP Code:
            else if ($user['awaystatus'] == 1)
            {
                
$awaysincedate vbdate($vboptions['dateformat'], $user['awaysince']);
                if (
$user['awayuntildate'] == "")
                {
                    
$awayuntilmsg "not given";
                }
                else
                {
                    
$awayuntilmsg $user['awayuntildate'];
                }
                eval(
'$pmuseraway[] = "' fetch_phrase('userawaynopm'PHRASETYPEID_ERROR) . '";');
            } 
Then find:

PHP Code:
            $url "private.php?$session[sessionurl]";
            eval(
print_standard_redirect('pm_messagesent')); 
and replace it with :

PHP Code:
        if (!empty($pmuseraway))
        {
            
define('PMPREVIEW'1);
            
$preview construct_errors($pmuseraway); // this will take the preview's place
            
$_REQUEST['do'] = 'newpm';
        }
        else
        {
            
$url "private.php?$session[sessionurl]";
            eval(
print_standard_redirect('pm_messagesent'));
        } 
Let me know if it works.
----------
John
That displayed the error message about being away in the preview when trying to send message.
Reply With Quote
  #49  
Old 10-03-2004, 01:35 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lionel
That displayed the error message about being away in the preview when trying to send message.
You mean the error message comes up when you hit "Preview"?? It doesn't work like that in my case. Preview works as it is supposed to, then when you click "Submit" the error appears, which is what it should do.
Reply With Quote
  #50  
Old 10-03-2004, 01:56 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sv1cec
You mean the error message comes up when you hit "Preview"?? It doesn't work like that in my case. Preview works as it is supposed to, then when you click "Submit" the error appears, which is what it should do.
I meant it works as intended. It displays the useraway message pm not sent in the preview screen that appears when trying to submit.
Reply With Quote
  #51  
Old 10-03-2004, 03:08 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lionel
I meant it works as intended. It displays the useraway message pm not sent in the preview screen that appears when trying to submit.
Well, the preview screen does not come up with any error message in my system. But after you do the preview, if you hit "Submit", then it shows the error. Same thing it does if you do not preview, and hit "Submit" from the editor screen.

Just to let you know though, I stopped using this mod. I replaced it in my forums with the e-mail warning one. I think it is better that way, your PM goes to the recipient, even if he is away, and you get back an e-mail saying that the recipient is away and he will get your message when he returns.

A PM would be a more elegant solution, but I do not want to get involved with all the checks necessary to send a PM. The e-mail is sent by the admin account, so users will get it one way or another.

Rgds
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 09:35 AM.


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.08789 seconds
  • Memory Usage 2,360KB
  • 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
  • (10)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
  • (4)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