Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
zacklk
Regular
Regular


Joined: Mar 06, 2010
Posts: 79

PostPosted: Tue Aug 17, 2010 2:08 am Reply with quote

IE 8 stop supporting "marquee" tag. even it is supported by most other browsers, W3 validator showing as a error. Im using "marquee" to scroll downloads and my game arcade contains. is there any way to use jquery or something similar to do this process?

i found great jquery scroller here Only registered users can see links on this board! Get registered or login! but i dont have any clue how to use it in my blocks.

this is my download block code.

Code:
<?php


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* 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.       */
/************************************************************************/
/*         Additional security & Abstraction layer conversion           */
/*                           2003 chatserv                              */
/*      http://www.nukefixes.com -- http://www.nukeresources.com        */
/************************************************************************/
/************************************************************************/
/* Additional code clean-up, performance enhancements, and W3C and      */
/* XHTML compliance fixes by Raven and Montego.                         */
/************************************************************************/

if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}

global $prefix, $db;

$content = '';
$n = 1;
$result = $db->sql_query('SELECT lid, title FROM '.$prefix.'_downloads_downloads ORDER BY hits DESC LIMIT 0,10');
while (list($lid, $title) = $db->sql_fetchrow($result)) {
   $lid = intval($lid);
   $title2 = htmlspecialchars(str_replace('_', ' ', $title), ENT_QUOTES, _CHARSET);
   $content .= '<strong><big>&middot;</big></strong>&nbsp;'.$n.
      ': <a href="modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid='.$lid.'">'.$title2.'</a><br />';
   ++$n;
}
?>



can anyone tell me how to apply jquery scroller or something smiler to this code. thanks in advance.
 
View user's profile Send private message
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Tue Aug 17, 2010 6:38 am Reply with quote

ok, try this...

upload jscroller-0.4.js to includes/jquery/

create and upload includes/addons/head-jscroller.php

Code:
<?php


if (stristr(htmlentities($_SERVER['PHP_SELF']), 'head-jscroller.php')) {
   Header('Location: ../../index.php');
   die();
}

addJSToHead('includes/jquery/jquery.js', 'file');
addJSToHead('includes/jquery/jscroller-0.4.js', 'file');
   $inlineJS = '<script type="text/javascript">'."\n";
   $inlineJS .= '$(document).ready(function(){'."\n";
   $inlineJS .= '        $jScroller.add("#scroller_container","#scroller","down",1);'."\n";
   $inlineJS .= '        $jScroller.start();'."\n";
   $inlineJS .= '});'."\n";
   $inlineJS .= '</script>'."\n\n";
addJSToHead($inlineJS, 'inline');


?>


and your block
Code:
<?php


if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}

global $prefix, $db;

$content = '';
$content .= '<div id="scroller_container">'."\n";
$content .= '  <div id="scroller">'."\n";
$n = 1;
$result = $db->sql_query('SELECT lid, title FROM '.$prefix.'_downloads_downloads ORDER BY hits DESC LIMIT 0,10');
while (list($lid, $title) = $db->sql_fetchrow($result)) {
   $lid = intval($lid);
   $title2 = htmlspecialchars(str_replace('_', ' ', $title), ENT_QUOTES, _CHARSET);
   $content .= '<strong><big>&middot;</big></strong>&nbsp;'.$n.
      ': <a href="modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid='.$lid.'">'.$title2.'</a><br />';
   ++$n;
}
$content .= '  </div>'."\n";
$content .= '</div>'."\n";
?>
 
View user's profile Send private message Visit poster's website
zacklk
PostPosted: Tue Aug 17, 2010 8:34 am Reply with quote

i tryed it. its loading 1st and then the block is comming blank.
 
spasticdonkey
PostPosted: Tue Aug 17, 2010 4:11 pm Reply with quote

ahh yes, I tried it and realized there was some CSS to add too. Add this to your themes/YOUR_THEME/style/style.css

Code:
/* Scroller Box */

#scroller_container {
 position: relative;
 width: 150px;
 height: 100px;
 overflow: hidden;
}

#scroller p {
 padding: 0;
}
/* Scoller Box */


you can adjust the width and height to your needs. If you run multiple themes you'll need to add to all the style.css files... You can see it working on my testing site @ the bottom Only registered users can see links on this board! Get registered or login!

I might also suggest changing the direction to up and adding a true at the end (so it pauses on mouseover), like so:
$jScroller.add("#scroller_container","#scroller","up",1,true);
in your head-jscroller.php file Wink
 
zacklk
PostPosted: Tue Aug 17, 2010 8:25 pm Reply with quote

cool. works great. thanks a lot spastic.
 
spasticdonkey
PostPosted: Tue Aug 17, 2010 8:42 pm Reply with quote

np, glad you got it working Wink
 
zacklk
PostPosted: Wed Aug 18, 2010 3:46 am Reply with quote

hi spastic, i like to ask one more thing. is there any way to show, how many hits for each download in the next raw? sorry about disturbing and thanks a lot for all ur help Smile
 
spasticdonkey
PostPosted: Wed Aug 18, 2010 8:14 am Reply with quote

yes, here's the part you will need to modify in your block
Code:
$result = $db->sql_query('SELECT lid, title, hits FROM '.$prefix.'_downloads_downloads ORDER BY hits DESC LIMIT 0,10');

while (list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
   $lid = intval($lid);
   $title2 = htmlspecialchars(str_replace('_', ' ', $title), ENT_QUOTES, _CHARSET);
   $hits = intval($hits);
   $content .= '<strong><big>&middot;</big></strong>&nbsp;'.$n.
      ': <a href="modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid='.$lid.'">'.$title2.'</a><br />Hits: '.$hits.'<br />';
   ++$n;
}
 
zacklk
PostPosted: Wed Aug 18, 2010 10:20 pm Reply with quote

great. as always u been a big help. thanks a lot sir Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©