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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,972
  • Latest: Lineo
Stats
  • Total Posts: 196,142
  • Total Topics: 21,346
  • Online today: 1,074
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

hiding a block

Started by jessicac, October 22, 2006, 04:13:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jessicac

#20
It's cool. You rock!

1) it continues to show.
2) yes, created new theme and switched to that.
3)

case 'categorybox':
$context['TPortal']['blocklisting']= $block['body'];
$context['TPortal']['blocklisting_height']= $block['var1'];
break;
}

//begin hide block
$switch['castlist'] = 0;
if ($block['title'] == 'Castlist') {

include("c:\htdocs\scripts\list\dbinfo.inc.php");
mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die ('DB connect error - view: '. mysql_error() );
$query="SELECT frank FROM script_castlist";
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
mysql_close();
$frank=mysql_result($result,0,"frank");

  if(!empty($frank)){
    $switch['castlist'] = 1;
  }
}
//end hide block

echo
'<div', (($theme || $block['frame']=='frame') ? ' class="tborder"' : ''), ' style="margin-bottom: 5px;">';



</script>';
}

if ($block['title'] <> 'Castlist' || $switch['castlist']) { //block hide

// TPortal leftblocks
function TPortal_leftbar()


and a } at the very bottom of the page.


}
echo '</div>';
}
}

}//block hide
?>

JPDeni

That second code block is the problem. You have your function defined within the "if" statement. This is not good.

You probably should attach your whole TPortalBlocks.template.php file to a post so I can see where you need to move things around. I'm surprised you're not getting a crash with that code.

jessicac

LMAO! OMG if I could just READ right? I got it. I was thinking that you meant to use the if statement on the next function but you meant for me to put the rest of that function into the if statement. I got it now! and it works! Thanks again for putting up with one step above stupid.

JPDeni

LOL I'm just surprised it ever worked. LOL

Sometimes things aren't obvious when you first read them. Glad we got it worked out. :)

This website is proudly hosted on Crocweb Cloud Website Hosting.