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

Reply
 
Thread Tools
Details »»

Version: , by bira bira is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 12-09-2001 Last Update: Never Installs: 109
 
No support by the author.

Hi,

This is something that is common in IRC - /me is away

In BBs, a user is either online or offline (or invisible).

But, on my Bulletin Board, the folks created such a community that every time someone goes on a holiday or goes offline for a while, he/she posts a new thread to annouce they're 'away.

So, I wrote a hack allowing a user to change his/her status to "away", including a return date and an away reason which will show up in their profile.

Likewise, the online/offline icon in postbit and buddy list will change to an away icon (a very faded version of the 'offline' one).

Some demo captures:

The Edit Profile screen, when a user is NOT away:



The Edit Profile screen when a user IS away:



The Get Info (User Profile) screen when a user IS away:



The Get Info (User Profile) screen when a user is NOT away:



The postbit icon when a user is away:




How to install:

Download the attached zip file. Upload away.gif to your images dir (or create your own away.gif).

Upload install_awayuser.php to your admin dir and follow the instructions.

Cheers,

Bira

newest version by sho here:
https://vborg.vbsupport.ru/showthrea...606#post287606

Show Your Support

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

Comments
  #22  
Old 12-10-2001, 08:04 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, here are a couple of add-ons:

1) Cancel 'Away' status when user posts:

Open newthread.php

Find:

Code:
          $DB_site->query("UPDATE user SET
          ".iif ($foruminfo[countposts],"posts=posts+1,","")."
          $dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");
Change to (changes hilighted):

Code:
          $DB_site->query("UPDATE user SET
          ".iif ($foruminfo[countposts],"posts=posts+1,","")."
          $dotitle"."lastpost='".time()."'[high],away=0,awaydate='',awayreason='',returndate=''[/high] WHERE userid='$bbuserinfo[userid]'");
Open newreply.php and find:

Code:
          		$DB_site->query("UPDATE user SET
          		".iif ($foruminfo[countposts],"posts=posts+1,","")."
          		$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");
Change to (changes hilighted):

Code:
          		$DB_site->query("UPDATE user SET
          		".iif ($foruminfo[countposts],"posts=posts+1,","")."
          		$dotitle"."lastpost='".time()."'[high],away=0,awaydate='',awayreason='',returndate=''[/high] WHERE userid='$bbuserinfo[userid]'");
Save both files and upload.

This change will automatically cancel a user's 'away' status once he/she posts a new thread or a new reply.


2) Send auto-reply to PMs while a user is a way.

This add-on will act like the "vacation" auto-reply most e-mail programs have.

When you send a PM to a user who is away, you will immediately receive a PM with "Auto Reply:" in the subject line.
The PM message body will say 'I'm away and will read your PM when I return', with the reason (if present) and the return date (if present).

If you want to add this, open private.php and find:

Code:
eval("standardredirect(\"".gettemplate("redirect_pmthanks")."\",\"private.php?s=$session[sessionhash]\");");
ABOVE it ADD:

PHP Code:
  // away auto-reply add-on
  
if ($touserinfo[away]=="1") {
      
      
$sincedate vbdate($dateformat$touserinfo[awaydate]);
    if (
$touserinfo[returndate]=="0000-00-00") {
        
$returndate "[i](date unknown)[/i]";
    } else {
          
$returnaway explode("-"$touserinfo[returndate]);
          
$returndate "on ".vbdate($dateformatmktime(0,0,0,$returnaway[1],$returnaway[2],$returnaway[0]));
      }
      if (!
$touserinfo[awayreason]) {
          
$awayreason "[i](No reason specified)[/i]";
      } else {
          
$awayreason "[i]($touserinfo[awayreason])[/i]";
      }
       
      
$autoreply "Hi $bbuserinfo[username],\n\n I have been away since $sincedate $awayreason and will read your message when I return $returndate.";

    
$autotitle "Auto Reply: ".addslashes(htmlspecialchars($title));

      
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,showsignature,iconid,messageread,folderid,receipt) VALUES (NULL,$bbuserinfo[userid],$bbuserinfo[userid],$touserinfo[userid],'".addslashes(htmlspecialchars($autotitle))."','".addslashes(htmlspecialchars($autoreply))."','".time()."',0,0,0,0,0)");
    if (
$bbuserinfo[emailonpm]) {
      eval(
"\$emailmsg = \"".gettemplate("email_pmautoreply",1,0)."\";");
      eval(
"\$emailsubject = \"".gettemplate("emailsubject_pmreceived",1,0)."\";");
      
mail($bbuserinfo[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
    }

  }
  
// away auto-reply add-on 
Save and upload.

create NEW template called email_pmautoreply and place in it:

Quote:
$bbuserinfo[username],

You have received a new private message at $bbtitle from $touserinfo[username]. Please click here to log in and read it:
$bburl/private.php

Thanks,
$bbtitle team
That's it

p.s.

Meta, I will add what you're asking for (Admin CP) tomorrow. I'm off to sleep now
Reply With Quote
  #23  
Old 12-10-2001, 08:19 PM
Bedhead Bedhead is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome!!!
Reply With Quote
  #24  
Old 12-10-2001, 08:49 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't have time to do this hack now, but I've saved it and have it queued... One question: Does the ZIP in the original post include the changes or additions from just above?
Reply With Quote
  #25  
Old 12-11-2001, 12:33 AM
Chi Chi is offline
 
Join Date: Dec 2001
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very very sweet.
Reply With Quote
  #26  
Old 12-11-2001, 01:22 AM
Hooper's Avatar
Hooper Hooper is offline
 
Join Date: Oct 2001
Location: St. Louis, Mo
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Question:

Will you be incorporating all of the addon code you posted into the script? If so, I will just wait for the final. Looks very impressive.

Thank You.
Reply With Quote
  #27  
Old 12-11-2001, 03:57 AM
SirSteve SirSteve is offline
 
Join Date: Oct 2001
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How about being able to set your own auto PM message.

Reply With Quote
  #28  
Old 12-11-2001, 04:58 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice addons, installed all except one (auto-setting away back to 0 when posting, because people often login to check posts out and sometimes post while they're still away).
Reply With Quote
  #29  
Old 12-11-2001, 06:31 AM
Crinos's Avatar
Crinos Crinos is offline
 
Join Date: Oct 2001
Location: Los Angeles, CA
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and working ... excellent work!

Just did some slight modifications to the getinfo template, but it works great.

This is the 3rd or 4th straight hack from bira I am using, and all of them are just grrrrrreat
Reply With Quote
  #30  
Old 12-11-2001, 07:28 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by Crinos
Just did some slight modifications to the getinfo template, but it works great.
Reply With Quote
  #31  
Old 12-11-2001, 07:43 AM
Nemesis77 Nemesis77 is offline
 
Join Date: Nov 2001
Location: canada
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great Hack thanks. I installed this with no probs at all except The Icon in the postbit area (away.gif) does not show when a user is away. I didn't see anything in the install instructions about adding anything to the postbit template.
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 02:57 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.07707 seconds
  • Memory Usage 2,333KB
  • 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
  • (5)bbcode_code
  • (1)bbcode_php
  • (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
  • (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