|
Post by Wormopolis on Jul 5, 2010 2:04:51 GMT -8
the mini profile code has a bug where it crashes on anyone who doesnt have messenger icons in their profile (like casch)
replace this:
var getText = avvy.innerHTML.split(/<br\s?\/?>/i)[2]; if (getText.match(/<img/i)) { var icons = avvy.innerHTML.split(/<br\s?\/?>/i)[2]; var ep = avvy.innerHTML.split(/<br\s?\/?>/i)[3]; pText =''; }else if (!getText.match(/<img/i)) { var icons = avvy.innerHTML.split(/<br\s?\/?>/i)[4]; var ep = avvy.innerHTML.split(/<br\s?\/?>/i)[5]; if(ep.indexOf("<span> ") != -1 || ep.indexOf("<SPAN> ") != -1) { icons += ep.substr(ep.indexOf("<span> ") != -1 ? ep.indexOf("<span> ") : ep.indexOf("<SPAN> ")); ep = ep.split("<SPAN> ")[0].split("<span> ")[0]; } pText = getText; }else if (pb_username == 'Guest'){ var icons = avvy.innerHTML.split(/<br\s?\/?>/i)[4]; var ep = ''; pText = getText; if(ep.indexOf("<span> ") != -1 || ep.indexOf("<SPAN> ") != -1) { icons += ep.substr(ep.indexOf("<span> ") != -1 ? ep.indexOf("<span> ") : ep.indexOf("<SPAN> ")); ep = ep.split("<SPAN> ")[0].split("<span> ")[0]; } }
with this:
var getText = avvy.innerHTML.split(/<br\s?\/?>/i)[2]; breakcount=avvy.innerHTML.split(/<br\s?\/?>/i).length; var icons = avvy.innerHTML.split(/<br\s?\/?>/i)[count-2]; var ep = avvy.innerHTML.split(/<br\s?\/?>/i)[count-1]; if (getText.match(/<img/i)) pText =''; else pText = getText; if (pb_username == 'Guest'){ var icons = avvy.innerHTML.split(/<br\s?\/?>/i)[count-2]; var ep = ''; pText = getText; }
then lets see what that gets us. its harder to do the guest part without being able to see threads as a guest however. but if you dont have any guest viewable threads I guess it wont matter.
|
|
|
Post by allthingsofgillian on Jul 5, 2010 13:01:45 GMT -8
I replaced the old part with the new part you requested and the Axel code no longer works EDIT: I'm curious to know if there's a code to make the mini-profile look like this? I have looked through all the customized MP codes and none of them look like this...is this one customized specially for this forum I found it on?
|
|
|
Post by Wormopolis on Jul 5, 2010 23:00:45 GMT -8
I dont recognize that one.
I have to load your MP code on to a site then.
|
|
|
Post by Wormopolis on Jul 6, 2010 1:31:19 GMT -8
I am in the process of rewriting the MP code. Im going to add in the Karma thing you wanted as well.
|
|
|
Post by allthingsofgillian on Jul 6, 2010 10:43:32 GMT -8
Okay no problem about the other MP look I posted...just wondered if you knew of a code. And thank you for help with the current MP code and working on it as well as adding in the Karma to it. Much appreciated.
|
|
|
Post by Wormopolis on Jul 6, 2010 11:06:19 GMT -8
Everytime I get it working I find a new way to break it. The problem is the MP changes depending on what the user has filled in. if they have an avatar.. personal text.. custom title... messenger icons... gender... karma... it all changes what shows up, so you have to write a code that can expect ANYthing...
|
|
|
Post by Wormopolis on Jul 6, 2010 13:31:43 GMT -8
<script type="text/javascript"> /*Axel Mini Profile Mod by DBuzzin*/ // Mods by Wormopolis
var defaultAvatar ='';
if(location.href.match(/n=(search2|(user)?rece|display|pmvi|goto|calendar|viewpro)/)){
var grabMp = document.getElementsByTagName("td"); for(i=0; i < grabMp.length; i++){ if(grabMp[i].className.match(/windowbg/i) && grabMp[i].width=="20%" && grabMp[i].innerHTML.match(/Joined:/i)){
var userName = grabMp[i].innerHTML.split(/<br\s?\/?>/i)[0]; var userRank = grabMp[i].innerHTML.split(/<br\s?\/?>/i)[1]; var rankStars = grabMp[i].innerHTML.split(/<br\s?\/?>/i)[2]; var onOrOff = grabMp[i].innerHTML.match(/member is (.+?)<br\s?\/?>/i) ? RegExp.$1: ''; var posts = grabMp[i].innerHTML.match(/Posts: (.+?)<br\s?\/?>/i) ? RegExp.$1: ''; var joined = grabMp[i].innerHTML.match(/Joined: (.+?)<br\s?\/?>/i) ? RegExp.$1: ''; var krma= grabMp[i].innerHTML.match(/Karma: (.+?)(\s*?)($|<)/i) ? RegExp.$1: '';
var customT = grabMp[i].innerHTML.split(/<br\s?\/?>/i)[3]; if (customT.match(/member is/i)) { customT = ''; }
if(grabMp[i].innerHTML.match(/Location:/i)){ var loc = grabMp[i].innerHTML.match(/Location: (.+?)<br\s?\/?>/i) ? RegExp.$1: ''; }else{ var loc ='Undisclosed'; }
if(grabMp[i].innerHTML.match(/Gender:/i)){ var gender = grabMp[i].innerHTML.match(/Gender: (.+?)<br\s?\/?>/i) ? RegExp.$1: ''; }else{ var gender ='Undisclosed'; }
var avvy = grabMp[i].getElementsByTagName("center")[0]; STUFF=' '+avvy.innerHTML; stuffArray=STUFF.split(/<br/i); breakcount=stuffArray.length; var getText = stuffArray[2].substr(1,stuffArray[2].length); var icons = stuffArray[breakcount-2].substr(1,stuffArray[breakcount-2].length); icons=(icons.match(/<img/i) ? icons : "none"); var ep = stuffArray[breakcount-1].substr(1,stuffArray[breakcount-1].length);; pText= (getText.match(/<img/i) ? '' : getText); if (pb_username == 'Guest'){ var ep = ''; }
if(avvy.firstChild.nodeName == 'IMG') { var avatar = '<br /><img src="'+avvy.firstChild.src+'" height="100" width="100" alt="[avatar]" /><br /><br />'; }else{ var avatar ='<br /><img src="'+defaultAvatar+'" height="100" width="100" alt="[avatar]" /><br /><br />'; }
var mpTab ='<table width="100%" class="bordercolor" cellspacing="1">'; mpTab +='<tr><td class="titlebg" align="center" colspan="2">'+userName+'</td></tr>'; mpTab +='<tr><td class="windowbg" align="center" colspan="2">'+rankStars+'</td></tr>'; mpTab +='<tr><td class="windowbg" align="center" colspan="2"><b>'+userRank+'</b></td></tr>'; mpTab +='<tr><td class="windowbg" align="center" colspan="2">'+customT+'<br />'+avatar+'<br />'+pText+'<br /><br /></td></tr>'; mpTab +='<tr><td class="titlebg" colspan="2" width="50%" align="center">User Info</td></tr>'; mpTab += '<tr><td class="windowbg" width="50%" align="left">Gender:</td>'; mpTab += '<td class="windowbg" align="center">'+gender+'</td></tr>'; mpTab += '<tr><td class="windowbg" width="50%" align="left">Karma:</td>'; mpTab += '<td class="windowbg" align="center">'+krma+'</td></tr>'; mpTab += '<tr><td class="windowbg" width="50%" align="left">Posts:</td>'; mpTab += '<td class="windowbg" align="center">'+posts+'</td></tr>'; mpTab += '<tr><td class="windowbg" width="50%" align="left">Location:</td>'; mpTab += '<td class="windowbg" align="center">'+loc+'</td></tr>';
mpTab +='<tr><td class="windowbg" align="center" colspan="2">Joined: '+joined+'</td></tr>'; mpTab +='</table>';
mpTab +='<br /><table width="100%" class="bordercolor" cellspacing="1">'; mpTab +='<tr><td class="titlebg" width="50%" align="center">Messenger\'s</td></tr>'; if (!icons == '') { mpTab +='<tr><td class="windowbg" width="50%" align="center">'+icons+'</td></tr>'; }else{ mpTab +='<tr><td class="windowbg" width="50%" align="center">None</td></tr>'; } if (pb_username != 'Guest') { mpTab +='<tr><td class="titlebg" width="50%" align="center">Email & Pm</td></tr>'; mpTab +='<tr><td class="windowbg" width="50%" align="center">'+ep+'</td></tr>'; } mpTab +='</table>';
grabMp[i].innerHTML = mpTab; } } }
// --> </script>
|
|
|
Post by allthingsofgillian on Jul 7, 2010 10:13:00 GMT -8
The code seems to be working fine...I forgot to request the option of "Smite" and "Exalt" for the Karma feature. My bad. EDIT: Hold up, my IE is not showing anything. It still doesn't work for IE users...I had my friend take a look in his browser and nothing shows up and I cannot install an older version of IE on my W7. And also does this new MP work with the reflected avatar code? Just checked it does.
|
|
|
Post by rhondairv on Jul 7, 2010 10:33:49 GMT -8
I have tried this and really like the look. One thing is it does not work with the 2nd avatar code. Just a thought in case.
|
|
|
Post by rhondairv on Jul 7, 2010 15:40:31 GMT -8
nm... just hit me this isn't your code. You're just helping a member with it.
|
|
|
Post by Wormopolis on Jul 7, 2010 16:30:38 GMT -8
I SWEAR it worked in IE because I wrote it in IE to work....
I didnt put in anything for smite/exalt because It was going to be my next question.. where would you want those links to BE?
|
|
|
Post by Wormopolis on Jul 7, 2010 16:43:22 GMT -8
I think I know what it is.. one of the google ads has a weird error where if you use "i" as a variable, it constantly kills the value in it. you cant use "i" as a loop variable in IE because of it. That ad doesnt run on my testsite so I wasnt seeing it.
try this version:
<script type="text/javascript"> /*Axel Mini Profile Mod by DBuzzin*/ // Mods by Wormopolis
var defaultAvatar ='';
if(location.href.match(/n=(search2|(user)?rece|display|pmvi|goto|calendar|viewpro)/)){
var grabMp = document.getElementsByTagName("td"); for(MPi=0; MPi < grabMp.length; MPi++){ if(grabMp[MPi].className.match(/windowbg/i) && grabMp[MPi].width=="20%" && grabMp[MPi].innerHTML.match(/Joined:/i)){
var userName = grabMp[MPi].innerHTML.split(/<br\s?\/?>/i)[0]; var userRank = grabMp[MPi].innerHTML.split(/<br\s?\/?>/i)[1]; var rankStars = grabMp[MPi].innerHTML.split(/<br\s?\/?>/i)[2]; var onOrOff = grabMp[MPi].innerHTML.match(/member is (.+?)<br\s?\/?>/i) ? RegExp.$1: ''; var posts = grabMp[MPi].innerHTML.match(/Posts: (.+?)<br\s?\/?>/i) ? RegExp.$1: ''; var joined = grabMp[MPi].innerHTML.match(/Joined: (.+?)<br\s?\/?>/i) ? RegExp.$1: ''; var krma= grabMp[MPi].innerHTML.match(/Karma: (.+?)(\s*?)($|<)/i) ? RegExp.$1: ''; var krmaactions=(grabMPi[MPi].innerHTML.match(/action=karma/) ? true : false); var customT = grabMp[MPi].innerHTML.split(/<br\s?\/?>/i)[3]; if (customT.match(/member is/i)) { customT = ''; }
if(grabMp[MPi].innerHTML.match(/Location:/i)){ var loc = grabMp[MPi].innerHTML.match(/Location: (.+?)<br\s?\/?>/i) ? RegExp.$1: ''; }else{ var loc ='Undisclosed'; }
if(grabMp[MPi].innerHTML.match(/Gender:/i)){ var gender = grabMp[MPi].innerHTML.match(/Gender: (.+?)<br\s?\/?>/i) ? RegExp.$1: ''; }else{ var gender ='Undisclosed'; }
var avvy = grabMp[MPi].getElementsByTagName("center")[0]; STUFF=' '+avvy.innerHTML; stuffArray=STUFF.split(/<br/i); breakcount=stuffArray.length; var getText = stuffArray[2].substr(1,stuffArray[2].length); var icons = stuffArray[breakcount-2].substr(1,stuffArray[breakcount-2].length); icons=(icons.match(/<img/i) ? icons : "none"); var ep = stuffArray[breakcount-1].substr(1,stuffArray[breakcount-1].length);; pText= (getText.match(/<img/i) ? '' : getText); if (pb_username == 'Guest'){ var ep = ''; }
if(avvy.firstChild.nodeName == 'IMG') { var avatar = '<br /><img src="'+avvy.firstChild.src+'" height="100" width="100" alt="[avatar]" /><br /><br />'; }else{ var avatar ='<br /><img src="'+defaultAvatar+'" height="100" width="100" alt="[avatar]" /><br /><br />'; }
var mpTab ='<table width="100%" class="bordercolor" cellspacing="1">'; mpTab +='<tr><td class="titlebg" align="center" colspan="2">'+userName+'</td></tr>'; mpTab +='<tr><td class="windowbg" align="center" colspan="2">'+rankStars+'</td></tr>'; mpTab +='<tr><td class="windowbg" align="center" colspan="2"><b>'+userRank+'</b></td></tr>'; mpTab +='<tr><td class="windowbg" align="center" colspan="2">'+customT+'<br />'+avatar+'<br />'+pText+'<br /><br /></td></tr>'; mpTab +='<tr><td class="titlebg" colspan="2" width="50%" align="center">User Info</td></tr>'; mpTab += '<tr><td class="windowbg" width="50%" align="left">Gender:</td>'; mpTab += '<td class="windowbg" align="center">'+gender+'</td></tr>'; mpTab += '<tr><td class="windowbg" width="50%" align="left">Karma:</td>'; mpTab += '<td class="windowbg" align="center">'+krma+'</td></tr>'; if (krmaactions) { mpTab += '<tr><td class="windowbg" width="50%" align="center"><a href="/index.cgi?action=karma&user=test&type=1">Exalt</a></td>'; mpTab += '<td class="windowbg" align="center"><a href="/index.cgi?action=karma&user=test&type=2">Smite</a></td></tr>'; } mpTab += '<tr><td class="windowbg" width="50%" align="left">Posts:</td>'; mpTab += '<td class="windowbg" align="center">'+posts+'</td></tr>'; mpTab += '<tr><td class="windowbg" width="50%" align="left">Location:</td>'; mpTab += '<td class="windowbg" align="center">'+loc+'</td></tr>';
mpTab +='<tr><td class="windowbg" align="center" colspan="2">Joined: '+joined+'</td></tr>'; mpTab +='</table>';
mpTab +='<br /><table width="100%" class="bordercolor" cellspacing="1">'; mpTab +='<tr><td class="titlebg" width="50%" align="center">Messenger\'s</td></tr>'; if (!icons == '') { mpTab +='<tr><td class="windowbg" width="50%" align="center">'+icons+'</td></tr>'; }else{ mpTab +='<tr><td class="windowbg" width="50%" align="center">None</td></tr>'; } if (pb_username != 'Guest') { mpTab +='<tr><td class="titlebg" width="50%" align="center">Email & Pm</td></tr>'; mpTab +='<tr><td class="windowbg" width="50%" align="center">'+ep+'</td></tr>'; } mpTab +='</table>';
grabMp[MPi].innerHTML = mpTab; } } }
// --> </script>
|
|
|
Post by allthingsofgillian on Jul 7, 2010 17:12:45 GMT -8
I am having issues with my IE, I cannot see if it's working or not...my W7 came with it and I cannot see any of the codes that was added to my forum or my friend's forum...I cannot uninstall it either. :/ Know of a way to help out with this little problem? I know this code works with Safari, FF and Chrome, but I cannot see for myself if it works with IE. As for the Smite and Exalt, how about putting the option under the Joined area or maybe directly under Karma? Either position seems great. Thank you so much for your help on this.
|
|
|
Post by Wormopolis on Jul 7, 2010 18:09:43 GMT -8
the code right above the MP code... you have the end of it like:
//--></script>
change that to this for me:
//--> </script>
|
|
|
Post by allthingsofgillian on Jul 7, 2010 18:11:16 GMT -8
Your request has been done.
|
|