Insert torrent upload into shout issue?
Im just having a play cos im bored lol
Im using tbdev08, trying to add torrent upload inserted into shout, i have done this BUT it inserts it at bottom of shout when text enters at top of shout
PHP Code:
////////new torrent upload detail sent to shoutbox//////////
$text = "[color=red][b][i]New Torrent: [url=http://localhost/details.php?id=$id] ".$torrent."[/url][/i][/b][/color]"; $userid = "7"; $username = "Shoutbot"; $date=time(); mysql_query("INSERT INTO shoutbox (id, userid, username, date, text) VALUES ('id'," . sqlesc($userid) . ", " . sqlesc($username) . ", $date, " . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__); /////////////////////////////END///////////////////////////////////
I noticed that the code for entering text in shout is
PHP Code:
mysql_query("INSERT INTO shoutbox (id, userid, username, date, text) VALUES ('id'," . sqlesc($userid) . ", " . sqlesc($username) . ", $date, " . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__); print "<script type=\"text/javascript\">parent.document.forms[0].shbox_text.value='';</script>"; }
$res = mysql_query("SELECT * FROM shoutbox ORDER BY date DESC LIMIT 200") or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($res) == 0) print("\n"); else { print("<table border=0 cellspacing=0 cellpadding=2 width='100%' align='left' class='small'>\n");
My question is how to make upload text insert at top same as chat ? any help is really appreciated.
Many thanks
update --- all fixed a simple $date=sqlesc(get_date_time($ti)); change & bob's your uncle
|