#57723
05/31/2004 7:00 PM
|
Joined: May 2001
Posts: 55
Member
|
Member
Joined: May 2001
Posts: 55 |
got this download counter here http://utilmind.com/cgi-bin/download.cgi?scripts/download/downloadcounter.zip you then change your links to: "www.mysite.com/cgi-bin/load?picture1.zip" then it makes a small txt file to record d/l's Then, your page will say this picture have been downloaded "64213" times and increment automatically everytime someone clicks on it. problem is, to show the number of downloads, it uses SSI like this: <!--#include virtual="www.mysite.com/cgi-bin/showload.cgi?picture1.zip" --> into threads...???
|
|
|
#57724
05/31/2004 7:14 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
when using "...???", please include a question in the thread
|
|
|
#57725
05/31/2004 7:18 PM
|
Joined: Nov 2001
Posts: 1,704
Moderator / Da Masta
|
Moderator / Da Masta
Joined: Nov 2001
Posts: 1,704 |
I think I get it, even though you didn't specifically ask a question... You want to SSI-include that on a UBB page. Technically it's possible (with .htaccess), but it would require parsing EVERY single UBB page. Servers don't like this. It tends to make them keel over and die. I know; I've been in that situation several times in my early days. You could try modifying your script to use GD and display the counter as an image (then call it into UBB with an [img] tag, as LK does here), it'd be much server-friendlier...
|
|
|
#57726
05/31/2004 7:19 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
ohhh... or you could change it to be a javascript call quite easily
|
|
|
#57727
05/31/2004 7:45 PM
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Man I'd so love to see how LK does that with GD.
|
|
|
#57728
06/01/2004 6:04 AM
|
Joined: Nov 2001
Posts: 1,704
Moderator / Da Masta
|
Moderator / Da Masta
Joined: Nov 2001
Posts: 1,704 |
It's not that hard... I made a sig image a while ago for another board I visit that uses GD. Just a little script that incremements the number of pageviews it's got, shows the number and exits. It's actually pretty easy when you get used to it. Heavy studying of the readme is suggested first though.
|
|
|
#57729
06/01/2004 6:31 AM
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
I can give you the code of my nums.php script, very easy. <?php
Header("Content-type: image/png");
$s = $HTTP_GET_VARS['s'];
$file = file("stats.cgi");
if (ereg(",", $s)) { $splitted = split(",", $s); } else { $splitted = Array("$s"); }
foreach ($splitted as $asplit) { $num = 0; foreach ($file as $line) { if (preg_match("/q~$asplit~ => (d+),/", $line, $test)) { $num = $test[1]; } } $result = $result + $num; }
if (ereg("^([0-9]{2})([0-9]{3})([0-9]{3})$", $result, $test)) { $result = "$test[1],$test[2],$test[3]"; $im = ImageCreate(69,11); } else if (ereg("^([0-9])([0-9]{3})([0-9]{3})$", $result, $test)) { $result = "$test[1],$test[2],$test[3]"; $im = ImageCreate(62,11); } else if (ereg("^([0-9]{3})([0-9]{3})$", $result, $test)) { $result = "$test[1],$test[2]"; $im = ImageCreate(48,11); } else if (ereg("^([0-9]{2})([0-9]{3})$", $result, $test)) { $result = "$test[1],$test[2]"; $im = ImageCreate(41,11); } else if (ereg("^([0-9])([0-9]{3})$", $result, $test)) { $result = "$test[1],$test[2]"; $im = ImageCreate(34,11); } else if (ereg("^[0-9]{3}$", $result)) { $im = ImageCreate(20,11); } else if (ereg("^[0-9]{2}$", $result)) { $im = ImageCreate(13,11); } else if (ereg("^[0-9]$", $result)) { $im = ImageCreate(6,11); } else { $im = ImageCreate(20,11); $result = "N/A"; }
$white = ImageColorAllocate($im,255,255,255); $black = ImageColorAllocate($im,0,0,0);
ImageColorTransparent($im, $white);
//ImageTTFText($im, 8, 0, 0, 9, $black, "/.../ud/verdanab.ttf", "$result");
ImageString($im, 3, 0, 0, "$result", $black);
ImagePNG($im); ImageDestroy($im); print "$result"; ?> The reason I'm not using ImageTTFText is because this server doesn't support it.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 69
Joined: January 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|