[Release] page - hit counter in mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • George L
    Former vBulletin Support
    • May 2000
    • 32996
    • 3.8.x

    [Release] page - hit counter in mysql

    Who would ever think me releasing something

    Being a newbie at php/mysql programming i had help from tutorials all over the place and from freakysid from SPF forums

    1. MySQL based counter

    You need:
    1. phpmyadmin - http://sourceforge.net/projects/phpmyadmin/ -phpmyadmin install and use guide to add a table named mycounter to your existing vB database.

    you need to select you vb database name listed in the left of phpmyadmin and run the following queries once in phpmyadmin
    Code:
    CREATE TABLE mycounter (count INT(11) UNSIGNED NOT NULL);
    INSERT INTO mycounter SET count = 0;
    i.e. if my vb database is named usertest you should enter like this the screen cap below or here.

    2. need to edit your phpinclude template and add the following in:
    PHP Code:
    $result mysql_query("SELECT count FROM mycounter");
    $mycounter mysql_result($result0) + 1;
    $result mysql_query("UPDATE mycounter SET count = count + 1"); 
    save changes

    3. then place $mycounter in your footer template
    Last edited by George L; Sun 26 Aug '01, 4:31pm.
    :: Always Back Up Forum Database + Attachments BEFORE upgrading !
    :: Nginx SPDY SSL - World Flags Demo [video results]
    :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]
  • Ruth
    Senior Member
    • Apr 2001
    • 360

    #2
    looks nice,

    is there a demo?

    and how does it work? based on logins? or specified ip adress?

    Comment

    • George L
      Former vBulletin Support
      • May 2000
      • 32996
      • 3.8.x

      #3
      based a raw pageview hits... you can see it working on my vB at the bottom of each page http://animeboards.com/

      i'm still a newbie with php but working on it
      :: Always Back Up Forum Database + Attachments BEFORE upgrading !
      :: Nginx SPDY SSL - World Flags Demo [video results]
      :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

      Comment

      • merk
        Senior Member
        • Jul 2001
        • 4149

        #4
        A sugestion eva2k...

        Im after a counter script myself, which yours is great for, but i need one to also record the HTTP_REFFERER, and useragent, and i dont really want to us webtrends :/

        I could try to add these features for you if you want me to?

        Comment

        • George L
          Former vBulletin Support
          • May 2000
          • 32996
          • 3.8.x

          #5
          Originally posted by merk
          A sugestion eva2k...

          Im after a counter script myself, which yours is great for, but i need one to also record the HTTP_REFFERER, and useragent, and i dont really want to us webtrends :/

          I could try to add these features for you if you want me to?
          sure why not.. i'm planning to do this too but i have to learn how to do it first (it's only been 48 hrs since i started learning php )
          :: Always Back Up Forum Database + Attachments BEFORE upgrading !
          :: Nginx SPDY SSL - World Flags Demo [video results]
          :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

          Comment

          • merk
            Senior Member
            • Jul 2001
            • 4149

            #6
            Ive done php for some time, but never have gotten around do doing anything of any importance :/

            Comment

            • FWC
              Senior Member
              • Jul 2001
              • 282

              #7
              Who would ever think me releasing something
              That's a nice hack. I installed it.
              FWC
              White Sox Interactive Forums

              Comment

              • _
                Member
                • Sep 2000
                • 57

                #8
                lol eva

                the counter on AB is just like a stopwatch almost, it goes up like 2 every second (3 if you include me =)

                Comment

                • Bane
                  Senior Member
                  • Jul 2000
                  • 515

                  #9
                  Originally posted by merk
                  A sugestion eva2k...

                  Im after a counter script myself, which yours is great for, but i need one to also record the HTTP_REFFERER, and useragent, and i dont really want to us webtrends :/

                  I could try to add these features for you if you want me to?
                  In case anyone is interested, I am putting together something like this. You can view an example of the output at:



                  As far as the referrer check

                  Comment

                  • dxb
                    Senior Member
                    • Mar 2001
                    • 126

                    #10
                    hi there eva

                    you did it at last

                    thanks for the counter

                    and Bane the stats look really great ....yes I'm intersted in and I will be waiting for if

                    but could you make it so that you can add it to a VB page and a non VB page if it's possible

                    Comment

                    • Dakota
                      Senior Member
                      • Feb 2001
                      • 135

                      #11
                      Bane that looks really good. I hope you release it
                      Bid For Power - Bid For Power Forums
                      =======================
                      Anime Academy - Anime Academy Forums

                      Comment

                      • merk
                        Senior Member
                        • Jul 2001
                        • 4149

                        #12
                        Geezes, you must have taken your time to make something like that!

                        I cant ever get the motivation to create something like it :/

                        Comment

                        • MarkB
                          Senior Member
                          • Apr 2001
                          • 1253

                          #13
                          Nice stuff, Eva Now to get depressed about how low the page count is

                          Comment

                          • merk
                            Senior Member
                            • Jul 2001
                            • 4149

                            #14
                            Lol, good point there

                            Comment

                            • George L
                              Former vBulletin Support
                              • May 2000
                              • 32996
                              • 3.8.x

                              #15
                              really i only want a simple pageview counter to compare against my banner script impressions and my site log files since my figures seem to differ a bit in each
                              :: Always Back Up Forum Database + Attachments BEFORE upgrading !
                              :: Nginx SPDY SSL - World Flags Demo [video results]
                              :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...