Previous Thread
Next Thread
Print Thread
Rate Thread
#57723 05/31/2004 7:00 PM
Joined: May 2001
Posts: 55
Member
Member
Offline
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:
Code
<!--#include virtual="www.mysite.com/cgi-bin/showload.cgi?picture1.zip" -->
into threads...???

Sponsored Links
#57724 05/31/2004 7:14 PM
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
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
CTM Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
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. smile

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
Offline
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.


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Sponsored Links
#57728 06/01/2004 6:04 AM
Joined: Nov 2001
Posts: 1,704
CTM Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
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. wink

#57729 06/01/2004 6:31 AM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
I can give you the code of my nums.php script, very easy.
Code
<?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.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)