TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,027
  • Total Topics: 21,334
  • Online today: 519
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 132
  • Total: 132

Shoutbox value6 again

Started by executor4855, February 15, 2011, 08:08:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

executor4855

Link to my site: http://otm.l2devastation.com
SMF version: SMF 2.0 RC5
TP version: TP 1.102
Default Forum Language: English
Theme name and version: Default
Browser Name and Version: FF, IE, Chrome
Mods installed: none
Related Error messages:
Field 'value6' doesn't have a default value
File: D:\Websites\otm\tp-files\tp-modules\TPShout\Sources\TPShout.php
Line: 209


Just installed the fresh version of SMF and TP, nothing else yet.  I added the blocks (had some issues with the blocks, but found this post: http://www.tinyportal.net/index.php?topic=32976.0
) which fixed the one error.  But now I have a problem with the shoutbox.  I get the above error, and googling and searching on here turns up topics from back in 2008.  I checked the changelog and it didnt mention anything of these (but maybe I just didnt look in the right place?) so has this error become prevelant again or am I missing the fix to get my shoutbox working?
Thanks in advance

IchBin

You get this error when doing what? Just posting a shout, or doing something in the shout admin panel? I guess there must be a difference in the way the queries are handled between versions. Mine works just fine. I'm guessing your sql server is in strict mode or something.

executor4855

#2
Ah yes, I should have mentioned exactly when it happened too:
When you press "shout" after putting somethign in the text area this error occurs.
I have looked at my DB and the TP_shoutbox has value 1 - 8, id as the key, type between 3 and 4, and edit at the end.
I looked at tpshout.php and the insert values into ends at value 5.  So there are values 6,7,8 and edit that are not populated.
In my DB i set those fields to allow nulls and the error does not occur, but then the actual text that was shouted does not show up.
I've even tried re-installing the whole DB and TP from scratch to see if that had any effect and I still have the same error.

IchBin

You can try altering the query to insert nothing in those spots to see if that helps. I don't see that those values are used at the moment. It could have been something that Bloc was planning to use, but I don't know.

tp-files/tp-modules/TPShout/Sources/TPShout.php

Find this:
        if($shout!='')
            tp_query("INSERT INTO " . $tp_prefix . "shoutbox (value1,value2,value3,type,value4, value5)
                        VALUES('". mysql_real_escape_string($shout)."','".$shout_time."','".mysql_real_escape_string($shout_name)."','shoutbox','".$ip."',".$memID.")", __FILE__, __LINE__);



Replace with this:
        if($shout!='')
            tp_query("INSERT INTO " . $tp_prefix . "shoutbox (value1,value2,value3,type,value4, value5, value6, value8)
                        VALUES('". mysql_real_escape_string($shout)."','".$shout_time."','".mysql_real_escape_string($shout_name)."','shoutbox','".$ip."',".$memID.", ' ', ' ')", __FILE__, __LINE__);


I suspect a text column may have a problem with no default value being present or something. I've added a change for both the value6 and value8 columns since they are both text columns. Let me know if that works.

executor485

Thanks for the help, the code above didnt work because value7 was missing, so I added it, then edit was missing, so I added that.  Then it was giving me errors that value7 was missing an integer, so I manually specified 0, same thing for edit.  Then all the sudden it worked.
I've pasted the code below for those who may encounter the same problem.  Again, thanks for the help.


if($shout!='')
            tp_query("INSERT INTO " . $tp_prefix . "shoutbox (value1,value2,value3,type,value4, value5, value6,value7,value8, edit)
                        VALUES('". mysql_real_escape_string($shout)."','".$shout_time."','".mysql_real_escape_string($shout_name)."','shoutbox','".$ip."',".$memID.", ' ', ' 0', ' ', ' 0')", __FILE__, __LINE__);

IchBin

Glad you figured it out. Once I have time to go over the shoutbox more maybe I'll figure out what those values are used for. lol

This website is proudly hosted on Crocweb Cloud Website Hosting.