inherit
24252
0
Aug 1, 2023 15:01:24 GMT -8
coolcoolcool
When the world says, "Give up," Hope whispers, "Try it one more time."
2,148
May 2004
coolcoolcool
|
Post by coolcoolcool on Jul 16, 2012 5:58:50 GMT -8
The trick is to use one of the already existing forms. Send the data through one of them then when the page is loaded remove the data from the form and manipulate the page with the data.
|
|
Former Member
inherit
guest@proboards.com
155913
0
Nov 23, 2024 8:08:58 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 16, 2012 17:18:42 GMT -8
OK, not quite understanding ya yet. I have tried using the "Modify Profile" form and have modified the form successsfully. But I still am having no luck with manipulating the Profile page.
Here is what I am using to modify the "Modify Profile" form:
<SCRIPT TYPE="text/javascript"> if(pb_action=="modifyprofile"){ table=document.getElementsByTagName("table") for(i=0;i<table.length;i++){ if(table.width=="650"){ var row=table.insertRow(0) var cell1=row.insertCell(0) var cell2=row.insertCell(1) cell1.innerHTML="BodyBG Color" cell2.innerHTML= "<INPUT NAME='colorbox' TYPE='text'>" }} } </SCRIPT>
This adds a row at the top of the "Modify Profile" form, which contains a cell that contains a description ("BodyBGColor") and a textbox in the next cell.
something like this:
BodyBG "This is the text box'
So how do I get my new text box to manipulate the Profile page? Through a function?
|
|
inherit
24252
0
Aug 1, 2023 15:01:24 GMT -8
coolcoolcool
When the world says, "Give up," Hope whispers, "Try it one more time."
2,148
May 2004
coolcoolcool
|
Post by coolcoolcool on Jul 16, 2012 17:24:39 GMT -8
In the spirit of not giving too much away, I'll just describe how it works and let you code it.
Basically, if you ever want to send any data to a server through html you have to do so through the post (by using a form or some Ajax trickery). The problem is, even if you send off data in post, that doesn't mean the server has to do anything with it. You creating an input box does nothing if you can't touch the server side coding.
So does that mean we're done? We can't do anything? Not quite. What proboards coders have figured out is that the other forms that already exist on the page can still be used, even though their purpose is usually meant for different things. For example, you could make a fake input textbox and whenever the form is submitted, manipulate the post by tacking on the value of your input box to say the signature input that already exists. Then, on every page that the signature appears you can remove the data and do as you see fit with it.
It's a bit of a hackish way of doing things, but unless proboards has changed since I last coded here, that's the only way of doing things.
|
|
Former Member
inherit
guest@proboards.com
155913
0
Nov 23, 2024 8:08:58 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 16, 2012 17:41:51 GMT -8
I guess that doing it any other way is edging TOS rules? OK, I'm going to take a minute to grasp what you have told me and see what I can do. I'll check back. Thanks
|
|
Former Member
inherit
guest@proboards.com
155913
0
Nov 23, 2024 8:08:58 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 16, 2012 21:50:44 GMT -8
OK, I've been messing around and still have no clue. Could you explain it any easier? This is where I am at: <SCRIPT TYPE="text/javascript"> if(pb_action=="modifyprofile"){ table=document.getElementsByTagName("table") for(i=0;i<table.length;i++){ if(table.width=="92%" && table.className!="bordercolor"){ var row=table.insertRow(0) var cell1=row.insertCell(0) var cell2=row.insertCell(1) cell1.innerHTML="" cell2.innerHTML="<INPUT NAME='text1' ID='box1' TYPE='text'><INPUT TYPE='button' VALUE='Submit' ONCLICK='transfer()'>" } } } </SCRIPT>
<SCRIPT TYPE="text/javascript"> if(pb_action=="modifyprofile"){ function transfer(){ sig=document.getElementsByTagName("TEXTAREA") for(i=0;i<sig.length;i++){ if(sig.name=="signature"){ textbox=document.getElementById("box1").value sig.value=textbox }}}} </SCRIPT> |
This just puts a textbox and button at the top of the Modify Profile page and transfers the text that's entered into the textbox into the forms signature box when ya click the button. lol, I think I may have headed the wrong direction with this.... I have came to a sudden stop in curiousity: How is this going to manipulate the Profile Page?, lol Like I said, I think I took a wrong turn somewhere ...
|
|
Former Member
inherit
guest@proboards.com
155913
0
Nov 23, 2024 8:08:58 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 17, 2012 0:50:54 GMT -8
I've been working on this more. So, after hours of frustration and mind boggling I have came to a conclusion.
What you were trying to tell me in your last post is to use a pre-existing form (such as the Modify Profile form) and modify it's fields to meet my needs. For ex. With the Display Name field, I would change the text "Display Name" to .... ehh let's say "Your Favorite Cookies" Therefore when the user fills in the corrosponding textbox, it will be displayed on the Profile page as what they chose.
So if they answered "Chocolate Chip", it would be displayed on the Profile page as
Favorite Cookies: Chocolate Chip
instead of
Display Name: Bob (lol, if that was the users name of course)
If what I have collected from your last post is a precise understanding on my behalf, then this would mean that there would be no way to manipulate the body background color of the Profile page individually because there is not a form anywhere that does that already.
Am I understanding correctly or not?
|
|
inherit
24252
0
Aug 1, 2023 15:01:24 GMT -8
coolcoolcool
When the world says, "Give up," Hope whispers, "Try it one more time."
2,148
May 2004
coolcoolcool
|
Post by coolcoolcool on Jul 17, 2012 3:36:43 GMT -8
You're half understanding it.
You don't need to lose the functionality of the existing input. Take the signature for example. Say you added ||COLOR=RED to the end of your signature input (by using another input on submit). Then on each page you can remove anything past the last ||, split COLOR=, and use the color to do whatever you wanted to the profile. The signature would still work and you would have the customization you need.
|
|
Former Member
inherit
guest@proboards.com
155913
0
Nov 23, 2024 8:08:58 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 19, 2012 6:32:12 GMT -8
This is what has me stumped. Here is the signatures HTML:
<textarea name="signature" onkeyup="if(this.value.length > 400) this.value=this.value.substring(0,400); document.modifyForm.sigLength.value=(400-this.value.length);" onchange="if(this.value.length > 400) this.value=this.value.substring(0,400); document.modifyForm.sigLength.value=(400-this.value.length);" rows="5" cols="32">
where would i insert the ||COLOR="" ?
|
|
Former Member
inherit
guest@proboards.com
155913
0
Nov 23, 2024 8:08:58 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 19, 2012 12:53:16 GMT -8
uppin anybody
|
|
inherit
24252
0
Aug 1, 2023 15:01:24 GMT -8
coolcoolcool
When the world says, "Give up," Hope whispers, "Try it one more time."
2,148
May 2004
coolcoolcool
|
Post by coolcoolcool on Jul 19, 2012 16:47:18 GMT -8
Its innerHTML.
You got dis.
|
|
Former Member
inherit
guest@proboards.com
155913
0
Nov 23, 2024 8:08:58 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 19, 2012 19:00:10 GMT -8
OK man, I appreciate your patience, but lol, I still am not fully aware. This is what I have came up with. I know I am much closer.
<script type= "text/javascript"> if(pb_action== "modifyprofile"){ var color= "red" var background= document.getElementsByTagName("body")[0] var text= document.getElementsByTagName("textarea") for(i=0;i<text.length;i++){ if(text.name== "signature"){ text.innerHTML+=background.bgColor=color }}} </script>
This changes the background color on the MODIFY PROFILE page, but not the VIEW PROFILE page.
I still need to ceate a fake text input box and button on the VIEW PROFILE page to transfer the data to the signature input on the MODIFY PROFILE page, correct?
Well if so, well that much is simple:
<script type= "text/javascript"> if(pb_action== "viewprofile"){ document.write("<input type=text name=text><input type=button onclick=send()>") } </script>
But, how do I transfer the data from the VIEW PROFILE page to the MODIFY PROFILE page?
|
|
Former Member
inherit
guest@proboards.com
155913
0
Nov 23, 2024 8:08:58 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 20, 2012 1:27:06 GMT -8
On a quick side note: Why does this statement not recognize what is true?
<script type= "text/javascript"> var members_aloud= ["tim","john","red"]; if(pb_displayname!= members_aloud) { alert("NO MATCHES"); } else { alert("YES THERE IS A MATCH"); } </script>
Though there is a match, it returns false. (Unless I do away with the array and use just a single variable)
Am I using the wrong type of array?
|
|
inherit
24252
0
Aug 1, 2023 15:01:24 GMT -8
coolcoolcool
When the world says, "Give up," Hope whispers, "Try it one more time."
2,148
May 2004
coolcoolcool
|
Post by coolcoolcool on Jul 20, 2012 4:40:14 GMT -8
I'll answer your other question tonight when I have more time, but the pb username thing doesn't work because it's an array. You have to loop through it and access each entry by index. Ex) members[0]
|
|
Former Member
inherit
guest@proboards.com
155913
0
Nov 23, 2024 8:08:58 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jul 20, 2012 16:35:26 GMT -8
Oh OK, I figured that I needed to loop through the the array, but I just wasn't sure on which type of array was used for that process. Thanks alot! (I guess it is pretty much like looping through the tables on the forum....)
Whenever you get the chance to answer the other question is fine. I'm just creating these codes accordingly. Thanks again for all of the help and knowledge!
|
|
inherit
24252
0
Aug 1, 2023 15:01:24 GMT -8
coolcoolcool
When the world says, "Give up," Hope whispers, "Try it one more time."
2,148
May 2004
coolcoolcool
|
Post by coolcoolcool on Jul 20, 2012 19:09:12 GMT -8
Keep in mind I only tested this in firefox. <script type="text/javascript"> // Automatically put location at end of signature on submit // Just to show how to make mini-profile mods // Not useful in the slightest var updateForms = function() { document.modifyForm.signature.appendChild(document.createTextNode(document.modifyForm.location.value)); return true; }; if(location.href.match(/action=modifyprofile/i)) document.modifyForm.setAttribute('onsubmit','disable(this); return updateForms();'); </script>
Basically, I wrote this to give you an idea of how things work. What this does is every time you submit your profile, the signature receives the value of your profile's location. All I do is define a function and change the form's onsubmit so that it applies the changes quickly as the form gets submitted. You have to apply the same idea to whatever input values you want to change. I haven't done proboards scripting in awhile, but one foreseeable issue that could arise here is that the signature has a maximum size and you have to make sure you don't go over it. Maybe there are other fields that would be more useful? That's up to you as the coder though. Good luck .
|
|