vForums Support Banner


Visit Base Classics - Gaming Chairs

 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Predifined posting template. (Wrighty?) - View Topic
Topic Rating: *****
Printable View
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 35
Joined:  
Reputation: 62%  


pmwww
Predifined posting template. (Wrighty?) (10th Jul 08 at 4:24am UTC)
PLEASE READ! NEED ASAP!!!
I need this:

About You
Name/Nickname: What is your name?
Age: What is your age?
Gender: What is your gender?
How long have you been roleplaying and/or writing?: Tell about your experiences.
What is your goal in coming here: what do you want to learn, etc.
Other info/intro stuff: Is there anything you want or need to say?

<-- The note needs to be on a break in between "About You" and "Characters Info "-->
Note: You don’t have to have a character if you don’t plan on doing anything in the role playing section.

Characters info:
Name/Nickname: What is your characters Name and/or Nickname?
Age: What is your characters Age?
Gender: What is your characters gender?
Sexual Orientation: What is your characters sexual orientation?
Origin: What is your characters Origin?
Race: What is your characters race?
Occupation: What is your characters Occupation?
Appearance: Picture or description work
Personality: What is your characters personality?
Theme Song: What is your characters theme song?
History: What is your characters History?
Other comments/info: Do you have any other comments or info?


in this:
Code:
 
  1. <script type="text/javascript">
  2. <!--
  3.  
  4. /* Predefined Posting Template/Form
  5.     Created by Ross of vForums
  6.     http://virtualforums.co.uk
  7.     Please do not repost outside of
  8.     vForums support without permission */
  9.  
  10. var _title = 'New Code Request';
  11.  
  12. var _description = 'Please ensure you have a read of the <a href="URL">Rules</a> before posting';
  13.  
  14. var _fields = new Array(); var _f = 0;
  15.     _fields[_f++] = new Array('input', 'Description', ['size', 40, 'maxLength', 50], '', 'Please give a short description of what it is you're after. Include any relevant keywords.', false);
  16.     _fields[_f++] = new Array('select', 'Type', false, ['All Pages', 'Main Page', 'Mini-Profile', 'Info Center', 'Private Messaging', 'Profile', 'Posting', 'Thread Listing', 'Welcome Table', 'Other'], 'Select the category/area that best fits the type of code you're after.', true);
  17.     _fields[_f++] = new Array('input', 'Example', ['size', 40, 'maxLength', 200], false, 'If you have an example of what you want to achieve, please link to it here. This can be anything from an image of what you need to a link to a forum using the code you want.', false);
  18.     _fields[_f++] = new Array('textarea', 'Request Details', ['cols', 40, 'rows', 10], false, 'Please give as much information as possible about your request. The more information you give now, the easier it will be for someone to fill your request.', true);
  19.  
  20. var _widths = ['100%', '20%', '40%', '40%'];
  21.  
  22. var _posting_form = {
  23.  
  24.     errors: new Array(),
  25.  
  26.     init: function() {
  27.         this.create_form();
  28.     },
  29.     
  30.     create_form: function() {
  31.         // Create new post layout
  32.         var _holder = document.createElement('table');
  33.         _holder.setAttribute('className', 'border');
  34.         _holder.setAttribute('class', 'border');
  35.         _holder.setAttribute('cellSpacing','1');
  36.         _holder.setAttribute('cellPadding', '4');
  37.         _holder.setAttribute('align', 'center');
  38.         _holder.setAttribute('width', _widths[0]);
  39.         _holder.setAttribute('id', 'post_form_holder');
  40.         _holder.appendChild(document.createElement('tbody'));
  41.         _holder.firstChild.appendChild( document.createElement('tr') ).appendChild( document.createElement('td') ).appendChild( document.createElement('font') );
  42.         _holder.firstChild.lastChild.lastChild.className = 'title1';
  43.         _holder.firstChild.lastChild.lastChild.colSpan = '3';
  44.         _holder.firstChild.lastChild.lastChild.lastChild.size = '2';
  45.         _holder.firstChild.lastChild.lastChild.lastChild.appendChild(document.createTextNode(_title));
  46.         if(_description) {
  47.             _holder.firstChild.appendChild( document.createElement('tr') ).appendChild( document.createElement('td') ).appendChild( document.createElement('font') );
  48.             _holder.firstChild.lastChild.lastChild.setAttribute('className', 'window1');
  49.             _holder.firstChild.lastChild.lastChild.setAttribute('class', 'window1');
  50.             _holder.firstChild.lastChild.lastChild.setAttribute('colSpan', '3');
  51.             _holder.firstChild.lastChild.lastChild.lastChild.setAttribute('size', '2');
  52.             _holder.firstChild.lastChild.lastChild.lastChild.innerHTML = _description;
  53.         }
  54.         
  55.         for(_f=0; _f<_fields.length; _f++) {
  56.             switch(_fields[_f][0]) {
  57.                 case 'textarea' :
  58.                     var _tmp = document.createElement('textarea');
  59.                 break;
  60.                 
  61.                 case 'select' :
  62.                     var _tmp = document.createElement('select');
  63.                     for(_o=0; _o<_fields[_f][3].length; _o++) {
  64.                         _tmp.options[_o] = new Option(_fields[_f][3][_o], _fields[_f][3][_o]);
  65.                     }
  66.                 break;
  67.                 
  68.                 default :
  69.                     var _tmp = document.createElement('input');
  70.                     _tmp.type = 'text';
  71.                     if("undefined" != typeof _fields[_f][3] && _fields[_f][3] != "")
  72.                         _tmp.setAttribute('value', _fields[_f][3]);
  73.                 break;
  74.             }
  75.             _tmp.setAttribute('id', _f);
  76.             if("undefined" != typeof _fields[_f][2] && _fields[_f][2].length > 0) {
  77.                 for(_a=0; _a<_fields[_f][2].length; _a++) {
  78.                     _tmp.setAttribute(_fields[_f][2][_a++], _fields[_f][2][_a]);
  79.                 }
  80.             }
  81.             var _class = 'window' + ((_f % 2 == 0)? '2' : '1');
  82.             var _row = document.createElement('tr');
  83.             _row.appendChild(document.createElement('td'));
  84.             _row.lastChild.setAttribute('class', _class);
  85.             _row.lastChild.setAttribute('className', _class);
  86.             _row.lastChild.setAttribute('vAlign', 'top');
  87.             _row.lastChild.setAttribute('width', _widths[1]);
  88.             _row.lastChild.appendChild(document.createElement('font'));
  89.             _row.lastChild.lastChild.setAttribute('size', '2');
  90.             _row.lastChild.lastChild.style.fontWeight = 'bold';
  91.             _row.lastChild.lastChild.appendChild(document.createTextNode(_fields[_f][1] + ':'));
  92.             _row.appendChild(document.createElement('td'));
  93.             _row.lastChild.setAttribute('class', _class);
  94.             _row.lastChild.setAttribute('className', _class);
  95.             _row.lastChild.setAttribute('width', _widths[2]);
  96.             _row.lastChild.appendChild(document.createElement('font'));
  97.             _row.lastChild.lastChild.setAttribute('size', '2');
  98.             _row.lastChild.lastChild.appendChild(_tmp);
  99.             _row.appendChild(document.createElement('td'));
  100.             _row.lastChild.setAttribute('class', _class);
  101.             _row.lastChild.setAttribute('className', _class);
  102.             _row.lastChild.setAttribute('vAlign', 'top');
  103.             _row.lastChild.setAttribute('width', _widths[3]);
  104.             _row.lastChild.appendChild(document.createElement('font'));
  105.             _row.lastChild.lastChild.size = '1';
  106.             _row.lastChild.lastChild.appendChild(document.createTextNode(_fields[_f][4]));
  107.             _holder.firstChild.appendChild(_row);
  108.         }
  109.         var _submit = document.createElement('tr');
  110.         _submit.appendChild(document.createElement('td'));
  111.         _submit.lastChild.setAttribute('class', 'window' + (((_f+1) % 2 == 0)? '1' : '2'));
  112.         _submit.lastChild.setAttribute('className', 'window' + (((_f+1) % 2 == 0)? '1' : '2'));
  113.         _submit.lastChild.setAttribute('align', 'center');
  114.         _submit.lastChild.setAttribute('colSpan', 3);
  115.         var _button = document.createElement('input');
  116.         _button.setAttribute('type', 'button');
  117.         _button.setAttribute('value', 'Post Message');
  118.         _button.onclick = function() { _posting_form.post_it(); };
  119.         _submit.lastChild.appendChild(_button);
  120.         _holder.firstChild.appendChild(_submit);
  121.         document.post_form.style.display = 'none';
  122.         document.post_form.parentNode.insertBefore(_holder,  document.post_form);
  123.     },
  124.     
  125.     post_it: function() {
  126.         // create message and attempt to post it
  127.         this.errors = new Array();
  128.         document.post_form.message.value = document.post_form.subject.value = '';
  129.         var _sub = document.getElementById('0').value;
  130.         _fields[0][5] = true;
  131.         document.post_form.subject.value    = _sub;
  132.         for(_f=0; _f<_fields.length; _f++) {
  133.             if(document.getElementById(_f)) {
  134.                 _value = document.getElementById(_f).value;
  135.                 if(!_value || _value.match(/^s*$/)) {
  136.                     if(_f > 0 && _fields[_f][5])
  137.                         this.show_error('You have left the ' + _fields[_f][1] + ' option empty. This is a required field and as such must contain a value.');
  138.                     else
  139.                         _value = '[i]None[/i]';
  140.                 }
  141.                 document.post_form.message.value += '[b]' + _fields[_f][1] + ':[/b] ' + _value + 'nn';
  142.             }
  143.         }
  144.         if(this.errors.length == 0)
  145.             document.post_form.post.click();
  146.         else
  147.             this.show_error();
  148.     },
  149.     
  150.     show_error: function() {
  151.         if("undefined" != typeof arguments[0] && arguments[0]) {
  152.             this.errors.push(arguments[0]);
  153.         } else {
  154.             // Show Errors
  155.             if(document.getElementById('status_holder')) {
  156.                 document.getElementById('status_holder_title').innerHTML = "An Error Has Occured";
  157.                 document.getElementById('status_holder_message').innerHTML = this.errors.join("<br />");
  158.                 document.getElementById('status_holder').style.display = 'block';
  159.             }
  160.         }
  161.     }
  162. }
  163.  
  164.  
  165. if(document.post_form && location.href.match(/action\/post\/?$/) && vf_username != 'Guest') {
  166.     _posting_form.init();
  167. }
  168.  
  169. //-->
  170. </script>
 


I kinda need this ASAP!!

Thanks,
Darkmage


I would do this myself, but what needs to be done, is something I do not know how to do, without screwing the code up.


EDIT: Will someone please do this. I give cookies if you do {Cheesy}
 Printable View

All times are GMT+0 :: The current time is 12:28am
Page generated in 2.5331 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums