TinyPortal

General => Chit chat => Topic started by: courage on January 07, 2006, 01:09:41 AM

Title: IRC Chat Mod + TP - ???
Post by: courage on January 07, 2006, 01:09:41 AM
I can't seem to get 3guks PJIRC Integrated Chat Mod to work with Tiny Protal 0.75. Next to index.templeate it says faileure and even if I install it nothing happens.
Title: Re: IRC Chat Mod + TP - ???
Post by: Rasyr on January 07, 2006, 04:09:33 AM
Ahh. that would likely be because the chat Mod is looking for the where the menubar is built (to add the Chat button) and cannot find it since TinyPortal changed that section as well (in adding the Forum and TPAdmin buttons).

This may have occured in other sections of the file as well.
Title: Re: IRC Chat Mod + TP - ???
Post by: fenris_w0lf on January 16, 2006, 11:38:57 AM
So, any ideas on how to get the "3guks PJIRC Integrated Chat Mod" to work with Tiny Protal 0.75 ?

Would it work to simply manually ftp the chat mod files to the server, then add a block or menu-item pointing to the php file ?
Title: Re: IRC Chat Mod + TP - ???
Post by: Rasyr on January 16, 2006, 06:15:54 PM
Inside the PJIRC mod zip file, you will find two files that tell you what you need to do to manually install it.

modification.xml and package-info.xml

Most of the files in the zip will go into a folder structure created by the package installer (unzipping the mod into its own directory should recreate the folder structure needed for the pjirc folder).

package-info.xml tells you to put the pjirc folder in the forum root, and what directories to put the other two files that it requires.

modification.xml tells you what files need to be modified and where in the file the modification needs to go and what the modification is.

This package should be relatively easy to install manually.

Title: Re: IRC Chat Mod + TP - ???
Post by: fenris_w0lf on January 16, 2006, 06:44:24 PM
Thanks Rasyr for your reply.

From what I've managed to understand (I hope..lol) the modification.xml will show what stuff gets "injected" into existing files on my forum, like a "chat link" using the icons supplied with the package etc etc....

Is that really needed for this to work ?

Wouldnt it be sufficient to do what I suggested. Upload the files and make a new "box" or menu-link (using TPadmin) that points to the php file (Chat.template.php) ?? If not...why not ?? lol
Title: Re: IRC Chat Mod + TP - ???
Post by: Rasyr on January 16, 2006, 11:18:53 PM
not just code that gets "injected" but also code that gets changed as well. Sometimes a mod will need to change some of the code to make sure it works well with the rest.

I haven't tried a manual install of pjirc yet (but I really need to as I am going to have to do it for one or two websites myself when the time comes for use to upgrade them... hehe), so I do not know for sure at the moment.

Title: Re: IRC Chat Mod + TP - ???
Post by: fenris_w0lf on January 17, 2006, 12:23:06 AM
Well, I did a fast and ugly test. I unpacked the files locally, edited the Chat.template.php file to reflect my site, irc-server, #room etc etc, uploaded the files (retained the sub-folders) and tried to direct my browser (Firefox) directly to Chat.php and got Hacker attempt (or something) then I tried Chat.template.php and got ...nothing.. ://
Title: Re: IRC Chat Mod + TP - ???
Post by: feline on January 17, 2006, 12:23:28 AM
Hi @ all

one word to IRC chat ..

Normaly ..it's not need to apply a mod .. to add a IRC chat is simple.

You need a small change to the theme index.template.php and a small php script.

step one .. open your Theme index.template.php
search for:

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
        global $context, $settings, $options, $scripturl, $boardurl, $user_info, $txt;


add after:

        // I'm using IRC Chat that will open in a new window
          echo '
           <script type="text/javascript">
            <!--
              function OpenChat() {
              F1 = window.open("' . $boardurl .'/chatboard.php?theme='.$settings['theme_url'].'&nick=' . $user_info['name'] . '", "Chat", "width=670,height=640,left=150,top=10,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no");
              }
            //-->
           </script>';


and later in this section add a button for chat ..

              echo '<a class="menu" href="javascript:OpenChat();">CHAT</a></td>';


and here the chatboard.php (copy at your root)

<?php

$themeurl
= '';
$nick = '';
if (isset(
$_GET['theme'])) $themeurl = $_GET['theme'];
if (isset(
$_GET['nick'])) $nick = $_GET['nick'];

echo
'
<html>
<head>
 <title>Chat</title>
 <link rel="stylesheet" type="text/css" href="'
. $themeurl . '/style.css?rc1" >
<head>
<body>
 <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="tborder">
  <tr>
   <td>
    <div class="titlebg"><center><b>Chat</b></center></div>
    <center>
     <script type="text/javascript" language="JavaScript"src="http://irc.everywherechat.com:8000/Java/e.js?room=MYROOM&width=650&height=610&roomstab=false&fontsize=12&ads=false&nick='
. $nick .'"></script>
    </center>
   </td>
  </tr>
 </table>
</body>
</html>'
;
?>


Change MYROOM to your Roomname

That's all folks  ::)

Fel

[attachment deleted by admin]
Title: Re: IRC Chat Mod + TP - ???
Post by: IchBin on January 17, 2006, 03:15:59 AM
Nice Feline!!
Title: Re: IRC Chat Mod + TP - ???
Post by: fenris_w0lf on January 17, 2006, 11:46:38 AM
Yes very nice Feline!!

But this is not the PJIRC mod. The main disadvantage with everywherechat is that you're not able to use any other irc server than the one run by ewc, this was my reason from the beginning to choose PJIRC.

I can see however ways to use your code and apply it to the files I got from PJIRC, so thanks!! :)

Gonna go try some more now !!
Title: Re: IRC Chat Mod + TP - ???
Post by: fenris_w0lf on January 17, 2006, 12:15:03 PM
Hmmm...how about doing a nice little change in the "index.html" file and add something like:

Quote// Here's the monstrous $_REQUEST['action'] array - $_REQUEST['action'] => array($file, $function).
   $actionArray = array(
'activate' => array('Register.php', 'Activate'),
      'admin' => array('Admin.php', 'Admin'),
      'announce' => array('Post.php', 'AnnounceTopic'),
      'ban' => array('ManageBans.php', 'Ban'),
      'boardrecount' => array('Admin.php', 'AdminBoardRecount'),
      'buddy' => array('Subs-Members.php', 'BuddyListToggle'),
      'calendar' => array('Calendar.php', 'CalendarMain'),
      'pjirc_chat' => array('Chat.php', 'xyz'),
.
.
.
(snipped)

I dont have enough knowledge to say what 'xyz' should be. The thing tho however is that the "Chat.php" file from PJIRC only contains:

<?php
if (!defined('SMF'))
die(
'Hacking attempt...');

function
Chat() {
global $context, $settings, $options;
$context['page_title'] = 'Live Chat';
loadTemplate('Chat');
}

?>


whereas the file "Chat.template.php" contains mostly all of the code for the java to load.

Anyways, adding a action like this would make it so much easier to use the admin-panel to add the PJIRC to TinyPortal without the fuzz of editing any of the Themes. Like using the menu manager:

<a href="index.php?action=forum">Forum</a>
<a href="index.php?action=profile">Profile</a>
<a href="index.php?action=calendar">Calendar</a>
<a href="index.php?action=help">Help</a>
<a href="index.php?action=search">Search</a>
<a href="index.php?action=pjirc_chat">Chat</a>


(notice the action "pjirc_chat" at the end of the code snipped above)

Or perhaps even better (?) adding it as a separate "Block" - this way one could easily adjust what Membergroups should be allowed to chat as well....

...could anyone say if this would work or not ????
Title: Re: IRC Chat Mod + TP - ???
Post by: fenris_w0lf on January 18, 2006, 01:19:58 AM
Anyone please ??  ::)
Title: Re: IRC Chat Mod + TP - ???
Post by: fenris_w0lf on January 22, 2006, 10:00:12 PM
I can now confirm that this works.

http://www.tinyportal.net/smf/index.php?topic=2267.new#new