News:

Wondering if this will always be free?  See why free is better.

Main Menu

Problem with TinyPortal

Started by armycadets, August 01, 2010, 11:12:24 AM

Previous topic - Next topic

armycadets

Hello! I'm sorry if i this is in the wrong section,
When i try to add a new block to tiny portal i get this error-

Field 'var3' doesn't have a default value
File: C:\HostingDIR\USERNAME\battlefield3news.com\wwwroot\Sources\TPortalAdmin.php
Line: 2337

This is the code from line 2299 to 2337
elseif($from == 'addblock')
{
checkSession('post');
isAllowedTo('tp_blocks');

$title = empty($_POST['tp_addblocktitle']) ? '-no title-' : tp_sanitize($_POST['tp_addblocktitle']);
$panel = $_POST['tp_addblockpanel'];
$type = $_POST['tp_addblock'];
if(!is_numeric($type))
{
if(substr($type,0,3) == 'mb_')
{
$request =tp_query("SELECT * FROM " . $tp_prefix . "blocks WHERE id =" . substr($type,3), __FILE__, __LINE__);
if(tpdb_num_rows($request)>0)
{
$cp = tpdb_fetch_assoc($request);
tpdb_free_result($request);
}
}
else
$od = TPparseModfile(file_get_contents($boarddir . '/tp-files/tp-blockcodes/' . $type.'.blockcode') , array('code'));
}
if(isset($od['code']))
{
$body = tp_convertphp($od['code']);
$type = 10;
}
else
$body = '';

if(isset($cp))
$request = tp_query("INSERT INTO " . $tp_prefix . "blocks
(type,frame,title,body,access,bar,pos,off,visible,var1,var2,lang,access2,editgroups)
VALUES(" . $cp['type'] . ", '" . $cp['frame'] . "', '" . $title . "', '" . htmlentities($cp['body'],ENT_QUOTES) . "','" . $cp['access'] . "',
" . $panel .", 0, 1,1," . $cp['var1'] . "," . $cp['var2'] . ",'" . $cp['lang'] . "','" . $cp['access2'] . "','" . $cp['editgroups'] . "') " , __FILE__, __LINE__);
else
$request = tp_query("INSERT INTO " . $tp_prefix . "blocks
(type,frame,title,body,access,bar,pos,off,visible,var1,var2,lang,access2,editgroups)
VALUES(" . $type . ", 'theme', '" . $title . "', '" . htmlentities($body, ENT_QUOTES) . "', '-1,0,1', " . $panel .", 0, 1,1,0,0,'','actio=allpages','') " , __FILE__, __LINE__);


Any insight you could give on this issue would be wonderful, thanks!

xenovanis

Hi armycadets, welcome to SMF :)

For support about a modification, it's better to ask your question in the support topic for Tiny Portal  ;)
"Insanity: doing the same thing over and over again and expecting different results."

Advertisement: