vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: Predefined Posting Template/Form - View Topic (Page 3 of 5)
| |
| Michael Moderator
Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
pmvForum | Re: Predefined Posting Template/Form (23rd Jan 08 at 2:14am UTC) | | For now use the one I posted a couple of posts above your post.
it works fine. I'll point Ross here! | |
| dog199200 Guest | Re: Predefined Posting Template/Form (23rd Jan 08 at 2:29am UTC) | | ok the one that Ross redid for that one guy works on my Inuyasha one, but then i tried it on my Naurto one and it didn't work...in fact none of them works on my naruto site...
http://narutoillusions.virtualforums.co.uk/ | |
| Michael Moderator
Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
pmvForum | Re: Predefined Posting Template/Form (23rd Jan 08 at 3:01am UTC) | | try moving:
Code: - <script type="text/javascript">
- <!--
- /*
- Send PM's With No Subject by Cr0w
- Copyright 2008
- Do not repost
- */
-
- var pForm = document.pm_form;
- pForm.onsubmit = function(){
- if(pForm.subject.value == "" || pForm.subject.value == null){
- var conf = confirm("PM has no subject!\nSend anyway?");
- if(conf){
- pForm.subject.value = "(no subject)";
- return true;
- }
- else{
- return false;
- }
- }
- }
- //-->
-
- </script>
to your MAIN footer | |
| dog199200 Guest | Re: Predefined Posting Template/Form (23rd Jan 08 at 3:20am UTC) | | it is | |
| Cryhavoc_ Full Member
Just do it. Posts: 238 Status: Offline Gender: Male Location: The wrong way. Age: 32 Joined:
pm | Re: Predefined Posting Template/Form (5th Feb 08 at 2:01am UTC) | | Oh Ross the great. | |
|
| Tim Senior Member
banned.
The only easy day was yesterday. Posts: 698 Status: Offline Gender: Male Location: Under your bed..in your closet..in your head Age: 33 Joined:
pmmsn | Re: Predefined Posting Template/Form (16th Mar 08 at 2:38am UTC) | | Gee, thanks Ross for making this code so damn confusing.
So where exactly do we post the content of wat we want our members to fill out? | |
|
| Marc vChat Developer
I <3 Rossy
Posts: 3,388 Status: Offline Gender: Male Location: Ontario, Canada Age: 32 Joined:
Additional Groups: Coding Team
pmwww | Re: Predefined Posting Template/Form (16th Mar 08 at 2:45am UTC) | | Gee, thanks Ross for making this code so damn confusing.
So where exactly do we post the content of wat we want our members to fill out?
Insulting code creators is never a good idea; they make these codes for you on their own time, not because they have to.
If you'd like help with a code, head on over to Code Support. | |
rroll.to— Shorten a link, rickroll your friends. |
| Tim Senior Member
banned.
The only easy day was yesterday. Posts: 698 Status: Offline Gender: Male Location: Under your bed..in your closet..in your head Age: 33 Joined:
pmmsn | Re: Predefined Posting Template/Form (16th Mar 08 at 2:48am UTC) | | I wasn't trying to insult him | |
|
| Dave New Member
Posts: 6 Status: Offline Location: Bolton, Lancashire, UK Age: 38 Joined:
pmwwwmsn | Re: Predefined Posting Template/Form (15th Apr 09 at 10:08pm UTC) | | This code no longer works and is returning an error | |
| Ross Administrator
Posts: 3,709 Status: Offline Gender: Male Age: 8 1⁄1 Joined:
Additional Groups: Support Team
pmwwwgtalkvForum | Re: Predefined Posting Template/Form (15th Apr 09 at 11:39pm UTC) | | This code no longer works and is returning an error Looks like I hadn't followed my own advice and had left an un-escaped apostrophe in the example version. I have fixed the version in the first post | |
|
| Aiken Full Member
Posts: 333 Status: Offline Gender: Male Location: In a very lonely place, the domain of despair Age: 35 Joined:
pmskypemsnyahooxfire | | Aiken Full Member
Posts: 333 Status: Offline Gender: Male Location: In a very lonely place, the domain of despair Age: 35 Joined:
pmskypemsnyahooxfire | Re: Predefined Posting Template/Form (18th Dec 09 at 3:37am UTC) | | My Perfect World RP needs this code for multiple boards and it won't work on most of those boards
A suggestion: have a variable for post title or people can use default title method, also an optional variable for description | |
vF forums: Perfect World RP BLEACH Universe - Under Construction / Testing Phase Xen Qarna RP - Stage I Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled the Final Anime Hideout |
| Nick Very Senior Member
Posts: 3,012 Status: Offline Gender: Male Location: vForums Age: 34 Joined:
pmwww | Re: Predefined Posting Template/Form (18th Dec 09 at 5:05am UTC) | | Does the code have something like this: Don't if so then it would need something like this Don\'t in order for it to work.
But just in case, can you post the codes that don't work? | |
| Aiken Full Member
Posts: 333 Status: Offline Gender: Male Location: In a very lonely place, the domain of despair Age: 35 Joined:
pmskypemsnyahooxfire | Re: Predefined Posting Template/Form (18th Dec 09 at 1:20pm UTC) | | Code: - <script type="text/javascript">
- <!--
-
- /* Predefined Posting Template/Form
- Created by Ross of vForums
- http://virtualforums.co.uk
- Please do not repost outside of
- vForums support without permission */
-
- var _title = 'Buying a room';
-
- var _description = 'Please fill out these fields to buy your room, it costs 1 gold and 5 silver.';
-
- var _fields = new Array(); var _f = 0;
- _fields[_f++] = new Array('input', 'Room Name', ['size', 40, 'maxLength', 50], 'New room', '', true);
- _fields[_f++] = new Array('select', 'Location of Room', [], ['Perfect World', '--Portal of Darkness', '--Paradise', '----Kami's battle house', '----Fantasia'], '', true);
- _fields[_f++] = new Array('textarea', 'Brief Description', ['cols', 40, 'rows', 10, 'maxlength', 300], '', '300 characters max', true);
- _fields[_f++] = new Array('textarea', 'Full Description', ['cols', 40, 'rows', 10], '', 'Unlimited characters - optional', false);
-
- var _widths = ['100%'];
-
- var _posting_form = {
-
- errors: new Array(),
-
- init: function() {
- this.create_form();
- },
-
- create_form: function() {
- // Create new post layout
- var _holder = document.createElement('table');
- _holder.setAttribute('className', 'border');
- _holder.setAttribute('class', 'border');
- _holder.setAttribute('cellSpacing','1');
- _holder.setAttribute('cellPadding', '4');
- _holder.setAttribute('align', 'center');
- _holder.setAttribute('width', _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 = 'title1';
- _holder.firstChild.lastChild.lastChild.colSpan = '3';
- _holder.firstChild.lastChild.lastChild.lastChild.size = '2';
- _holder.firstChild.lastChild.lastChild.lastChild.appendChild(document.createTextNode(_title));
- if(_description) {
- _holder.firstChild.appendChild( document.createElement('tr') ).appendChild( document.createElement('td') ).appendChild( document.createElement('font') );
- _holder.firstChild.lastChild.lastChild.setAttribute('className', 'window1');
- _holder.firstChild.lastChild.lastChild.setAttribute('class', 'window1');
- _holder.firstChild.lastChild.lastChild.setAttribute('colSpan', '3');
- _holder.firstChild.lastChild.lastChild.lastChild.setAttribute('size', '2');
- _holder.firstChild.lastChild.lastChild.lastChild.innerHTML = _description;
- }
-
- for(_f=0; _f<_fields.length; _f++) {
- switch(_fields[_f][0]) {
- case 'textarea' :
- var _tmp = document.createElement('textarea');
- break;
-
- case 'select' :
- var _tmp = document.createElement('select');
- for(_o=0; _o<_fields[_f][3].length; _o++) {
- _tmp.options[_o] = new Option(_fields[_f][3][_o], _fields[_f][3][_o]);
- }
- break;
-
- default :
- var _tmp = document.createElement('input');
- _tmp.type = 'text';
- if("undefined" != typeof _fields[_f][3] && _fields[_f][3] != "")
- _tmp.setAttribute('value', _fields[_f][3]);
- break;
- }
- _tmp.setAttribute('id', _f);
- if("undefined" != typeof _fields[_f][2] && _fields[_f][2].length > 0) {
- for(_a=0; _a<_fields[_f][2].length; _a++) {
- _tmp.setAttribute(_fields[_f][2][_a++], _fields[_f][2][_a]);
- }
- }
- var _class = 'window' + ((_f % 2 == 0)? '2' : '1');
- 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', _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(_fields[_f][1] + ':'));
- _row.appendChild(document.createElement('td'));
- _row.lastChild.setAttribute('class', _class);
- _row.lastChild.setAttribute('className', _class);
- _row.lastChild.setAttribute('width', _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', _widths[3]);
- _row.lastChild.appendChild(document.createElement('font'));
- _row.lastChild.lastChild.size = '1';
- _row.lastChild.lastChild.appendChild(document.createTextNode(_fields[_f][4]));
- _holder.firstChild.appendChild(_row);
- }
- var _submit = document.createElement('tr');
- _submit.appendChild(document.createElement('td'));
- _submit.lastChild.setAttribute('class', 'window' + (((_f+1) % 2 == 0)? '1' : '2'));
- _submit.lastChild.setAttribute('className', 'window' + (((_f+1) % 2 == 0)? '1' : '2'));
- _submit.lastChild.setAttribute('align', 'center');
- _submit.lastChild.setAttribute('colSpan', 3);
- var _button = document.createElement('input');
- _button.setAttribute('type', 'button');
- _button.setAttribute('value', 'Post Message');
- _button.onclick = function() { _posting_form.post_it(); };
- _submit.lastChild.appendChild(_button);
- _holder.firstChild.appendChild(_submit);
- document.post_form.style.display = 'none';
- document.post_form.parentNode.insertBefore(_holder, document.post_form);
- },
-
- post_it: function() {
- // create message and attempt to post it
- this.errors = new Array();
- document.post_form.message.value = document.post_form.subject.value = '';
- var _sub = document.getElementById('0').value;
- _fields[0][5] = true;
- document.post_form.subject.value = _sub;
- for(_f=0; _f<_fields.length; _f++) {
- if(document.getElementById(_f)) {
- _value = document.getElementById(_f).value;
- if(!_value || _value.match(/^s*$/)) {
- if(_f > 0 && _fields[_f][5])
- this.show_error('You have left the ' + _fields[_f][1] + ' option empty. This is a required field and as such must contain a value.');
- else
- _value = '[i]None[/i]';
- }
- document.post_form.message.value += '[b]' + _fields[_f][1] + ':[/b] ' + _value + '
- ';
- }
- }
- if(this.errors.length == 0)
- document.post_form.post.click();
- else
- this.show_error();
- },
-
- show_error: function() {
- if("undefined" != typeof arguments[0] && arguments[0]) {
- this.errors.push(arguments[0]);
- } else {
- // Show Errors
- if(document.getElementById('status_holder')) {
- document.getElementById('status_holder_title').innerHTML = "An Error Has Occured";
- document.getElementById('status_holder_message').innerHTML = this.errors.join("<br />");
- document.getElementById('status_holder').style.display = 'block';
- }
- }
- }
- }
-
-
- if(document.post_form && location.href.match(/action\/post\/?$/) && vf_username != 'Guest') {
- _posting_form.init();
- }
-
- //-->
- </script><script type="text/javascript">
- <!--
-
- /* Predefined Posting Template/Form
- Created by Ross of vForums
- http://virtualforums.co.uk
- Please do not repost outside of
- vForums support without permission */
-
- var _title = 'Buying an item';
-
- var _description = 'Please select what item you are buying<br><br>Colors: 5,000 Yen<br>Style: 1,000 Yen';
-
- var _fields = new Array(); var _f = 0;
- _fields[_f++] = new Array('select', 'Item', [], ['Red Name', 'Blue Name', 'Yellow Name', 'Green Name', 'Orange Name', 'Purple Name', 'White Name', 'Gold Name', 'Silver Name', 'Pink Name', 'Gray Name', 'Bold Name', 'Italic Name', 'Strike Through Name'], '', true);
-
- var _widths = ['100%'];
-
- var _posting_form = {
-
- errors: new Array(),
-
- init: function() {
- this.create_form();
- },
-
- create_form: function() {
- // Create new post layout
- var _holder = document.createElement('table');
- _holder.setAttribute('className', 'border');
- _holder.setAttribute('class', 'border');
- _holder.setAttribute('cellSpacing','1');
- _holder.setAttribute('cellPadding', '4');
- _holder.setAttribute('align', 'center');
- _holder.setAttribute('width', _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 = 'title1';
- _holder.firstChild.lastChild.lastChild.colSpan = '3';
- _holder.firstChild.lastChild.lastChild.lastChild.size = '2';
- _holder.firstChild.lastChild.lastChild.lastChild.appendChild(document.createTextNode(_title));
- if(_description) {
- _holder.firstChild.appendChild( document.createElement('tr') ).appendChild( document.createElement('td') ).appendChild( document.createElement('font') );
- _holder.firstChild.lastChild.lastChild.setAttribute('className', 'window1');
- _holder.firstChild.lastChild.lastChild.setAttribute('class', 'window1');
- _holder.firstChild.lastChild.lastChild.setAttribute('colSpan', '3');
- _holder.firstChild.lastChild.lastChild.lastChild.setAttribute('size', '2');
- _holder.firstChild.lastChild.lastChild.lastChild.innerHTML = _description;
- }
-
- for(_f=0; _f<_fields.length; _f++) {
- switch(_fields[_f][0]) {
- case 'textarea' :
- var _tmp = document.createElement('textarea');
- break;
-
- case 'select' :
- var _tmp = document.createElement('select');
- for(_o=0; _o<_fields[_f][3].length; _o++) {
- _tmp.options[_o] = new Option(_fields[_f][3][_o], _fields[_f][3][_o]);
- }
- break;
-
- default :
- var _tmp = document.createElement('input');
- _tmp.type = 'text';
- if("undefined" != typeof _fields[_f][3] && _fields[_f][3] != "")
- _tmp.setAttribute('value', _fields[_f][3]);
- break;
- }
- _tmp.setAttribute('id', _f);
- if("undefined" != typeof _fields[_f][2] && _fields[_f][2].length > 0) {
- for(_a=0; _a<_fields[_f][2].length; _a++) {
- _tmp.setAttribute(_fields[_f][2][_a++], _fields[_f][2][_a]);
- }
- }
- var _class = 'window' + ((_f % 2 == 0)? '2' : '1');
- 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', _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(_fields[_f][1] + ':'));
- _row.appendChild(document.createElement('td'));
- _row.lastChild.setAttribute('class', _class);
- _row.lastChild.setAttribute('className', _class);
- _row.lastChild.setAttribute('width', _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', _widths[3]);
- _row.lastChild.appendChild(document.createElement('font'));
- _row.lastChild.lastChild.size = '1';
- _row.lastChild.lastChild.appendChild(document.createTextNode(_fields[_f][4]));
- _holder.firstChild.appendChild(_row);
- }
- var _submit = document.createElement('tr');
- _submit.appendChild(document.createElement('td'));
- _submit.lastChild.setAttribute('class', 'window' + (((_f+1) % 2 == 0)? '1' : '2'));
- _submit.lastChild.setAttribute('className', 'window' + (((_f+1) % 2 == 0)? '1' : '2'));
- _submit.lastChild.setAttribute('align', 'center');
- _submit.lastChild.setAttribute('colSpan', 3);
- var _button = document.createElement('input');
- _button.setAttribute('type', 'button');
- _button.setAttribute('value', 'Post Message');
- _button.onclick = function() { _posting_form.post_it(); };
- _submit.lastChild.appendChild(_button);
- _holder.firstChild.appendChild(_submit);
- document.post_form.style.display = 'none';
- document.post_form.parentNode.insertBefore(_holder, document.post_form);
- },
-
- post_it: function() {
- // create message and attempt to post it
- this.errors = new Array();
- document.post_form.message.value = document.post_form.subject.value = '';
- var _sub = document.getElementById('0').value;
- _fields[0][5] = true;
- document.post_form.subject.value = _sub;
- for(_f=0; _f<_fields.length; _f++) {
- if(document.getElementById(_f)) {
- _value = document.getElementById(_f).value;
- if(!_value || _value.match(/^s*$/)) {
- if(_f > 0 && _fields[_f][5])
- this.show_error('You have left the ' + _fields[_f][1] + ' option empty. This is a required field and as such must contain a value.');
- else
- _value = '[i]None[/i]';
- }
- document.post_form.message.value += '[b]' + _fields[_f][1] + ':[/b] ' + _value + '
- ';
- }
- }
- if(this.errors.length == 0)
- document.post_form.post.click();
- else
- this.show_error();
- },
-
- show_error: function() {
- if("undefined" != typeof arguments[0] && arguments[0]) {
- this.errors.push(arguments[0]);
- } else {
- // Show Errors
- if(document.getElementById('status_holder')) {
- document.getElementById('status_holder_title').innerHTML = "An Error Has Occured";
- document.getElementById('status_holder_message').innerHTML = this.errors.join("<br />");
- document.getElementById('status_holder').style.display = 'block';
- }
- }
- }
- }
-
-
- if(document.post_form && location.href.match(/action\/post\/?$/) && vf_username != 'Guest') {
- _posting_form.init();
- }
-
- //-->
- </script>
| |
vF forums: Perfect World RP BLEACH Universe - Under Construction / Testing Phase Xen Qarna RP - Stage I Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled the Final Anime Hideout |
| Aiken Full Member
Posts: 333 Status: Offline Gender: Male Location: In a very lonely place, the domain of despair Age: 35 Joined:
pmskypemsnyahooxfire | | |
| |
|