Jump to content
xisto Community
snlildude87

Who's Viewing My Site? Targeted for AIM users

Recommended Posts

As some of you may know, I asked a question on how to get a portion of the URL in the address bar and save it, and thanks to several sources*, I have successfully learned how to do that. Today, I will share with you, step-by-step, my knowledge.

 

The object of this tutorial is to mimic a feature on many subprofiles where you're able to see the AIM screennames of people who viewed your site.

 

Note: The URL that I will be using extensively throughout this tutorial is http://forums.xisto.com/no_longer_exists/. This is not a special URL reserved on Xisto but is merely a representation of your site, so you'd need to replace that URL with your own. In my case, it'd be http://forums.xisto.com/no_longer_exists/.

 

More noteage: Since the forum does not allow more than one space (" ") and my tutorial is intended to be in outline format, the numbering is a little weird, but the overall meaning of the tutorial is the same.

 

1. Open Notepad

2. Copy and paste the following code into Notepad:

<?php  $name = $_GET["name"];    //gets whatever is after "name=" in your URL (for example, the URL http://yoursite.trap17.com/index.php?name=myname will store "myname" in the variable $name  $file = "info.txt";                 //this is the file name, or the list, of the screennames of people who viewed your site  $handle = fopen($file, "a"); //opens info.txt to append  fwrite($handle, $name);     //appends whatever is in the variable $name to info.txt  fwrite($handle, ";\n");        //adds a new line to info.txt after appending  fclose($handle);                //closes file connection?>
3. Save the Notepad file as index.php (Use the same configuration I have in the screenshot to successfully save the file as a .php file) Posted Image

4. Make a new file in Notepad (File -> New)

5. Save the blank file as info.txt in the SAME DIRECTORY as index.php saved in step 3

6. Upload

 

a. WS_FTP [Professional] (I will assume you already know how to use this program)

 

1. Upload info.txt and index.php to a folder in your Xisto account (I am going to use the root folder* in this tutorial)

2. Right click on info.txt on your Xisto webspace (the right side of WS_FTP)

3. Select Properties in the menu

4. Enter 777 as the numeric value Posted Image

 

b. Browser

 

1. Go to your cPanel (http://forums.xisto.com/no_longer_exists/)

2. Click on File Manager in Site Management Tools

3. Click on the FOLDER ICON next to "www"

4. Click on Upload file(s)

5. Click the first "Browse..." button

6. Find info.txt

7. Click Open

8. Click on the second "Browse..." button

9. Find index.php (it should be in the same directory as info.txt)

10. Find and click on info.txt on the left side of the window.

11. You should see the following menu on the right side of the browser:

Show File

Delete File

Edit File

Change Permissions

Rename File

Copy File

Move File

 

12. Click on Change Permissions

13. Enter 7 for the User, 7 for the Group, and 7 for the World Posted Image

14. Click Save

 

7. To test, you have to put a link to index.php in your AIM profile:

a. Go to your buddy list

b. Go to My AIM -> Edit Profile...

d. If you get a window with an OK button on it, click OK

e. Click the Next button (it should be at the bottom next to the Cancel button) twice

f. Click on link Posted Image

g. Enter in the following "http://forums.xisto.com/no_longer_exists/; (without quotes) for "Hyperlink URL". Remember to replace yoursite.trap17.com with the URL of your site

h. For Hyperlink Text, enter "Check out my site!" (without quotes - by the way, any text can go here)

i. Click OK in the "Edit Hyperlink" box, and Finish in the "Create a Profile" box

 

 

You're done! You can either get a friend to click on the link in your profile, or test it out yourself. To test it yourself, go to your URL (http://forums.xisto.com/no_longer_exists/). If you followed my instructions explicitly, then you should not get an error or warning, but you should see a blank page. Now, go you http://forums.xisto.com/no_longer_exists/, and you should see "testing;" on the first line.

 

Be sure to check info.txt periodically to see who viewed your site :) !

 

*I like to thank beeseven for helping me get started as well as SAMS Teach Yourself PHP4 in 24 Hours

 

Edit: One of the BBCode did not show up, but it does now :)

Edited by snlildude87 (see edit history)

Share this post


Link to post
Share on other sites

A quick Q for you, and I don't think you mentioned it...does this feature tell HOW MANY TIMES someone has clicked your link? I already do a IMCHAOS link in my buddy profile but if your feature counts how many times someone clicks your link I'll have to try it out...

Share this post


Link to post
Share on other sites

A quick Q for you, and I don't think you mentioned it...does this feature tell HOW MANY TIMES someone has clicked your link?  I already do a IMCHAOS link in my buddy profile but if your feature counts how many times someone clicks your link I'll have to try it out...

63941[/snapback]

Yes and no. It does not tell you the number of people who visited your site via AIM, but it does list the people who visits your site through AIM, so the only way to know is to count the lines in info.txt :)

Share this post


Link to post
Share on other sites

I was wondering how IMCHAOS did it...
Thanks for this, I'm going to put it in my profile now :P

Something to add:
If you want to add the date that the person viewed your profile, try this:

<?php $name = $_GET["name"];    //gets whatever is after "name=" in your URL (for example, the URL http://yoursite.trap17.com/index.php?name=myname will store "myname" in the variable $name $date = $_GET["date"]; //gets whatever is after  "date=" in your url $file = "info.txt";                 //this is the file name, or the list, of the screennames of people who viewed your site $handle = fopen($file, "a"); //opens info.txt to appendfwrite($handle, "$name | $date\r\n");fwrite($handle, ";\n");        //adds a new line to info.txt after appending  fclose($handle);                //closes file connection?>
and in your profile put in the link as "http://forums.xisto.com/no_longer_exists/;

thanks again snlildude!

edit: forgot a semicolon in the code XD
Edited by rejected (see edit history)

Share this post


Link to post
Share on other sites

I was wondering how IMCHAOS did it...

Thanks for this, I'm going to put it in my profile now :(

 

Something to add:

If you want to add the date that the person viewed your profile, try this:

 

<?php $name = $_GET["name"];    //gets whatever is after "name=" in your URL (for example, the URL http://yoursite.trap17.com/index.php?name=myname will store "myname" in the variable $name $date = $_GET["date"]; //gets whatever is after  "date=" in your url $file = "info.txt";                 //this is the file name, or the list, of the screennames of people who viewed your site $handle = fopen($file, "a"); //opens info.txt to appendfwrite($handle, "$name | $date\r\n");fwrite($handle, ";\n");        //adds a new line to info.txt after appending  fclose($handle);                //closes file connection?>
and in your profile put in the link as "http://forums.xisto.com/no_longer_exists/;

 

thanks again snlildude!

 

edit: forgot a semicolon in the code XD

148673[/snapback]

Hey man, no problem. :D

 

My code is a bit inefficient if you have lots of users clicking on the link in your profile because it writes stuff to info.txt even if $name is blank (if someone types in http://forums.xisto.com/no_longer_exists/ instead of http://forums.xisto.com/no_longer_exists/?name=rejected), but you can add an if...then statement so that it only writes if $name is NOT blank. :D

Share this post


Link to post
Share on other sites

If you want to have the link open in the profile window (like some subprofile sites do), type the following code somewhere then copy and paste into AIM:

<a href="http://yoursite.trap17.com/profile.php?name=%n" target="_self">Click here</a>
If you copy and paste from an AIM window to another AIM window it won't work. Also make sure the URL works.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.