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?


All times are GMT. The time now is 01:41 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.01155 seconds
  • Memory Usage 1,769KB
  • 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
  • (8)bbcode_php_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
  • (10)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