vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Away message for users (https://vborg.vbsupport.ru/showthread.php?t=33099)

Admin 12-10-2001 03:26 PM

[QUOTE]Originally posted by bira
Yeah, I've actually been using it for my last 3 or 4 hacks. It's very good.

(Regarding that - I got a small surprise coming. But let me finish it first ;))

Lesane 12-10-2001 03:32 PM

I receive a parse error in admin/functions.php

Bira, you say in the install:
Step 1 of 1 FIND:


PHP Code:

if ($post['lastactivity'] > $datecut and !$post['invisible'] and $post['lastvisit'] != $post['lastactivity']) {
            eval(
"\$onlinestatus = \"".gettemplate("postbit_online")."\";");
        } else {
            eval(
"\$onlinestatus = \"".gettemplate("postbit_offline")."\";");
        } 

well, i'm using 2.03 and 2.0.3 dont have that part in functions.php so i'm looking for a similar code and i found this in my functions.php:

PHP Code:

if ($post[userid]!=0) {
        if (
$showonline) {
            unset(
$onlinestatus);
            if (
$post[sessionuserid]>0) {
                eval(
"\$onlinestatus = \"".gettemplate("postbit_online")."\";");
            } else {
                eval(
"\$onlinestatus = \"".gettemplate("postbit_offline")."\";");
            }
        }
        if (
$post[avatarid]!=0) {
            
$avatarurl=$post[avatarpath];
        } else {
            if (
$post[hascustomavatar] and $avatarenabled) {
                
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
            } else {
                
$avatarurl="";
            }
        }
        if (
$avatarurl=="" or ($bbuserinfo[userid]>and !($bbuserinfo[showavatars]))) {
            
$post[avatar]="";
        } else {
            eval(
"\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
        }
        if (
$post[customtitle]==2) {
            
$post[usertitle] = htmlspecialchars($post[usertitle]);
        } 

I changed the above code to:

PHP Code:

if ($post[away]=="1") {
            eval(
"\$onlinestatus = \"".gettemplate("postbit_away")."\";");
        } else {
    if (
$post[userid]!=0) {
        if (
$showonline) {
            unset(
$onlinestatus);
            if (
$post[sessionuserid]>0) {
                eval(
"\$onlinestatus = \"".gettemplate("postbit_online")."\";");
            } else {
                eval(
"\$onlinestatus = \"".gettemplate("postbit_offline")."\";");
            }
        }
        }
        if (
$post[avatarid]!=0) {
            
$avatarurl=$post[avatarpath];
        } else {
            if (
$post[hascustomavatar] and $avatarenabled) {
                
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
            } else {
                
$avatarurl="";
            }
        }
        if (
$avatarurl=="" or ($bbuserinfo[userid]>and !($bbuserinfo[showavatars]))) {
            
$post[avatar]="";
        } else {
            eval(
"\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
        }
        if (
$post[customtitle]==2) {
            
$post[usertitle] = htmlspecialchars($post[usertitle]);
        } 

but then i receive a parse error :(.


Hope u can help me out with this.

bira 12-10-2001 03:43 PM

Lesane,

Revert back the code to what it was originally.

After that, find:

PHP Code:

if ($post[sessionuserid]>0) {
    eval(
"\$onlinestatus = \"".gettemplate("postbit_online")."\";");
} else {
     eval(
"\$onlinestatus = \"".gettemplate("postbit_offline")."\";");


And replace it with:

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) 


Meta 12-10-2001 06:21 PM

Thank you for this very lovely hack, Bira!

Installed ... and works smooth without any problems ... a nice to have.

Lesane 12-10-2001 06:30 PM

Thanks Bira, it works perfect now.

Meta 12-10-2001 06:35 PM

But ...

if you User don't gives a Return Date it says he will come back on 1. Januar 1970.

Is there a way to change that to something like "not quite sure" or something like that?

(And ... do somebody know where my hackcount has gone? I had five or six of them installed ... at least this one. And now it says none. Quite strange.)

bira 12-10-2001 06:45 PM

[QUOTE]Originally posted by Meta
But ...


if you User don't gives a Return Date it says he will come back on 1. Januar 1970.

Is there a way to change that to something like "not quite sure" or something like that?

Meta 12-10-2001 07:02 PM

Quote:

Yeah, you have a point.
It was a pleasure for me.

Quote:

The "hack:" under your username in posts is the number of hacks you released, not installed
Oh ... what a shame.

(Look ... thats because i'm a junior member and a newbie with only 10 Posts at all and ... oh, what a shame.)


Anyway ... thanks for your fast reply. I think, this will work. If not ... i'll be back.

Meta 12-10-2001 07:15 PM

Works like it should. Great! But ...

Now it would be nice, if the Admin could do this also for an user. The admin can enter a birthday for users ... why not the longer absence ...?

Would be nice.

Crinos 12-10-2001 07:24 PM

Hey bira, nice hack once again ...

but before I install it, I was wondering if this one had a pop-up or some sort of notification to remind a user who has been "away" if he or she wants to update their away info after they return ... I know that some users, once they set an away message and then come back a little early, will sometimes forget to to update their away status ... hence they will already be posting yet still be considered "away" until the date is reached.

Maybe, even automatically disable the away setting once the user posts a message before the date he stated he was gonne be back...

I dunno, just a suggestion ... I'll install the hack anyway ;)


All times are GMT. The time now is 09:25 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.01488 seconds
  • Memory Usage 1,782KB
  • 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
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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