PHP and MySQL Link/Download Tracker Take 2 (SHTracker)

A few weeks ago I released my PHP and MySQL link/download tracker. Today I release a complete rewrite. Announcing SHTracker!

To see a working example, simply download from the site as it powers the downloads system.

See here for more information

PHP and MySQL Link/Download Tracker

Recently I decided, to redesign the site’s downloads system. Originally I was using the excellent PHP Click Counter from PHPJunkyard to count downloads. However the script was far from perfect and presented problems each time I released a new download. For the revamp I decided I wanted to use MySQL databases to store the data. Unfortunately I could not find a script which would do exactly what I required. So I made my own.

Three hours later the PHP and MySQL Link/Download Tracker was born.

What it does: The script will count link clicks and store its results in a database.

Setup:

  1. Create a new database using you web hosts control panel
  2. Select your new database in Phpmyadmin
  3. Go to the query tab and paste the following in the box:
    CREATE TABLE `Data` (
    `id` VARCHAR( 50 ) NOT NULL ,
    `count` INT( 10 ) NOT NULL default '0' ,
    PRIMARY KEY ( `id` )
    ) ENGINE = MYISAM ;
  4. Open up config.php and change the database values to match your settings
  5. Open up get.php and change the id’s and url’s in the links array to reflect the id’s you want to use. See below for an example:
    $links = array(
    "mydownload1" => "http://some.site/mydownload1.zip",
    "mydownload2" => "http://some.site/mydownload2.zip"
    );

    So if your download was called mytest, you would change mydownload1 to mytest and set the url to the download url of the file. You can add as many id’s as you wish.

  6. Upload get.php, show.php and config.php to your server
  7. Done

Usage:

The script is called like this: /get.php?id=mydownload1

So instead of linking to /mydownload1.zip, link to /get.php?id=mydownload1

To show your download stats simply call show.php rather than get.php

Download
Source

Update: See here.

Big changes are coming…

In the next few months the emesene OS X build is going to change dramatically. The new version will include:

  • Sparkle integration
  • A 64 bit binary
  • A rewritten uninstaller
  • Various other Mac OS X integration tweaks

emesene menu check for updates
emesene with a touch of sparkleemesene 64bit

These changes are ready, i am purely waiting for Sparkle to be updated to work with Lion. If you are running Snow Leopard and are interested in beta testing the new version, please contact me.

emesene is going Qt!

Due to the hard work of Gabriele “Whisky” Visconti, emesene 2 now has a Qt interface. The interface needs a lot of work, but it is a step toward integrating emesene with OS X. If you want to get the Qt interface working on Snow Leopard, follow the instructions below.

Update: As pointed out by Gabriele “Whisky” Visconti, you will also need GObject and PyCrypto. For instructions on how build/install these see here.

Download Qt from here (You want the Cocoa binary package)

Mount the DMG and install the Qt package

1. Download SIP from here (You want Linux, UNIX, MacOS/X source)
2. Unzip the downloaded file
3. Move the unzipped folder to your home directory
4. Open terminal and run:

cd sip-x.x.x (Change depending on SIP version)
python setup.py
make
sudo make install

5. Download PyQt from here (You want MacOS/X source)
6. Unzip the downloaded file
7. Move the unzipped folder to your home directory
8. Open terminal and run:

cd PyQt-mac-gpl-snapshot-x.x-xxxxx (Change depending on PyQt version)
python setup.py
make
sudo make install

9. Download the latest version of emesene from GitHub and unzip
10. Test it out

cd /emesene-emesene-xxxxxx (Change according depending of emesene version)
./emesene -e main:qt4_main

11. You can deleted the folders you moved into your home directory if you wish

Getting emesene 2 up and running on OS X

Note: This guide is pretty outdated, use at your own risk

You will need:

  • Git (http://code.google.com/p/git-osx-installer/downloads/list?can=3)
  • Apple developer tools
  • A text editor (I recommend TextMate)
  • Terminal

NOTE: IF YOU HAVE USED MACPORTS/FINK, REMOVE ALL TRACES OF IT BEFORE CONTINUING

I assume you want to install gtk at ~/gtk, if not change the instructions accordingly.

First we need to install JHBuild:

curl -o gtk-osx-build-setup.sh https://raw.github.com/jralls/gtk-osx-build/master/gtk-osx-build-setup.sh

sh gtk-osx-build-setup.sh

Once JHBuild is installed run these commands:

PATH=$HOME/.local/bin:$PATH

export PATH

By default JHBuild will install gtk to ~/gtk, if you want a different location edit ~/.jhbuildrc and change the install directory.

We are now ready to build GTK:

jhbuild bootstrap

jhbuild build meta-gtk-osx-bootstrap

Now we need to edit ~/.cache/jhbuild/gtk-osx.modules and remove the line:

<patch file=”https://github.com/jralls/gtk-osx-build/raw/master/patches/gtk-relocation.patch” strip=”1″/>

Once done run:

jhbuild build meta-gtk-osx-core

jhbuild build meta-gtk-osx-python

If you get this error: “checking whether to build Python bindings… configure: error: Couldn’t find the required Python tools.” See here.

Optional: Edit file: ~/.cache/jhbuild/gtk-osx-themes.modules and disable all engines except for clearlooks by adding:

autogenargs=”–disable-all –enable-clearlooks”

Then build the themes:

jhbuild build meta-gtk-osx-themes

GTK and PyGTK should now have been built.

Now navigate to ~/gtk/inst/lib/python2.6/site-packages and copy the contents of the site-packages folder to /Library/Python/2.6/site-packages

Or run:

echo “import site; site.addsitedir(‘~/gtk/inst/lib/python2.6/site-packages’)” > /Library/Python/2.6/site-packages/gtkredirect.pth

Next we need to build Pycrypto:

curl -o pycrypto-2.3.tar.gz http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.3.tar.gz

tar -xf pycrypto-2.3.tar.gz

cd pycrypto-2.3

sudo python setup.py install

mv /Library/Python/2.6/site-packages/Crypto ~/gtk/inst/lib/python2.6/site-packages

Now all the dependencies are in place, lets download emesene 2 from GitHub.

git clone https://github.com/emesene/emesene.git

cd emesene

git submodule init

git submodule update

Now browse to navigate to the emesene/emesene directory and double click the executable.

Enjoy!

Some Pretty Big News…

emesene 2 about

emesene 2 beta is here. MSN works, Jabber works and it is pretty stable. No need for complex hacking of emesene files to run it. Simple drag and drop to install.

Currently sounds are not working and there is no theme at the moment.

Some more pictures…

emesene 2 chat window

emesene 2 contact list

emesene 2 login window

emesene 2 service selector

Interested?

A beta will be available soon. Request to be a beta tester and then check the beta page.

Update:

emesene 2 with clearlooks theme

We have GTK theme engines at last. Currently ClearLooks is included but Murrine and other engines will be included in the future.

Christ, what a mess!

I guess you could call this a plea for help…

I am having serious problems getting emesene 2 to run on OS X. Currently Papyon will not work, libpyglib keeps crashing and the menu bar does not work.

Without Papyon, WLM does not work. Rather a large problem in a WLM client.

PyGlib Problem

If you know how to fix any of these problems, please fork the emesene repo and contact me if you manage to get emesene 2 running successfully.

Taking Back The Internet…

Many congratulations to the work of anonymous, who are trying to win back a censorship free internet and are fighting for freedom of speech. I will keep supporting you are i encourage others to do the same.

Just grab LOIC and fire away.

Anonymous’s manifesto: http://www.indybay.org/newsitems/2010/12/09/18666107.php

Rant of the Week: 13/10 Call Of Dumbasses

Call Of Duty, Camp Or Die, Call of Dumbasses, etc etc

It used to be about camping but now it’s about boosting. Why? Because some people could not win a free for all if their life depended on it. They rely on cheating to get to first place. Wow. That is really clever isn’t it.

No. Your all ruining gaming.

The whole point of gaming is for some friendly competition, so if two people get together to “boost” it is ruined. After some moron boosting is on 15 kills there is no way playing fairly you can catch up.

I guess my message here is to give people you see boosting bad rep and file a complaint. Get the wankers banned from live. I would do a camp list like before but there are too many cheats too keep track of. It is weird how this only happens on CoD, most other games people play fairly and the players actually have enough skill to bring a challenge.