Welcome Guest ( Log In | Register)



2 Pages V   1 2 >  
Reply to this topicStart new topic
> Who's Viewing My Site?, Targeted for AIM users
snlildude87
post Mar 25 2005, 03:26 AM
Post #1


Moderator
***************

Group: Members
Posts: 2,325
Joined: 8-March 05
From: Mawson, Antarctica
Member No.: 4,254



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://yoursite.trap17.com. This is not a special URL reserved on trap17 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://sang.trap17.com.

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:
CODE

<?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) user 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 trap17 account (I am going to use the root folder* in this tutorial)
2. Right click on info.txt on your trap17 webspace (the right side of WS_FTP)
3. Select Properties in the menu
4. Enter 777 as the numeric value user posted image

b. Browser

1. Go to your cPanel (http://yoursite.trap17.com/cpanel)
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:
QUOTE
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 user 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 user posted image
g. Enter in the following "http://yoursite.trap17.com/index.php?name=%n" (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://yoursite.trap17.com/index.php?name=testing). 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://yoursite.trap17.com/info.txt, and you should see "testing;" on the first line.

Be sure to check info.txt periodically to see who viewed your site smile.gif !

*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 smile.gif

This post has been edited by snlildude87: Mar 25 2005, 03:31 AM
Go to the top of the page
 
+Quote Post
elevenmil
post Mar 25 2005, 05:32 AM
Post #2


Super Member
*********

Group: Members
Posts: 440
Joined: 22-March 05
Member No.: 4,795



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...
Go to the top of the page
 
+Quote Post
rectab
post Mar 25 2005, 04:26 PM
Post #3


Newbie [Level 2]
**

Group: Members
Posts: 32
Joined: 25-March 05
Member No.: 4,889



Copied post from above deleted.

This post has been edited by snlildude87: Mar 25 2005, 06:04 PM
Go to the top of the page
 
+Quote Post
snlildude87
post Mar 25 2005, 06:00 PM
Post #4


Moderator
***************

Group: Members
Posts: 2,325
Joined: 8-March 05
From: Mawson, Antarctica
Member No.: 4,254



QUOTE(elevenmil @ Mar 25 2005, 02:32 AM)
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...
*


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 smile.gif
Go to the top of the page
 
+Quote Post
rejected
post Jun 7 2005, 05:54 AM
Post #5


{([Mod])}
*********

Group: Members
Posts: 710
Joined: 30-October 04
From: Texas
Member No.: 2,058



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

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

CODE

<?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 append

fwrite($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://yoursite.trap17.com/index.php?name=%n&date=%d"

thanks again snlildude!

edit: forgot a semicolon in the code XD

This post has been edited by rejected: Jun 7 2005, 08:08 AM
Go to the top of the page
 
+Quote Post
snlildude87
post Jun 9 2005, 07:52 PM
Post #6


Moderator
***************

Group: Members
Posts: 2,325
Joined: 8-March 05
From: Mawson, Antarctica
Member No.: 4,254



QUOTE(rejected @ Jun 7 2005, 02:54 AM)
I was wondering how IMCHAOS did it...
Thanks for this, I'm going to put it in my profile now biggrin.gif

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

CODE

<?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 append

fwrite($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://yoursite.trap17.com/index.php?name=%n&date=%d"

thanks again snlildude!

edit: forgot a semicolon in the code XD
*


Hey man, no problem. smile.gif

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://thyelite.com instead of http://thyelite.com?name=rejected), but you can add an if...then statement so that it only writes if $name is NOT blank. smile.gif
Go to the top of the page
 
+Quote Post
compwiz3000
post Aug 11 2005, 08:29 PM
Post #7


Newbie
*

Group: Members
Posts: 1
Joined: 11-August 05
Member No.: 10,592



I've created an AIM Profile Tracker which records who views your profile, how many times the have viewed your AIM profile, and when they last viewed your AIM profile. To register for it, simply go to http://www.venkatkoduru.gamerzparadise.biz...Track/index.php, click register, enter your screen name, and copy the code given into your AIM Profile.
Go to the top of the page
 
+Quote Post
beeseven
post Aug 12 2005, 02:40 PM
Post #8


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



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:
CODE
<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.