Author |
Message |
zacklk
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Mar 06, 2010
Posts: 79
|
Posted:
Tue Aug 17, 2010 2:08 am |
|
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 http://jscroller.markusbordihn.de/ 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>·</big></strong> '.$n.
': <a href="modules.php?name=Downloads&d_op=viewdownloaddetails&lid='.$lid.'">'.$title2.'</a><br />';
++$n;
}
?>
|
can anyone tell me how to apply jquery scroller or something smiler to this code. thanks in advance. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/48fb116845dfecf66294c.gif)
Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Tue Aug 17, 2010 6:38 am |
|
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>·</big></strong> '.$n.
': <a href="modules.php?name=Downloads&d_op=viewdownloaddetails&lid='.$lid.'">'.$title2.'</a><br />';
++$n;
}
$content .= ' </div>'."\n";
$content .= '</div>'."\n";
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
zacklk
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Aug 17, 2010 8:34 am |
|
i tryed it. its loading 1st and then the block is comming blank. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Aug 17, 2010 4:11 pm |
|
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 http://www.rtsforce.com/
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](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
zacklk
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Aug 17, 2010 8:25 pm |
|
cool. works great. thanks a lot spastic. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Aug 17, 2010 8:42 pm |
|
np, glad you got it working ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
zacklk
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Aug 18, 2010 3:46 am |
|
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](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Aug 18, 2010 8:14 am |
|
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>·</big></strong> '.$n.
': <a href="modules.php?name=Downloads&d_op=viewdownloaddetails&lid='.$lid.'">'.$title2.'</a><br />Hits: '.$hits.'<br />';
++$n;
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
zacklk
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Aug 18, 2010 10:20 pm |
|
great. as always u been a big help. thanks a lot sir ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|