Author |
Message |
kingjames
Hangin' Around
![](modules/Forums/images/avatars/4af12d2d4ed4e01c7f064.gif)
Joined: Sep 27, 2011
Posts: 33
|
Posted:
Sat Nov 26, 2011 8:21 am |
|
Is there an easy way to make the contents of the Review Block scroll, like the scrolling forums block, and the NS block? I have three blocks on my left side and the other two blocks scroll I would like this one to match. |
Last edited by kingjames on Sun Nov 27, 2011 4:22 pm; edited 1 time in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat Nov 26, 2011 8:49 am |
|
The easiest way, although will cause your site to not validate (but all browsers still support so will work), is to add marquee tags around the content. Any of the blocks which scroll should help you figure out how to place the code.
However, here is the base RavenNuke(tm) Review block modified to give you some scrolling options:
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. */
/************************************************************************/
/* Added (montego) scrolling options for kingjames in the RPS forums */
/************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
/**
* Configuration Options
*/
$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
*/
global $prefix, $db;
$content = '';
if ($scron == 1) {
$content .= '<marquee behavior="scroll" direction="' . $scrdr . '" height="' . $scrhg . '" width="' . $scrwd . '" scrollamount="' . $speed . '" scrolldelay="' . $scrolldelay . '" onmouseover="this.stop()" onmouseout="this.start()"><br />';
}
$sql = 'SELECT id, title FROM '.$prefix.'_reviews ORDER BY id DESC LIMIT 0,10';
$result = $db->sql_query($sql);
while (list($id, $title) = $db->sql_fetchrow($result)) {
$id = intval($id); // montego:0000763 - even this line is unnecessary because this field is ALWAYS an integer coming off the db!
// $title = stripslashes($title); // montego:0000763 - check_html was already done prior to adding to the DB and will end up stripping slashes again!
$content .= '<strong><big>·</big></strong> <a href="reviews.html?amp;rop=showcontent&id='.$id.'">'.$title.'</a><br />';
}
if ($scron == 1) {
$content .= '</marquee>';
}
|
|
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kingjames
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Nov 26, 2011 3:11 pm |
|
Something seems backwards maybe it is me I don't know. I copied and pasted the above code exactly into my review block and it didn't scroll. The only thing I changed was I added a "?>" at the end.
Just for kicks I then changed the line "if ($scron == 1) {" to "if ($scron == 0) {" and for some reason now it scrolls. I have no idea why that is but it does. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
Site Admin
![](modules/Forums/images/avatars/Dilbert/Dilbert_-_Dogbert_King.gif)
Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Sun Nov 27, 2011 11:57 am |
|
$scron = 0; // Turn scrolling on by setting to 1 |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kingjames
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Nov 27, 2011 12:51 pm |
|
That is how I read it as well Palbin but that is not what is happening. Here is a screenshot to show what I am talking about, you can see my $scron == 0;, and yet the review block in the process of scrolling.
http://www.monster-hardware.com/files/capture.png |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Nov 27, 2011 4:00 pm |
|
kingjames, the point is to use my code as is, and up at the top, just change this line here:
$scron = 0; // Turn scrolling on by setting to 1
to
$scron = 1; // Turn scrolling on by setting to 1
Trust us... this will do exactly what you want if you make only this one change. I just had it defaulted as "off" (or 0). |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kingjames
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Nov 27, 2011 4:21 pm |
|
That worked. Thank you for your patience in explaining this in a way I could understand. ![worship](modules/Forums/images/smiles/icon_worship.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Nov 28, 2011 7:38 pm |
|
No problem. Always glad to help. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|