PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
kd8hho
Worker
Worker


Joined: Mar 30, 2009
Posts: 105

PostPosted: Wed Jul 15, 2009 11:10 am Reply with quote Back to top

ok. this block was a port from the old Nukestyles advanced downloads and was converted by them at nukecode to work with nsn-downloads.

well im trying to get this to work on Ravennuke and not having much luck. (conversion went wrong somewhere?)

here is the code from the block

Code:

if(!defined('NUKE_FILE')) {
  Header("Location: ../index.php");
  die();
}
global $prefix, $db;
$blkh = 10; // Number of lines high
$blkw = 20; // Number of characters wide 0 = unused
$scron = 1; // Turn scrolling on by setting to 1
$scrdr = up; // Scroll direction (up, down, left, or right)
$scrhg = 200; // Scroller height in pixels
$scrwd = 170; // Scroller width in pixels
$speed = 2; // Speed Of Scroll
$most = "Top Downloads";
$latest = "Newest Downloads";
$totalfiles = "Total Files";
$totalcategories = "Total Categories";
$totaldownloads = "Total Downloads";
$totalserved = "Total Served";

// Total Files
$result = $db->sql_query("select * from ".$prefix."_nsngd_downloads");
$files = $db->sql_numrows($result);

// Total Categories
$result = $db->sql_query("select * from ".$prefix."_nsngd_categories");
$cats = $db->sql_numrows($result);

// Total Downloads
$result = $db->sql_query("select hits from ".$prefix."_nsngd_downloads");

$a = 1;
while(list($hits) = $db->sql_fetchrow($result)) {
     $total_hits = $total_hits + $hits;
      $a++;
}

$result=sql_query("select lid, hits from $prefix"._nsngd_downloads." order by lid");

$dresult=0;

while(list($lid, $hits) = $db->sql_fetchrow($result)) {
   $dresult = $dresult + $hits;
}

$result = $db->sql_query("select * from $prefix"._nsngd_downloads."");
$numrows = $db->sql_numrows($result);
$result = $db->sql_query("select sum(filesize*hits) as serv from $prefix"._nsngd_downloads."");

while(list($serv) = $db->sql_fetchrow($result)) {
   $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 ($scron == 1) {
    $content .= "<marquee behavior='scroll' direction='$scrdr' height='$scrhg' width='$scrwd' scrollamount='$speed' scrolldelay='100' onMouseOver='this.stop()' onMouseOut='this.start()'><br>";
}
//Latest Downloads
$content .= "<b>".$latest."</b><br>";
$a = 1;
$result = $db->sql_query("select lid, title, hits from $prefix"._nsngd_downloads." order by date DESC limit 0,$blkh");
while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
    $title2 = ereg_replace("_", " ", $title);
    $title = strtr($title, " ()", "_[]");
    if ($blkw > 0) { if (strlen($title2) > $blkw) { $title2 = substr($title2, 0, $blkw); } }
    if ($a < 10) { $content .= "0$a: "; } else { $content .= "$a: "; }
    $content .= "<a href='modules.php?name=Downloads&amp;op=getit&amp;lid=$lid'>$title2</a><br>[Hits:&nbsp;$hits]<br>";
    $a++;
}
//Top Downloads
$content .= "<br><b>".$most."</b><br>";
$a = 1;
$result = $db->sql_query("select lid, title, hits from $prefix"._nsngd_downloads." order by hits DESC limit 0,$blkh");
while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
    $title2 = ereg_replace("_", " ", $title);
    $title = strtr($title, " ()", "_[]");
    if ($blkw > 0) { if (strlen($title2) > $blkw) { $title2 = substr($title2, 0, $blkw); } }
    if ($a < 10) { $content .= "0$a: "; } else { $content .= "$a: "; }
    $content .= "<a href='modules.php?name=Downloads&amp;op=getit&amp;lid=$lid'>$title2</a><br>[Hits:&nbsp;$hits]<br>";
    $a++;
}
if ($scron == 1) {
   $content .= "</marquee>";
}

?>


any ideas? when this block is active it dose not show the block or any other block after it.
View user's profile Send private message Visit poster's website
nuken
RavenNuke(tm) Development Team


Joined: Mar 11, 2007
Posts: 1435
Location: North Carolina

PostPosted: Wed Jul 15, 2009 11:19 am Reply with quote Back to top

Here ya go, this should work.

Code:

<?php
if(!defined('NUKE_FILE')) {
  Header("Location: ../index.php");
  die();
}
global $prefix, $db;
$blkh = 10; // Number of lines high
$blkw = 20; // Number of characters wide 0 = unused
$scron = 1; // Turn scrolling on by setting to 1
$scrdr = up; // Scroll direction (up, down, left, or right)
$scrhg = 200; // Scroller height in pixels
$scrwd = 170; // Scroller width in pixels
$speed = 2; // Speed Of Scroll
$most = "Top Downloads";
$latest = "Newest Downloads";
$totalfiles = "Total Files";
$totalcategories = "Total Categories";
$totaldownloads = "Total Downloads";
$totalserved = "Total Served";

// Total Files
$result = $db->sql_query("select * from ".$prefix."_nsngd_downloads");
$files = $db->sql_numrows($result);

// Total Categories
$result = $db->sql_query("select * from ".$prefix."_nsngd_categories");
$cats = $db->sql_numrows($result);

// Total Downloads
$result = $db->sql_query("select hits from ".$prefix."_nsngd_downloads");

$a = 1;
while(list($hits) = $db->sql_fetchrow($result)) {
     $total_hits = $total_hits + $hits;
      $a++;
}

$result=$db->sql_query("select lid, hits from $prefix"._nsngd_downloads." order by lid");

$dresult=0;

while(list($lid, $hits) = $db->sql_fetchrow($result)) {
   $dresult = $dresult + $hits;
}

$result = $db->sql_query("select * from $prefix"._nsngd_downloads."");
$numrows = $db->sql_numrows($result);
$result = $db->sql_query("select sum(filesize*hits) as serv from $prefix"._nsngd_downloads."");

while(list($serv) = $db->sql_fetchrow($result)) {
   $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 ($scron == 1) {
    $content .= "<marquee behavior='scroll' direction='$scrdr' height='$scrhg' width='$scrwd' scrollamount='$speed' scrolldelay='100' onMouseOver='this.stop()' onMouseOut='this.start()'><br>";
}
//Latest Downloads
$content .= "<b>".$latest."</b><br>";
$a = 1;
$result = $db->sql_query("select lid, title, hits from $prefix"._nsngd_downloads." order by date DESC limit 0,$blkh");
while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
    $title2 = ereg_replace("_", " ", $title);
    $title = strtr($title, " ()", "_[]");
    if ($blkw > 0) { if (strlen($title2) > $blkw) { $title2 = substr($title2, 0, $blkw); } }
    if ($a < 10) { $content .= "0$a: "; } else { $content .= "$a: "; }
    $content .= "<a href='modules.php?name=Downloads&amp;op=getit&amp;lid=$lid'>$title2</a><br>[Hits:&nbsp;$hits]<br>";
    $a++;
}
//Top Downloads
$content .= "<br><b>".$most."</b><br>";
$a = 1;
$result = $db->sql_query("select lid, title, hits from $prefix"._nsngd_downloads." order by hits DESC limit 0,$blkh");
while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
    $title2 = ereg_replace("_", " ", $title);
    $title = strtr($title, " ()", "_[]");
    if ($blkw > 0) { if (strlen($title2) > $blkw) { $title2 = substr($title2, 0, $blkw); } }
    if ($a < 10) { $content .= "0$a: "; } else { $content .= "$a: "; }
    $content .= "<a href='modules.php?name=Downloads&amp;op=getit&amp;lid=$lid'>$title2</a><br>[Hits:&nbsp;$hits]<br>";
    $a++;
}
if ($scron == 1) {
   $content .= "</marquee>";
}

?>
View user's profile Send private message Send e-mail Visit poster's website
kd8hho
Worker
Worker


Joined: Mar 30, 2009
Posts: 105

PostPosted: Wed Jul 15, 2009 1:11 pm Reply with quote Back to top

well that worked. lol thanks
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum