Author |
Message |
Tizwit
Involved


Joined: Aug 29, 2004
Posts: 324
Location: New Mexico
|
Posted:
Thu Apr 28, 2005 9:31 am |
|
Hmm.. After no one responsed on the last one I am going to try it again.
I am trying to get the Advanced Downloads block to work. It works fine on my main site of www.DiabetesBytes.com but when I placed it on my other site www.TwistedNurse.com it fails to work. I think it has something to do with the fact that my site is a add on site.
Can anyone please tell me what to change..
Here is the script:
Quote: | <?php
/************************************************************************/
/* Advanced Downloads Block */
/* =========================== */
/* */
/* This is basically just an edit of the original block by Francisco. */
/* Even though this is heavly edited, I think he deserves credit, so: */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* */
/* Copyright © 2002 by Michael Bacoz */
/* http://www.fatal-instinct.com */
/* */
/************************************************************************/
// Make sure people don't try and access it directly
if (eregi("block-Advanced_Downloads.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
/************************/
/* Variables */
/************************/
$downloadstoshow = 40;
$usemarquee = 1;
$scrolldirection = "up";
$most = "Most Downloaded";
$latest = "Latest Downloads";
$totalfiles = "Total Files";
$totalcategories = "Total Categories";
$totaldownloads = "Total Downloads";
$hitstext = "Hits";
$totalserved = "Total Served";
/************************/
/* End Variables */
/************************/
global $prefix, $dbi, $db;
// Total Files
$result = sql_query("select * from ".$prefix."_downloads_downloads", $dbi);
$files = sql_num_rows($result, $dbi);
// Total Categories
$result = sql_query("select * from ".$prefix."_downloads_categories", $dbi);
$cats = sql_num_rows($result, $dbi);
// Total Downloads
$result = sql_query("select hits from ".$prefix."_downloads_downloads", $dbi);
$a = 1;
while(list($hits) = sql_fetch_row($result, $dbi)) {
$total_hits = $total_hits + $hits;
$a++;
}
$result=sql_query("select lid, hits from $prefix"._downloads_downloads." order by lid", $dbi);
$dresult=0;
while(list($lid, $hits) = sql_fetch_row($result, $dbi)) {
$dresult = $dresult + $hits;
}
$result = sql_query("select * from $prefix"._downloads_downloads."", $dbi);
$numrows = sql_num_rows($result, $dbi);
$result = sql_query("select sum(filesize*hits) as serv from $prefix"._downloads_downloads."", $dbi);
while(list($serv) = sql_fetch_row($result, $dbi)) {
$served = $serv;
}
$tb = 1024*1024*1024*1024;
$gb = 1024*1024*1024;
$mb = 1024*1024;
$kb = 1024;
if ($served >= $tb){
$mysizes = sprintf ("%01.2f",$served/$tb) . " TB ";
} elseif ($served >= $gb) {
$mysizes = sprintf ("%01.2f",$served/$mb) . " GB ";
} elseif ($served >= $mb) {
$mysizes = sprintf ("%01.2f",$served/$mb) . " MB ";
} elseif ($served >= $kb) {
$mysizes = sprintf ("%01.2f",$served/$kb) . " KB ";
} else{
$mysizes = $served . " B ";
}
$content .= "$totalfiles: $files<br>$totalcategories: $cats<br> $totaldownloads: $total_hits<br> $totalserved: $mysizes<br>";
if ($usemarquee == 1) {
$content .= "<Marquee Behavior=\"Scroll\" Direction=\"$scrolldirection\" ScrollAmount=\"2\" ScrollDelay=\"100\" onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\"><br>";
}
// Latest added
$content .= $latest."<br>";
$a = 1;
$sql = "select lid, title, hits from ".$prefix."_downloads_downloads order by date DESC limit 0,$downloadstoshow";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) {
$title2 = ereg_replace ("_", " ", $row[title]);
$transfertitle = str_replace(" ", "_", $row[title]);
$content .= "<strong><big>·</big></strong> $a: <a title=\"$title2\" href=\"downloadview-details-$row[lid]-$transfertitle.html\">$title2</a><br>[$hitstext: ".$row['hits']."]<br><br>";
$a++;
}
// Most downloaded
$content .= "<br>".$most."<br>";
$a = 1;
$sql = "select lid, title, hits from ".$prefix."_downloads_downloads order by hits DESC limit 0,$downloadstoshow";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) {
$title2 = ereg_replace ("_", " ", $row[title]);
$transfertitle = str_replace(" ", "_", $row[title]);
$content .= "<strong><big>·</big></strong> $a: <a title=\"$title2\" href=\"downloadview-details-$row[lid]-$transfertitle.html\">$title2</a><br>[$hitstext: ".$row['hits']."]<br><br>";
$a++;
}
?>
|
|
_________________ Brian
www.4Support.org
Helping the Children in the NM Children's Hospital |
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Apr 28, 2005 10:13 am |
|
That would seem to indicate that there is a problem with accessing the tables. Have you checked your server error log? Add this line to your .htaccess and see if that reveals anything.
PHP_FLAG display_errors on |
|
|
|
 |
Tizwit

|
Posted:
Thu Apr 28, 2005 10:27 am |
|
Added the above code in the .htaccess file but I don't see anything different |
|
|
|
 |
Raven

|
Posted:
Thu Apr 28, 2005 10:30 am |
|
So there are no errors in the server error log? |
|
|
|
 |
Tizwit

|
Posted:
Thu Apr 28, 2005 10:40 am |
|
Not that I can find
The only error log I have is that of someone trying to access a page that is not existant.. over and over and over. |
|
|
|
 |
Tizwit

|
Posted:
Wed May 11, 2005 10:32 pm |
|
Any Help/Ideas with this? |
|
|
|
 |
64bitguy
The Mouse Is Extension Of Arm

Joined: Mar 06, 2004
Posts: 1164
|
Posted:
Thu May 12, 2005 11:24 am |
|
First off, I would note that it looks like the links in this block are "Google Tapped" and the site you described isn't.
Next, when you say that it doesn't work, can you be more specific? Does the block not show up? Etc...
Next, what version of Nuke are you using and what is the patched revision?
Thanks |
_________________ Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. |
|
|
 |
Tizwit

|
Posted:
Thu May 12, 2005 1:37 pm |
|
The Site that I am having the problem with is www.TwistedNurse.com The downloads do not appear to show up in the module. The same module is loaded on my www.DiabetesBytes.com website and it works perfectly that is why I think it is due to the fact that the TwistedNurse site is an add on domain.
I do think the version is the patched 7.5 if I remember right. |
|
|
|
 |
Raven

|
Posted:
Thu May 12, 2005 3:34 pm |
|
My site is an addon domain and it works just fine, so I doubt that is the problem. Unfortunately I don't have any thoughts on resolution either. |
|
|
|
 |
|