Insert torrent upload into shout issue?

Started by MrXp, May 24, 2013, 08:11:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MrXp

Quote from: autotron on May 24, 2013, 02:45:09 PM
Quote from: MrXp on May 24, 2013, 08:11:25 AM


Ah yes, silly me... in shoutbox.php it is $date=sqlesc(get_date_time($ti));
so changed it in take upload.php to same & works ....  thanks for help.

autotron

Quote from: MrXp on May 24, 2013, 08:11:25 AM
Im just having a play cos im bored lol, and refreshing my php skills

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

////////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

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

in shout is $date defined the same as your bit for upload?
$date = time()
it does not make sence it would insert as it is now, when you shout or upload it does not go straight to shout, but goes database then shout so on upload its simply writting to database and shout is pulling that info and listing those values in desc order by date, look at the dates in shout and see if the times are in order after an upload.

MrXp

Im just having a play cos im bored lol, and refreshing my php skills

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

////////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

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