Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Template Shares
Reply
  #1  
Old 26th December 2022, 16:21
Floky123 Floky123 is offline
Senior Member
 
Join Date: Nov 2013
Slovenia
Posts: 55
Default Problem with shoutbox
Hi i have problem with shoutbox when i try to write something i become this error:

SQL Error
Incorrect integer value: 'id' for column `admin_infire`.`shoutbox`.`id` at row 1
in /home/admin/domains/******/public_html/shoutbox.php, line 61

My shoutbox.php:


Quote:
<?php
require_once("include/bittorrent.php");
dbconn(false);
loggedinorreturn();
parked();
iplogger();
if (isset($_GET['del']))
{
if (is_valid_id($_GET['del']))
{
if ( (get_user_class() >= UC_MODERATOR) ) {
sql_query("DELETE FROM shoutbox WHERE id=".mysql_real_escape_string($_GET['del']));
}
}
}
?>
<html><head>
<title>ShoutBox</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<META HTTP-EQUIV=REFRESH CONTENT="10; URL=shoutbox.php">
<style type="text/css">
A {color: #000000; font-weight: bold; }
A:hover {color: #FF0000;}
.small {font-size: 8pt; font-family: tahoma; }
.date {font-size: 7pt;}
</style>
<STYLE>BODY {
background-color: #F0F0E6;
SCROLLBAR-3DLIGHT-COLOR: #004E98;
SCROLLBAR-ARROW-COLOR: #004E98;
SCROLLBAR-DARKSHADOW-COLOR: white;
SCROLLBAR-BASE-COLOR: white;
}
</STYLE>
</head>
<body bgcolor=#F5F4EA>
<?
mysql_query("UPDATE users SET chat_access='" . get_date_time() . "' WHERE id=" . mysql_real_escape_string($CURUSER["id"]));// or die(mysql_error());
/*
if ($CURUSER["chatpost"] == 'no')
{
print("<h2><br><center>You are banned.</center></h2>");
exit;
}
else
{
*/

if($_GET["sent"]=="yes")
if(!$_GET["shbox_text"])
{
$userid=0+$CURUSER["id"];
}
else
{
$userid=0+$CURUSER["id"];
$username=htmlspecialchars(trim($CURUSER["username"]));
$date=sqlesc(time());
$text=trim($_GET["shbox_text"]);

sql_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.shbox.shbox_text.value ='';</script>";
}

$res = sql_query("SELECT * FROM shoutbox ORDER BY date DESC LIMIT 70") 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");

while ($arr = mysql_fetch_assoc($res))
{
$res2 = sql_query("SELECT username,class,avatar,donor, title,enabled,warned FROM users WHERE id=$arr[userid]") or sqlerr(__FILE__, __LINE__);
$arr2 = mysql_fetch_assoc($res2);
$resowner = sql_query("SELECT id, username, class FROM users WHERE id=$arr[userid]") or print(mysql_error());
$rowowner = mysql_fetch_array($resowner);


if ($rowowner["class"] == "8")
$usercolor= "<font color=#500000>" .htmlspecialchars($rowowner["username"]). "</font>";
if ($rowowner["class"] == "7")
$usercolor= "<font color=green><b>" .htmlspecialchars($rowowner["username"]). "</b></font>";
if ($rowowner["class"] == "6")
$usercolor= "<font color=red>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "5")
$usercolor= "<font color=blue>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "4")
$usercolor= "<font color=orange>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "3")
$usercolor= "<font color=brown>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "2")
$usercolor= "<font color=purple>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "1")
$usercolor= "<font color=black>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "0")
$usercolor= "<font color=black>" .htmlspecialchars($rowowner["username"]). "</font>";

if (get_user_class() >= UC_MODERATOR) {
$del="<span class='date'>[<a href=shoutbox.php?del=".$arr[id].">del</a>]</span>";
}

print("<tr><td><span class='date'>[".strftime("%d.%m %H:%M",$arr["date"])."]</span>
$del
</span>
<a href='userdetails.php?id=".$arr["userid"]."' target='_blank'>$usercolor</a>" .
($arr2["donor"] == "yes" ? "<img src=pic/star.gif alt='DONOR'>" : "") .
($arr2["warned"] == "yes" ? "<img src="."pic/warned.gif alt='Warned'>" : "") .
" ".format_comment($arr["text"], 0)."
</td></tr>\n");
}
print("</table>");
}
?>
</body>
</html>
Reply With Quote
  #2  
Old 27th December 2022, 06:50
BamBam0077 BamBam0077 is offline
Banned
 
Join Date: Jul 2013
P2P
Posts: 410
Default
Firstly replace
PHP Code:
sql_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.shbox.shbox_text.value ='';</script>";

With;:

PHP Code:
sql_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.shbox.shbox_text.value ='';</script>";

Next step:
Replace:
PHP Code:
$arr2 mysql_fetch_assoc($res2);
$resowner sql_query("SELECT id, username, class FROM users WHERE id=$arr[userid]") or print(mysql_error());
$rowowner mysql_fetch_array($resowner);


if (
$rowowner["class"] == "8"
With::

PHP Code:
$arr2 mysql_fetch_assoc($res2);
$resowner sql_query("SELECT id, username, class FROM users WHERE id=$arr2[userid]") or print(mysql_error());
$rowowner mysql_fetch_array($resowner);


if (
$rowowner["class"] == "8"
Try That G8 work dude
Reply With Quote
  #3  
Old 27th December 2022, 20:02
Floky123 Floky123 is offline
Senior Member
 
Join Date: Nov 2013
Slovenia
Posts: 55
Default
Quote:
Originally Posted by BamBam0077 View Post
Firstly replace
PHP Code:
sql_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.shbox.shbox_text.value ='';</script>";

With;:

PHP Code:
sql_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.shbox.shbox_text.value ='';</script>";

Next step:
Replace:
PHP Code:
$arr2 mysql_fetch_assoc($res2);
$resowner sql_query("SELECT id, username, class FROM users WHERE id=$arr[userid]") or print(mysql_error());
$rowowner mysql_fetch_array($resowner);


if (
$rowowner["class"] == "8"
With::

PHP Code:
$arr2 mysql_fetch_assoc($res2);
$resowner sql_query("SELECT id, username, class FROM users WHERE id=$arr2[userid]") or print(mysql_error());
$rowowner mysql_fetch_array($resowner);


if (
$rowowner["class"] == "8"
Try That G8 work dude
Thank you for time and help, but that don't work :(
Reply With Quote
  #4  
Old 30th December 2022, 15:32
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,241
Default
have you looked in the database at the auto_increment for that table field?
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
  #5  
Old 5th January 2023, 00:01
Floky123 Floky123 is offline
Senior Member
 
Join Date: Nov 2013
Slovenia
Posts: 55
Default
Quote:
Originally Posted by DND View Post
have you looked in the database at the auto_increment for that table field?
yep, all looks ok its working normal with php 5.3 but 5.6 have i this error
Reply With Quote
  #6  
Old 5th January 2023, 01:23
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,241
Default
old code.. need updating
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
  #7  
Old 5th January 2023, 15:59
Floky123 Floky123 is offline
Senior Member
 
Join Date: Nov 2013
Slovenia
Posts: 55
Default
Quote:
Originally Posted by DND View Post
old code.. need updating
Yep i think its too many work to make it updated :D
Reply With Quote
  #8  
Old 6th January 2023, 13:58
iseeyoucopy iseeyoucopy is offline
VIP
 
Join Date: Jan 2011
P2P
Posts: 28
Default
I think you are using old version of php and newer version of mysql server, newer versions of mysql have set SQL_MODE to strict...

check your mysql version
Reply With Quote
  #9  
Old 14th January 2023, 02:45
mogo mogo is offline
Senior Member
 
Join Date: Jun 2020
P2P
Posts: 94
Default
I don't know why guys like bigjoos, iseeyoucopy, antimidas, son, asterix, darkalchemy and ets and etc working on this greath source gave up
But maybe it was meant to be
Thank you for everything guys :)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 00:17. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.