vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Make 'Contact Us' Name & E-mail fields uneditable for log'd in members (https://vborg.vbsupport.ru/showthread.php?t=99538)

timetunnel 10-27-2005 10:00 PM

Make 'Contact Us' Name & E-mail fields uneditable for log'd in members
 
Hello.

For those of you who have public forums with members who may become future-banned members, because they have too much time on their hands, this is one area of the forum's E-mail system they won't be able to play with.

What I mean is, currently, the 'Contact Us' form's member's 'username' and 'E-mail' fields can be overwritten such that the admin can receive E-mail with the incorrect 'reply to' info if someone monkey's with the username and/or put's someone else's E-mail address in the field. This can cause some unknowing person to receive unwanted E-mail from the admin.

This 'playfulness' is expected from random 'guests'. Therefore, in order to restrict this behavior to 'guests' only, here is the code to make these fields 'uneditable' for logged-in members, since their profile values are automatically filled-in by the system. At least, they won't be able to 'play' here...


Locate the 'name' section of code. Modify with this:

PHP Code:

<!-- begin revision -->
<if 
condition="$show['member']">
                        <
input type="text" class="bginput" name="name" value="$namesize="50" readonly="readonly" /> &nbsp;(uneditable)
<else />
                        <
input type="text" class="bginput" name="name" value="$namesize="50" />
</if>
<!-- 
end revision --> 

Next, locate the 'email' section of code. Modify with this:

PHP Code:

<!-- begin revision -->
<if 
condition="$show['member']">
                        <
input type="text" class="bginput" name="email" value="$emailsize="50" dir="ltr" readonly="readonly" /> &nbsp;(uneditable)
<else />
                        <
input type="text" class="bginput" name="email" value="$emailsize="50" dir="ltr" />
</if>
<!-- 
end revision --> 

NOTE: the difference in the 2 '<input...> statements is the 'readonly' attribute and a field message that lets members know those 2 fields are 'uneditable'.


Hope this helps.

EDIT: Make change to 'contactus' template

EDIT (11/15/05): CHANGED from 'readonly' to readonly="readonly" to make compliant although the original version works. The text file download was also updated.

Moparx 10-28-2005 09:08 PM

good idea :)

Boofo 10-28-2005 09:54 PM

Text file, please? ;)

timetunnel 10-28-2005 11:47 PM

Boofo,

Not sure if this is the answer you're looking for, but I had edited my initial post to show the change is to the 'contactus' template.

Moparx 10-29-2005 01:50 AM

boofo wants you to add a text file attachment containing the template mods instructions.
its helpful for many of us so we can store it in our hack/modification folders for future use :)

Lea Verou 10-29-2005 02:37 AM

If it's a template mod shoudn't it be on template modifications?

Great idea though, I wonder why Jelsoft left it editable...

Boofo 10-29-2005 03:21 AM

Quote:

Originally Posted by Moparx
boofo wants you to add a text file attachment containing the template mods instructions.
its helpful for many of us so we can store it in our hack/modification folders for future use :)

Exactly! ;)

Yorixz 10-29-2005 11:22 AM

Very nice idea, should be standard in vB imho.

timetunnel 10-29-2005 05:01 PM

ooh...I see...

is there a particular format for the text file or should I just copy what's above in my initial post?

As far as where to put it, I wasn't sure since I've seen a template mod(s) in this category in the past. Earlier in the week I had mod with a change to 'modifyprofile' template (re: how to hide the member's URL) in code mods and it was moved to tutorial. I thought maybe if it was to be moved, it would have gone into 'template mods' forum. Still feeling my way around to know where to put things. For the future, I'll put template mods in that category.

Boofo 10-29-2005 11:32 PM

Quote:

Originally Posted by timetunnel
ooh...I see...

is there a particular format for the text file or should I just copy what's above in my initial post?

As far as where to put it, I wasn't sure since I've seen a template mod(s) in this category in the past. Earlier in the week I had mod with a change to 'modifyprofile' template (re: how to hide the member's URL) in code mods and it was moved to tutorial. I thought maybe if it was to be moved, it would have gone into 'template mods' forum. Still feeling my way around to know where to put things. For the future, I'll put template mods in that category.

Just a text file with the instructions and code in it is all.


All times are GMT. The time now is 06:54 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.01080 seconds
  • Memory Usage 1,748KB
  • 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_php_printable
  • (2)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
  • (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