vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   User Away Messages (https://vborg.vbsupport.ru/showthread.php?t=67250)

Gamingforce 07-15-2004 10:00 PM

User Away Messages
 
[ 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! :)

Gamingforce 07-16-2004 06:41 PM

Screenshots Attached.

turbidblue 07-16-2004 07:03 PM

i have a question..

in your instrictions you say:


[FIND]-->
fetch_profilefields(0);

[REPLACE WITH]-->
fetch_profilefields(0);

// Get Since Away Info
if ($bbuserinfo[awaystatus] == 1) {
$awaysincedate = vbdate($vboptions['dateformat'], $bbuserinfo['awaysince']);
$awaysincetime = vbdate($vboptions['timeformat'], $bbuserinfo['awaysince']);
$awaysincedisplay = " <b>(Since $awaysincedate - $awaysincetime)</b>";
} else {
$awaysincedisplay = '';
}
================================================== ========
[FIND]-->
fetch_profilefields(0);
[REPLACE WITH]-->
homepage = '" . addslashes(htmlspecialchars_uni($homepage)) . "',
awaystatus = $xawaystatus,
awaymessage = '" . addslashes(htmlspecialchars_uni($xawaymessage)) . "',
awaysince = $xawaydate,



I dont have a second one of the one in yellow. the only other fetch_profilefields i can find is:

fetch_profilefields(1);

but when replacing that i get an error on my "edit profile" pages

???

Gamingforce 07-16-2004 07:26 PM

Sorry about that. Please re-download the file for updated instructions.

nexialys 07-16-2004 07:34 PM

this hack is cool... btw, would be cool to have a popup to fill, or a dropin in the navbar so we fill it the same way we use the search block...
(did i say cool!)

turbidblue 07-16-2004 10:02 PM

awesome! worked like a charm!!

thanks so much!

[high]* turbidblue clicks install ;)[/high]

Koutaru 07-17-2004 03:20 AM

Excellent hack, my users were requesting this one a couple days ago ^^

turbidblue 07-17-2004 03:29 AM

i have a question.

how do i get it to show in postbit? i am still sorta a newbie when it comes to all this :)


thanks :)

MrNase 07-17-2004 05:20 AM

wow!!! Getting to work my second vBulletin today and that is one of the hacks i'll definatly gonna install :)

ChuanSE 07-17-2004 05:32 AM

[high]* ChuanSE just wanted to state that the nice girl in the screenshot profile is really really really good looking :o Hi to you if you are Gamingforce on this board :D[/high]

Boofo 07-17-2004 08:35 AM

Will this also add away unilt a certain date so we might know how long they will be gone? And maybe have it automatically set them back on that day and time if they choose that option? Or can it be done? ;)

Gamingforce 07-17-2004 12:37 PM

Quote:

Originally Posted by Boofo
Will this also add away unilt a certain date so we might know how long they will be gone? And maybe have it automatically set them back on that day and time if they choose that option? Or can it be done? ;)

This can easily be done using cron but I figured the auto-back when replying to a thread made things easier. I can look into it for a future version though.

Erwin 07-17-2004 01:34 PM

Cool hack... will add when I find time. :)

ChuanSE 07-18-2004 02:19 AM

Quote:

Originally Posted by Boofo
Will this also add away unilt a certain date so we might know how long they will be gone? And maybe have it automatically set them back on that day and time if they choose that option? Or can it be done? ;)


Heya Boofo Amigo ;)

You have a point there allright, but for now...

[high]* ChuanSE clicks install[/high]

nexialys 07-18-2004 10:46 AM

this mod, added to LastSeenOnline is mostly complete... just need to add a WillBeBack at x date... but franckly, i don't see the use... just add the date in your away message, that's all...

but, a cool feature would be to have s select button for the away user...: deactivate PMs when away ... so if you go outside for a long period, users PMing you will have your away message in the face instead of the PM system ... kinda: don't PM me, i'm not here and don't want to be bothered...

obsidian 07-18-2004 02:46 PM

I had users asking for something similiar for the PM system. Something like an email away message where if you sent them a PM it would reply back saying they were out untill XXXXX. Probably alot of work but it would seem logical to integrate that with something like this.

Zelda-King 07-18-2004 11:05 PM

Quote:

Originally Posted by ChuanSE
[high]* ChuanSE just wanted to state that the nice girl in the screenshot profile is really really really good looking :o Hi to you if you are Gamingforce on this board :D[/high]

Just so you know: that really really really good looking, nice girl has been shown your message. :cool:

House_of_Crazed 07-19-2004 07:07 AM

While I appreciate your work,

mind taking a look at the section for profile.php. Steps 3 / 5 is identical.

So, I'm sure that we're missing something, *laughs*

HoC

teksigns 07-19-2004 04:41 PM

i know i can add a
conditional ($bbuserinfo[awaystatus] == 1)

to the postbit to show that a user is away .

but i cant seem to get the away since date and the away message
to appear in the postbit .....

any ideas?

Gamingforce 07-19-2004 09:59 PM

I'll be issuing an update to this modification soon with many more features. :)

Stay tuned!

flstreetscene 07-19-2004 11:10 PM

Great will the update be compatible with 3.0.3. Just curious because so many major additions (vbgarage, vbarcade) aren't. :(

turbidblue 07-19-2004 11:21 PM

Quote:

Originally Posted by Gamingforce
I'll be issuing an update to this modification soon with many more features. :)

Stay tuned!

awesome! cant wait!! :)

M1th 07-20-2004 12:07 AM

Suggestion:

dropdown menu, with different away messages on forumhome for easy access.

Oldfart 07-20-2004 01:21 AM

Quote:

Originally Posted by flstreetscene
Great will the update be compatible with 3.0.3. Just curious because so many major additions (vbgarage, vbarcade) aren't. :(

VbArcade works fine with 3.0.3, what kind of problems are you having?

Gamingforce 07-20-2004 01:22 AM

I think he was wondering if it was compatible or not.

Yes, it's fully compatible with 3.03 since it doesn't rely on special vB 3 functions (well, maybe vbdate but that doesn't count :p)

rookie7 07-20-2004 04:38 AM

Quote:

Originally Posted by Gamingforce
I'll be issuing an update to this modification soon with many more features. :)

Stay tuned!

Any chance you can make the away message display on postbit as well?

Thanks

dookie 07-20-2004 06:39 AM

I love U for this hack. :)
I requested it long long ago - now it?s done. *install*

sv1cec 07-20-2004 08:20 AM

One thing I believe would be useful, is to show "User is away", next to the member's name in his posts, when that member is away. Those who view his posts, will know not to comment on his writings, until he is ... no longer away.

After a lot of "trials and errors", here is what I came up with:

In postbit template, find this :

HTML Code:

                                <if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
                               
                        </td>
                        <td width="100%">&nbsp;</td>

Replace the last line above, i.e. the line:

HTML Code:

                        <td width="100%">&nbsp;</td>
with

HTML Code:

<if condition="$post['awaystatus'] == 1">
<td width="100%"><CENTER>User $post[musername] is away at the moment.</td>
<else />
<td width="100%">&nbsp;</td>
</if>

The whole chunk of code there, should look like:

HTML Code:

<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
                               
                        </td>
<if condition="$post['awaystatus'] == 1">
<td width="100%"><CENTER>User $post[musername] is away at the moment.</td>
<else />
<td width="100%">&nbsp;</td>
</if>
                        <td valign="top" nowrap="nowrap">
                               
                                <div class="smallfont">
                                        <if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>

I hope it make sense, if not e-mail me, I am nowhere being as good in documenting things, as those people who offer us those lovely hacks.

If only I knew how to put the awaysincedate parameter there!!!

Rgds

John

Sadie Frost 07-21-2004 05:35 PM

Awesome - thanks for that mod as well John :)

sv1cec 07-21-2004 06:45 PM

Quote:

Originally Posted by Sadie Frost
Awesome - thanks for that mod as well John :)

Glad if I can be of (little) help. I like that hack so I took some time to tailor it to my needs.

I am not sure though, how the members will appreciate it.

Rgds

sv1cec 07-22-2004 10:36 AM

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

lifesourcerec 08-10-2004 07:18 AM

This code is only in profile once

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

You have it listed twice in the instructions

Pinkie 08-12-2004 06:03 PM

This I will try for sure
Great work

sully02 08-13-2004 09:16 PM

Quote:

Originally Posted by Pinkie
This I will try for sure
Great work

Gamingforce, any progress on adding this to the postbit?

sv1cec 08-14-2004 05:06 AM

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

turbidblue 08-14-2004 05:15 PM

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

sv1cec 08-14-2004 05:55 PM

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

Lionel 10-01-2004 01:13 PM

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.

sv1cec 10-01-2004 07:50 PM

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

Lionel 10-01-2004 09:57 PM

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.


All times are GMT. The time now is 05:59 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.01656 seconds
  • Memory Usage 1,903KB
  • 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_html_printable
  • (8)bbcode_php_printable
  • (12)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
  • (40)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