[SOLVED] Who knows PHP and wants to help out.

Here is the place were the team and the community projects meet together. Help us to develop SolydXK projects or contribute your ideas for future releases.
User avatar
Arjen Balfoort
Site Admin
Posts: 9518
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

[SOLVED] Who knows PHP and wants to help out.

Postby Arjen Balfoort » 03 Apr 2013 15:03

I've got a bit of an issue with the download statistics.
Currently Wordpress is keeping track of the clicks on the downloads.
Unfortunately, it will max on 500 records, so eventually I will not be able to retrieve the complete download history.

Now, my question is:
Do you know php/mySQL and would like to help out?

Use case:
The sites main domain is solydxk.nl
The iso and torrent files are in the sub-domain: downloads.solydxk.nl
If a user clicks on a link in the main site that points to a file in downloads.solydxk.nl, a counter is upped with one on a daily basis.
datefilecounter
2013-04-01http://downloads.solydxk.nl/solydk32_latest.iso12
2013-04-01http://downloads.solydxk.nl/solydk32_latest.iso.torrent4
Note: date and file together are unique.

To represent the data, I need a simple page to show the stats of the current month and totals per downloaded file.


SolydXK needs you!
Development | Testing | Translations

User avatar
on4aa
Posts: 153
Joined: 24 Mar 2013 19:12
Location: Hasselt, Belgium

Re: Who knows PHP and wants to help out.

Postby on4aa » 04 Apr 2013 20:51

@Schoelje: No, I do not know PHP, nor do I want to learn it (looks awful :o compared to Python).

I do would like to suggest you to have a look at the following CGI web application: AWStats.
I have been using it on my hosted website for many years now.
It does what you would like to achieve and it works like a charm!
Kurtz: "Have you ever considered any real freedoms? Freedoms from the opinion of others... even the opinions of yourself?"

User avatar
Arjen Balfoort
Site Admin
Posts: 9518
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Who knows PHP and wants to help out.

Postby Arjen Balfoort » 04 Apr 2013 21:07

on4aa wrote:@Schoelje: No, I do not know PHP, nor do I want to learn it (looks awful :o compared to Python).

I do would like to suggest you to have a look at the following CGI web application: AWStats.
I have been using it on my hosted website for many years now.
It does what you would like to achieve and it works like a charm!
I know, but I don't want to use stats on my site, because I'm running:
  • Apache server
  • MySQL server
  • The main site
  • This forum
  • Torrent server
  • Rsync server
  • Two repositories
and these take up all the resources I can afford (I'm maxed out 100% all the time). Running these kind of statistics takes up resources that cannot be used for anything else.
I'm afraid I'll have to build it myself.


SolydXK needs you!
Development | Testing | Translations

BobHinds
Posts: 6
Joined: 05 Mar 2013 19:27

Re: Who knows PHP and wants to help out.

Postby BobHinds » 12 Apr 2013 19:02

Schoelje,

Do you still want some help with a php/mySQL web page?

I am still learning php but I have come up with a web page that may be close to what you want. I have attach a screen shot of the web page.

I took the layout from your original post and created the following table in mySQL:

Code: Select all

mysql> describe downloads;
+---------+--------------+------+-----+---------+-------+
| Field   | Type         | Null | Key | Default | Extra |
+---------+--------------+------+-----+---------+-------+
| date    | date         | YES  |     | NULL    |       |
| file    | varchar(128) | YES  |     | NULL    |       |
| counter | int(11)      | YES  |     | NULL    |       |
+---------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
The table is populated with the following test data:

Code: Select all

mysql> select * from downloads;
+------------+-----------------------------+---------+
| date       | file                        | counter |
+------------+-----------------------------+---------+
| 2013-02-28 | solydk32_latest.iso         |       4 |
| 2013-02-28 | solydk64_latest.iso         |       7 |
| 2013-02-28 | solydx64_latest.iso         |       8 |
| 2013-02-28 | solydx32_latest.iso         |       6 |
| 2013-02-28 | solydx32_latest.iso.torrent |       3 |
| 2013-02-28 | solydx64_latest.iso.torrent |       2 |
| 2013-03-01 | solydk64_latest.iso         |       6 |
| 2013-03-01 | solydk32_latest.iso         |       2 |
| 2013-03-01 | solydk64_latest.iso.torrent |       5 |
| 2013-03-01 | solydx64_latest.iso.torrent |       8 |
| 2013-03-03 | solydk32_latest.iso         |       6 |
| 2013-03-05 | solydk64_latest.iso         |       9 |
| 2013-03-08 | solydk32_latest.iso.torrent |       5 |
| 2013-03-11 | solydk64_latest.iso.torrent |       3 |
| 2013-04-01 | solydk32_latest.iso         |       6 |
| 2013-04-01 | solydx32_latest.iso         |       2 |
| 2013-04-02 | solydk64_latest.iso         |       7 |
| 2013-04-02 | solydx64_latest.iso         |       4 |
| 2013-04-02 | solydk32_latest.iso.torrent |       3 |
| 2013-04-02 | solydx32_latest.iso.torrent |       1 |
| 2013-04-03 | solydk64_latest.iso.torrent |       8 |
| 2013-04-03 | solydx64_latest.iso.torrent |       6 |
| 2013-04-04 | solydk32_latest.iso         |       3 |
| 2013-04-04 | solydx32_latest.iso         |       9 |
| 2013-04-05 | solydk64_latest.iso         |       2 |
| 2013-04-05 | solydx64_latest.iso         |       7 |
| 2013-04-06 | solydk32_latest.iso.torrent |       2 |
| 2013-04-06 | solydx32_latest.iso.torrent |       3 |
| 2013-04-06 | solydk64_latest.iso.torrent |       7 |
| 2013-04-06 | solydx64_latest.iso.torrent |       1 |
+------------+-----------------------------+---------+
30 rows in set (0.01 sec)
Let me know if you would like to see the source code. It will of course need to be modified to access the Wordpress database table.
Attachments
downloaded.png

User avatar
Arjen Balfoort
Site Admin
Posts: 9518
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Who knows PHP and wants to help out.

Postby Arjen Balfoort » 12 Apr 2013 22:35

Thanks BobHinds, but I solved the issue just a few days ago (and totally forgot about this thread).
My solution is to get data daily from the wordpress API for the previous day, save that into a MySQL table and write the absolute totals of SolydX and SolydK into two separate files. These files are used in the product pages to show the counter.
A detailed page is used in the moderators section of the forum that looks a lot like your page, but differentiates between server and mirror downloads.

Thanks for thinking about me, and thanks for reminding me that I have to follow my own policy: put [SOLVED] in the subject.


SolydXK needs you!
Development | Testing | Translations

BobHinds
Posts: 6
Joined: 05 Mar 2013 19:27

Re: [SOLVED] Who knows PHP and wants to help out.

Postby BobHinds » 12 Apr 2013 23:15

I had a feeling you already had it solved :)

Thanks for the reply.


Return to “Suggestions & ideas / Open Projects”

Who is online

Users browsing this forum: No registered users and 0 guests