Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
lokasher
Newbie
Newbie



Joined: Nov 09, 2008
Posts: 6

PostPosted: Thu May 31, 2012 3:54 pm Reply with quote

Hi there,
How to add Category name after title in block-NSNGD_Advanced.php.
thanks
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Thu May 31, 2012 6:09 pm Reply with quote

It is definitely doable. I'll have to take a look at it tonight/tomorrow and post back.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Thu May 31, 2012 6:28 pm Reply with quote

If you are willing to try code that has not been tested yet, replace your current block code with this:

Code:


<?php
/**
 * TegoNuke(tm)/NSN GR Downloads (NSNGD): Downloads
 *
 * This module allows admins and end users (if so configured - see Submit Downloads
 * module) to add/submit downloads to their site.  This module is NSN Groups aware
 * (Note: NSN Groups is already built into RavenNuke(tm)) and carries more features
 * than the stock *nuke system Downloads module.  Check out the admin screens for a
 * multitude of configuration options.
 *
 * The original NSN GR Downloads was given to montego by Bob Marion back in 2006 to
 * take over on-going development and support.  It has undergone extensive bug
 * removal, including XHTML compliance and further security checking, among other
 * fine enhancements made over time.
 *
 * Original copyright statements are below these.
 *
 * PHP versions 5.2+ ONLY
 *
 * LICENSE: GNU/GPL 2 (provided with the download of this script)
 *
 * @category    Module
 * @package     TegoNuke(tm)/NSN
 * @subpackage  Downloads
 * @author      Rob Herder (aka: montego) <montego@montegoscripts.com>
 * @copyright   2006 - 2011 by Montego Scripts
 * @license     http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt GNU/GPL 2
 * @version     1.1.3_51
 * @link        http://montegoscripts.com
 */
/********************************************************/
/* NSN GR Downloads                                     */
/* By: NukeScripts Network (webmasternukescripts.net)   */
/* http://www.nukescripts.net                           */
/* Copyright (c) 2000-2005 by NukeScripts Network       */
/********************************************************/
/********************************************************/
/* NSN GR Downloads Advanced Downloads Block            */
/* By: NukeCode (adminnukecode.com)                    */
/* http://nukecode.com                                  */
/* Copyright 2003-2005 by NukeCode and NSN Mirror Site  */
/********************************************************/
/********************************************************/
/* This block is intended for use ONLY with NSN GR      */
/* Downloads... Do not attempt to use it with any other */
/* Downloads Module, It will not work properly          */
/********************************************************/
if (!defined('BLOCK_FILE')) {
   Header('Location: ../index.php');
   die();
}
/*
 * If you change the name of your module from Download to anything
 * else, you need to also change the below line to match
 */
$tndlModName = 'Downloads';
/**
 * Configuration Options
 */
$blkh  = 10;       // Number of lines high
$blkw  = 0;        // Number of characters wide 0 = unused
$scron = 0;        // Turn scrolling on by setting to 1
$scrdr = 'up';     // Scroll direction ('up', 'down', 'left', or 'right')
$scrhg = 200;      // Scroller height in pixels
$scrwd = 145;      // Scroller width in pixels
$speed = 2;        // Speed Of Scroll
$scrolldelay = 75; // Scroll delay - small the number the smoother the scroll
/*
 * End of Configuration Options
 */
if (!defined('_DL_LANG_MODULE')) get_lang('Downloads');
global $prefix, $db;
$content = '';
/*
 * Total downloads in the database
 */
if (!(list($files) = $db->sql_fetchrow($db->sql_query('SELECT COUNT(`lid`) FROM `' . $prefix . '_nsngd_downloads`')))) $files = 0;
/*
 * Total download categories in the database
 */
if (!(list($cats) = $db->sql_fetchrow($db->sql_query('SELECT COUNT(`cid`) FROM `' . $prefix . '_nsngd_categories`')))) $cats = 0;
/*
 * Total hits across all downloads (including inactives)
 */
if (!(list($total_hits) = $db->sql_fetchrow($db->sql_query('SELECT SUM(`hits`) FROM `' . $prefix . '_nsngd_downloads`')))) $total_hits = 0;
/*
 * Total GB Served
 */
if (!(list($served) = $db->sql_fetchrow($db->sql_query('SELECT SUM(`filesize`*`hits`) AS serv FROM `' . $prefix . '_nsngd_downloads`')))) $served = 0;
$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/$gb) . ' 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 ';
}
/*
 * Ok, start building the content.
 */
$content .= _DL_TOTALDLFILES . ': ' . $files . '<br />' . _DL_TOTALDLCATEGORIES . ': ' . $cats . '<br /> ' . _DL_TDN . ': ' . $total_hits . '<br /> ' . _DL_TOTALDLSERVED . ': ' . $mysizes . '<br />';
if ($scron == 1) {
   $content .= '<marquee behavior="scroll" direction="' . $scrdr . '" height="' . $scrhg . '" width="' . $scrwd . '" scrollamount="' . $speed . '" scrolldelay="' . $scrolldelay . '" onmouseover="this.stop()" onmouseout="this.start()"><br />';
}
/*
 * Latest Downloads
 */
$content .= '<strong>' . _DL_NEWDOWNLOADS . '</strong><br />';
$a = 1;
$result = $db->sql_query('SELECT `lid`, a.`title`, `hits`, b.`title` FROM `' . $prefix . '_nsngd_downloads` a'
   . ' LEFT JOIN `' . $prefix . '_nsngd_categories` b ON (a.`cid` = b.`cid`) ORDER BY `date` DESC LIMIT 0, ' . $blkh);
while (list($lid, $title, $hits, $ctitle) = $db->sql_fetchrow($result)) {
   if (!empty($ctitle)) $title = $title . ' - ' . $ctitle;
   if ($blkw > 0) {
      if (strlen($title) > $blkw) {
         $title = substr($title, 0, $blkw);
      }
   }
   if ($a < 10) {
      $content .= '0' . $a . ': ';
   } else {
      $content .= $a . ': ';
   }
   $content .= '<a href="modules.php?name=' . $tndlModName . '&amp;op=getit&amp;lid=' . $lid . '">'
      . htmlspecialchars($title, ENT_QUOTES, _CHARSET) . '</a><br />(' . _DL_HITS . ': ' . $hits . ')<br />';
   $a++;
}
/*
 * Top Downloads
 */
$content .= '<br /><b>' . _DL_POPULARDLS . '</b><br />';
$a = 1;
$result = $db->sql_query('SELECT `lid`, a.`title`, `hits`, b.`title` FROM `' . $prefix . '_nsngd_downloads` a'
   . ' LEFT JOIN `' . $prefix . '_nsngd_categories` b ON (a.`cid` = b.`cid`) ORDER BY `hits` DESC LIMIT 0, ' . $blkh);
while (list($lid, $title, $hits, $ctitle) = $db->sql_fetchrow($result)) {
   if (!empty($ctitle)) $title = $title . ' - ' . $ctitle;
   if ($blkw > 0) {
      if (strlen($title) > $blkw) {
         $title = substr($title, 0, $blkw);
      }
   }
   if ($a < 10) {
      $content .= '0' . $a . ': ';
   } else {
      $content .= $a . ': ';
   }
   $content .= '<a href="modules.php?name=' . $tndlModName . '&amp;op=getit&amp;lid=' . $lid . '">'
      . htmlspecialchars($title, ENT_QUOTES, _CHARSET) . '</a><br />(' . _DL_HITS . ': ' . $hits . ')<br />';
   $a++;
}
if ($scron == 1) {
   $content .= '</marquee>';
}

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
lokasher
Newbie
Newbie



Joined: Nov 09, 2008
Posts: 6

PostPosted: Sat Jun 02, 2012 1:19 pm Reply with quote

Thankyou that worked just fine but its not scrolling.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Jun 02, 2012 4:21 pm Reply with quote

My changes have nothing to do with scrolling. So, if it does not scroll, even if you have made this setting change:

$scron = 1;

Then your browser doesn't support the marquee tag.

This block is a very simple scrolling block. It does not incorporate fancy javascript scrolling. Sorry.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
lokasher
Newbie
Newbie



Joined: Nov 09, 2008
Posts: 6

PostPosted: Sun Jun 03, 2012 11:50 am Reply with quote

Sorry my mistake didnt check the setting,
after change $scron = 1; its working fine.
thankyou once again.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Mon Jun 04, 2012 9:06 am Reply with quote

Oh, good. Thanks for letting us know.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Mon Jul 02, 2012 9:06 am Reply with quote

Why I can validate marquee?

I get an error from W3C

<marquee> is not approved by W3C


any sugestion to make this validated? If not i will disable scrolling.
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Mon Jul 02, 2012 9:45 am Reply with quote

hicux,

The Marquee is not valid, however, it works in every browser that I am aware of. Therefore, one must decide what is more important: having a working scrolling block or 100% compliance for compliance sake.

I have chosen not to clutter up this module and blocks with additional JS just to achieve 100% compliance (ALL the rest IS 100% compliant). However, if RavenNuke(tm) comes out-of-the-box with standard scrolling API, I would most definitely consider taking advantage of it instead of using the Marquee tag.
 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Mon Jul 02, 2012 10:12 am Reply with quote

you are right montego, I just thought marquee could be validate it but they don't like it I guess. From now I will never be able to use any more crap old block or any deprecate module. Finally I got my site validate it. U can check it here bestbuildpc.org and let me know and I will remove the link if u want.
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Jul 03, 2012 8:39 am Reply with quote

"I will remove the link if u want"

Hicux, not sure what link you are referring to. I went to that domain/site and there really isn't any content that I can see yet? BTW, the image at the top left doesn't appear to be on the server as it is not showing up.

I look forward to seeing how your site comes along with content.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Wed Jul 04, 2012 7:13 pm Reply with quote

Yes, I think it is better to remove this marquee and make the block and the whole site validated. I am spending lots of time on this important issue. I will not be able to install any old block or module which is not validate it or compatible with Ravennuke.
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Thu Jul 05, 2012 6:53 pm Reply with quote

Well, I don't really think having a marquee tag on your site being the only thing keeping it from validating is really a big issue. This isn't an old block by the way. If you turn off the scrolling, it is 100% valid XHTML 1.0 Transitional like the rest of RN.

Good luck with your site.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Mon Jul 09, 2012 5:13 am Reply with quote

Yes that's what I did. 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


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch