Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on May 14, 2010 11:59:26 GMT -8
Why does ctitle keep retrieving (member is Online/offline) when i have it as if(!miniArray[e+3].match(/member is/i)) { ? Im talking about the Guest post. 3rd post down on this thread... topekat3.proboards.com/index.cgi?board=general&action=display&thread=4&page=1 <script type="text/javascript"> //miniprofile andpost edit //By Topeka
if (location.href.match(/thread=3743/)) {
//retriving MP parts for (tds=document.getElementsByTagName('td'), i=0; i<tds.length; i++) { if (!tds[i].id.match(/newcell/i) && tds[i].width=="20%" && tds[i].className.match(/windowbg/i) && tds[i].vAlign=="top" && tds[i+1].width=="80%") { //entire posing area allpostsrow=tds[i].parentNode
name=uname=rank=stars=ctitle=stat=perc=wbar=jnd=gnd=posts=locat=karma=avatar=ptext=contact=empm='';
miniArray=tds[i].innerHTML.split(/<br>/i); for (e=0; e<miniArray.length; e++) { if (miniArray[e].match(/action=viewprofile/) && name=='') { name=miniArray[e]; uname=miniArray[e].split('user=')[1].split('"')[0]; if (!miniArray[e+1].match(/warning level/i)) { rank=miniArray[e+1]; stars=miniArray[e+2]; } if (!miniArray[e+3].match(/member is/i) || !miniArray[e+3].match(/warning level/i) && ctitle=='') { ctitle=miniArray[e+3]; } } if (miniArray[e].match(/warning level/i) && perc=='') { perc=miniArray[e].split('Warning Level - ')[1]; wbar=miniArray[e+1]; if (!miniArray[e+2].match(/member is/i) || !miniArray[e+2].match(/warning level/i) && ctitle=='') { ctitle=miniArray[e+2]; } } if (miniArray[e].match(/member is/i) && status=='') { stat=miniArray[e].split('member is ')[1]; } if ((miniArray[e].match(/\[icq\]/i) || miniArray[e].match(/\[yim\]/i) || miniArray[e].match(/\[msn\]/i) || miniArray[e].match(/\[aim\]/i)) && contact=='') { contact=miniArray[e]; } if ((miniArray[e].match(/action=pmsend/i) || miniArray[e].match(/\[email\]/i)) && empm=='') { empm=miniArray[e]; } if (miniArray[e].match(/joined:/i) && jnd=='') { jnd=miniArray[e].split('Joined: ')[1]; } if (miniArray[e].match(/gender:/i) && gnd=='') { gnd=miniArray[e].split('Gender: ')[1]; } if (miniArray[e].match(/posts:/i) && posts=='') { posts=miniArray[e].split('Posts: ')[1]; } if (miniArray[e].match(/location:/i) && locat=='') { locat=miniArray[e].split('Location: ')[1]; } if (miniArray[e].match(/karma:/i) && karma=='') { karma=miniArray[e].split('Karma: ')[1]; } }
//pinfo not a mp part pinfo=tds[i].getElementsByTagName('center')[0]; if(pinfo.firstChild.nodeName.match(/img/i)) { avwidth=pinfo.firstChild.getAttribute('width'); avheight=pinfo.firstChild.getAttribute('height'); avalt=pinfo.firstChild.getAttribute('alt'); avlink=pinfo.firstChild.getAttribute('src'); avatar="<img width="+avwidth+" height="+avheight+" alt="+avalt+" src="+avlink+" />" } if (pinfo.getElementsByTagName('br')[1].nextSibling.nodeName.match(/text/i)) { ptext=pinfo.getElementsByTagName('br')[1].nextSibling.nodeValue; } //end retriving MP parts
(I didnt end the script or finish if statments when i posted this.)
|
|
|
Post by Wormopolis on May 14, 2010 19:19:41 GMT -8
A= text contains warning level B = text contains member is
!A | !B = !(A & B)
since the text does not contain "warning level" and the text does not contain "member is", (A & B) evauluates to false. which means !(A & B) evaluates to true.
change the || to &&
|
|
Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on May 15, 2010 9:19:33 GMT -8
wow. that can get more confusing then expected. i need to find a site or something to look at the algebra to this. Thanks. That did the trick.
|
|
|
Post by Wormopolis on May 15, 2010 14:07:31 GMT -8
Boolean Algebra is a skill to master for sure. I got really good at it in high school so it flows naturally for me now. the rule I used up there was called DeMorgan's Law. The negation of a closed group results in the negation of each element in the group and a change of operator in between them.
|
|