Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
kingjames
Hangin' Around



Joined: Sep 27, 2011
Posts: 33

PostPosted: Sat Nov 26, 2011 8:21 am Reply with quote

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 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Nov 26, 2011 8:49 am Reply with quote

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>&middot;</big></strong>&nbsp;<a href="reviews.html?amp;rop=showcontent&amp;id='.$id.'">'.$title.'</a><br />';
}
if ($scron == 1) {
   $content .= '</marquee>';
}


_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
kingjames







PostPosted: Sat Nov 26, 2011 3:11 pm Reply with quote

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.
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sun Nov 27, 2011 11:57 am Reply with quote

$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. 
View user's profile Send private message
kingjames







PostPosted: Sun Nov 27, 2011 12:51 pm Reply with quote

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.
[ Only registered users can see links on this board! Get registered or login! ]
 
montego







PostPosted: Sun Nov 27, 2011 4:00 pm Reply with quote

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

Wink

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).
 
kingjames







PostPosted: Sun Nov 27, 2011 4:21 pm Reply with quote

That worked. Thank you for your patience in explaining this in a way I could understand. worship
 
montego







PostPosted: Mon Nov 28, 2011 7:38 pm Reply with quote

No problem. Always glad to help.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

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 ©