vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   vBPunch v1.2 - A Quick Warning System (https://vborg.vbsupport.ru/showthread.php?t=97117)

Alan @ CIT 09-28-2005 10:00 PM

vBPunch v1.2 - A Quick Warning System
 
If Upgrading from version 1.1, upload all of the files in the Zip, making sure that they overwrite the old ones, then install the product XML.

If upgrading from version 1.0, please follow the instructions in the install guide in the Zip file.

Changelog
Version 1.2
  • Clicking "Cancel" on the extra text prompt means that the PM will not be sent
  • Adding an option to display a confirmation popup when the PM has been sent
  • Fixed a bug with usergroup permission checking (thanks Osmosis)
Version 1.1
  • Added a global on/off switch for vBPunch
  • Added the ability to add/remove reputation points when punching
  • Added usergroup permissions - you can now choose which usergroups are allowed to use vBPunch
  • Now includes 3 "Punch User" images as well as the text link
What is vBPunch?
vBPunch is a quick way of sending a warning PM to a user, based on a post they have made.
It adds a link to the postbit called "Punch User". When an admin clicks this, vBPunch pops up a textbox letting the admin type a reason (if they wish, it's optional), then it sends the user a PM.

What makes vBPunch so special then???!?
The useful thing about vBPunch is that it does it all in the backgorund using Ajax. That means, no popup windows, no page refreshes, nothing. All the admin does is click the "Punch User" link, enter a reason if needed, then continues reading the thread / post, without being interupted.

Installation
Please read install.html located in the zip file

Un-installation
Please read install.html located in the zip file. Please ensure that you delete the uploaded files, before un-installing the product in the vBulletin AdminCP, otherwise you will recieve errors when you edit a usergroup.

-----------------------------------------------------------------

Important: Unfortunately, my leased vBulletin licence has now expired, and I won't be renewing it until September which means I will be unable to reply to this thread, or update this mod until then. I'm hopeful that the great vBulletin.org community will step in to answer any questions in my absence though :) See you all in early September! :D

Hawkbizkit 09-29-2005 05:01 AM

OMG this is the best hack on the vborg Clicks install w00tage Alan-CIT you rock.

Guest190829 09-29-2005 05:02 AM

[high]* Guest190829 punches Alan @ Cit in the face
[/high]

:D

Great job, can't wait to see this AJAX-licious modification.

Alan @ CIT 09-29-2005 05:03 AM

Forgot to mention, vBPunch uses 4 phrases, all in the GLOBAL section, and all begining with vbpunch_ so they should be easy to find.

The PM message that is sent is vbpunch_warning_text if you wish to change it

Bad Bunny 09-29-2005 06:13 AM

lol This is awesome. I think my forum would actually really like to do this to each other. LOL

How would I go about making it so different usergroups can punch someone?

Azhrialilu 09-29-2005 06:46 AM

LOL funny, I like it :D

Hawkbizkit 09-29-2005 06:58 AM

yes in the plugin vBPunch : Template conditional checks change this line:
PHP Code:

 else if (can_administer()) 

To:
PHP Code:

else if (in_array($vbulletin->userinfo[usergroupid], array(5,6,7,9))) 

just add the usergroups you want to the array.

Also edit vbpunch.php on line 25:
PHP Code:

if (!can_administer()) 

With this:
PHP Code:

if (!in_array($vbulletin->userinfo[usergroupid], array(5,6,7,9))) 


Alan @ CIT 09-29-2005 07:04 AM

Good idea Hawkbizkit, I'll add usergroup permissions in the next release :)

Cyricx 09-29-2005 11:46 AM

Wow this could be a great basis for someone to use to rewrite the vbpager system with.

Using AJAX for that would be awesome too.

Nice work Alan! :), I may use this code a lil differently but it's definately extremely useful :)

memorex 09-29-2005 11:54 AM

Quote:

Originally Posted by Alan @ CIT
Good idea Hawkbizkit, I'll add usergroup permissions in the next release :)

Can't wait for the next release :banana:

jugo 09-29-2005 12:07 PM

LMAO...This is why I love this Community. Because even in jest we can produce some good stuff.

Awesome work.

Hey, if I change some of the Phrases can I make it a positive thing...like "The Admin" kisses (pulling name out of a hat) amykhar in the lips". or something like that?

Also, it would be a cool addon if this added or took away rep points.

BTW: INSTALLED!!!

Alan @ CIT 09-29-2005 03:50 PM

Thanks for the good comments guys :)

Jugo: I'll make the add/remove rep points an option in the next version.

Bad Bunny 09-29-2005 05:18 PM

Quote:

Originally Posted by Hawkbizkit
yes in the plugin vBPunch : Template conditional checks change this line:
PHP Code:

 else if (can_administer()) 

To:
PHP Code:

else if (in_array($vbulletin->userinfo[usergroupid], array(5,6,7,9))) 

just add the usergroups you want to the array.

Also edit vbpunch.php on line 25:
PHP Code:

if (!can_administer()) 

With this:
PHP Code:

if (!in_array($vbulletin->userinfo[usergroupid], array(5,6,7,9))) 


Yes! I need to go gold, then my users will be spurred on to participate more as their love to punch each other in the face will be encouraged! YES!

utw-Mephisto 09-29-2005 05:41 PM

I like that addition, however, I rather moved it on the bottom of the post rather on the top ... I guess a button would be cool too rather than simple text (gonna make one soon myself).

Another idea : Instead of a link rather a drop down menu entry (Moderation) where you simply tick the post u want to punch ..

Alan @ CIT 09-29-2005 06:11 PM

Hi Mephisto,

Changing it to a button is on my todo list, and it can be placed anywhere on the postbit, just move it about :)

As for the dropdown, I thought about doing this, but it would mean the admin would have to tick the post, scroll down, pick Punch from the dropdown, enter the reason, then scroll back up and carry on reading. Or, they would tick multiple posts, scroll down and pick Punch from the menu, then have to enter x amount of additional text to add to the PM's (if they wanted), and all this just seemed like a lot of hassle comapred to the 2 click system at the moment.

utw-Mephisto 09-29-2005 06:53 PM

Quote:

Originally Posted by Alan @ CIT
Hi Mephisto,

Changing it to a button is on my todo list, and it can be placed anywhere on the postbit, just move it about :)

As for the dropdown, I thought about doing this, but it would mean the admin would have to tick the post, scroll down, pick Punch from the dropdown, enter the reason, then scroll back up and carry on reading. Or, they would tick multiple posts, scroll down and pick Punch from the menu, then have to enter x amount of additional text to add to the PM's (if they wanted), and all this just seemed like a lot of hassle comapred to the 2 click system at the moment.

Ok, point for you :)

jesus likes pie 09-29-2005 08:15 PM

Alan, is this why you asked me to count my rows in phpmyadmin over at #vbfans about 2 weeks ago? (I'm ATI4EVER! on vbfans).

eh?

Anyways, lmao, this looks awesome but does it really "warn" as in after X ammount of warnings the user gets banned?

I would really like to see a full wrning system that uses AJAX.

jesus likes pie 09-29-2005 08:21 PM

To add to my last post (editing sucks without Ajax :P), there should be an option to just "punch" and one to actually warn. So punching would be for little stupid things that kinda break forum rules or are just stupid posts that make no sense, and another one punches AND adds a "warn", and after say, X ammount of warns the user gets banned for X ammount of days.

Ideally you should be able to change these values through the admincp. But this would then be a full warning system that is probably harder to do.

Anyways Alan, if you do this, I'll kiss your feet.

See ya at #vbfans!

Alan @ CIT 09-29-2005 09:23 PM

lol - hey ATI mate,

I was asking for the number of rows in your threadrate table as I'm working on a rating system for a different project and wanted to see how well vB's performed on a big forum :D

At the moment, this isn't really what you'd call a real warning system (points / bans / etc), all it does is send a PM to the user with some pre-set text + whatever additional text you send. At the moment it says something along the lines of "You have been warned for this post, pleae follow the forum rules when posting"...etc - this can be changed in the Phrase manager though.

I didn't plan on adding points / bans / etc to vBPunch, but I might write another hack based on it that works as a proper warning system.

I'll see what I can do bud :)

jesus likes pie 09-29-2005 09:23 PM

Alright.....

now join #vbfans and we can talk real time :D

Alan @ CIT 09-29-2005 09:54 PM

Add me to MSN or GTalk mate - awagstaff@gmail.com for both, or I'm in #vborg (^^^ chat link up there)

Dan 09-30-2005 11:16 AM

Really nice :D I like it

Hawkbizkit 09-30-2005 05:36 PM

here is a little quick button for people with dark backgrounds

upload the fist to your images/buttons folder for your style
in your postbit template you use

Find:
Code:

<a href="#" onClick="do_punch('$post[userid]', '$post[postid]'); return false;">$vbphrase[vbpunch_punch_user]</a>
Replace with:
Code:

<a href="#" onClick="do_punch('$post[userid]', '$post[postid]'); return false;"><img class="inlineimg" src="$stylevar[imgdir_button]/fist.gif" alt="$vbphrase[vbpunch_punch_user]" border="0" /></a>
this is just a quick fix to remove the text link i'm sure Alan-CIT will use a better one for the next release of the hack...also thanks Alan-CIT for all your hard work this hack is great

Anette 10-01-2005 10:47 AM

Lovely. Thank you! :D

Alan @ CIT 10-01-2005 05:15 PM

Thanks Hawk, I'd like to add the button into the next release if you'll allow me mate :)

I'm away Sunday, but will catch you on IRC on Monday at some point :)

Also, thanks to all those who have installed vBPunch so far, I've started adding a few new features for the next release, and all being well, should have it finished by next Friday.

csidlernet 10-05-2005 02:48 AM

very cool thanks
/me installs

rb290 10-11-2005 03:47 AM

it did not work for me.
i installed it perfect too
i have vB 3.5
anyone know whats the problem ?

lamilein 10-11-2005 05:17 AM

[high]* lamilein loves this one :D
[/high]

[high]* lamilein clicked install :D[/high]

Bad Bunny 10-11-2005 06:06 AM

Quote:

Originally Posted by rb290
it did not work for me.
i installed it perfect too
i have vB 3.5
anyone know whats the problem ?

You probably didn't install it perfect. It works for everyone but you? This isn't a very realistic assumption. Perhaps you can share any errors or other clues with us, so we can see what exactly doesn't work.

I stopped reading minds earlier this year, so I need some help to know what your problem is. (sorry if my post is punchy, I'm not trying to be rude, I'm just silly right now)

Alan @ CIT 10-11-2005 07:23 AM

Quote:

Originally Posted by rb290
it did not work for me.
i installed it perfect too
i have vB 3.5
anyone know whats the problem ?

Unfortunatly, that doesn't give us a lot to go on :)

What exactly doesn't work? Do you recieve any Javascript or PHP errors?

Are you certain that you uploaded the files to the correct places?

Hawkbizkit 10-11-2005 07:19 PM

i figured i would go back in and fix the fist and make a PSD of it with the dark themed version and the light themed version if anyone wants it... Cheers

Alan @ CIT 10-11-2005 07:22 PM

Thanks bud, very handy :)

Just to let everyone know, I haven't forgotten about vBPunch, the next version is half done, just needs finishing up. I've been a bit distracted with 2 other hacks I'm working on :)

rb290 10-13-2005 04:17 PM

I put everything in the right place and I dont see the vbpunch in peoples post

Alan @ CIT 10-13-2005 06:05 PM

pb290: Revert the postbit template back to it's original, and try the change again.

akanevsky 10-13-2005 11:18 PM

Screenshot please?

Alan @ CIT 10-14-2005 05:55 AM

Screenshot of what? It's just a link that says "Punch User"... :)

Screenshot:

Punch User

:)

u4ea 10-14-2005 11:50 AM

Awesome tool!

How can I set this so mods can use as well as admins?

Alan @ CIT 10-14-2005 03:38 PM

u4ea: Follow the instructions here https://vborg.vbsupport.ru/showpost....31&postcount=7

u4ea 10-15-2005 10:12 AM

Quote:

Originally Posted by Alan @ CIT


Where do I state what user groups in the code below... SOrry im such a newbie...

PHP Code:

yes in the plugin vBPunch Template conditional checks change this line:

PHP Code:
 else if (
can_administer())  


To:

PHP Code:
 else if (
in_array($vbulletin->userinfo[usergroupid], array(5,6,7,9)))  


just add the usergroups you want to the array.

Also edit vbpunch.php on line 25:

PHP Code:
 if (!
can_administer())  


With this:

PHP Code:
 if (!
in_array($vbulletin->userinfo[usergroupid], array(5,6,7,9))) 


Alan @ CIT 10-15-2005 11:43 AM

In this line:

PHP Code:

if (!in_array($vbulletin->userinfo[usergroupid], array(5,6,7,9))) 

The numbers in that line represent usergroup id's. Replace them.

Alterantivly, wait a day or so, and the next version of vBPunch will be released which will make it easier to do this.


All times are GMT. The time now is 04:47 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.01535 seconds
  • Memory Usage 1,846KB
  • 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
  • (2)bbcode_code_printable
  • (10)bbcode_php_printable
  • (6)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