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
jib_intelli
Hangin' Around


Joined: Aug 17, 2004
Posts: 43

PostPosted: Sun Aug 24, 2008 2:11 am Reply with quote

Hi Guys!!

I'm using the NSN supporters left scrolling block on my site. The marquee tag is not recognised as valid xhtml. Is there a workaround to it. The code is as follows:

Code:
<?php


/********************************************************/
/* NSN Supporters(TM) Universal                         */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright © 2000-2005 by NukeScripts Network         */
/************************************************************************/
/* PHP-Nuke Platinum: Expect to be impressed                  COPYRIGHT */
/*                                                                      */
/* Copyright (c) 2004 - 2006 by http://www.techgfx.com                  */
/*     Techgfx - Graeme Allan                       (goose@techgfx.com) */
/*                                                                      */
/* Copyright (c) 2004 - 2006 by http://www.conrads-berlin.de            */
/*     MrFluffy - Axel Conrads                 (axel@conrads-berlin.de) */
/*                                                                      */
/* Refer to TechGFX.com for detailed information on PHP-Nuke Platinum   */
/*                                                                      */
/* TechGFX: Your dreams, our imagination                                */
/************************************************************************/

if (stristr($_SERVER['SCRIPT_NAME'], "block-GT_Supporters_Lt.php")) {
    Header("Location: ../index.html");
    die();
}

get_lang("Supporters");
global $prefix, $db, $user, $admin;
$supporterlt = $db->sql_fetchrow($db->sql_query("SELECT * from ".$prefix."_nsnsp_config"));
$content = "<center>Supported by<br/><br/>";
$content .= "<marquee behavior=\"scroll\" direction=\"left\" height=\"31\" width=\"90%\" scrollamount=\"3\" scrolldelay=\"90\" onmouseover='this.stop()' onmouseout='this.start()'>\n";
$result = $db->sql_query("SELECT site_id, site_name, site_image FROM $prefix"._nsnsp_sites." WHERE site_status>'0' ORDER BY site_name");
while (list($site_id, $site_name, $site_image) = $db->sql_fetchrow($result)) {
    $content .= "&nbsp;<a href=\"supporters-site-$site_id.html\" target=\"_blank\"><img src=\"$site_image\" height=\"31\" width=\"88\" alt=\"\" title=\"$site_name\" border=\"0\"/></a>&nbsp;\n";
}
$content .="</marquee><br/><br/>\n";
if ($supporterlt['require_user'] == 0 || is_user($user)) { $content .= "[ <a href='supporters-submit.html'>"._BESUPPORTER."</a> ]<br/>\n"; }
if (is_admin($admin)) { $content .= "[ <a href='modules.php?name=Supporters&amp;file=admin'>"._GOTOADMIN."</a> ]<br/>\n"; }
$content .= "[ <a href='supporters.html'>"._SUPPORTERS."</a> ]</center>\n";

?>


Please help, the code is working fine in both FireFox and IE but it is not being validated as XHTML.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message
wHiTeHaT
Life Cycles Becoming CPU Cycles


Joined: Jul 18, 2004
Posts: 577
Location: Netherlands

PostPosted: Sun Aug 24, 2008 3:40 am Reply with quote

you need to use a javascript to get marquee valid ,
the marquee tag isnt a valid xhtml one.

a verry simple solution would be to use : Only registered users can see links on this board! Get registered or login!

Grtzz wHiTeHaT Wink

[EDIT] sorry abovelink is verry advanced ... here is a much easyer one's: 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!
 
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
wHiTeHaT
PostPosted: Sun Aug 24, 2008 4:48 am Reply with quote

i just took the one from dhtmlgoodies.com and used a test block you can see at the bottom of the page Only registered users can see links on this board! Get registered or login!
 
wHiTeHaT
PostPosted: Sun Aug 24, 2008 5:57 am Reply with quote

I did some investigation and it seem you not using latest nsn supporters module...or do you.

If not... download from nukescripts, after you logged :
Only registered users can see links on this board! Get registered or login!

once installed/upgraded :

Goto root/header.php
add after:
Code:
if (file_exists('themes/'.$ThemeSel.'/images/favicon.ico')) {

        echo '<link rel="shortcut icon" href="themes/'.$ThemeSel.'/images/favicon.ico" type="image/x-icon" />'."\n";
    }

the folowing :
Code:


    ?>
    <style type="text/css">   
   
   
   /*################################# */
      /* CSS for my first scrolling box */
   #scrollingContainer{
      width:170px;   /* 170 pixels in width */
      height:250px;   /* Height of box */
      
      border:1px solid #000;   /* Black border around box */
      background-color: #E2EBED;   /* Light blue background color */

      padding:2px;   /* A little bit of space between border of box and text inside */
      float:left;   /* I want the text to wrap around the box */
      margin-right:10px;   /* Right margin of 10 pixels */
      font-size:0.9em;   /* Smaller font size than the rest of the page */
      
      overflow:hidden;   /* Hide overflow content */
   }
   /* End css for my first scrolling box */
   
   
   /* CSS for my second scrolling box */
   #scrollingContainer2{
      width:100px;   /* Width of second box */
      height:150px;   /* Height of second box */
      
      border:1px solid #000;
      background-color: #DDD;

      padding:2px;   /* A little bit of space between border of box and text inside */
      float:right;   /* I want the text to wrap around the box */
      margin-left:10px;   /* Space at the left of the box */
      color:red;   /* red text color */
      
      
   }
   #scrollingContent2{
      font-size:0.9em;
   }   
   
   </style>
  <script type="text/javascript">
     // <![CDATA[
   /************************************************************************************************************
   (C) Only registered users can see links on this board! Get registered or login! November 2005
   
   This is a script from Only registered users can see links on this board! Get registered or login! You will find this and a lot of other scripts at our website.   
   
   Terms of use:
   You are free to use this script as long as the copyright message is kept intact. However, you may not
   redistribute, sell or repost it without our permission.
   
   Thank you!
   
   www.dhtmlgoodies.com
   Alf Magne Kalleland
   
   ************************************************************************************************************/
      
   var slideTimeBetweenSteps = 30;   // General speed variable (Lower = slower)
   
   
   var scrollingContainer = false;
   var scrollingContent = false;
   var containerHeight;
   var contentHeight;   
   
   var contentObjects = new Array();
   var originalslideSpeed = false;
   function slideContent(containerId)
   {
      var topPos = contentObjects[containerId]['objRef'].style.top.replace(/[^\-0-9]/g,'');
      topPos = topPos - contentObjects[containerId]['slideSpeed'];
      if(topPos/1 + contentObjects[containerId]['contentHeight'] / 1 < 0)topPos = contentObjects[containerId]['containerHeight'];
      contentObjects[containerId]['objRef'].style.top = topPos + 'px';
      setTimeout('slideContent("' + containerId + '")',slideTimeBetweenSteps);
      
   }
   
   function stopSliding()
   {
      var containerId = this.id;
      contentObjects[containerId]['slideSpeed'] = 0;   
   }
   
   function restartSliding()
   {
      var containerId = this.id;
      contentObjects[containerId]['slideSpeed'] = contentObjects[containerId]['originalSpeed'];
      
   }
   function initSlidingContent(containerId,slideSpeed)
   {
      scrollingContainer = document.getElementById(containerId);
      scrollingContent = scrollingContainer.getElementsByTagName('DIV')[0];
      
      scrollingContainer.style.position = 'relative';
      scrollingContainer.style.overflow = 'hidden';
      scrollingContent.style.position = 'relative';
      
      scrollingContainer.onmouseover = stopSliding;
      scrollingContainer.onmouseout = restartSliding;
      
      originalslideSpeed = slideSpeed;
      
      scrollingContent.style.top = '0px';
      
      contentObjects[containerId] = new Array();
      contentObjects[containerId]['objRef'] = scrollingContent;
      contentObjects[containerId]['contentHeight'] = scrollingContent.offsetHeight;
      contentObjects[containerId]['containerHeight'] = scrollingContainer.clientHeight;
      contentObjects[containerId]['slideSpeed'] = slideSpeed;
      contentObjects[containerId]['originalSpeed'] = slideSpeed;
      
      slideContent(containerId);
      
   }
   
// ]]>
   </script>
<?php


after that create a block name what ever youwish i used:

block-Mytest_Block.php

inside this file insert:
Code:


<?php
#### Generated by Block Creator by Disipal Site (www.disipal.net) ###
if(!defined('NUKE_FILE') AND !defined('BLOCKS_FILE')) { header("Location: ../index.php"); }
global $prefix, $db, $user, $sp_config, $spmodule;
$content  =  '<div id="scrollingContainer">';
$content  .= '   <div id="scrollingContent">';
$result = $db->sql_query("SELECT `site_id`, `site_name`, `site_image` FROM `".$prefix."_nsnsp_sites` WHERE `site_status`>'0' ORDER BY `site_name` DESC");
while(list($site_id, $site_name, $site_image) = $db->sql_fetchrow($result)) {
  list($width, $height, $type, $attr) = getimagesize($site_image);
  if($width > $sp_config['max_width']) { $width = $sp_config['max_width']; }
  if($height > $sp_config['max_height']) { $height = $sp_config['max_height']; }

$content  .= '      <p><a href="modules.php?name='.$spmodule.'&amp;op=SPGo&amp;site_id='.$site_id.'" target="_blank"><img src="'.$site_image.'" height="'.$height.'" width="'.$width.'" title="'.$site_name.'" alt="'.$site_name.'" border="0" /></a></p>';

}
$content  .= '   </div>';
$content  .= '</div>';
$content  .= '<script type="text/javascript">';
$content  .= "initSlidingContent('scrollingContainer',3);";
$content  .= '</script>';

?>


Have fun.

Grtzz wHiTeHaT Wink

[PS] i made a working version on my site so you can see
 
Susann
Moderator


Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Sat Oct 03, 2009 2:04 pm Reply with quote

@ wHiTeHaT Thank you so much for posting this solution !
I had over 30 errors from my created scrolling block (no NS) and now it´s W3C valid again.
I owe you a beer.
Cheers
 
View user's profile Send private message
montego
Site Admin


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

PostPosted: Sun Oct 04, 2009 8:26 am Reply with quote

Doesn't the latest NS scrolling block also have some form of JS implementation? Just serves as another example.

_________________
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! 
View user's profile Send private message Visit poster's website
Susann
PostPosted: Sun Oct 04, 2009 8:38 am Reply with quote

Yeah, it just didn´t scroll with my block but should normally work too.
 
Palbin
Site Admin


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

PostPosted: Sun Oct 04, 2009 8:56 am Reply with quote

In the latest package we included a much simpler script from dynamic drive for use in the NS block. It fixed javascript warnings in IE. I really can't remember, but I don't think it scrolled in IE either (at least IE 8 ). Just an FYI.

_________________
"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
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 ©