Quick Question!!!
Posted: Tue Oct 08, 2002 8:44 pm
Hello! I have a script! I would like to have the output of the script to be placed into a Iframe or anything else so it have a scrollbar! This way i can have the output at a max hight of 300 and if its any bigger a scroller is made to scroll throught it! What tag or whatever will do this???
Part of script needing editing as followed!
but full one can be DL at http://net-xperience.org/download/SB.zip
Part of script needing editing as followed!
but full one can be DL at http://net-xperience.org/download/SB.zip
Code: Select all
<script Language="JavaScript">
<!--
function popup(url, name, width, height)
{
settings=
"toolbar=no,location=no,directories=no,"+
"status=no,menubar=no,scrollbars=yes,"+
"resizable=yes,width="+width+",height="+height;
MyNewWindow=window.open(url,name,settings);
}
function x () {
return;
}
function DoSmilie(addSmilie) {
var addSmilie;
var revisedMessage;
var currentMessage = document.form1.comment.value;
revisedMessage = currentMessage+addSmilie;
document.form1.comment.value=revisedMessage;
document.form1.comment.focus();
return;
}
//-->
</script>
<?php
/************************************************************************/
/* PHP-NUKE: ShoutBlock */
/* ================================ */
/* */
/* Copyright (c) 2002 by Quiecom */
/* http://www.Quiecom.com */
/* */
/* 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 */
/************************************************************************/
//Basic Page Junk here//
if (eregi("block-Counter.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
include("config.php");
include("modules/Qshoutblock/functions.php");
//Testing of submit//
if($Submit == "shout"){
$test = 0;
$yr = date(Y);
$mnth = date(m);
$dy = date(d);
$day = "$mnth-$dy-$yr";
$h = date(g);
$m = date(i);
$ap = date(a);
$time = "$h:$m:$ap";
//Code testing, adding security with each process :) //
//lots of little tests
$num = strlen($comment);
if($num < 2){ $error ="toshort"; }
if($num > 2500){ $error="tolong"; }
if(!$comment){ $error ="notext"; }
if($confї2] == $comment){ $error ="sameposting"; }
//no more XSS....more or less...needs work..//
if (eregi("javascript:(.*)", $comment))
{ $error = "javascript"; }
//add test to ensure all images have close tag on them, and $comment is not longer then 200char//
$needle1 = "<";
$needle2 = ">";
$oore1 = count(explode($needle1,$comment)) - 1;
$oore2 = count(explode($needle2,$comment)) - 1;
$done = $oore1 + $oore2;
if(1 & $done){ $error ="oddnumberofbrackets"; }
//Fix people entering urls.
$comment = ereg_replace("(ї^ ]{42})","\\1",$comment);
$comment = str_replace('<', '<', $comment);
$comment = str_replace('>', '>', $comment);
//Fix log words
//$comment = wordwrap( $comment, 21, " ", 1);
if (eregi("\ї\/url\](.*)", $comment)){
$splits=explode(" ",$comment);
$maxchar = 21;
foreach($splits as $split){
if(!eregi("http", $split)){
$len=(strlen($split));
if($len>$maxchar){
$comment=$comment." ".$split; }}
}
} else { $comment = wordwrap( $comment, 21, " ", 1); }
if($confї10] == "yes"){
//Allow for URL tags
if (eregi("\їurl\](.*)", $comment))
{ $url = "1"; }
if (eregi("\ї\/url\](.*)", $comment))
{ $url2 = "1";
if (!eregi("http://(.*)", $comment))
{ $error = "nohttpinurl"; }
if (!eregi("\.(.*)", $comment))
{ $error = "nodotinurl"; }
}
if($url && $url2){
$comment = ereg_replace("\їurl\]","<a href=",$comment);
$comment = ereg_replace("\ї\/url\]",">url<\/a>",$comment);
}
} else {
if (eregi("\їurl\](.*)", $comment))
{ $error = "urlpostingnoallowed"; }
}
//Icons from database
$eresult = sql_query("select * from ".$prefix."_quiecom_shoutblock_emoticons", $dbi);
while ($emoticons = mysql_fetch_row($eresult)){
$comment = str_replace($emoticonsї1],$emoticonsї2],$comment);}
//do ipblock test then error if on list
if($confї6] == "yes"){
$ipresult = sql_query("select * from ".$prefix."_quiecom_shoutblock_ipblock", $dbi);
while ($badips = mysql_fetch_row($ipresult)){
if($REMOTE_ADDR == $badipsї1])
$error ="bannedip";}
}
//do name test then error if on list
if($confї7] == "yes"){
$nameresult = sql_query("select * from ".$prefix."_quiecom_shoutblock_nameblock", $dbi);
while ($badname = mysql_fetch_row($nameresult)){
if($username == $badnameї1])
$error ="bannedusername";}
}
//look for bad words, then censor them.
//need to make this case insensitive.
if($confї8] == "yes"){
$cresult = sql_query("select * from ".$prefix."_quiecom_shoutblock_censor", $dbi);
while ($censor = mysql_fetch_row($cresult)){
$one = strtolower($censorї1]);
$two = strtolower($censorї2]);
$comment = strtolower($comment);
$comment = " $comment";
$comment = str_replace($one,$two,$comment); }
}
//if error just reload page, else add posting.
if($error){
print "error: $error";
//Header("Location: index.php");
} else {
sql_query("INSERT INTO ".$prefix."_quiecom_shoutblock (id,name,comment,date,time ) VALUES ('0','$username ','$comment','$day','$time')",$dbi);
Header("Location: index.php");
exit;}
}
?>
<?php
//Display Content From here on down//
$query = "select * from ".$prefix."_quiecom_shoutblock order by id DESC LIMIT $confї5]";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
$content .= "<br>";
$content .= "<form name="form1" method="post" action="">";
$content .= "<table style="table-layout:fixed" width="$confї9]" border="0" align=center>";
$flag = 1;
while ($row = mysql_fetch_row($result)){
if($flag == 1){ $bgcolor = "$confї1]"; }
if($flag == 2){ $bgcolor = "$confї2]"; }
$content .= "<tr>";
$content .= "<td bgcolor=$bgcolor>";
if ($username == "Anonymous") {
$content .= "<b>$rowї1]:</b> $rowї2]<br>";}
else { $content .= "<a href="/modules.php?name=Your_Account&op=userinfo&uname=$rowї1]"><b>$rowї1]:</b></a> $rowї2]<br>"; }
if($confї3] == "yes") { $content .= "$rowї3]"; }
if($confї4] == "yes") { $content .= "$rowї4]"; }
$content .= "</td>";
$content .= "</tr>";
if($flag == 1)
{ $flag = 2; }
elseif($flag == 2)
{ $flag =1; }
}
//Allow Anonymous visitors to shout
if($confї12] == "no"){
if ($username == "Anonymous") {
$content .= "<tr>";
$content .= "<td><br><div align=center>Only Registered Users can Shout<br><a href="/modules.php?name=Your_Account">Create/Login</a><br></div></td>";
$content .= "</tr>";
}
else {
$content .= "<tr>";
$content .= "<td>";
$content .= "<input type="text" name="comment">";
$content .= "</td>";
$content .= "</tr>";
$content .= "<tr>";
$content .= "<td>";
$content .= "<input type="submit" name="Submit" value="shout"><br>";
$nameresult = sql_query("select * from ".$prefix."_quiecom_shoutblock_emoticons", $dbi);
while ($emoticons = mysql_fetch_row($nameresult)){
$emoticonsї2] = str_replace('=', '=/', $emoticonsї2]);
$emoticonsї3] = str_replace('>', '', $emoticonsї2]);
$content .= "<A href="javascript: x()" onClick="DoSmilie(' $emoticonsї1] ');">$emoticonsї3] border="0" alt="$emoticonsї1]" hspace="2" vspace="2"></A>";
}
$content .= "</td>";
$content .= "</tr>";
}
}
else {
$content .= "<tr>";
$content .= "<td>";
$content .= "<input type="text" name="comment">";
$content .= "</td>";
$content .= "</tr>";
$content .= "<tr>";
$content .= "<td>";
$content .= "<input type="submit" name="Submit" value="shout"><br>";
$nameresult = sql_query("select * from ".$prefix."_quiecom_shoutblock_emoticons", $dbi);
while ($emoticons = mysql_fetch_row($nameresult)){
$emoticonsї2] = str_replace('=', '=/', $emoticonsї2]);
$emoticonsї3] = str_replace('>', '', $emoticonsї2]);
$content .= "<A href="javascript: x()" onClick="DoSmilie(' $emoticonsї1] ');">$emoticonsї3] border="0" alt="$emoticonsї1]" hspace="2" vspace="2"></A>";
}
$content .= "</td>";
$content .= "</tr>";
}
$content .= "</table>";
$content .= "</form>";
?>