UBB.Dev
Posted By: ScriptZ Man Adding Scroll(er) to custombox#pal.php? - 01/18/2005 1:56 AM
I would like to add a scroller to one of my [/u]custombox#pal.php[/u] file(s), like the ShoutBox has. Is this possible to do? And if so, can someone post the script?

Thank You!
I would like to thank whoever rated this post, but that's not what I need right now. I need an answer.
Posted By: scroungr Re: Adding Scroll(er) to custombox#pal.php? - 01/19/2005 8:38 PM
depends on the script you are placing in the customebox.. its either gonna be an html way or a javascript way
[]scroungr said:
depends on the script you are placing in the customebox.. its either gonna be an html way or a javascript way [/]
I want to display a custombox that will show the names of the members who donated to our forum - the list is quite long. This is why I need that scroll-bar like you see on the ShoutBox. I haven't the foggiest idea on how to do it, this is why I'm requesting assistance from one of you guys/gals...
Posted By: scroungr Re: Adding Scroll(er) to custombox#pal.php? - 01/20/2005 10:25 PM
ok so what your gonna do is pull from a mysql table the names? or from a flat file? non the less you will probably be doing it in php script.. using some html perhaps?

Since scrollbars (horiz & vert) are added automatically if the option's text is larger than the select's size...

<select name="MyList" size="7">
<option value="1">Name 1</option>
<option value="2">Name 2</option>
<option value="3">Name 3</option>
<option value="4">Name 4</option>
<option value="5">Name 5</option>
<option value="6">Name 6</option>
<option value="7">Name 7</option>
<option value="8">Name 8</option>
<option value="9">Name 9</option>
<option value="10">Name 10</option>
<option value="11">Name 11</option>
<option value="12">Name 12</option>
</select>

in this example the 7 thru 12 wouldn't be shown and a scroll bar would appear then you could scroll down if you wish..

you could make the above a php script with a for and a loop statement or you could do it as the shoutbox does


$query = "
SELECT contributorname
FROM {$config['tbprefix']}mylist
ORDER BY contribution DESC
LIMIT 0,10
";
$sth = $dbh -> do_query($query);
while ( list($contributorname) = $dbh -> fetch_array($sth)) {
$contributors = "<tr><td align="left" title="-" >$contributorname</td></tr>";
}

echo <<<UBBTPRINT
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Contributor List</title>
<script language="javascript" type="text/javascript" src="{$config['phpurl']}/pals/java/javapal.php"></script>
$myLang
$styleLink
<style type="text/css">
body {
margin: 0px;
padding: 0px;
}
</style>
</head>
<body onload="window.scrollTo(0,99999)">
<table style="table-layout: fixed" width="100%" border="0" cellspacing="0" cellpadding="2">
$contributors
</table>
UBBTPRINT;

couple of ways to do it..
© UBB.Developers