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
  #32  
Old 07-22-2004, 10:36 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One thing I would like to see in this hack, is the "Be back Date". I agree with the developer that we do not need to have it cleared automatically, the idea of clearing this up with the first post is brilliant, however, I would like to see the return date there.

I tried to do it, but I am not good with php and I do not know how to handle a date field in the scripts etc., so I can't help much.

The idea of automatically stopping PM receives when one is away, is also very cool, I wish we could extend it to e-mail notifications as well, but I do not think this can be done.

Rgds
Reply With Quote
  #33  
Old 08-10-2004, 07:18 AM
lifesourcerec's Avatar
lifesourcerec lifesourcerec is offline
 
Join Date: Jan 2002
Posts: 429
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This code is only in profile once

"homepage = '" . addslashes(htmlspecialchars_uni($homepage)) . "',"

You have it listed twice in the instructions
Reply With Quote
  #34  
Old 08-12-2004, 06:03 PM
Pinkie Pinkie is offline
 
Join Date: Aug 2004
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This I will try for sure
Great work
Reply With Quote
  #35  
Old 08-13-2004, 09:16 PM
sully02 sully02 is offline
 
Join Date: Jul 2004
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Pinkie
This I will try for sure
Great work
Gamingforce, any progress on adding this to the postbit?
Reply With Quote
  #36  
Old 08-14-2004, 05:06 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sully02
Gamingforce, any progress on adding this to the postbit?
I've managed to add it in my postbits, to see what I've done, please check the following:

http://forum.m1911.org/showthread.php?t=623

If you like what you see, I can provide you with my files, but the changes I've made to the original hack, are significant, and I haven't kept exact records in the form of "find this, replace it with", so you will need to do some work yourself.

However, in order to have the original "User is away" message, here is some code which goes in the postbit template (and postbitlegacy).

PHP Code:
<!-- Code change for user being away -->
<if 
condition="$post['awaystatus'] == 1">
<
td width="100%"><CENTER><div class="smallfont"><FONT COLOR="red">User $post[musernameis away at the moment.</FONT><BR>
<if 
condition="$post['awaymessage'] != ''">
Reason$post[awaymessage]<BR>
<else />
No reason was given.<BR>
</if>

</
div></CENTER></td>
<else />
<
td width="100%">&nbsp;</td>
</if>
<!-- 
end of code for user being away --> 
This piece of code, goes right below the part shown below:

PHP Code:
                <if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
                
            </
td
Let me know if I can be of more help.

Rgds
Reply With Quote
  #37  
Old 08-14-2004, 05:15 PM
turbidblue's Avatar
turbidblue turbidblue is offline
 
Join Date: Apr 2004
Location: Indiana
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you! i was mostly just looking for the way to get the reason in the postbit, and your code worked flawlessly

i dont really care about having the return date on my forums

xoxo
Reply With Quote
  #38  
Old 08-14-2004, 05:55 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by turbidblue
thank you! i was mostly just looking for the way to get the reason in the postbit, and your code worked flawlessly

i dont really care about having the return date on my forums

xoxo
Glad if I can be of help.

The return date is a bit more involved, it includes altering tables etc. I finally managed it, but I would be hard pressed to describe every necessary step.

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

That would be nice to add a query to check user status when someone is sending PM. If away, bounce an away message back to sender.
Reply With Quote
  #40  
Old 10-01-2004, 07:50 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 would be nice to add a query to check user status when someone is sending PM. If away, bounce an away message back to sender.
This can be done, but you should keep in mind that:

1. Sending a PM to a user, necessitates only an insertion of a new row in a table in the database.
2. Any part of vB can therefore send a PM to a user, by just doing such an insert.
3. The only way to catch the "user away" condition, for each program which tries to insert a PM in the PMs table, is to have a trigger within the table. This I cannot do, I am not that good in MySQL, I do not even know if it supports triggers.

So, what I did, is the next best thing. I modified the code of the private.php program, which is the one you use, when you send a PM to a user. To do this, follow the steps below:

1. Edit private.php and find :

PHP Code:
            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) . '";');
            } 
Now go into your Admin CP, Phrase Manager and add a new phrase. The type is "Front-End Error Messages" and the phrase name should be "userawaynopm". The text of the phrase should be something like:

PHP Code:
<u><b>Attention : </b></uYour PM cannot be send to its intended recipients.<br>User <b>$user[username]</bis away since the $awaysincedate.<brExpected return date was $awayuntilmsg.<br>Your PM was not delivered to  <b>$user[username]</b>. 

Please keep in mind that I've added some custom fields in this hack, so if you get error messages about awayuntildate etc., you should remove those bits from the code and the phrase. Let me know if you have problems and I'll try to help.

With this, when you try to PM a user who is away, you will receive the above message and your PM is not send. I am not sure if this is the best way to handle this though, maybe, one should issue a warning to the sender, that the recipient is away, and let the PM go through. I would appreciate if you could let me know what you think about this question.

Finally, with this mod, if your PM is send to many recipients, the user(s) who is/are away, will not receive the PM, while the rest of them will.

Let me know if you have problems.

Rgds
------------
John
Reply With Quote
  #41  
Old 10-01-2004, 09:57 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
This can be done, but you should keep in mind that:

1. Sending a PM to a user, necessitates only an insertion of a new row in a table in the database.
2. Any part of vB can therefore send a PM to a user, by just doing such an insert.
3. The only way to catch the "user away" condition, for each program which tries to insert a PM in the PMs table, is to have a trigger within the table. This I cannot do, I am not that good in MySQL, I do not even know if it supports triggers.

So, what I did, is the next best thing. I modified the code of the private.php program, which is the one you use, when you send a PM to a user. To do this, follow the steps below:

1. Edit private.php and find :

PHP Code:
            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) . '";');
            } 
Now go into your Admin CP, Phrase Manager and add a new phrase. The type is "Front-End Error Messages" and the phrase name should be "userawaynopm". The text of the phrase should be something like:

PHP Code:
<u><b>Attention : </b></uYour PM cannot be send to its intended recipients.<br>User <b>$user[username]</bis away since the $awaysincedate.<brExpected return date was $awayuntilmsg.<br>Your PM was not delivered to  <b>$user[username]</b>. 

Please keep in mind that I've added some custom fields in this hack, so if you get error messages about awayuntildate etc., you should remove those bits from the code and the phrase. Let me know if you have problems and I'll try to help.

With this, when you try to PM a user who is away, you will receive the above message and your PM is not send. I am not sure if this is the best way to handle this though, maybe, one should issue a warning to the sender, that the recipient is away, and let the PM go through. I would appreciate if you could let me know what you think about this question.

Finally, with this mod, if your PM is send to many recipients, the user(s) who is/are away, will not receive the PM, while the rest of them will.

Let me know if you have problems.

Rgds
------------
John
Thanks. But rather than prevent the PM from being sent, I'd rather the autoresponder option, so no PM get lost or prevented.
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 05:02 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.14968 seconds
  • Memory Usage 2,369KB
  • 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
  • (8)bbcode_php
  • (5)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