vForums Support > Programming & Coding :: Database of Codes/Hacks/Mods :: > Profile Views

Profile Views - Posted By Michael (wrighty) on 2nd Jan 08 at 8:43pm
This will show how many views the users' profile has had.

Preview:
Image

Main Header:
Code:
 
  1. <script>
  2. if(location.href.match(/\/view_profile/i)){
  3. user = (location.href.match(/\/user\//i))?location.href.split(/\/user\//i)[1].replace(/\//,''):vf_username;
  4. s= "<script src=http://vf.wrighty.info/codes/profile_views/views.php?forum="+location.host+"&user="+user+"></scr"+"ipt>";
  5. document.write(s);
  6. }
  7. </script>
 


Main Footer:
Code:
 
  1. <script>
  2. if(location.href.match(/\/view_profile/i)){
  3. d = document.getElementById('full_profile').getElementsByTagName('span')[0];
  4. d.innerHTML += ' ('+tot_views+' views)';
  5. }
  6. </script>
 



Re: Profile Views - Posted By Marc (cr0w) on 2nd Jan 08 at 8:44pm
I hope you know, I can enter in fake forum names and users, and run it on a non-vForum site, and it still updates the values and whatnot. {Wink} {Tongue Out}

Re: Profile Views - Posted By Michael (wrighty) on 2nd Jan 08 at 9:01pm
Yup! {Smile}

Re: Profile Views - Posted By Marc (cr0w) on 2nd Jan 08 at 9:27pm
 
Yup! {Smile}


You also know that I could manually put in someone's forum & username, then reload the page a bunch of times and screw up their stats, correct? {Wink}

Re: Profile Views - Posted By Michael (wrighty) on 2nd Jan 08 at 9:27pm
Yup..


Re: Profile Views - Posted By Reverse Blade (zohvi) on 2nd Jan 08 at 9:29pm
Sure you did...
Nice code though.

Re: Profile Views - Posted By Marc (cr0w) on 2nd Jan 08 at 9:29pm
 
Yup..


Are you going to fix it? {Tongue Out}

Re: Profile Views - Posted By Michael (wrighty) on 2nd Jan 08 at 9:48pm
Why? It's not going to kill someone...

And my PHP isn't brilliant! {Sad}

Re: Profile Views - Posted By XeroCint (kai) on 2nd Jan 08 at 10:30pm
Not working on mine {Unsure}

Re: Profile Views - Posted By Michael (wrighty) on 2nd Jan 08 at 10:34pm
recopy - vF doesn't like \ {Tongue Out}

Re: Profile Views - Posted By XeroCint (kai) on 3rd Jan 08 at 1:41am
still not working {Unsure}

Re: Profile Views - Posted By Michael (wrighty) on 3rd Jan 08 at 1:47am
recopy, I missed a \

Re: Profile Views - Posted By XeroCint (kai) on 3rd Jan 08 at 2:12am
{Lips Sealed}

... still no worky

Re: Profile Views - Posted By Michael (wrighty) on 3rd Jan 08 at 2:15am
you need to alter this code too:

Code:
 
  1. <script>
  2. var t = document.getElementById('welcome_table');
  3. with(T){
  4. style.backgroundColor = "343434";
  5. cellSpacing = "0";
  6. }
  7. </script>
 

to:
Code:
 
  1. <script>
  2. var t = document.getElementById('welcome_table');
  3. with(t){
  4.     style.backgroundColor = "343434";
  5.     cellSpacing = "0";
  6. }
  7. </script>
 

Re: Profile Views - Posted By XeroCint (kai) on 3rd Jan 08 at 3:04am
Still no workey {Tongue Out}

Re: Profile Views - Posted By Nick (nickb) on 3rd Jan 08 at 4:10am
It works fine for me
Clicky

Re: Profile Views - Posted By Danny (schnooble) on 3rd Jan 08 at 4:37am
im guessing you clicked on your profile and copied the url because when you do that knowone else will be able to get to the page unless they are a logged in member. it works though. I checked. Nice man {Smile}

Re: Profile Views - Posted By Michael (wrighty) on 3rd Jan 08 at 9:46am
kai, you've copied it wrong! {Tongue Out}

recopy the footer part! {Tongue Out}

Re: Profile Views - Posted By XeroCint (kai) on 3rd Jan 08 at 12:30pm
its still not working >,>

Re: Profile Views - Posted By Michael (wrighty) on 3rd Jan 08 at 12:36pm
just try disabling the auto gradients, and if it works, I'll try to fix it! {Smile}