vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Mini Mods - Usergroup Messages (https://vborg.vbsupport.ru/showthread.php?t=128544)

harmor19 10-07-2006 10:00 PM

Usergroup Messages
 
Description
Have you ever wanted to show a usergroup or usergroups a message but don't feel like editing the template to do so?
With this add-on you'll be able to write a message to one, a few, or all usergroups.

To add, edit, or delete a message go to ACP --> Usergroups --> Usergroup Messages Manager

If you have installed this add-on on your board please click Install to the bottom right of this post
You are not permitted to redistribute this add-on on any site.
If you feel this add-on deserves Mod of the Month please click to nominate it

harmor19 10-08-2006 04:41 AM

*Reserved* (But I doubt I'll need to edit this post)

rmxs 10-08-2006 04:56 AM

ohh very good :) thanks

harmor19 10-08-2006 05:02 AM

Don't upload this yet, I found a bug.

Edit: It should be good now.

Snake 10-08-2006 05:19 AM

Thankies! This is quite useful. :)

harmor19 10-08-2006 05:23 AM

Quote:

Originally Posted by Snake
Thankies! This is quite useful. :)

Thanks Snake. So far I think you like all my hacks, if I'm not mistaken.

redlabour 10-08-2006 06:27 AM

Good work ! ;)

reteep 10-08-2006 08:15 AM

Cool, installed!

ChavMagnet 10-08-2006 02:10 PM

Great mod

MentaL 10-08-2006 03:46 PM

WHy aint this default in vb, amazing, yay

harmor19 10-08-2006 11:13 PM

Thanks everyone.

I don't know why it's not default in vBulletin.

Aaron RV 10-09-2006 03:22 AM

mmm 3.6.2 no work! :cross-eyed:

eNforce 10-09-2006 03:30 AM

Confirmed not working with 3.6.2

It does not install the product, gives a DB error.

Code:

Database error in vBulletin 3.6.2:

Invalid SQL:
CREATE TABLE `usergroupmessages` (
  `usergroupmessagesid` mediumint(10) unsigned NOT NULL auto_increment,
  `title` varchar(120) NOT NULL default '',
  `usergroups` varchar(200) NOT NULL default '',
  `message` text NOT NULL,
  `enabled` tinyint(1) unsigned NOT NULL default '',
  PRIMARY KEY  (`usergroupmessagesid`)
);;

MySQL Error  : Invalid default value for 'enabled'
Error Number : 1067
Date        : Monday, October 9th 2006 @ 12:29:36 AM
Script      : http://www.areyouserios.com/admincp/plugin.php?do=productimport
Referrer    : http://www.areyouserios.com/admincp/plugin.php?do=productadd
IP Address  :
Username    : Windextor
Classname    : vB_Database


harmor19 10-09-2006 03:34 AM

I added "0" as the default for "enabled". Tell me if it works.

eNforce 10-09-2006 03:42 AM

It works great now, thanks /installs

Also, would it be possible to have a drop down menu to select which usergroups will be able to see the message... instead of entering the usergroup ID?

Aaron RV 10-09-2006 07:15 AM

work now, thank's.

Hornstar 10-09-2006 09:36 AM

Quote:

Originally Posted by eNforce
It works great now, thanks /installs

Also, would it be possible to have a drop down menu to select which usergroups will be able to see the message... instead of entering the usergroup ID?

great idea.

this looks really good. Thanks.

Snake 10-09-2006 10:21 AM

Thanks.

Nathan2006 10-09-2006 11:53 PM

Thanks harmor19

Install

Shanj 11-09-2006 10:18 AM

Sounds a neat tool - but does it send emails? pms? or display posts somewhere? If the last option where?

Tx

harmor19 11-09-2006 04:25 PM

I'm sorry but it doesn't. I'm focused working on new features for my vHosting hack.

kizzmet 11-15-2006 04:14 PM

This is great! Thanks!

Shanj 11-15-2006 10:31 PM

Quote:

Originally Posted by harmor19 (Post 1113708)
I'm sorry but it doesn't. I'm focused working on new features for my vHosting hack.

What I meant is how do the usergroup members SEE the messages?

harmor19 11-17-2006 12:51 AM

They will see the message if you edited the "FORUMHOME" template and added the variable in the "Install_Instructions.txt".

kizzmet 11-17-2006 01:28 PM

Is there a way to get it to display on every page?

Also it does not allow simply typed characters such as " or >...

Shanj 11-17-2006 05:11 PM

Shan said: What I meant is how do the usergroup members SEE the messages?
Quote:

Originally Posted by harmor19 (Post 1119064)
They will see the message if you edited the "FORUMHOME" template and added the variable in the "Install_Instructions.txt".

OK that's how I make it possible for tem to see it.
How do they see it? - a popup? a notice at the top of the page? ... what?

harmor19 11-20-2006 07:26 AM

Quote:

Originally Posted by Shanj (Post 1119441)
Shan said: What I meant is how do the usergroup members SEE the messages?


OK that's how I make it possible for tem to see it.
How do they see it? - a popup? a notice at the top of the page? ... what?

It's just a notice under the navbar.

cbiweb 12-23-2006 02:29 PM

Three things:
  1. Characters such as ">", and quote marks don't work. It converts them to Unicode :(
  2. It doesn't accept line breaks because of the first problem. :(
  3. How do I get it to show up on the homepage of vBadvanced?

Sofia 03-25-2007 12:02 AM

Hi Andrew

Great hack, thanks a lot ! it works on 3.6.5.

I have parse bbcode to use html, bbcode, and smilies on the message and i have insert the title of message above the message ;)

Andyucs 03-27-2007 05:44 PM

Quote:

Originally Posted by Sofia (Post 1211462)
Hi Andrew

Great hack, thanks a lot ! it works on 3.6.5.

I have parse bbcode to use html, bbcode, and smilies on the message and i have insert the title of message above the message ;)

and how did you do that for us n00bs lol

Sofia 03-30-2007 02:43 PM

Quote:

Originally Posted by Andyucs (Post 1213759)
and how did you do that for us n00bs lol

To use HTML, bbcode and smilies in the message

In usergroup_messages.php (admincp), find

PHP Code:

$parser =& new vB_BbCodeParser($vbulletinfetch_tag_list()); 

Replace by :

PHP Code:

require_once(DIR '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());
$parsed_text $parser->do_parse($text$do_html$do_smilies$do_bbcode$do_imgcode$do_nl2br$cachable); 

Find (x 2)

PHP Code:

$message $parser->do_parse($db->escape_string($vbulletin->GPC['message']), falsetruetruetruetruefalse); 

Replace by (x 2)

PHP Code:

$message $parser->do_parse($db->escape_string($vbulletin->GPC['message']), truetruetruetruetruetrue); 




To insert a title above the message, find in the template usergroupemessages :


PHP Code:

<div align='center' style='border:2px black solid;' class='alt1'>$ugmsg[message]</div><br /> 

And replace by :

PHP Code:

table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">

<
tr><td class="tcat"><center>$ugmsg[title]</center></td></tr>

<
tr><td class='alt1'>$ugmsg[message]</td></tr></table><br /> 


Andyucs 03-31-2007 06:06 PM

First Thanks Sofia

i modifyed mine a bit to also centre the message as well and made it bold also

PHP Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">

<
tr><td class="tcat"><center>$ugmsg[title]</center></td></tr>

<
tr><td class='alt1'><b><center>$ugmsg[message]</b></center></td></tr></table><br /> 

you missed a
PHP Code:



from the begining of your modification

Sofia 03-31-2007 06:10 PM

Yes, sorry :p the html, bbcode and smilies are good ?

Andyucs 03-31-2007 06:26 PM

Quote:

Originally Posted by Sofia (Post 1217009)
Yes, sorry :p the html, bbcode and smilies are good ?

yea looking good thanks

seem to have a prob with html code but bb codes work fine

take a look just above shout box

http://www.ucsclan.co.uk/forum/index.php

Sofia 03-31-2007 07:47 PM

Quote:

Originally Posted by Andyucs (Post 1217023)
yea looking good thanks

seem to have a prob with html code but bb codes work fine

take a look just above shout box

http://www.ucsclan.co.uk/forum/index.php

Ok so good :) Nice forum ;)

For html, you must put "true" everywhere :

PHP Code:

$message $parser->do_parse($db->escape_string($vbulletin->GPC['message']), falsetruetruetruetruefalse); 

The first "false" corresponds to the html (activation -> true) ;)

Benj 04-01-2007 06:57 PM

sweet work is there anyway i can make this message only show once per users session?

|Jordan| 04-09-2007 06:58 PM

Is there any way to make the messages display to users who's usergroup is not primary, but rather secondary?

harmor19 04-09-2007 07:29 PM

Quote:

Originally Posted by |Jordan| (Post 1223510)
Is there any way to make the messages display to users who's usergroup is not primary, but rather secondary?

Not with this version. I'm planning on upgrading this hack soon to do what you're asking.

|Jordan| 04-09-2007 09:52 PM

Quote:

Originally Posted by harmor19 (Post 1223529)
Not with this version. I'm planning on upgrading this hack soon to do what you're asking.

Sweet :up:

EDIT: Wow that was fast, i wasnt expecting an update 2 hours later. I thought it would be several days/weeks later. GJ!

harmor19 04-10-2007 01:10 AM

I have fixed the problem with HTML tags from converting into ASCII characters.
Messages are shown to users in primary and secondary usergroups.


All times are GMT. The time now is 06:28 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.01296 seconds
  • Memory Usage 1,841KB
  • 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
  • (1)bbcode_code_printable
  • (9)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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