|
Post by deadlyassassin on Feb 13, 2006 15:48:23 GMT
This will prevent guests from viewing member's profiles. Preview: Click HereTop of Main Footers<script type="text/javascript"> <!-- /* Prevent Guests From Viewing Profiles By {XF}Äs$@§sîñ™, www.xf-clan.net */
// Edit Error Message var eMessage = "Sorry, but you may not view members' profiles as a Guest.";
var td = document.getElementsByTagName('td');
if(pb_username == "Guest" && location.href.match(/action=viewprofile/i)) { for (i=0; i<td.length; i++) { if (td.item(i).className == "titlebg" && td.item(i).colSpan == "2" && td.item(i).innerHTML.match(/View\sProfile:/i)) { document.title = document.title.split('-')[0] + " An Error Has Occurred"; var tFont = document.createElement('font'); tFont.style.fontSize = '12px'; tFont.style.fontWeight = 'bold'; tFont.appendChild(document.createTextNode('An Error Has Occurred')); td.item(i).replaceChild(tFont, td.item(i).firstChild); td.item(i).parentNode.nextSibling.style.display = 'none'; var mCell = td.item(i).parentNode.parentNode.insertRow(1).insertCell(0); mCell.setAttribute("colSpan", 2); mCell.className = "windowbg"; var eFont = document.createElement('font'); eFont.style.fontSize = '12px'; eFont.appendChild(document.createTextNode(eMessage)); mCell.appendChild(eFont); break; } } } //--> </script>
|
|
Richie
Veteran
^ Yes, That's me V_V
Posts: 624
|
Post by Richie on Feb 13, 2006 18:11:31 GMT
cool codes, esp the 2nd one, it's short yet very effective. although personally i don't see why anyone wouldn't want guests to view profiles?
|
|
Ross
eCreations Staff
Posts: 1,768
|
Post by Ross on Feb 14, 2006 0:31:34 GMT
The second one is a TOS violation. Redirects aren't allowed as users are unable to click on the adverts.
|
|
Richie
Veteran
^ Yes, That's me V_V
Posts: 624
|
Post by Richie on Feb 14, 2006 0:54:15 GMT
what if it redirected them after like 5 seconds?
|
|
Ross
eCreations Staff
Posts: 1,768
|
Post by Ross on Feb 14, 2006 9:59:26 GMT
what if it redirected them after like 5 seconds? Last time I checked, not allowed.
|
|
|
Post by deadlyassassin on Feb 14, 2006 12:30:06 GMT
Oh man, thank for pointing that out, what i will do is remove the re-direct and submit the first one if thats ok if you.
|
|
Ross
eCreations Staff
Posts: 1,768
|
Post by Ross on Feb 14, 2006 21:21:39 GMT
Thats fine
|
|
Richie
Veteran
^ Yes, That's me V_V
Posts: 624
|
Post by Richie on Feb 14, 2006 23:42:24 GMT
hey could you include a preview too?
|
|
|
Post by deadlyassassin on Feb 15, 2006 8:23:22 GMT
Preview Added
|
|
Richie
Veteran
^ Yes, That's me V_V
Posts: 624
|
Post by Richie on May 16, 2006 23:12:09 GMT
Anyway to make it so guests can only view the main admins profile but no-one else's?
|
|
ME!
Moderator
~Remanifesting-Eternal.~
Posts: 778
|
Post by ME! on May 16, 2006 23:34:12 GMT
find this line
if(pb_username == "Guest" && location.href.match(/action=viewprofile/i)) {
replace with this
if(pb_username == "Guest" && location.href.match(/action=viewprofile/i) && !location.href.match(/action=viewprofile&user=admin/i)) {
|
|
Richie
Veteran
^ Yes, That's me V_V
Posts: 624
|
Post by Richie on May 16, 2006 23:47:39 GMT
find this line if(pb_username == "Guest" && location.href.match(/action=viewprofile/i)) { replace with this if(pb_username == "Guest" && location.href.match(/action=viewprofile/i) && !location.href.match(/action=viewprofile&user=admin/i)) { Thanx! ;D Saved By Dre Again!
|
|