inherit
139476
0
Jan 19, 2020 4:24:42 GMT -8
Auburn
I will steal your smile and treasure it
263
April 2009
auburneye
|
Post by Auburn on Nov 11, 2009 17:11:29 GMT -8
So... I'm not a coder, but just from fixing up my site so much I'm starting to understand things more. I sorta want to be able to make the codes that I want to have without having to bug the support board so much. I wanted to ask you guys where do you all learn this stuff? Do you take a special college class for it, is it independent study, or do you use an online resource or something? And if you did take it in college/etc where did you learn the specifics of the way proboards is coded and how to make code specifically for proboards? *** On a rather unrelated note, here's an example of a failure code of mines. <script type="text/javascript"> <!-- var td=document.getElementsByTagName("td"); var a = td.getElementsByTagName("a"); { if(location.href.match(/on=(displ|search2|viewpr|pmv|(user)?rece|cal\w+iew)/) && a.className.match(/group/i) && td.width == "20%"){ a.style = "font-family:verdana; font-size:20px; font-weight:normal"; } } //--></script>I know it's a disgraceful mess and probably missing very key elements. But the basic idea here is that I want it to style the usernames of members to 20px non-bold but only in the miniprofile. I made this code below myself, but the issue is that it also changes the size in the "Last Edit" section and makes it bulge out all nasty. <script type="text/javascript"> if(location.href.match(/(display|viewprofile|calendar|search2|pmview|recent)/)|| location.href.match(/index.cgi$/) && document.title.match(/(Preview|Search)/)){ document.write('<style type="text/css"> .group1, .group2, .group3, .group4 {font-family:verdana; font-size:20px; font-weight:normal;}</style>');}</script>Any and all advice is welcome! ;D
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Nov 11, 2009 19:40:46 GMT -8
Javascript isn't too hard to learn, and most people learn it on their own. You will want to start out with general Javascript tutorials that you can find on the internet ( htmlite.com, w3schools.com), and then read a few Proboard tutorials on Javascript ( StudioZero). There's no such thing as "Proboards coding", but most Proboards codes are all about looping through the HTML elements on the page until you find what you need to modify. Feel free to send me pms about Javascript questions. Replace the code you were using above with this. <script type="text/javascript"> <!--
if(location.href.match(/on=(displ|search2|viewpr|pmv|(user)?rece|cal\w+iew)/)){ for(var td=document.getElementsByTagName("td"), x= 6; x<td.length; x++){ if(td[x].width == "20%"){
var a = td[x].getElementsByTagName("a"), b = a.length, c = 0;
while(c < b){ if(a[c].className && a[c].className.match(/group/i)){ a[c].style.fontSize = "20px"; a[c].style.fontFamily = "verdana"; a[c].style.fontWeight = "normal"; break; } c++; } } } }
//--> </script>
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Nov 11, 2009 21:33:38 GMT -8
I taught myself. I refuse to take courses in programming, 'cause I'm sure the teacher would aggrevate me by teaching something improperly (e.g. that you should use <b> to bold text; argargargargarg). I just looked at others code, evaluated what each line did, trial and error.
|
|
inherit
139476
0
Jan 19, 2020 4:24:42 GMT -8
Auburn
I will steal your smile and treasure it
263
April 2009
auburneye
|
Post by Auburn on Nov 11, 2009 22:51:01 GMT -8
I taught myself. I refuse to take courses in programming, 'cause I'm sure the teacher would aggrevate me by teaching something improperly (e.g. that you should use <b> to bold text; argargargargarg). I just looked at others code, evaluated what each line did, trial and error. That's the exact same approach I take. It actually may not be the most "time efficient" but it sure is a lot more fun! Learning new things as I go, and discovering things for myself is the way I do things. I do this with most everything in life. @ - Jordan, ah I see what you did there. *takes note* So the for() loop is necessary for the code to re-apply the username style changes to each post right? Hm, but in any case, it doesn't work.. I even placed it in a test board that had been cleared out of any other codes and it still didn't work.
|
|
inherit
100824
0
May 13, 2012 5:37:49 GMT -8
Michael
14,585
March 2007
wrighty
|
Post by Michael on Nov 12, 2009 7:12:40 GMT -8
I taught myself. I refuse to take courses in programming, 'cause I'm sure the teacher would aggrevate me by teaching something improperly (e.g. that you should use <b> to bold text; argargargargarg). I just looked at others code, evaluated what each line did, trial and error. ^ What I did too!
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Nov 12, 2009 12:36:50 GMT -8
@ - Jordan, ah I see what you did there. *takes note* So the for() loop is necessary for the code to re-apply the username style changes to each post right? Hm, but in any case, it doesn't work.. I even placed it in a test board that had been cleared out of any other codes and it still didn't work. Could you pm me the test board you are testing this on? And yes, the for loop goes through each <td> tag on the page and changes the style on the display name hyperlink in each mini-profile. I taught myself. I refuse to take courses in programming, 'cause I'm sure the teacher would aggrevate me by teaching something improperly (e.g. that you should use <b> to bold text; argargargargarg). I just looked at others code, evaluated what each line did, trial and error. I think it depends on what you are learning. I'm taking a C++ course and my professor really knows what he is talking about unlike others I have had, but that's because he's been in the industry for most of his career. Although I could have tested out of this class, I've learned a lot and now have a much better understanding of the basics of C++ which I thought I knew. Plus, we are learning how we will be required to program for the companies we will work for. C++ is a little different from everything else so I do see what you are saying, though. I had teachers in high school who didn't have a clue.
|
|
inherit
139476
0
Jan 19, 2020 4:24:42 GMT -8
Auburn
I will steal your smile and treasure it
263
April 2009
auburneye
|
Post by Auburn on Nov 12, 2009 18:23:38 GMT -8
Ah! Jordan I figured out the issue ^^; I put it in the wrong place. Now that I put it in the global footer it works just fine. ;D thank you!
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Nov 13, 2009 15:46:15 GMT -8
Glad to help.
If you ever have any questions feel free to send me a private message.
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Nov 15, 2009 21:38:19 GMT -8
@ - Jordan, ah I see what you did there. *takes note* So the for() loop is necessary for the code to re-apply the username style changes to each post right? Hm, but in any case, it doesn't work.. I even placed it in a test board that had been cleared out of any other codes and it still didn't work. Could you pm me the test board you are testing this on? And yes, the for loop goes through each <td> tag on the page and changes the style on the display name hyperlink in each mini-profile. I taught myself. I refuse to take courses in programming, 'cause I'm sure the teacher would aggrevate me by teaching something improperly (e.g. that you should use <b> to bold text; argargargargarg). I just looked at others code, evaluated what each line did, trial and error. I think it depends on what you are learning. I'm taking a C++ course and my professor really knows what he is talking about unlike others I have had, but that's because he's been in the industry for most of his career. Although I could have tested out of this class, I've learned a lot and now have a much better understanding of the basics of C++ which I thought I knew. Plus, we are learning how we will be required to program for the companies we will work for. C++ is a little different from everything else so I do see what you are saying, though. I had teachers in high school who didn't have a clue. I took a C++ course in high school. The teacher was an idiot, and I just taught myself C++ through the help manual that came with the program. It was similar enough to JS for me to find my way around it.
|
|