View Full Version : User Away Messages
Gamingforce
07-15-2004, 10:00 PM
[ Feature Description ]
This hack allows users to easily set themselves as away via the Edit Profile page. An optional away message can be added along with the away status. Away messages are viewable at the top of the user profile (by the avatar/user picture). If a post is made when a user is in away mode, the user is automatically set off away mode.
[ Hack Concept ]
Credits to bira for making the original away message hack for vBulletin 2. This is a complete remake however.
[ Future Plans ]
Show away status in postbit. (If you want, you can add this right now by using an xhtml conditional ($bbuserinfo[awaystatus] == 1)).
[ Example ]
http://www.gamingforce.com/forums/member.php?u=852
Enjoy! :)
Gamingforce
07-16-2004, 06:41 PM
Screenshots Attached.
turbidblue
07-16-2004, 07:03 PM
i have a question..
in your instrictions you say:
[FIND]-->
fetch_profilefields(0);
[REPLACE WITH]-->
fetch_profilefields(0);
// Get Since Away Info
if ($bbuserinfo[awaystatus] == 1) {
$awaysincedate = vbdate($vboptions['dateformat'], $bbuserinfo['awaysince']);
$awaysincetime = vbdate($vboptions['timeformat'], $bbuserinfo['awaysince']);
$awaysincedisplay = " <b>(Since $awaysincedate - $awaysincetime)</b>";
} else {
$awaysincedisplay = '';
}
================================================== ========
[FIND]-->
fetch_profilefields(0);
[REPLACE WITH]-->
homepage = '" . addslashes(htmlspecialchars_uni($homepage)) . "',
awaystatus = $xawaystatus,
awaymessage = '" . addslashes(htmlspecialchars_uni($xawaymessage)) . "',
awaysince = $xawaydate,
I dont have a second one of the one in yellow. the only other fetch_profilefields i can find is:
fetch_profilefields(1);
but when replacing that i get an error on my "edit profile" pages
???
Gamingforce
07-16-2004, 07:26 PM
Sorry about that. Please re-download the file for updated instructions.
nexialys
07-16-2004, 07:34 PM
this hack is cool... btw, would be cool to have a popup to fill, or a dropin in the navbar so we fill it the same way we use the search block...
(did i say cool!)
turbidblue
07-16-2004, 10:02 PM
awesome! worked like a charm!!
thanks so much!
* turbidblue clicks install ;)
Koutaru
07-17-2004, 03:20 AM
Excellent hack, my users were requesting this one a couple days ago ^^
turbidblue
07-17-2004, 03:29 AM
i have a question.
how do i get it to show in postbit? i am still sorta a newbie when it comes to all this :)
thanks :)
MrNase
07-17-2004, 05:20 AM
wow!!! Getting to work my second vBulletin today and that is one of the hacks i'll definatly gonna install :)
ChuanSE
07-17-2004, 05:32 AM
* ChuanSE just wanted to state that the nice girl in the screenshot profile is really really really good looking :o Hi to you if you are Gamingforce on this board :D
Boofo
07-17-2004, 08:35 AM
Will this also add away unilt a certain date so we might know how long they will be gone? And maybe have it automatically set them back on that day and time if they choose that option? Or can it be done? ;)
Gamingforce
07-17-2004, 12:37 PM
Will this also add away unilt a certain date so we might know how long they will be gone? And maybe have it automatically set them back on that day and time if they choose that option? Or can it be done? ;)
This can easily be done using cron but I figured the auto-back when replying to a thread made things easier. I can look into it for a future version though.
Erwin
07-17-2004, 01:34 PM
Cool hack... will add when I find time. :)
ChuanSE
07-18-2004, 02:19 AM
Will this also add away unilt a certain date so we might know how long they will be gone? And maybe have it automatically set them back on that day and time if they choose that option? Or can it be done? ;)
Heya Boofo Amigo ;)
You have a point there allright, but for now...
* ChuanSE clicks install
nexialys
07-18-2004, 10:46 AM
this mod, added to LastSeenOnline is mostly complete... just need to add a WillBeBack at x date... but franckly, i don't see the use... just add the date in your away message, that's all...
but, a cool feature would be to have s select button for the away user...: deactivate PMs when away ... so if you go outside for a long period, users PMing you will have your away message in the face instead of the PM system ... kinda: don't PM me, i'm not here and don't want to be bothered...
obsidian
07-18-2004, 02:46 PM
I had users asking for something similiar for the PM system. Something like an email away message where if you sent them a PM it would reply back saying they were out untill XXXXX. Probably alot of work but it would seem logical to integrate that with something like this.
Zelda-King
07-18-2004, 11:05 PM
* ChuanSE just wanted to state that the nice girl in the screenshot profile is really really really good looking :o Hi to you if you are Gamingforce on this board :DJust so you know: that really really really good looking, nice girl has been shown your message. :cool:
House_of_Crazed
07-19-2004, 07:07 AM
While I appreciate your work,
mind taking a look at the section for profile.php. Steps 3 / 5 is identical.
So, I'm sure that we're missing something, *laughs*
HoC
teksigns
07-19-2004, 04:41 PM
i know i can add a
conditional ($bbuserinfo[awaystatus] == 1)
to the postbit to show that a user is away .
but i cant seem to get the away since date and the away message
to appear in the postbit .....
any ideas?
Gamingforce
07-19-2004, 09:59 PM
I'll be issuing an update to this modification soon with many more features. :)
Stay tuned!
flstreetscene
07-19-2004, 11:10 PM
Great will the update be compatible with 3.0.3. Just curious because so many major additions (vbgarage, vbarcade) aren't. :(
turbidblue
07-19-2004, 11:21 PM
I'll be issuing an update to this modification soon with many more features. :)
Stay tuned!
awesome! cant wait!! :)
Suggestion:
dropdown menu, with different away messages on forumhome for easy access.
Oldfart
07-20-2004, 01:21 AM
Great will the update be compatible with 3.0.3. Just curious because so many major additions (vbgarage, vbarcade) aren't. :(
VbArcade works fine with 3.0.3, what kind of problems are you having?
Gamingforce
07-20-2004, 01:22 AM
I think he was wondering if it was compatible or not.
Yes, it's fully compatible with 3.03 since it doesn't rely on special vB 3 functions (well, maybe vbdate but that doesn't count :p)
rookie7
07-20-2004, 04:38 AM
I'll be issuing an update to this modification soon with many more features. :)
Stay tuned!
Any chance you can make the away message display on postbit as well?
Thanks
dookie
07-20-2004, 06:39 AM
I love U for this hack. :)
I requested it long long ago - now it?s done. *install*
sv1cec
07-20-2004, 08:20 AM
One thing I believe would be useful, is to show "User is away", next to the member's name in his posts, when that member is away. Those who view his posts, will know not to comment on his writings, until he is ... no longer away.
After a lot of "trials and errors", here is what I came up with:
In postbit template, find this :
<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
</td>
<td width="100%"> </td>
Replace the last line above, i.e. the line:
<td width="100%"> </td>
with
<if condition="$post['awaystatus'] == 1">
<td width="100%"><CENTER>User $post[musername] is away at the moment.</td>
<else />
<td width="100%"> </td>
</if>
The whole chunk of code there, should look like:
<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
</td>
<if condition="$post['awaystatus'] == 1">
<td width="100%"><CENTER>User $post[musername] is away at the moment.</td>
<else />
<td width="100%"> </td>
</if>
<td valign="top" nowrap="nowrap">
<div class="smallfont">
<if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
I hope it make sense, if not e-mail me, I am nowhere being as good in documenting things, as those people who offer us those lovely hacks.
If only I knew how to put the awaysincedate parameter there!!!
Rgds
John
Sadie Frost
07-21-2004, 05:35 PM
Awesome - thanks for that mod as well John :)
sv1cec
07-21-2004, 06:45 PM
Awesome - thanks for that mod as well John :)
Glad if I can be of (little) help. I like that hack so I took some time to tailor it to my needs.
I am not sure though, how the members will appreciate it.
Rgds
sv1cec
07-22-2004, 10:36 AM
One thing I would like to see in this hack, is the "Be back Date". I agree with the developer that we do not need to have it cleared automatically, the idea of clearing this up with the first post is brilliant, however, I would like to see the return date there.
I tried to do it, but I am not good with php and I do not know how to handle a date field in the scripts etc., so I can't help much.
The idea of automatically stopping PM receives when one is away, is also very cool, I wish we could extend it to e-mail notifications as well, but I do not think this can be done.
Rgds
lifesourcerec
08-10-2004, 07:18 AM
This code is only in profile once
"homepage = '" . addslashes(htmlspecialchars_uni($homepage)) . "',"
You have it listed twice in the instructions
Pinkie
08-12-2004, 06:03 PM
This I will try for sure
Great work
sully02
08-13-2004, 09:16 PM
This I will try for sure
Great work
Gamingforce, any progress on adding this to the postbit?
sv1cec
08-14-2004, 05:06 AM
Gamingforce, any progress on adding this to the postbit?
I've managed to add it in my postbits, to see what I've done, please check the following:
http://forum.m1911.org/showthread.php?t=623
If you like what you see, I can provide you with my files, but the changes I've made to the original hack, are significant, and I haven't kept exact records in the form of "find this, replace it with", so you will need to do some work yourself.
However, in order to have the original "User is away" message, here is some code which goes in the postbit template (and postbitlegacy).
<!-- Code change for user being away -->
<if condition="$post['awaystatus'] == 1">
<td width="100%"><CENTER><div class="smallfont"><FONT COLOR="red">User $post[musername] is away at the moment.</FONT><BR>
<if condition="$post['awaymessage'] != ''">
Reason: $post[awaymessage]<BR>
<else />
No reason was given.<BR>
</if>
</div></CENTER></td>
<else />
<td width="100%"> </td>
</if>
<!-- end of code for user being away -->
This piece of code, goes right below the part shown below:
<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
</td>
Let me know if I can be of more help.
Rgds
turbidblue
08-14-2004, 05:15 PM
thank you! i was mostly just looking for the way to get the reason in the postbit, and your code worked flawlessly ;)
i dont really care about having the return date on my forums :)
xoxo
sv1cec
08-14-2004, 05:55 PM
thank you! i was mostly just looking for the way to get the reason in the postbit, and your code worked flawlessly ;)
i dont really care about having the return date on my forums :)
xoxo
Glad if I can be of help.
The return date is a bit more involved, it includes altering tables etc. I finally managed it, but I would be hard pressed to describe every necessary step.
Rgds
Lionel
10-01-2004, 01:13 PM
That would be nice to add a query to check user status when someone is sending PM. If away, bounce an away message back to sender.
sv1cec
10-01-2004, 07:50 PM
That would be nice to add a query to check user status when someone is sending PM. If away, bounce an away message back to sender.
This can be done, but you should keep in mind that:
1. Sending a PM to a user, necessitates only an insertion of a new row in a table in the database.
2. Any part of vB can therefore send a PM to a user, by just doing such an insert.
3. The only way to catch the "user away" condition, for each program which tries to insert a PM in the PMs table, is to have a trigger within the table. This I cannot do, I am not that good in MySQL, I do not even know if it supports triggers.
So, what I did, is the next best thing. I modified the code of the private.php program, which is the one you use, when you send a PM to a user. To do this, follow the steps below:
1. Edit private.php and find :
if (!($user['options'] & $_USEROPTIONS['receivepm']))
{
// recipient has private messaging disabled
eval('$errors[] = "' . fetch_phrase('pmrecipturnedoff', PHRASETYPEID_ERROR) . '";');
}
Right below it, add :
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) . '";');
}
Now go into your Admin CP, Phrase Manager and add a new phrase. The type is "Front-End Error Messages" and the phrase name should be "userawaynopm". The text of the phrase should be something like:
<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> Expected return date was $awayuntilmsg.<br>Your PM was not delivered to <b>$user[username]</b>.
Please keep in mind that I've added some custom fields in this hack, so if you get error messages about awayuntildate etc., you should remove those bits from the code and the phrase. Let me know if you have problems and I'll try to help.
With this, when you try to PM a user who is away, you will receive the above message and your PM is not send. I am not sure if this is the best way to handle this though, maybe, one should issue a warning to the sender, that the recipient is away, and let the PM go through. I would appreciate if you could let me know what you think about this question.
Finally, with this mod, if your PM is send to many recipients, the user(s) who is/are away, will not receive the PM, while the rest of them will.
Let me know if you have problems.
Rgds
------------
John
Lionel
10-01-2004, 09:57 PM
This can be done, but you should keep in mind that:
1. Sending a PM to a user, necessitates only an insertion of a new row in a table in the database.
2. Any part of vB can therefore send a PM to a user, by just doing such an insert.
3. The only way to catch the "user away" condition, for each program which tries to insert a PM in the PMs table, is to have a trigger within the table. This I cannot do, I am not that good in MySQL, I do not even know if it supports triggers.
So, what I did, is the next best thing. I modified the code of the private.php program, which is the one you use, when you send a PM to a user. To do this, follow the steps below:
1. Edit private.php and find :
if (!($user['options'] & $_USEROPTIONS['receivepm']))
{
// recipient has private messaging disabled
eval('$errors[] = "' . fetch_phrase('pmrecipturnedoff', PHRASETYPEID_ERROR) . '";');
}
Right below it, add :
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) . '";');
}
Now go into your Admin CP, Phrase Manager and add a new phrase. The type is "Front-End Error Messages" and the phrase name should be "userawaynopm". The text of the phrase should be something like:
<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> Expected return date was $awayuntilmsg.<br>Your PM was not delivered to <b>$user[username]</b>.
Please keep in mind that I've added some custom fields in this hack, so if you get error messages about awayuntildate etc., you should remove those bits from the code and the phrase. Let me know if you have problems and I'll try to help.
With this, when you try to PM a user who is away, you will receive the above message and your PM is not send. I am not sure if this is the best way to handle this though, maybe, one should issue a warning to the sender, that the recipient is away, and let the PM go through. I would appreciate if you could let me know what you think about this question.
Finally, with this mod, if your PM is send to many recipients, the user(s) who is/are away, will not receive the PM, while the rest of them will.
Let me know if you have problems.
Rgds
------------
John
Thanks. But rather than prevent the PM from being sent, I'd rather the autoresponder option, so no PM get lost or prevented.
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:
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:
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:
$url = "private.php?$session[sessionurl]";
eval(print_standard_redirect('pm_messagesent'));
and replace it with :
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
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
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:
}
// process errors if there are any
if (!empty($errors))
{
Replace that with:
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
OK, try this if you can. Use the original private.php file and find:
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:
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:
$url = "private.php?$session[sessionurl]";
eval(print_standard_redirect('pm_messagesent'));
and replace it with :
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
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
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
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
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
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
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
Screenshots Attached.
Awesome Hack...Thanks.
BTW...That girls is beautiful.
TwinsForMe
12-07-2004, 10:28 PM
* TwinForMe clicks install
I added the postbit code by sv1cec except I use postbit legacy. I had to change his code a bit.
Find:
$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 change for user being away -->
<if condition="$post['awaystatus'] == 1">
<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 />
</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 ?
================================================== ========
[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
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
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
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
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:
<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!
henken
08-02-2005, 05:53 PM
Can this be used on vB 3.0.8 without any problems too?
Yukino_AE
08-18-2005, 03:15 AM
If a post is made when a user is in away mode, the user is automatically set off away mode.
i installed this hack and it seems good except when i try to post something while being away. it just gives me a db error message.
Database error in vBulletin 3.0.7:
Invalid SQL: UPDATE user SET awaystatus = '0',awaymessage = '',awaysince = '0' WHERE userid = '1'
mysql error: Table 'aex4.user' doesn't exist
mysql error number: 1146
Date: Wednesday 17th of August 2005 09:13:52 PM
Script: http://anime-extreme.net/forum/newthread.php
Referer: http://anime-extreme.net/forum/newthread.php?do=newthread&f=17
Username: Yukino
but when i got to the forum again it DOES post the thread but it doesn't show in thread count. or posts.
help?
Yukino_AE
08-18-2005, 03:17 AM
i did do the original query with the intructions and added my prefix but is this another query that wasn't listed in teh instructions?
Does this work with version 3.0.7?
Mastar
09-24-2005, 05:50 PM
I've installed this on vb3.07?? and the only error i got so far is when I did the fuctions_newpost.php i got an error at line 703 when trying to edit or post a reply and new thread.
Also when I try saving my profile, I get this -->> Database error in vBulletin 3.0.7:
Invalid SQL: UPDATE user SET
birthday = '02-03-1975',
birthday_search = '1975-02-03',
usertitle = 'Visiting Mods/Admins',
customtitle = 2,
parentemail = '',
homepage = '',homepage = '',
awaystatus = ,
awaymessage = '',
awaysince = ,homepage = '',
awaystatus = ,
awaymessage = '',
awaysince = ,
icq = '',
aim = '',
yahoo = '',
msn = '',
usergroupid = 6
WHERE userid = 392
mysql error: 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 '
awaymessage = '',
awaysince = ,homepage = '',
a
mysql error number: 1064
Date: Saturday 24th of September 2005 12:46:29 PM
Script: http://www.wanthelp.com/forums/profile.php
Referer: http://www.Wanthelp/forums/profile.php?do=editprofile
Username: Name
IP Address: 00.00.00.00
Any Help!!??
BoYagoob
10-05-2005, 07:53 PM
Is it available for vb 3.5.0 ?
Startinfresh
10-12-2005, 07:08 PM
Was wondering the same thing BoYagoob
Scribbller
10-14-2005, 03:44 AM
Ok everything is fine but the hack doesnt work I set my self away go back to edit my profile and see that I am not set away thus nothing shows up when I view my own profile. Any ideas why?
PS. I am using 3.0.9
Scribbller
10-14-2005, 04:01 AM
i installed this hack and it seems good except when i try to post something while being away. it just gives me a db error message.
Database error in vBulletin 3.0.7:
Invalid SQL: UPDATE user SET awaystatus = '0',awaymessage = '',awaysince = '0' WHERE userid = '1'
mysql error: Table 'aex4.user' doesn't exist
mysql error number: 1146
Date: Wednesday 17th of August 2005 09:13:52 PM
Script: http://anime-extreme.net/forum/newthread.php
Referer: http://anime-extreme.net/forum/newthread.php?do=newthread&f=17
Username: Yukino
but when i got to the forum again it DOES post the thread but it doesn't show in thread count. or posts.
help?
Any solution to this problem?
Scribbller
10-14-2005, 04:25 AM
Ok I solved both the problems myself first one well I didnt edit the files completely left out an edit. Second one which Yukino_AE posted you need to change a bit of code in functions_newpost.php the edit tells you to do this
[FIND]-->
// ### POST NEW POST ###
[REPLACE WITH]-->
if ($bbuserinfo['awaystatus'] == '1') {
$DB_site->query("UPDATE user SET awaystatus = '0',awaymessage = '',awaysince = '0' WHERE userid = '$bbuserinfo[userid]'");
}
// ### POST NEW POST ###
Problem is with the bit highlighted in red so what I did was repace the word user with the name of the table in database eg my user table is called vb_user so the code should now look like
[REPLACE WITH]-->
if ($bbuserinfo['awaystatus'] == '1') {
$DB_site->query("UPDATE vb_user SET awaystatus = '0',awaymessage = '',awaysince = '0' WHERE userid = '$bbuserinfo[userid]'");
}
// ### POST NEW POST ###[/CODE]
Startinfresh
10-18-2005, 01:12 AM
Anyone know if it works with 3.5.0 GOLD???
funinthesun
11-06-2005, 08:00 PM
Has this hack been updated for 3.5? :)
akanevsky
11-06-2005, 08:14 PM
I could port this to 3.5.0 if I get the permission...
But judging by gamingforce's last activity, I doubt I ever will.
funinthesun
11-06-2005, 11:26 PM
Well I hope you do! It would be a great hack to have! :)
futuredood
06-17-2006, 02:06 AM
pleaaassee get it to work for 3.5.4 someone!
parabat
07-09-2006, 08:24 AM
pleaaassee get it to work for 3.5.4 someone!
Yes please can someone please help us out here, or point us in the direct of a similar mod.
I could port this to 3.5.0 if I get the permission...
But judging by gamingforce's last activity, I doubt I ever will.
Hey PV, have you asked Gamingforce about this as yet???
GAMINGFORCE can you please port this or at least give someone like PV permission to port it.
Please, pretty please. (now this is just sad) :bunny:
tazB.ca
10-04-2006, 01:19 PM
Comr On Somoene Posrt This To 3.6..:(
I'm really hoping it'll come out for 3.6.5 too :)
I've emailed Gamingforce for permission to port this to 3.6.x. If I get a response, I'll update this thread.
:)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.