[ Frane Marinković @ 17.03.2006. 18:21 ] @
evo ovo me zeza, imam servere u americi, tj. serveri kasne 6 sati pa me zanima kako da to ispravim preko skripta, ovo je skript tog chatboxa: Code: <?php class shoutbox { var $listlimit; var $bgcolor1; var $bgcolor2; function connect() { mysql_connect("localhost", "user", "pass") OR die ("Connection Error to Server"); mysql_select_db("bolbrac_ssbolchat") OR die("Connection Error to Database"); } function displayform() { //display the shoutbox form echo" <TABLE WIDTH=\"170\" BORDER=\"0\" CELLPADDING=\"4\" CELLSPACING=\"0\"> <FORM NAME=\"shout\" ACTION=\"index.php\" METHOD=\"post\"> <TBODY> <TR> <TD ALIGN=\"center\"> <INPUT TYPE=\"text\" VALUE=\"nadimak\" NAME=\"shoutname\" SIZE=\"20\"><BR> <INPUT TYPE=\"text\" VALUE=\"poruka\" NAME=\"shout\" SIZE=\"20\"><BR> <INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Šalji!\"> <INPUT TYPE=\"reset\" VALUE=\"Poništi\"> </TD> </TR> </TBODY> </FORM> </TABLE>\n"; } function displayshoutbox() { //displays shouts in the table up to the defined limit echo "<p> <TABLE WIDTH=\"170\" BORDER=\"0\" CELLPADDING=\"4\" CELLSPACING=\"0\"> "; $shoutboxResult = mysql_query("SELECT * FROM myshout ORDER BY shoutid DESC LIMIT $this->listlimit;"); if ($shoutboxRow = mysql_fetch_array($shoutboxResult)) { do { $shoutid = $shoutboxRow[shoutid]; $shoutname = $shoutboxRow[shoutname]; $shoutdate = $shoutboxRow[shoutdate]; // evo tu to treba nekako, ili nemam pojma gdje $shoutmsg = $shoutboxRow[shoutmsg]; $shoutmsg = wordwrap($shoutmsg, 20, "\n", 1); $bgcolor = ($count++ % 2) ? "$this->bgcolor1" : "$this->bgcolor2"; echo "<TR><TD BGCOLOR=\"$bgcolor\">$shoutname: $shoutmsg<DIV ALIGN=\"right\"> $shoutdate</DIV></TD></TR>\n"; } while($shoutboxRow = mysql_fetch_array($shoutboxResult)); } else { echo "Još nema Poruka"; } echo "</TABLE>"; } function insertshout($shoutname, $shout) { //insert data into table $shoutname = strip_tags($shoutname); $shout = strip_tags($shout, '<a><b><i><u>'); //strip html tags allowing only <a><b><i><u> if (mysql_query ("INSERT INTO myshout (shoutname, shoutmsg, shoutdate) VALUES ('$shoutname', '$shout', NOW())")) { echo ""; } else { echo mysql_error(); } } } ?> hvala |