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
  #132  
Old 12-17-2001, 05:10 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by ptbyjason
Sure

In the usercp.php I can't find

*****
$sql="SELECT userid,username,invisible,lastactivity
*****

Right, thats this rule on 20:

$sql="SELECT DISTINCT session.lastactivity, user.userid,username,session.userid AS online,invisible,away

(i have added away on the end)
Reply With Quote
  #133  
Old 12-17-2001, 05:25 PM
ptbyjason's Avatar
ptbyjason ptbyjason is offline
 
Join Date: Dec 2001
Location: TX
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, now that was what I needed. Thank you so much Lesane. Now last question before I change this. Since I have changed the code I was looking for, do I put the code in that is says in the original install or do I need to alter it in anyway?
Reply With Quote
  #134  
Old 12-17-2001, 06:32 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here are the instructions for the usercp.php code.
Reply With Quote
  #135  
Old 12-17-2001, 07:25 PM
ptbyjason's Avatar
ptbyjason ptbyjason is offline
 
Join Date: Dec 2001
Location: TX
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The whole database goes down and I get the following error when I follow the instructions:

Parse error: parse error in /business/bclapp/html/vbulletin/admin/functions.php on line 2103

Fatal error: Call to undefined function: getuserinfo() in /business/bclapp/html/vbulletin/admin/sessions.php on line 327


This is the code I put in from the for functions.php

PHP Code:
// Leave Away Message in Profile (v1.0)
            
if ($post[away]=="1") {
                eval(
"\$onlinestatus = \"".gettemplate("postbit_away")."\";");
            } else {
                if (
$post[sessionuserid]>0) {
                    eval(
"\$onlinestatus = \"".gettemplate("postbit_online")."\";");
                } else {
                    eval(
"\$onlinestatus = \"".gettemplate("postbit_offline")."\";");
                }
            }
            
// Leave Away Message in Profile (v1.0) 

Lesane, I am so sorry that I haven't gotten this down yet. I haven't had any trouble installing anything until this one.




Adding this:


functions.php line 2103

$DB_site->query("DELETE FROM post WHERE postid IN ($postids"."0)");


Sessions.php is still original.
Reply With Quote
  #136  
Old 12-17-2001, 07:59 PM
ptbyjason's Avatar
ptbyjason ptbyjason is offline
 
Join Date: Dec 2001
Location: TX
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

D'oh figured it out. Sorry. Who would have thought placing a code after what it is suppose to replace in functions.php could cause the problem? jk

Thank you for your patience Lesane, I couldn't have done it without you.
Reply With Quote
  #137  
Old 12-18-2001, 09:05 AM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your welcome , so it works fine now?
Reply With Quote
  #138  
Old 12-18-2001, 12:19 PM
ptbyjason's Avatar
ptbyjason ptbyjason is offline
 
Join Date: Dec 2001
Location: TX
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works perfectly now Lesane. I couldn't be happier.
Reply With Quote
  #139  
Old 12-18-2001, 01:46 PM
Tarion's Avatar
Tarion Tarion is offline
 
Join Date: Nov 2001
Location: Germany
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Bira,

i have a little problem viewing my modifie_profile template, wenn i add an bithday, the day and the month of the birthday is also showing in the selectboxes of your hack, i tried to get it work but it doesn't.

here the template:
PHP Code:
<tr>
    <
td bgcolor="{tableheadbgcolor}" colspan="2"><normalfont color="{tableheadtextcolor}" class="thtcolor"><b>Abwesenheitsinformation</b></normalfont> <smallfont color="{tableheadtextcolor}" class=thtcolor>Benutze diese Option um anderen Mitglieder deine Abwesenheit zu signalisieren</smallfont></td>
</
tr>
<
tr>
    <
td bgcolor="{secondaltcolor}"><b><normalfont>Abwesenheits Status</normalfont></b><br><smallfont>$awaystatus</smallfont></td>
    <
td bgcolor="{secondaltcolor}"><normalfont><input type="radio" name="away" value="0" $away0checkedBin da &nbsp;&nbsp;&nbsp; <input type="radio" name="away" value="1" $away1checkedBin abwesend</normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="{firstaltcolor}"><b><normalfont>Abwesenheits Grund:</normalfont></b><br><smallfont>max200 Zeichen</smallfont></td>
    <
td bgcolor="{firstaltcolor}"><normalfont><input type="text" class="bginput" name="awayreason" value="$bbuserinfo[awayreason]size="30" maxlength="200"></normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="{secondaltcolor}"><b><normalfont>R?ckkehr Datum:</normalfont></b></td>
    <
td bgcolor="{secondaltcolor}">
        <
table border="0" cellspacing="0" cellpadding="2">
        <
tr>
        <
td><smallfont><select name="awayday">
            <
option value="">Tag</option>
            <
option value="1" $day01selected>1</option>
            <
option value="2" $day02selected>2</option>
            <
option value="3" $day03selected>3</option>
            <
option value="4" $day04selected>4</option>
            <
option value="5" $day05selected>5</option>
            <
option value="6" $day06selected>6</option>
            <
option value="7" $day07selected>7</option>
            <
option value="8" $day08selected>8</option>
            <
option value="9" $day09selected>9</option>
            <
option value="10" $day10selected>10</option>
            <
option value="11" $day11selected>11</option>
            <
option value="12" $day12selected>12</option>
            <
option value="13" $day13selected>13</option>
            <
option value="14" $day14selected>14</option>
            <
option value="15" $day15selected>15</option>
            <
option value="16" $day16selected>16</option>
            <
option value="17" $day17selected>17</option>
            <
option value="18" $day18selected>18</option>
            <
option value="19" $day19selected>19</option>
            <
option value="20" $day20selected>20</option>
            <
option value="21" $day21selected>21</option>
            <
option value="22" $day22selected>22</option>
            <
option value="23" $day23selected>23</option>
            <
option value="24" $day24selected>24</option>
            <
option value="25" $day25selected>25</option>
            <
option value="26" $day26selected>26</option>
            <
option value="27" $day27selected>27</option>
            <
option value="28" $day28selected>28</option>
            <
option value="29" $day29selected>29</option>
            <
option value="30" $day30selected>30</option>
            <
option value="31" $day31selected>31</option>
        </
select></smallfont></td>
        <
td>
<
td><smallfont><select name="awaymonth">
            <
option value="">Monat</option>
            <
option value="1" $month01selected>Januar</option>
            <
option value="2" $month02selected>Februar</option>
            <
option value="3" $month03selected>M?rz</option>
            <
option value="4" $month04selected>April</option>
            <
option value="5" $month05selected>Mai</option>
            <
option value="6" $month06selected>Juni</option>
            <
option value="7" $month07selected>Juli</option>
            <
option value="8" $month08selected>August</option>
            <
option value="9" $month09selected>September</option>
            <
option value="10" $month10selected>Oktober</option>
            <
option value="11" $month11selected>November</option>
            <
option value="12" $month12selected>Dezember</option>
        </
select></smallfont></td>
        <
td><smallfont><select name="awayyear">
            <
option value="">Jahr</option>
            <
option value="01" $year2001selected>2001</option>
            <
option value="02" $year2002selected>2002</option>
            <
option value="03" $year2003selected>2003</option>
            <
option value="04" $year2004selected>2004</option>
        </
select></smallfont></td>
        </
tr>
        </
table>
    </
td>
</
tr
and here the part of member.php i insert your code:

PHP Code:
  // Get referrals
  
if ($usereferrer) {
    if (
$backcolor=="#13486D") {
      
$backcolor="#1C5780";
      
$bgclass "alt2";
    } else {
      
$backcolor="#13486D";
      
$bgclass "alt1";
    }
    
$refcount $DB_site->query_first("SELECT count(*) AS count
                                       FROM user
                                       WHERE referrerid = '
$userinfo[userid]'");
    
$referrals $refcount[count];
    eval(
"\$referrals = \"".gettemplate("getinfo_referrals")."\";");
  }
// Leave Away Message in Profile (v1.2)
  
if ($userinfo[away]=="1") {
      
$sincedate vbdate($dateformat$userinfo[awaydate]);
    if (
$userinfo[returndate]=="0000-00-00") {
        
$returndate "Unbekannt";
    } else {
          
$returnaway explode("-"$userinfo[returndate]);
          
$returndate vbdate($dateformatmktime(0,0,0,$returnaway[1],$returnaway[2],$returnaway[0]));
      }
      eval(
"\$away .= \"".gettemplate("getinfo_away")."\";");
  } else {
      
$away "";
  }
// Leave Away Message in Profile (v1.2)



  // get extra profile fields 
THX Bira

Sorry but the template is in german, i hope you understand this so far
Reply With Quote
  #140  
Old 12-18-2001, 07:40 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tarion, yes, that was a mistake I made which FireFly commented about in the first page of this thread

You need to change all the $xxxxxselected> in the template to $xxxxxaway> (replace 'selected' with 'away').

Then, in member.php, find:

Code:
    $dayname = "day".$returndate[2]."selected";
    $$dayname = "selected";
    $monthname = "month".$returndate[1]."selected";
    $$monthname = "selected";
    $yearname = "year".$returndate[0]."selected";
    $$yearname = "selected";
And replace it with:

Code:
    $dayname = "day".$returndate[2]."[high]away[/high]";
    $$dayname = "selected";
    $monthname = "month".$returndate[1]."[high]away[/high]";
    $$monthname = "selected";
    $yearname = "year".$returndate[0]."[high]away[/high]";
    $$yearname = "selected";
Reply With Quote
  #141  
Old 12-19-2001, 09:02 AM
Remi Remi is offline
 
Join Date: Nov 2001
Location: London, UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by Remi
Hi Bira

It is me, again

what can I do, I love your hacks

Is this hack compatable with tha Random Password hack.

I noticed this in the /root/member.php

$bbuserinfo[usergroupid]'$changepw $awaysql WHERE userid='$bbuserinfo[userid]'

is that the right order

Thanks
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 11:01 PM.


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.12743 seconds
  • Memory Usage 2,404KB
  • 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
  • (2)bbcode_code
  • (3)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
  • (2)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