HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media


Welcome to TinyPortal. Please login or sign up.

December 08, 2023, 01:00:49 PM

Login with username, password and session length
  • Total Posts: 194,611
  • Total Topics: 21,189
  • Online today: 80
  • Online ever: 3,540
  • (September 03, 2022, 01:38:54 AM)
Users Online
Users: 0
Guests: 80
Total: 80

Questions about TP behaviour controls

Started by NightOwl, March 21, 2005, 06:09:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Sorry for making a new topic.

I need help about codes that can automatically shrinks both bars in another php page(chat.php). This is used for the Java chat client that I've use for my site. The problem is, user always click on the PT blocks selection and this action will disconnect the Java client from chat which annoys them quite like setting traps.



What call is used to start the chat? ...something like action=chat?





I haven't thought so much about making some parts of the forum auto-close the sidebars...but I have an idea on perhaps how to make it happen, especially when there is explicit query in the path , like yours.

The script could check for presence of action=chat and when there, close the sidebars.

I would have to test it first though. You use 0.5b or 0.4b on this...?



I think it can be done with adding codes into the chat.template.php

Like if TP  is present, execute the shrink bar codes.

When the chat is initiated, it will open a new window and put the chat applet inside the index page with all blocks shown. Apparently, user will think those function can work with chat applet and click on it, then the applet is gone and chat disconnected.

Also, I think this also benefits some others routines like viewing member list, stats etc which need larger display space. Or admin page, I usually close all bars when I am using admin to edit templates. Cause the little window can't give clear visions of lines with lots of warppings.


function template_main()
global $context$settings$options$modSettings;

$chatAppend $modSettings['chatAppend'];
$chatWidth $modSettings['chatWidth'];
$chatHeight $modSettings['chatHeight'];
$chatRoomsTab $modSettings['chatRoomsTab'];
$chatPassword $modSettings['chatPassword'];

// Makes sure names are irc compliant
$chatName str_replace(" ","_",$context['user']['name']);
$chatName str_replace(".","_",$chatName);
$initialchar substr($chatName,0,1);
if ( (
$initialchar >= "0")  &&  ($initialchar <= "9") ) {
$chatName "_" $chatName;

// Appends the abreviation to the end of the username to prevent duplicate names on the server
$chatName $chatName $chatAppend;

$chatLanguage $modSettings['chatLanguage'] . ".prm";
$chatRoomName $modSettings['chatRoomName'];

// Html code for the room.

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="520" id="AutoNumber1">
     <td width="100%"><center><script language="JavaScript" src="' 
$chatRoomName '&roomstab=' $chatRoomsTab '&width=' $chatWidth '&height=' $chatHeight '&nick=' $chatName '&keypass=&paramfilename=' $chatLanguage '"></script></center></td>
   <input type=button value="Float" onClick="document.cs.doFloat()">




I agreed. When there are 2 bars present size is small.

I will try it out..but it must be done in TPortal.php(which gets loaded every time) since all sub-templates like chat, display, calendar etc. comes in AFTER index.template. And index.template initiates the blocks..



I was just going to request this today lol. Some of my users complained that I took a php block out that displays users on a teamspeak server. I took it out because of the delay it adds to the page load. If you make this happen Bloc I would like to have it myself. Then I can make it so the side columns don't display when viewing just the forum.


I think it's better to shrink both bars when accessing admin panel. Cause i do this manually everytime. Don't know if other get the same with me.