|
Post by Dragon on Nov 26, 2011 18:32:20 GMT -8
Wormo I dont understand how to put what I need in. <script type="text/javascript"> <!-- // Multiple Template Forms // by Wormopolis - [url]www.wormocodes.com[/url] // keep header intact // BASE CODE: /* Predefined Posting Template/Form Created by Ross of PBS Please do not repost outside of PBS/WormoCodes without permission */ // and yes I had permission to post on WormoCodes
// DO NOT EDIT THIS SECTION. EDITING IS BELOW THIS
var templateArray=new Array(), tA=0, keepTAnum;
// EDIT THIS SECTION:
// COPY THIS ENTIRE BLOCK FOR EACH FORM, change fields to what you need templateArray[tA]=new templateForm; templateArray[tA]._title="Form 1"; templateArray[tA]._description="Testing Form 1"; templateArray[tA]._fields[templateArray[tA]._f++] = new Array('input', 'Subject Title:', ['size', 60, 'maxLength', 50], '', 'This will be the name of your thread.', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('input', 'Character Name:', ['size', 60, 'maxLength', 50], '', 'Please write your characters name.', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('input', 'Age:', ['size', 60, 'maxLength', 50], '', 'Your characters age.', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('select', 'Gender:', [], ['Male', 'Female'], 'Either a guy or a gal', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('input', 'Parent Types:', ['size', 60, 'maxLength', 50], '', 'What are the parents\' creature types?', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('textarea', 'Physical Appearance:', ['cols', 70, 'rows', 5], '', 'A description of what your charrie looks like. A minimum of five good length sentences is required, OR an image accompanied by 2-3 good length sentences.', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('textarea', 'Personality Description:', ['cols', 70, 'rows', 5], '', 'A description of your character\'s personality. A minimum of five good length sentences is required.', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('textarea', 'History:', ['cols', 70, 'rows', 5], '', 'What happened in your person\'s past? Please make it realistic. A minimum of seven good length sentences is required.', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('textarea', 'Likes/Dislikes(optional):', ['cols', 70, 'rows', 5], '', 'Your person\'s likes and dislikes.', false); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('textarea', 'Other:', ['cols', 70, 'rows', 5], '', 'If there\'s anything else that doesn\'t fit in any of the above categories, here\'s the place to post it.', false); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('input', 'Codeword:', ['size', 60, 'maxLength', 50], '', 'Hidden in the rules is a codeword. This item is compulsory when creating a character.', true);
tA++; //leave this alone
// END BLOCK
// COPY THIS ENTIRE BLOCK FOR EACH FORM, change fields to what you need templateArray[tA]=new templateForm; templateArray[tA]._title="Form 2"; templateArray[tA]._description="Testing Form 2"; templateArray[tA]._fields[templateArray[tA]._f++] = new Array('input', 'Car Title:', ['size', 60, 'maxLength', 50], '', 'This will be the title number of your car.', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('input', 'Car Name:', ['size', 60, 'maxLength', 50], '', 'Please write your cars name.', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('select', 'Model:', [], ['Ford', 'Chevy'], 'choose wisely', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('textarea', 'Physical Appearance:', ['cols', 70, 'rows', 5], '', 'A description of what your car looks like. A minimum of five good length sentences is required, OR an image accompanied by 2-3 good length sentences.', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('textarea', 'History:', ['cols', 70, 'rows', 5], '', 'What happened in your car\'s past? Please make it realistic. A minimum of seven good length sentences is required.', true); templateArray[tA]._fields[templateArray[tA]._f++] = new Array('textarea', 'Other:', ['cols', 70, 'rows', 5], '', 'If there\'s anything else that doesn\'t fit in any of the above categories, here\'s the place to post it.', false);
tA++; //leave this alone
// END BLOCK
// END EDITABLE SECTION
// DO NOT EDIT BELOW, unless you know what you are doing
function templateForm(){ this._title = ''; this.this_description = ''; this._fields = new Array(); this._f = 0; this._widths = ['100%', '30%', '35%', '35%'];
this.postingForm={
errors : new Array(),
init : function() { this.create_form(); },
create_form: function() { // Create new post layout var _holder = document.createElement('table'); _holder.setAttribute('className', 'bordercolor'); _holder.setAttribute('class', 'bordercolor'); _holder.setAttribute('cellSpacing','1'); _holder.setAttribute('cellPadding', '4'); _holder.setAttribute('align', 'center'); _holder.setAttribute('width', this.parent._widths[0]); _holder.setAttribute('id', 'post_form_holder'); _holder.appendChild(document.createElement('tbody')); _holder.firstChild.appendChild( document.createElement('tr') ).appendChild( document.createElement('td') ).appendChild( document.createElement('font') ); _holder.firstChild.lastChild.lastChild.className = 'titlebg'; _holder.firstChild.lastChild.lastChild.colSpan = '3'; _holder.firstChild.lastChild.lastChild.lastChild.size = '2'; _holder.firstChild.lastChild.lastChild.lastChild.appendChild(document.createTextNode(this.parent._title)); if(this.parent._description) { _holder.firstChild.appendChild( document.createElement('tr') ).appendChild( document.createElement('td') ).appendChild( document.createElement('font') ); _holder.firstChild.lastChild.lastChild.setAttribute('className', 'windowbg'); _holder.firstChild.lastChild.lastChild.setAttribute('class', 'windowbg'); _holder.firstChild.lastChild.lastChild.setAttribute('colSpan', '3'); _holder.firstChild.lastChild.lastChild.lastChild.setAttribute('size', '2'); _holder.firstChild.lastChild.lastChild.lastChild.innerHTML = this.parent._description; } for(_f=0; _f<this.parent._fields.length; _f++) { switch(this.parent._fields[_f][0]) { case 'textarea' : var _tmp = document.createElement('textarea'); break; case 'select' : var _tmp = document.createElement('select'); for(_o=0; _o<this.parent._fields[_f][3].length; _o++) { _tmp.options[_o] = new Option(this.parent._fields[_f][3][_o], this.parent._fields[_f][3][_o]); } break; default : var _tmp = document.createElement('input'); _tmp.type = 'text'; if("undefined" != typeof this.parent._fields[_f][3] && this.parent._fields[_f][3] != "") _tmp.setAttribute('value', this.parent._fields[_f][3]); break; } _tmp.setAttribute('id', _f); if("undefined" != typeof this.parent._fields[_f][2] && this.parent._fields[_f][2].length > 0) { for(_a=0; _a<this.parent._fields[_f][2].length; _a++) { _tmp.setAttribute(this.parent._fields[_f][2][_a++], this.parent._fields[_f][2][_a]); } } var _class = 'windowbg' + ((_f % 2 == 0)? '2' : ''); var _row = document.createElement('tr'); _row.appendChild(document.createElement('td')); _row.lastChild.setAttribute('class', _class); _row.lastChild.setAttribute('className', _class); _row.lastChild.setAttribute('vAlign', 'top'); _row.lastChild.setAttribute('width', this.parent._widths[1]); _row.lastChild.appendChild(document.createElement('font')); _row.lastChild.lastChild.setAttribute('size', '2'); _row.lastChild.lastChild.style.fontWeight = 'bold'; _row.lastChild.lastChild.appendChild(document.createTextNode(this.parent._fields[_f][1] + ':')); _row.appendChild(document.createElement('td')); _row.lastChild.setAttribute('class', _class); _row.lastChild.setAttribute('className', _class); _row.lastChild.setAttribute('width', this.parent._widths[2]); _row.lastChild.appendChild(document.createElement('font')); _row.lastChild.lastChild.setAttribute('size', '2'); _row.lastChild.lastChild.appendChild(_tmp); _row.appendChild(document.createElement('td')); _row.lastChild.setAttribute('class', _class); _row.lastChild.setAttribute('className', _class); _row.lastChild.setAttribute('vAlign', 'top'); _row.lastChild.setAttribute('width', this.parent._widths[3]); _row.lastChild.appendChild(document.createElement('font')); _row.lastChild.lastChild.size = '1'; _row.lastChild.lastChild.appendChild(document.createTextNode(this.parent._fields[_f][4])); _row.onclick= function() { document.getElementById('MMPT_submit').style.color=''; }; _holder.firstChild.appendChild(_row); } var _submit = document.createElement('tr'); _submit.appendChild(document.createElement('td')); _submit.lastChild.setAttribute('class', 'windowbg' + (((_f+1) % 2 == 0)? '' : '2')); _submit.lastChild.setAttribute('className', 'windowbg' + (((_f+1) % 2 == 0)? '' : '2')); _submit.lastChild.setAttribute('align', 'center'); _submit.lastChild.setAttribute('colSpan', 3); var _button = document.createElement('input'); _button.id='MMPT_submit'; _button.setAttribute('type', 'button'); _button.setAttribute('value', 'Post Message'); _button.onclick = function() { templateArray[keepTAnum].postingForm.post_it(); }; _submit.lastChild.appendChild(_button); _holder.firstChild.appendChild(_submit); var _tables = document.postForm.getElementsByTagName('table')[0]; _tables.style.display = 'none'; _tables.parentNode.insertBefore(_holder, _tables); },
post_it : function() { // create message and attempt to post it this.errors = new Array(); document.postForm.message.value = document.postForm.subject.value = ''; var _sub = document.getElementById('0').value; this.parent._fields[0][5] = true; document.postForm.subject.value = _sub; for(_f=0; _f<this.parent._fields.length; _f++) { if(document.getElementById(_f)) { _value = document.getElementById(_f).value; if(!_value || _value.match(/^\s*$/)) { if(_f > 0 && this.parent._fields[_f][5]) this.show_error('You have left the ' + this.parent._fields[_f][1] + ' option empty. This is a required field and as such must contain a description.'); else _value = 'None'; } document.postForm.message.value += '' + this.parent._fields[_f][1] + ': ' + _value + '\n\n'; } } if(this.errors.length == 0) document.postForm.submit(true); else this.show_error(); },
show_error : function() { if("undefined" != typeof arguments[0] && arguments[0]) { this.errors.push(arguments[0]); } else { // Show Errors document.getElementById('MMPT_submit').style.color='FF0000'; if(document.getElementById('error_holder')) { document.getElementById('error_holder').innerHTML = this.errors.join("<br />"); } else { var _error_holder = document.createElement('table'); _error_holder.id='error_holder_table'; _error_holder.className = 'bordercolor'; _error_holder.cellSpacing= '1'; _error_holder.cellPadding = '4'; _error_holder.align = 'center'; _error_holder.width = this.parent._widths[0]; _error_holder.appendChild(document.createElement('tbody')); _error_holder.firstChild.appendChild(document.createElement('tr')).appendChild(document.createElement('td')).appendChild (document.createElement('font')); _error_holder.firstChild.lastChild.lastChild.className='titlebg'; _error_holder.firstChild.lastChild.lastChild.lastChild.setAttribute('size', '2'); _error_holder.firstChild.lastChild.lastChild.lastChild.innerHTML= 'An Error Has Occured'; _error_holder.firstChild.appendChild(document.createElement('tr')).appendChild(document.createElement('td')).appendChild (document.createElement('font')); _error_holder.firstChild.lastChild.lastChild.className='windowbg'; _error_holder.firstChild.lastChild.lastChild.lastChild.setAttribute('size', '2'); _error_holder.firstChild.lastChild.lastChild.lastChild.setAttribute('id', 'error_holder'); _error_holder.firstChild.lastChild.lastChild.lastChild.innerHTML= this.errors.join("<br />") ; var _holder = document.getElementById('post_form_holder'); _holder.parentNode.insertBefore(_error_holder, _holder); _holder.parentNode.insertBefore(document.createElement('br'), _holder); } } } }; this.postingForm.parent=this; }
if(document.postForm && location.href.match(/action=post/) && pb_username != 'Guest') { var MPTdiv=document.createElement('div'); MPTdiv.align="left"; MPTdiv.className='windowbg'; MPTdiv.innerHTML='<font size="2">Posting Templates: </font>'; var MPTdd=document.createElement('select'); MPTdd.onchange=function() {MPTinitForm(MPTdd.value);}; MPTddNorm=document.createElement('option'); MPTddNorm.value='-1'; MPTddNorm.innerHTML="Normal"; MPTdd.appendChild(MPTddNorm); for (pt=0; pt<tA; pt++) { var MPTddOpt=document.createElement('option'); MPTddOpt.value=pt; MPTddOpt.innerHTML=templateArray[pt]._title; MPTdd.appendChild(MPTddOpt); } MPTdiv.appendChild(MPTdd); document.postForm.insertBefore(MPTdiv, document.postForm.firstChild);
function MPTinitForm(num) { if (document.getElementById('post_form_holder')) { tmp=document.getElementById('post_form_holder'); tmp.parentNode.removeChild(tmp); } if (document.getElementById('error_holder_table')) { tmp=document.getElementById('error_holder_table'); tmp.parentNode.removeChild(tmp.nextSibling); tmp.parentNode.removeChild(tmp); } if (num>-1) { keepTAnum=num; templateArray[num].postingForm.init(); } else { document.postForm.getElementsByTagName('table')[0].style.display=''; } }
} // DO NOT EDIT ABOVE SECTION
//--> </script>
How do I put in a form for this: [#1]
|
Release date: 8 September 2007 (USA) Genre: , Summary: [scrolly:h(50),w(460),sy] Type here [/scrolly] External links:
|
I need it to put pretty much all that in, and I get the part for release date genre and external links I think, but how to put it all in..... Help please ?
|
|
|
Post by Wormopolis on Nov 26, 2011 21:06:04 GMT -8
a posting template is more for making replies fit a certain format. that code there allows you to have different templates in the same thread that can be chosen from a drop down. it makes it where specific information HAS to be included or a post cant be made.
if you are putting all these things in yourself, you mist likely dont need a template since you know what information needs to be included.
|
|
|
Post by Dragon on Nov 26, 2011 21:32:42 GMT -8
I suppose then what I need isnt a template but a preset thing ? I need it to be setup so in a new post that whole table is put inside already and then just paste in the blanks.
|
|
|
Post by Dragon on Dec 5, 2011 12:12:53 GMT -8
What do you think wormo? Is there a code to drop in the whole table there in the post so we can just fill in the blanks?
|
|