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
  #42  
Old 12-11-2001, 09:31 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by FireFly
Members could abuse and put offending messages as the away reason, so it's important to have the ability to change it.
Also bira while you're at it, censor the reason before it's saved.
Reply With Quote
  #43  
Old 12-11-2001, 09:37 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK,

I'm going to upload a new installer, which includes:

1) 'Away' auto-cancel when a user posts (optional)
2) Auto-reply to PMs while away (optional)
3) 'Away' details editable in the user's page in Admin CP

If you haven't installed the hack yet, then ignore this post and simply download the zip from the first post

If you already installed the hack, here's what you need to do to add the Admin CP bit:

Open admin/user.php

Find:

Code:
$user=$DB_site->query_first("SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,
Change to (changes marked in high):

Code:
$user=$DB_site->query_first("SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,[high]FROM_UNIXTIME(awaydate) AS awaydate,[/high]
Find:

Code:
makeinputcode("IP Address","aipaddress",$user[ipaddress]);
AFTER it ADD:

PHP Code:
// Leave Away Message in Profile (v1.0)
  
maketableheader("Away Status");
      
makeyesnocode("User is away?","away",$user[away]);
      
makeinputcode("Away since<br>(Format yyyy-mm-dd)","awaydate",$user[awaydate]);
      
makeinputcode("Return date<br>(Format yyyy-mm-dd)","returndate",$user[returndate]);
      
makeinputcode("Away reason","awayreason",$user[awayreason]);
// Leave Away Message in Profile (v1.0) 
Find:

Code:
  if ($posts=="") {
    $posts=0;
  }
BEFORE it ADD:

PHP Code:
// Leave Away Message in Profile (v1.0)
  
if ($awaydate!="") {
    
$awaydate="UNIX_TIMESTAMP('".addslashes($awaydate)."')";
  } else {
      
$awaydate="";
  }
// Leave Away Message in Profile (v1.0) 
Find:

Code:
$DB_site->query("UPDATE user SET birthday='$birthday'
Change to (changes marked in high):

Code:
$DB_site->query("UPDATE user SET [high]away=$away,awaydate=$awaydate,returndate='$returndate',awayreason='".addslashes(htmlspecialchars($awayreason))."',[/high]birthday='$birthday'
Save and upload.
Reply With Quote
  #44  
Old 12-11-2001, 09:44 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

JJR512 & Hooper: I uploaded a new zipfile to the 1st post. If you haven't installed the hack yet, then download the zipfile again (and make sure you don't get a cached version of the zip file -- the file should be called awayuser_v_12.zip when you are prompted to save it).
Reply With Quote
  #45  
Old 12-11-2001, 10:54 AM
Meta's Avatar
Meta Meta is offline
 
Join Date: Nov 2001
Location: Germany (north)
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works as expected. Wonderful. Thank you so much for your help!
Reply With Quote
  #46  
Old 12-11-2001, 11:14 AM
Bedhead Bedhead is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by bira
OK,

I'm going to upload a new installer, which includes:

1) 'Away' auto-cancel when a user posts (optional)
2) Auto-reply to PMs while away (optional)
3) 'Away' details editable in the user's page in Admin CP

If you haven't installed the hack yet, then ignore this post and simply download the zip from the first post

If you already installed the hack, here's what you need to do to add the Admin CP bit:

Open admin/user.php

Find:

Code:
$user=$DB_site->query_first("SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost
Change to (changes marked in high):

Code:
$user=$DB_site->query_first("SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost[high],FROM_UNIXTIME(awaydate) AS awaydate[/high]
Find:

Code:
makeinputcode("IP Address","aipaddress",$user[ipaddress]);
AFTER it ADD:

PHP Code:
// Leave Away Message in Profile (v1.0)
  
maketableheader("Away Status");
      
makeyesnocode("User is away?","away",$user[away]);
      
makeinputcode("Away since<br>(Format yyyy-mm-dd)","awaydate",$user[awaydate]);
      
makeinputcode("Return date<br>(Format yyyy-mm-dd)","returndate",$user[returndate]);
      
makeinputcode("Away reason","awayreason",$user[awayreason]);
// Leave Away Message in Profile (v1.0) 
Find:

Code:
  if ($posts=="") {
    $posts=0;
  }
BEFORE it ADD:

PHP Code:
// Leave Away Message in Profile (v1.0)
  
if ($awaydate!="") {
    
$awaydate="UNIX_TIMESTAMP('".addslashes($awaydate)."')";
  } else {
      
$awaydate="";
  }
// Leave Away Message in Profile (v1.0) 
Find:

Code:
$DB_site->query("UPDATE user SET birthday='$birthday'
Change to (changes marked in high):

Code:
$DB_site->query("UPDATE user SET [high]away=$away,awaydate=$awaydate,returndate='$returndate',awayreason='".addslashes(htmlspecialchars($awayreason))."',[/high]birthday='$birthday'
Save and upload.
Reply With Quote
  #47  
Old 12-11-2001, 11:16 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

e-mail me your user.php to goren@atlasf1.com and I'll take a look
Reply With Quote
  #48  
Old 12-11-2001, 11:20 AM
Bedhead Bedhead is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You got mail Buddy.

Everything is working great for me so far, exept for the user.php3
I am using 2.2.1
Thanks for taking the time.
Reply With Quote
  #49  
Old 12-11-2001, 11:30 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Beadhead, found your error.

Open your user.php3 and find:

Code:
  SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,FROM_UNIXTIME(awaydate) AS awaydate

                               avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
                               FROM user
                               LEFT JOIN avatar ON avatar.avatarid=user.avatarid
                               LEFT JOIN customavatar ON customavatar.userid=user.userid
                               WHERE user.userid=$userid");
This should be:

Code:
  $user=$DB_site->query_first("SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,FROM_UNIXTIME(awaydate) AS awaydate
                               avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
                               FROM user
                               LEFT JOIN avatar ON avatar.avatarid=user.avatarid
                               LEFT JOIN customavatar ON customavatar.userid=user.userid
                               WHERE user.userid=$userid");
Reply With Quote
  #50  
Old 12-11-2001, 11:44 AM
Bedhead Bedhead is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks,
I can now access the control panel but now I am getting the following:



There seems to have been a slight problem with the My Site database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

Database error in vBulletin Control Panel 2.2.1:

Invalid SQL: SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,FROM_UNIXTIME(awaydate) AS awaydate
avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
FROM user
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.userid=1
mysql error: You have an error in your SQL syntax near 'avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
' at line 2

mysql error number: 1064

Date: Tuesday 11th of December 2001 06:41:12 AM
Script: http://www.mysite.com/forum
Referer: http://www.mysite.com/forum/admin/index.php3
Reply With Quote
  #51  
Old 12-11-2001, 11:48 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry, try adding a coma , after "FROM_UNIXTIME(awaydate) AS awaydate"
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:26 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.07522 seconds
  • Memory Usage 2,341KB
  • 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
  • (14)bbcode_code
  • (4)bbcode_php
  • (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