View Full Version : Time on posbit for banned user
S3Ponline
07-06-2011, 09:44 PM
Just wondering if there?s code out there that will display the time someone is ?Banned? in the postbit.
Thank you :)
Badshah93
07-07-2011, 04:00 AM
Make A New Plugin
Hook Location: postbit_display_start
Title: Postbit Banned Date
Plugin PHP Code
$postban = $this->registry->db->query("SELECT bandate FROM ".TABLE_PREFIX."userban
where userid = '".$post['userid']."'");
$postbans = $this->registry->db->fetch_array($postban);
if (!empty($postbans['bandate'])) {
$post['bandate'] = vbdate($this->registry->options['dateformat'], $postbans['bandate']);
}
and save it.
Now in postbit or postbit legacy (depend upon which one u r using)
Find:
<dt>{vb:rawphrase posts}</dt> <dd>{vb:raw post.posts}</dd>
below that add:
<vb:if condition ="!empty($post['bandate'])">
<dt>Banned Date</dt> <dd>{vb:raw post.bandate}</dd>
</vb:if>
S3Ponline
07-07-2011, 04:27 AM
Thank you!
However, this didn’t seem to work. It might be because I’m using a custom template?
Also, do you know of a way to “ban” someone for hours, days, etc?
Thanks for the quick reply.
Badshah93
07-07-2011, 04:56 AM
this should be working, as i tested it before posting. you must be using postbit or postbit legacy.
i hope you have enable the plugin as default is "no", so in hurry you might have forget to click on yes.
130792
to ban someone for a day, open his profile in admincp and click on ban user.
then select for 1 day.
S3Ponline
07-07-2011, 07:08 AM
Oh, I see.
Thank you.
I dont’ mean to be overly nitpicky, but I’m looking for a countdown.
See, on my forum I want to put someone into a “timeout” for a few hours. Then I want them to know how much time they have left on their cool down and also so other people will know as well.
I was thinking of something like
Avatar
UserTitle
*CountDown TIll Out of Ban*
Thank you for helping!
Maybe you can make this a modification.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.