Results 1 to 15 of 41
Page 1 of 3
FirstFirst 1 2 3 ... LastLast

Thread: [release vB2.0]couter in vB page

  1. #1
    New Member bbqfan is on a distinguished road
    Join Date
    May 2001
    Posts
    25

    [release vB2.0]couter in vB page

    a. open vb2/global.php

    find:

    PHP Code:
    // ###################### Start init ####################### 
    Immediately ABOVE it put any PHP counter, i using this:

    PHP Code:
    // ipcounter hack by CX
    // config
    // create these two files count.txt and ip.txt, chmod them to 777
    $count_file "count.txt";
    $ip_file "ip.txt";
    $userip getenv('REMOTE_ADDR');  // in some fixed IP server, change this line to $userip = getenv('HTTP_X_FORWARDED_FOR');

    $count_temp=file($count_file);
    $ip_temp=file($ip_file);

    $detail=explode("|",$count_temp[0]);
    $count_t=getdate(time());
    $count_day=$count_t['mday'];

    if (
    $detail[0]==$count_day) {
        
    $detail[1]++;
        
    $detail[2]++;

        
    $count=count($ip_temp);
        
    $check=1;
        for (
    $i=0$i<$count$i++) {
            
    $ip_list=str_replace("\r","",str_replace("\n","",$ip_temp[$i]));
            if (
    $ip_list==$userip$check=0;
        }
        if (
    $check==1) {
            
    $detail[3]++;
            
    $detail[4]++;
            
    $fp=fopen($ip_file,"a");
            
    flock($fp,3);
            
    fputs($fp,$userip."\n");
            
    fclose($fp);
        }
    }
    else {
        
    $detail[0]=$count_day;
        
    $detail[1]=1;
        
    $detail[3]=1;
        
    $detail[2]++;
        
    $detail[4]++;
        
    $fp=fopen($ip_file,"w");
        
    flock($fp,3);
        
    fputs($fp,$userip."\n");
        
    fclose($fp);
    }

    $new=implode("|",$detail);
    $fp=fopen($count_file,"w");
    flock($fp,3);
    fputs($fp,$new);
    fclose($fp);

    // end ipcounter hack 
    b. edit the template footer

    find in last:

    PHP Code:
    </smallfont>
    </
    p
    Immediately ABOVE it put:

    PHP Code:
    <br><br>
    page views:&nbsp;&nbsp;today $detail[1],&nbsp;&nbsp;total $detail[2].&nbsp;&nbsp;variant IP visitors:&nbsp;&nbsp;today $detail[3],&nbsp;&nbsp;total $detail[4]. 
    Done!
    Last edited by bbqfan; Thu 31st May '01 at 5:05pm.
     

  2. #2
    New Member First-Man is on a distinguished road First-Man's Avatar
    Join Date
    Apr 2001
    Posts
    26
    Where can i see an Demo?
    thx
     

  3. #3
    New Member bbqfan is on a distinguished road
    Join Date
    May 2001
    Posts
    25
    see the demo.jpg:
     

  4. #4
    New Member Degen is on a distinguished road
    Join Date
    Apr 2001
    Posts
    11
    It works on my board, but I get this at the top of my page :

    Warning: file("../addons/count.txt") - No such file or directory in /home/gaminghq/public_html/forums/global.php on line 69

    Warning: file("../addons/ip.txt") - No such file or directory in /home/gaminghq/public_html/forums/global.php on line 70

    Warning: fopen("../addons/ip.txt","w") - No such file or directory in /home/gaminghq/public_html/forums/global.php on line 101

    Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 102

    Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 103

    Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 104

    Warning: fopen("../addons/count.txt","w") - No such file or directory in /home/gaminghq/public_html/forums/global.php on line 108

    Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 109

    Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 110

    Warning: Supplied argument is not a valid File-Handle resource in /home/gaminghq/public_html/forums/global.php on line 111

    Not sure what to make of this
     

  5. #5
    New Member bbqfan is on a distinguished road
    Join Date
    May 2001
    Posts
    25
    see this?
    PHP Code:
    $cxip_count_file "../addons/count.txt";  // check the path
    $cxip_file "../addons/ip.txt";           // check the path 
    check the path first plx...
    i set the path of count.txt and ip.txt to "../addons/", if you like, you can change it to anything else...

    or like this:

    chage those two lines to:

    PHP Code:
    $cxip_count_file "count.txt";  // check the path
    $cxip_file "ip.txt";           // check the path 
    it will be ok!
     

  6. #6
    Member bokhalifa is on a distinguished road bokhalifa's Avatar
    Join Date
    Feb 2001
    Location
    u a e dubai
    Age
    33
    Posts
    99

    good werk

    good werk
    In Dubai every thing is different
     

  7. #7
    Member Blue2000 is on a distinguished road
    Join Date
    Feb 2001
    Posts
    87
    i made a live counter ages ago

    its posted here somwhere

    i can repost it if people what it
     

  8. #8
    Senior Member Maverick1236 has disabled reputation
    Join Date
    Apr 2001
    Posts
    346

    Id like that

    Id like to see it
     

  9. #9
    Senior Member TimberLand is on a distinguished road TimberLand's Avatar
    Join Date
    Feb 2001
    Location
    Indiana
    Age
    42
    Posts
    148

    Nice

    Anyway to make this an option only the admin can see.
     

  10. #10
    Senior Member ztsky is on a distinguished road
    Join Date
    Mar 2001
    Age
    36
    Posts
    151
     

  11. #11
    New Member Degen is on a distinguished road
    Join Date
    Apr 2001
    Posts
    11
    BBQFan,

    I made the changes, but am still getting the same errors.
     

  12. #12
    Senior Member h4p3 is on a distinguished road
    Join Date
    Apr 2001
    Location
    Vienna, Austria
    Age
    27
    Posts
    215
    You have to create two files, called count.txt and ip.txt and chmod them to 777.
     

  13. #13
    Senior Member h4p3 is on a distinguished road
    Join Date
    Apr 2001
    Location
    Vienna, Austria
    Age
    27
    Posts
    215
    Hm, i think there is something wrong.

    It always displays this: (it is installed since two days)

    vb test received page views: today = 1, total = 22. variant IP visitors: today = 1, total = 22.

    today = 1 ? What does this mean? I know that there were more than one person on my test board, it should display today = 2 or so.

    Suggestions on this?
     

  14. #14
    Lesane
    Guest
    Originally posted by h4p3
    Hm, i think there is something wrong.

    It always displays this: (it is installed since two days)

    vb test received page views: today = 1, total = 22. variant IP visitors: today = 1, total = 22.

    today = 1 ? What does this mean? I know that there were more than one person on my test board, it should display today = 2 or so.

    Suggestions on this?
    same problem here
     

  15. #15
    Member Santa has disabled reputation Santa's Avatar
    Join Date
    Jul 2000
    Location
    Leipzig
    Age
    39
    Posts
    65
    same prob here too

    Santa
     

Page 1 of 3
FirstFirst 1 2 3 ... LastLast

Similar Threads

  1. [Release vB2.0.3] ReferralsHack
    By Afterburner in forum Releases: Version 2.x
    Replies: 2
    Last Post: Thu 25th Oct '01, 6:25pm
  2. [Release vB2.0] PM Stats 1.0
    By The_Sisko in forum Releases: Version 2.x
    Replies: 55
    Last Post: Thu 26th Jul '01, 8:34pm
  3. [Release vB2.0] vB colors for non-vb page
    By wajones in forum Releases: Version 2.x
    Replies: 2
    Last Post: Mon 25th Jun '01, 11:49am
  4. [Release vb2.0.1] vbPortal 2.0.1
    By wajones in forum Releases: Version 2.x
    Replies: 26
    Last Post: Wed 13th Jun '01, 9:22pm
  5. [Release vB2.0] vbPortal 1.0 alpha
    By wajones in forum Releases: Version 2.x
    Replies: 75
    Last Post: Tue 1st May '01, 5:10pm

Bookmarks

Posting Permissions

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts