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

Recent

Welcome to TinyPortal. Please login or sign up.

May 15, 2024, 07:05:10 AM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,188
  • Total Topics: 21,220
  • Online today: 164
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 167
  • Total: 167

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.

NightOwl

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.

Thanks.

Bjørn

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

NightOwl

Yes

http://linktosite/index.php?action=chat

Bjørn

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...?

NightOwl

#4
0.5b

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.

<?php

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.
echo'

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

'
;
}

?>

Bjørn

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..

NightOwl


IchBin

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.

NightOwl

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.