inherit
Graphics Ninja
3
0
Nov 19, 2012 12:17:26 GMT -8
Ryan Roos
Wordsmyth
35,133
November 2003
ryan
|
Post by Ryan Roos on Jul 17, 2013 6:40:58 GMT -8
Is there any way for me to get how many downloads and installs I have for a certain plugin without viewing my profile on proboards.com? No. We can only track plugins/themes that are in the library. So you have to go to the library to see those stats.
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Jul 17, 2013 7:38:47 GMT -8
Texas - Currently there isn't.
|
|
inherit
173855
0
Apr 23, 2024 9:59:44 GMT -8
Texas
I check in every once in a while...
869
November 2011
petermaggio
|
Post by Texas on Jul 17, 2013 8:09:22 GMT -8
You wouldn't happen to know how Peter does that in his sig would you?
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Jul 17, 2013 8:13:47 GMT -8
I haven't looked at it, but if I had to guess, some kind of phone-home script.
|
|
inherit
Graphics Ninja
3
0
Nov 19, 2012 12:17:26 GMT -8
Ryan Roos
Wordsmyth
35,133
November 2003
ryan
|
Post by Ryan Roos on Jul 17, 2013 8:14:12 GMT -8
You wouldn't happen to know how Peter does that in his sig would you? It's an image that he controls. You could always ask him how he does it.
|
|
inherit
173855
0
Apr 23, 2024 9:59:44 GMT -8
Texas
I check in every once in a while...
869
November 2011
petermaggio
|
Post by Texas on Jul 17, 2013 8:15:24 GMT -8
Yea, that's why I tagged him...It just seems to update automatically so I was wondering if he someone was getting the data from somewhere...But I guess that's a question for him to answer.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jul 17, 2013 8:37:52 GMT -8
TexasI append a 1x1 hidden image to the body that is a PHP script with the headers set to image/png. I actually broken it today and it reset the counter . var stat_image_url = "http://pixeldepth.net/proboards/plugins/yootil/stats/stats.php?f=" + location.hostname.split(".")[0]; var stat_image = $("<img src='" + stat_image_url + "' width='1' height='1' style='display: none;' />");
$("body").append(stat_image); Edit: Forgot to mention. Make sure you lock the file when you are writing to it, I forgot
|
|
inherit
173855
0
Apr 23, 2024 9:59:44 GMT -8
Texas
I check in every once in a while...
869
November 2011
petermaggio
|
Post by Texas on Jul 17, 2013 8:52:20 GMT -8
Heh, that just confuzzled me
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Jul 17, 2013 8:58:53 GMT -8
Heh, that just confuzzled me So it loads and "image" from his website, something like: pixeldepth.net/proboards/plugins/yootil/stats/stats.php?f=support (for this forum). That PHP file returns a 1x1 image that is blank, so to the browser, it looks like an image, but when it generates the image, it also logs that f= parameter to a database or flat file, and when it changes, it writes a new version of his sig image (http://pixeldepth.net/proboards/plugins/yootil/stats/installssig.png) with the new number (or that could be live generated, but longer load times and more CPU). This is the same method a lot of companies use to see if you open an email (if their hidden image gets loaded at all).
|
|
inherit
173855
0
Apr 23, 2024 9:59:44 GMT -8
Texas
I check in every once in a while...
869
November 2011
petermaggio
|
Post by Texas on Jul 17, 2013 9:12:23 GMT -8
Aaahhh, so this is an image that is placed there by the yootil plugin. So when it loads the image the counter is updated if the forum name isn't already stored in the php file...
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Jul 17, 2013 9:24:06 GMT -8
Yup. The plugin appends the image to the <body>, which causes it to load, pulling the PHP script, which does the logic to keep the number up to date. At least the simple version. Not sure if he tracks how many have stopped using the plugin, but you could crontab to see which forums haven't pulled in a long time.
|
|
inherit
173855
0
Apr 23, 2024 9:59:44 GMT -8
Texas
I check in every once in a while...
869
November 2011
petermaggio
|
Post by Texas on Jul 17, 2013 10:54:12 GMT -8
Thanks RedBassett.. If proboards charged you every time you submitted a plugin update, they'd have two dollars from me already today...I really need to stop messing up the Gold Shop plugin every time I fix something.... On a side note, it would be nice to be able to submit a reason for the update to the people that are reviewing them. Cause sometimes I feel kinda weird when I have to submit four updates in three days.
|
|
inherit
Graphics Ninja
3
0
Nov 19, 2012 12:17:26 GMT -8
Ryan Roos
Wordsmyth
35,133
November 2003
ryan
|
Post by Ryan Roos on Jul 17, 2013 10:57:20 GMT -8
Thanks RedBassett.. If proboards charged you every time you submitted a plugin update... That's a great idea!!! Hold on while I implement this.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jul 17, 2013 11:57:21 GMT -8
Aaahhh, so this is an image that is placed there by the yootil plugin. So when it loads the image the counter is updated if the forum name isn't already stored in the php file... Sorry, didn't explain in detail, was pushed for time when I saw your message. RedBassett pretty much explained it anyway. It's very simple. Here is my PHP script if you want to do one yourself. This only does the capturing and retrieving of the stat. Outputting it is very simple, just look over the GD library, or if I get time I will tidy up my script and post it. Anyway, here is the class, nothing complicated at all. It doesn't bother checking if the plugin is still installed / active, but you can easily add in support for that. final class Plugin_Statistics {
private $plugin; public function __construct($plugin = null){ $this -> plugin = $plugin; } private function get_data(){ $handle = fopen($this -> plugin, "r"); $data = (filesize($this -> plugin))? fread($handle, filesize($this -> plugin)) : "";
if(strlen($data)){ $data = unserialize($data); } else { $data = array(); }
fclose($handle); return $data; } public function capture($forum = null){ if(isset($forum) && strlen($forum)){ $data = $this -> get_data(); if(!in_array(strtolower($forum), $data)){ $data[] = strtolower($forum); $handle = fopen($this -> plugin, "w+");
if(flock($handle, LOCK_EX)){ ftruncate($handle, 0); fwrite($handle, serialize($data)); fflush($handle); flock($handle, LOCK_UN); } fclose($handle); } } } public function installs($format = true){ $data = $this -> get_data(); $installs = count($data); return ($format)? number_format($installs) : $installs; } } I fixed the file locking issue, so hopefully it won't be an issue now. Example if capturing... if(isset($_GET["f"])){ include_once("plugin_statistics.class.php");
$stats = new Plugin_Statistics("yootil_library"); $stats -> capture($_GET["f"]); }
header("Content-type: image/png"); exit(); Getting the total... include_once("plugin_statistics.class.php");
$stats = new Plugin_Statistics("yootil_library");
$installs = $stats -> installs(); Here is my class for creating the image... final class Plugin_Statistics_Image {
private $text; private $size; private $color; private $font; private $image; public function __construct($text = "", $size = 18, $color = "000000", $font = ""){ $this -> text = $text; $this -> size = $size; $this -> font = $font; $this -> color = $color; $this -> create_image(); } private function create_image(){ $image_width_height = $this -> create_bounding_box(); $this -> image = imagecreatetruecolor($image_width_height[0], $image_width_height[1]); ImageFill($this -> image, 0, 0, IMG_COLOR_TRANSPARENT); imagesavealpha($this -> image, true); imagealphablending($this -> image, false); $y = (($image_width_height[1] / 2) + ($this -> size / 2)); imagettftext($this -> image, $this -> size, 0, 5, $y, $this -> color, $this -> font, $this -> text); } private function create_bounding_box(){ $type_space = imagettfbbox($this -> size, 0, $this -> font, $this -> text); $image_width = abs($type_space[4] - $type_space[0]) + 10; $image_height = abs($type_space[5] - $type_space[1]) + 10; return array($image_width, $image_height); } public function save($file_name = null){ $name = (isset($file_name) && strlen($file_name))? $file_name : (time() . "_image"); $name .= ".png"; imagepng($this -> image, $name); } public function show(){ header("content-type: image/png"); imagepng($this -> image); imagedestroy($this -> image); exit(); }
} Example of how I am using it... include_once("classes/plugin_statistics.class.php"); include_once("classes/plugin_statistics_image.class.php");
$stats = new Plugin_Statistics("yootil_library");
$installs = $stats -> installs();
$text = $installs . " forum" . (($installs == 1)? "" : "s") . " have the Yootil Library installed"; $image = new Plugin_Statistics_Image($text, 20, "000000", "fonts/TravelingTypewriter.ttf"); $image -> save("yootil_stat_sig");
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Jul 17, 2013 12:07:09 GMT -8
Thanks RedBassett.. If proboards charged you every time you submitted a plugin update... That's a great idea!!! Hold on while I implement this. we should get money back if PB makes a base code change and breaks a plugin. fair is fair.
|
|