vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Signatures on/off per member (https://vborg.vbsupport.ru/showthread.php?t=41411)

Smoothie 07-23-2002 02:00 AM

Signatures on/off per member
 
I really need this hack. Anyone else need to restrict signature use on a per member level?

Please!!!

Xenon 07-23-2002 09:04 AM

wouldn't be such a problem

add a new field to the usertable called isallowedsig default='1'

then just add an editfield in your admin-cp to change it from 0/1
nowhere else, just in admincp.

then in newreply.php find this:
PHP Code:

    if ($signature) {
      
$post['signature'] = bbcodeparse($bbuserinfo['signature'],0,$allowsmilie);
      eval(
"\$post[signature] = \"".gettemplate("postbit_signature")."\";");
      
$previewmessage.=$post['signature'];
    } 

and replace it with this:
PHP Code:

    if ($signature and $bbuserinfo[isallowedsig]) {
      
$post['signature'] = bbcodeparse($bbuserinfo['signature'],0,$allowsmilie);
      eval(
"\$post[signature] = \"".gettemplate("postbit_signature")."\";");
      
$previewmessage.=$post['signature'];
    } 

you surely want to add that lines small modificated to editpost.php and newthread.php also.

i haven't tested, but it should work.

it just disables new signatures, signatures in old posts aren't infected ;)
run a query if you want to do it for old posts to ;)

Boofo 07-23-2002 09:10 AM

Smoothie, is you get it all figured out, I'd like to have it. I'm still not sure enough with myself to do the adding of the table or the admin cp. :)

Chris M 07-23-2002 10:27 AM

Great Xenon!:)

Satan

Smoothie 07-23-2002 10:33 PM

Xenon-

Thanks. What is the exact command to:
"add a new field to the usertable called isallowedsig default='1'

And how do I add an editfield in my admin-cp?

Xenon 07-23-2002 11:01 PM

[SQL]ALTER TABLE `user` ADD `isallowedsig` SMALLINT(6) DEFAULT '1' NOT NULL;[/sql]

open admin/user.php
find in edit section:
PHP Code:

maketextareacode("Signature","signature",$user[signature],8,45); 

below it add:
PHP Code:

makeinputcode("Can use siganture","isallowedsig",$user[isallowedsig],0); 

then find
PHP Code:

$DB_site->query("UPDATE user SET birthday='$birthday',options='$options',usergroupid='$usergroupid',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".addslashes(htmlspecialchars($email))."',styleid='$userstyleid',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))."',signature='".addslashes($signature)."',adminemail=$adminemail,showemail=$showemail,invisible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cookieuser=$cookieuser,nosessionhash=$nosessionhash,daysprune='$daysprune',lastvisit=$lastvisit,lastactivity=$lastactivity,lastpost=$lastpost,posts='$posts',timezoneoffset='$timezoneoffset',emailnotification=$emailnotification,receivepm='$receivepm',emailonpm='$emailonpm',ipaddress='".addslashes($aipaddress)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid"); 

change it to:
PHP Code:

$DB_site->query("UPDATE user SET birthday='$birthday',options='$options',usergroupid='$usergroupid',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".addslashes(htmlspecialchars($email))."',styleid='$userstyleid',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))."',signature='".addslashes($signature)."',isallowedsig=$isallowedsig,adminemail=$adminemail,showemail=$showemail,invisible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cookieuser=$cookieuser,nosessionhash=$nosessionhash,daysprune='$daysprune',lastvisit=$lastvisit,lastactivity=$lastactivity,lastpost=$lastpost,posts='$posts',timezoneoffset='$timezoneoffset',emailnotification=$emailnotification,receivepm='$receivepm',emailonpm='$emailonpm',ipaddress='".addslashes($aipaddress)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid"); 

should be all ;)

Boofo 07-23-2002 11:31 PM

Xenon, than you for the update. How and what do I change in the editpost.php? I couldn't find anything that even resembled the code I changed for the newthread.php and the newreply.php. And what would I need to add this to the private messages, too? :)

Xenon 07-24-2002 01:02 AM

in editpost you have to find this:
PHP Code:

$signature=iif($signature=="yes",1,0); 

after that add:
PHP Code:

if(!$bbuserinfo[isallowedsig]) $signature=0

for privat messages:
you have to do the same thing as in editpost.php ;)

i think this should be all, test it if it works ok, if not ask more ;)

Boofo 07-24-2002 01:10 AM

Thank you. I will test it out and let you know. :)

Smoothie 07-24-2002 03:29 AM

Xenon-

1 is for yes allow, 0 is for no, right? This just has an affect on img signatures, right?

BTW, anyone know the querie to set all users to no signatures?

Smoothie 07-24-2002 03:37 AM

didn't work. img sig shows for a user that isn't allowed, and didn't have one before.

Xenon 07-24-2002 10:03 AM

the query:
[sql]UPDATE user SET isallowedsig=0[/sql]

no it has an effect on using signatures complete!
you didn't say anything about just disable img use in sigs

Boofo 07-24-2002 10:20 AM

Is there a way to make it not allow ANY signature if enabled, no matter what is in it?

Quote:

Originally posted by Xenon
the query:
[sql]UPDATE user SET isallowedsig=0[/sql]

no it has an effect on using signatures complete!
you didn't say anything about just disable img use in sigs


Xenon 07-24-2002 10:28 AM

that's what i said.
it just enebles or disables signatureuse for users completly

Quote:

Originally posted by Boofo
Is there a way to make it not allow ANY signature if enabled, no matter what is in it?



Boofo 07-24-2002 10:45 AM

Oh, Ok, I'm sorry. I guess I misunderstood what Smoothie was talking about with the images then. :) This is what I wanted anyway. :)

Quote:

Originally posted by Xenon
that's what i said.
it just enebles or disables signatureuse for users completly



Smoothie 07-24-2002 05:51 PM

Xenon-

Sorry about that! But, i just tried again, and with the allow sig set to 0 in the admin cp under edite user, the user is still able to use a signature. I think I have understood what this does, but as far as i can tell, it still allows any kind of signature, text, or img code.

Xenon 07-24-2002 06:12 PM

@smoothie: try to apply the changes i told boofo for editpost to to also at newreply.php:
after
PHP Code:

 $signature=iif(trim($signature)=="yes",1,0); 

add:
PHP Code:

if(!$bbuserinfo[isallowedsig]) $signature=0

seems i have forgotten this line ;)

Boofo 07-24-2002 08:29 PM

Does this go in WITH the change you told me or instead of the changes?

Quote:

Originally posted by Xenon
@smoothie: try to apply the changes i told boofo for editpost to to also at newreply.php:
after
PHP Code:

 $signature=iif(trim($signature)=="yes",1,0); 

add:
PHP Code:

if(!$bbuserinfo[isallowedsig]) $signature=0

seems i have forgotten this line ;)


Chris M 07-24-2002 08:33 PM

As well as...

Satan

Boofo 07-24-2002 08:42 PM

I added the code to newthread.php, also. :)

Xenon 07-24-2002 08:45 PM

yes ;)

i hope it works now ;)

Smoothie 07-24-2002 08:47 PM

Xenon-

Seems to be working fine. Now, if there would be some way to allow text, and not the img tag, that would be the best.
Like this in the edit user:
Signature text: on
Signature text: off
Signature img code: on
Signature img code: off

Xenon 07-24-2002 08:55 PM

i think it'll be doable, too ;)

add another field to user table called is isallowedimgsig
in your admin/user.php do the same changes as you've done for allow sigs in general, just replace all isallowedsig with isallowedimgsig

then open member.php find:
PHP Code:

// check max images
  
if ($maximages!=0) {
    
$parsedsig=bbcodeparse($signature,0,$allowsmilies);
    if (
countchar($parsedsig,"<img")>$maximages) {
      eval(
"standarderror(\"".gettemplate("error_toomanyimages")."\");");
      exit;
    }
  } 

and replace it with:
PHP Code:

// check max images
  
if ($maximages!=0) {
    
$parsedsig=bbcodeparse($signature,0,$allowsmilies);
    if (
countchar($parsedsig,"<img")>$maximages or (countchar($parsedsig,"<img")>and !$bbuserinfo[isallowedimgsig])) {
      eval(
"standarderror(\"".gettemplate("error_toomanyimages")."\");");
      exit;
    }
  } 

i think it should do all ;)

Boofo 07-24-2002 09:19 PM

If you have this set to no, that would do it, without adding the code above, right?

Quote:

Allow vB IMG code in signatures?

Xenon 07-24-2002 09:28 PM

yes, if this is set to no img use in sigs is generally off ;)

but if you want to allow it to some users you had to set this setting to yes and apply my changes :)

Smoothie 08-06-2002 07:21 AM

Quote:

add another field to user table called is isallowedimgsig
Is this correct?
PHP Code:

ALTER TABLE `userADD `isallowedimgsigSMALLINT(6) DEFAULT '1' NOT NULL


Smoothie 08-06-2002 07:24 AM

Quote:

in your admin/user.php do the same changes as you've done for allow sigs in general, just replace all isallowedsig with isallowedimgsig
is this correct?
PHP Code:

makeinputcode("Can use siganture","isallowedimgsig",$user[isallowedimgsig],0); 


Smoothie 08-06-2002 07:28 AM

I'm not to sure about this part, admin/user.php
PHP Code:

$DB_site->query("UPDATE user SET birthday='$birthday',options='$options',usergroupid='$usergroupid',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".addslashes(htmlspecialchars($email))."',styleid='$userstyleid',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))."',signature='".addslashes($signature)."',isallowedsig=$isallowedsig,adminemail=$adminemail,showemail=$showemail,invisible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cookieuser=$cookieuser,nosessionhash=$nosessionhash,daysprune='$daysprune',lastvisit=$lastvisit,lastactivity=$lastactivity,lastpost=$lastpost,posts='$posts',timezoneoffset='$timezoneoffset',emailnotification=$emailnotification,receivepm='$receivepm',emailonpm='$emailonpm',ipaddress='".addslashes($aipaddress)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid"); 

What do I add?

Xenon 08-06-2002 11:41 AM

yes correct both ;)
PHP Code:

$DB_site->query("UPDATE user SET birthday='$birthday',options='$options',usergroupid='$usergroupid',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".addslashes(htmlspecialchars($email))."',styleid='$userstyleid',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))."',signature='".addslashes($signature)."',isallowedsig=$isallowedsig,isallowedimgsig=$isallowedimgsig,adminemail=$adminemail,showemail=$showemail,invisible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cookieuser=$cookieuser,nosessionhash=$nosessionhash,daysprune='$daysprune',lastvisit=$lastvisit,lastactivity=$lastactivity,lastpost=$lastpost,posts='$posts',timezoneoffset='$timezoneoffset',emailnotification=$emailnotification,receivepm='$receivepm',emailonpm='$emailonpm',ipaddress='".addslashes($aipaddress)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid"); 


Smoothie 08-06-2002 03:37 PM

Xenon-

Many thanks. I will let ya know how it goes!

isman 09-11-2002 12:50 AM

Is this supposed to affect posts that already have signatures in them? I tested it on a user with a signature and the signatures still show in her posts.

Smoothie 09-11-2002 07:25 AM

Quote:

it just disables new signatures, signatures in old posts aren't infected
run a query if you want to do it for old posts to

rstark 02-20-2003 07:01 AM

Can someone release a hack for this that will work on all posts (old/new)?

Frozen Dreams 05-17-2003 11:05 AM

Ok I put in all the changes u guys mentioned here - however when I set allow sig to 0 in the user profile in acp - and then go back to the same user the sig is back to 1 again ...
any idea someone ...


All times are GMT. The time now is 03:51 AM.

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.01598 seconds
  • Memory Usage 1,881KB
  • 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
  • (18)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (34)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete