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)

Dan 10-01-2004 10:09 PM

nice hack :) very useful! thanks for sharing it with us all ;)

Lionel 10-01-2004 11:06 PM

About letting the PM go and then display the message?

Lionel 10-02-2004 01:56 AM

I tried the below with
$sendto["$username"] = true;
$tostring["$user[userid]"] = $user['username'];
before and after the actual error message
or without it at all, like your code

I get no error messages and all PM went thru.

else if ($user['awaystatus'] == 1)
{
$awaysincedate = vbdate($vboptions['dateformat'], $user['awaysince']);
if ($user['awaymessage'] == "")
{
$awaymsg = "not given";
}
else
{
$awaymsg = $user['awaymessage'];
}
$sendto["$username"] = true;
$tostring["$user[userid]"] = $user['username'];
eval('$pmuseraway[] = "' . fetch_phrase('userawaynopm', PHRASETYPEID_ERROR) . '";');

}

sv1cec 10-02-2004 10:28 AM

OK, try this if you can. Use the original private.php file and find:

PHP Code:

        foreach ($checkedusers AS $username => $user)
        {
            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) . '";');
            } 

Then find:

PHP Code:

            $url "private.php?$session[sessionurl]";
            eval(
print_standard_redirect('pm_messagesent')); 

and replace it with :

PHP Code:

        if (!empty($pmuseraway))
        {
            
define('PMPREVIEW'1);
            
$preview construct_errors($pmuseraway); // this will take the preview's place
            
$_REQUEST['do'] = 'newpm';
        }
        else
        {
            
$url "private.php?$session[sessionurl]";
            eval(
print_standard_redirect('pm_messagesent'));
        } 

Let me know if it works.
----------
John

sv1cec 10-02-2004 10:38 AM

Quote:

Originally Posted by Lionel
Thanks. But rather than prevent the PM from being sent, I'd rather the autoresponder option, so no PM get lost or prevented.

I would like that too, but I just do not have the time to code this functionality. It's more involved, since it requires you to scan the recipients for those who are away, and then create a PM back to the sender. This requires the same checks as the ones performed when the original PM is send, and you have to change the recipient with the sender.

Sorry, not enough time here for that. I admit though, if someone can come up with it, I'll use it too.

Rgds
----------
John

sv1cec 10-02-2004 02:23 PM

Quote:

Originally Posted by Lionel
Thanks. But rather than prevent the PM from being sent, I'd rather the autoresponder option, so no PM get lost or prevented.

Would you mind if instead of a PM, you get an e-mail when the user you PMed is away?

If not, here is the code you can use. In your private.php, find:

PHP Code:

        }

        
// process errors if there are any
        
if (!empty($errors))
        { 

Replace that with:

PHP Code:

            if ($user['awaystatus'] ==1)
            {
                
mail ($bbuserinfo[email],"One of your PMs was send to a user who is away","The PM you send to $username was not delivered, because this user is currently away.","From: \"$vboptions[bbtitle] Mailer\" <$vboptions[webmasteremail]>");
            }
        }

        
// process errors if there are any
        
if (!empty($errors))
                { 

You may customize the above, to use a template for the e-mail send. If you want help on this, please let me know.

I hope this helps.

Rgds
--------------
John

Lionel 10-03-2004 07:15 AM

Quote:

Originally Posted by sv1cec
OK, try this if you can. Use the original private.php file and find:

PHP Code:

        foreach ($checkedusers AS $username => $user)
        {
            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) . '";');
            } 

Then find:

PHP Code:

            $url "private.php?$session[sessionurl]";
            eval(
print_standard_redirect('pm_messagesent')); 

and replace it with :

PHP Code:

        if (!empty($pmuseraway))
        {
            
define('PMPREVIEW'1);
            
$preview construct_errors($pmuseraway); // this will take the preview's place
            
$_REQUEST['do'] = 'newpm';
        }
        else
        {
            
$url "private.php?$session[sessionurl]";
            eval(
print_standard_redirect('pm_messagesent'));
        } 

Let me know if it works.
----------
John

That displayed the error message about being away in the preview when trying to send message.

sv1cec 10-03-2004 01:35 PM

Quote:

Originally Posted by Lionel
That displayed the error message about being away in the preview when trying to send message.

You mean the error message comes up when you hit "Preview"?? It doesn't work like that in my case. Preview works as it is supposed to, then when you click "Submit" the error appears, which is what it should do.

Lionel 10-03-2004 01:56 PM

Quote:

Originally Posted by sv1cec
You mean the error message comes up when you hit "Preview"?? It doesn't work like that in my case. Preview works as it is supposed to, then when you click "Submit" the error appears, which is what it should do.

I meant it works as intended. It displays the useraway message pm not sent in the preview screen that appears when trying to submit.

sv1cec 10-03-2004 03:08 PM

Quote:

Originally Posted by Lionel
I meant it works as intended. It displays the useraway message pm not sent in the preview screen that appears when trying to submit.

Well, the preview screen does not come up with any error message in my system. But after you do the preview, if you hit "Submit", then it shows the error. Same thing it does if you do not preview, and hit "Submit" from the editor screen.

Just to let you know though, I stopped using this mod. I replaced it in my forums with the e-mail warning one. I think it is better that way, your PM goes to the recipient, even if he is away, and you get back an e-mail saying that the recipient is away and he will get your message when he returns.

A PM would be a more elegant solution, but I do not want to get involved with all the checks necessary to send a PM. The e-mail is sent by the admin account, so users will get it one way or another.

Rgds

Lionel 10-03-2004 03:27 PM

Quote:

Originally Posted by sv1cec

Just to let you know though, I stopped using this mod. I replaced it in my forums with the e-mail warning one. I think it is better that way, your PM goes to the recipient, even if he is away, and you get back an e-mail saying that the recipient is away and he will get your message when he returns.

I agree with you. I am going to use the email solution. Many thanks for your help.

Lionel 10-03-2004 03:58 PM

I customized it and it is perfect. Since I integrated hivemail and vbulletin, users get instant visual of new emails, so it is like a PM in navbar for email. You might want to change your message as user away does get PM.

if ($user['awaystatus'] ==1)
{
$awaysincedate = vbdate($vboptions['dateformat'], $user['awaysince']);
if ($user['awaymessage'] == "")
{
$awaymsg = "(reason not given)";
}
else
{
$awaymsg = $user['awaymessage'];
}
{
mail ($bbuserinfo[email],"$username cannot read your private message.","The PM you sent to $username was

delivered, however this user is currently away since $awaysincedate. Reason: $awaymsg","From: \"$vboptions[bbtitle]

Mailer\" <$vboptions[webmasteremail]>");
}
}

sv1cec 10-03-2004 04:19 PM

Quote:

Originally Posted by Lionel
I customized it and it is perfect. Since I integrated hivemail and vbulletin, users get instant visual of new emails, so it is like a PM in navbar for email. You might want to change your message as user away does get PM.

if ($user['awaystatus'] ==1)
{
$awaysincedate = vbdate($vboptions['dateformat'], $user['awaysince']);
if ($user['awaymessage'] == "")
{
$awaymsg = "(reason not given)";
}
else
{
$awaymsg = $user['awaymessage'];
}
{
mail ($bbuserinfo[email],"$username cannot read your private message.","The PM you sent to $username was

delivered, however this user is currently away since $awaysincedate. Reason: $awaymsg","From: \"$vboptions[bbtitle]

Mailer\" <$vboptions[webmasteremail]>");
}
}

Well, I have already changed that, so that it uses a template for the text of the e-mail send to the sender and I corrected it.

One question, what is "hivemail"?? Sounds interesting.

John

Lionel 10-03-2004 04:26 PM

<a href="http://www.hivemail.com" target="_blank">http://www.hivemail.com</a>

that was created by Chen who used to be a top developper at vbulletin. The integration is really excellent. You get all your emails (a subject link) in your CP, and with a small hack over there you can incorporate in navbar next to pm messages.

Members automatically have an email @yoursite if they want. Could be username or alias (you define).

sv1cec 10-04-2004 03:56 AM

Quote:

Originally Posted by Lionel
http://www.hivemail.com

that was created by Chen who used to be a top developper at vbulletin. The integration is really excellent. You get all your emails (a subject link) in your CP, and with a small hack over there you can incorporate in navbar next to pm messages.

Members automatically have an email @yoursite if they want. Could be username or alias (you define).

Lionel,

Thanks for the tips. I did a Google search yesterday and find it. I wish I could (a) afford it, (b) convince my hosting people to install it on my server. It would be great, but I know I can't afford it at the moment and I am not sure they will agree on setting it up. My sites are hosted for free by some helpful people, so I can't take advantage of their good will.

Rgds

Scerina 11-19-2004 03:01 AM

Is it possible for someone to install this hack for me please? If you can do so, please contact me via email at: Pandora@Sweet-November.Net

Thanx in advance!

JohnBee 11-24-2004 04:04 PM

I get this error when I run the query

ALTER TABLE `user` ADD `awaystatus` INT( 1 ) UNSIGNED DEFAULT '0' NOT NULL ,

MySQL said:

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

any ideas

jugo 12-03-2004 02:45 PM

Quote:

Originally Posted by Gamingforce
Screenshots Attached.

Awesome Hack...Thanks.

BTW...That girls is beautiful.

TwinsForMe 12-07-2004 10:28 PM

[high]* TwinForMe clicks install
[/high]

I added the postbit code by sv1cec except I use postbit legacy. I had to change his code a bit.

Find:
Code:

                                $post[musername]
                                </if>
                        </div>
                       
                        <if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
                        <if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>

Below add this:
Code:

<!-- Code change for user being away -->
<if condition="$post['awaystatus'] == 1">
&nbsp;
<div class="smallfont"><FONT COLOR="red">$post[musername] is away.</FONT><BR>
<if condition="$post['awaymessage'] != ''">
Reason: $post[awaymessage]<BR>
<else />
No reason was given.<BR>
</if>

</div>
<else />
&nbsp;
</if>
<!-- end of code for user being away -->


Bison 12-30-2004 09:43 PM

It would be nice to see all of this in a text file ...

pagekeeper 12-31-2004 02:53 PM

just curious havent you repeated the following twice ?

HTML Code:

==========================================================
[FIND]-->
                homepage = '" . addslashes(htmlspecialchars_uni($homepage)) . "',

[REPLACE WITH]-->
                homepage = '" . addslashes(htmlspecialchars_uni($homepage)) . "',
                awaystatus = $xawaystatus,
                awaymessage = '" . addslashes(htmlspecialchars_uni($xawaymessage)) . "',
                awaysince = $xawaydate,
==========================================================


docvader 12-31-2004 09:01 PM

OK, this is bizarre. Wonder if anyone can help.
Installed without a problem. HOWEVER, if you are logged in, you cannot go and view your own member profile. (You can see other's without difficulty, and, they can see you. But you get a blank white page when you go to member's list and try to view yourself).

Any ideas????

rich

Crank 01-05-2005 03:34 PM

Quote:

Originally Posted by Bison
It would be nice to see all of this in a text file ...

ya any chance of an updated version coming i would love to install this.

docvader 01-05-2005 04:39 PM

Quote:

Originally Posted by Crank
ya any chance of an updated version coming i would love to install this.

OK, problem was a mis installation of the VBChat, that wiped out my member profile thing, not this hack. This hack works great. Sorry for the confusion.

pagekeeper 01-30-2005 02:43 AM

im trying to add this on vb 3.0.6 i had it before i upgraded so i reinstalled it, but when i test it, the away fields dont save ..... do you know whats causing it ?

wb-legends 02-16-2005 03:33 AM

Alrighty...I followed all the instructions (and then went back and added in the second homepage = '" . addslashes(htmlspecialchars_uni($homepage)) . "', that's in there a second time as well as change my " $show['extrainfo'] = true;" thing with the different combos since it shows up twice in my file..and its still not showing up. Can anyone tell me what might be the problem?

lefthome 03-09-2005 11:04 AM

I would like to install this hack. Currently I am using vb 3.06 and will upgrade to vb3.07 this weekend. Does this hack work in vb3.07?

lefthome 03-16-2005 10:37 PM

I?d really like to install this hack but I guess I?m missing something and haven?t been able to figure this out yet. I execute the query as instructed:



ALTER TABLE `user` ADD `awaystatus` INT( 1 ) UNSIGNED DEFAULT '0' NOT NULL ,

ADD `awaymessage` VARCHAR( 200 ) NOT NULL ,

ADD `awaysince` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL



But I keep getting the same message:



An error occurred while attempting to execute your query. The following information was returned.
error number: 1146
error desc: Table 'forum.user' doesn't exist




Okay, so somebody told me that is because the file does not exist and I have to added the location just before user like; forum_user. Tried that and no luck so I search for the user.php file, which I assume is the right file and I have two. One in admin and one in admincp. I tried the query adding both and different error but still an error.



I don?t want to keep asking these silly questions so there has to be someplace I can learn about running a query in vb3.07. Can somebody assist me please?

Marco van Herwaarden 03-17-2005 03:20 AM

[sql]ALTER TABLE `user` ADD `awaystatus` INT( 1 ) UNSIGNED DEFAULT '0' NOT NULL ,

ADD `awaymessage` VARCHAR( 200 ) NOT NULL ,

ADD `awaysince` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL
[/sql]
You are not editing files, but a table in your database. You are probably using a table prefix, thus the table named 'user' will be named something like 'prefix_user'.

To find your table prefix look in the bottom of your includes/config.php file.

For more information on how to run a query, click the link "How to run a query" above the sql-statement in my post.

lefthome 03-17-2005 01:07 PM

thank you for the help MarcoH64 and I will do as you suggest. By the way, the link is good, but the information is out of date when following those instructions and maybe they need updating from years back since the site linked is no longer what is described in the instructions and for someone like me, who hasn't a clue about this information it is rather confusing.

Marco van Herwaarden 03-17-2005 04:10 PM

Hmm to tell you the truth, i never even looked at the link myself :(

I will have a look and maybe see if i can post something better.

Starsurfer 04-02-2005 08:39 PM

You say EDIT TEMPLATE MODIFY PROFILE and then soem
================================================== ======
[FIND]-->
$customfields[required]

</div>
</div>
</td>
</tr>
</table>

<br />

[BELOW ADD]-->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead">Current Away Information</td>
</tr>
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div style="width:$stylevar[formwidth_usercp]" align="$stylevar[left]">
<fieldset class="fieldset">
<legend>Away Status</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
<tr>
<td>Check the box below to set yourself on away. Posting when you are away will take you off away mode automatically.</td>
</tr>
<tr>
<td><input type="checkbox" name="awaystatus" value="1" <if condition="$bbuserinfo[awaystatus] == 1">checked</if>>I am currently away.$awaysincedisplay</td>
</tr>
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Away Message</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
<tr>
<td colspan="2">Enter an away message that will be visible in your profile.</td>
</tr>
<tr>
<td><input type="text" class="bginput" name="awaymessage" id="tb_awaymessage" value="$bbuserinfo[awaymessage]" size="50" maxlength="200" /></td>
</tr>
</table>
</fieldset>
</div>
</div>
</td>
</tr>
</table><br />

then you say

[EDIT TEMPLATE MEMBERINFO]

then more how do you edit these templates?

womensden 04-03-2005 01:52 AM

Go into your Admin Control Panel --> Styles and Templates (on the left) --> Style Manager-->

Click on the button to the right that looks like this --- [<< >>].

The templates will be shown on that page. Find the template you want to edit and open it --> then edit.

womensden 04-03-2005 03:07 AM

How about adding something in the postbit to show when a user is away? For instance a small image or something? Maybe near the "online" light?

--I really like how it takes the away message when a post is made by the "away" user.

Starsurfer 04-03-2005 11:09 AM

Its on the first post but where do you implement it?

Sir_Yaro 06-16-2005 09:46 AM

Click install :)

btw. change content of "userawaynopm" phrase to:
Code:

<u><b>Attention : </b></u> Your PM cannot be send to its intended recipients.<br>User <b>$user[username]</b> is away since the $awaysincedate.<br>
User leave message - <b>$user[awaymessage]</b><br>
Expected return date was $awayuntilmsg.<br>Your PM was not delivered to  <b>$user[username]</b>.

it looks better :)

between worlds 06-24-2005 09:41 PM

Works perfectly! Thank you!

SHANE-D-PAIN 07-04-2005 02:37 PM

Love this, took less than 5 mins, hope my users dont use it as much as i will though!!! :)

RGSMDNR 07-05-2005 02:31 AM

hmm.. nothing is showing up when i set this..
[ OD is away since - ]
Reason:

thats all it says?

SHANE-D-PAIN 07-05-2005 08:27 PM

Have you ran the SQL Query at the top of vb3 userawaymessages install.txt, that should add the phrases, if so then check through all the file edits, works fine for me!


All times are GMT. The time now is 11:38 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.01602 seconds
  • Memory Usage 1,899KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (10)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