phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

How to put a chat as an extra page?

Goto page Previous  1, 2
 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Fri Jul 03, 2009 11:46 am 
Post subject: Re: How to put a chat as an extra page?

Acaria wrote:
Please post your chat.php code. :3

Code:
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
   <tr>
      <td align="left" class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></td>
   </tr>
</table>

<embed wmode="transparent" src="http://www.xatech.com/web_gear/chat/chat.swf" quality="high" width="640" height="480" name="chat" FlashVars="id=63876441&rl=Romanian" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.shtml" />

<table width="100%" cellspacing="0" cellpadding="0" border="0">
  <tr>
   <td><span class="nav">{PAGE_NUMBER}</span></td>
   <td align="right"><span class="nav">{PAGINATION}</span></td>
  </tr>
</table>                                 
</table>
</td></tr></table>

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Acaria
Board Member



Joined: 20 Feb 2009

Posts: 238



PostPosted: Fri Jul 03, 2009 6:50 pm 
Post subject: Re: How to put a chat as an extra page?

Okay, there's the problem.

That's a .tpl file. Stuff like {U_INDEX}, {L_INDEX}, etc. are all variables called in the PHP. That's why it's not working.

Was this a Mod you added or did you just try to add a chat thing?
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 541
Location: North West UK


flag
PostPosted: Fri Jul 03, 2009 7:16 pm 
Post subject: Re: How to put a chat as an extra page?

Acaria wrote:
Okay, there's the problem.

That's a .tpl file. Stuff like {U_INDEX}, {L_INDEX}, etc. are all variables called in the PHP. That's why it's not working.


Are you sure?
This is a section of the basic overall_header.tpl file

Quote:
<table width="100%" cellspacing="0" cellpadding="10" border="0" align="center">
<tr>
<td class="bodyline"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td><a href="{U_INDEX}"><img src="templates/subSilver/images/logo_phpBB.gif" border="0" alt="{L_INDEX}" vspace="1" /></a></td>
<td align="center" width="100%" valign="middle"><span class="maintitle">{SITENAME}</span><br /><span class="gen">{SITE_DESCRIPTION}<br />&nbsp; </span>
<table cellspacing="0" cellpadding="2" border="0">


Jim
Back to top
Acaria
Board Member



Joined: 20 Feb 2009

Posts: 238



PostPosted: Fri Jul 03, 2009 7:31 pm 
Post subject: Re: How to put a chat as an extra page?

Yeah.

There are variables written in PHP coding that allows you to use those in .tpl files. Without anything to assign those variables, the page is just reading that as text.
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Fri Jul 03, 2009 8:33 pm 
Post subject: Re: How to put a chat as an extra page?

Acaria wrote:
Okay, there's the problem.

That's a .tpl file. Stuff like {U_INDEX}, {L_INDEX}, etc. are all variables called in the PHP. That's why it's not working.

Was this a Mod you added or did you just try to add a chat thing?

But I've made it PHP. It is chat.php. icon_confused.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Tue Jul 07, 2009 7:12 pm 
Post subject: Re: How to put a chat as an extra page?

I've found something! icon_biggrin.gif
But I need a hand in making the required changes. icon_wink.gif

The MOD is called "Forum rules" and it ads a new page to the board as an extra page, with rules. So in stead of rules, I want to put the chat that I was talking about previously. But I am not sure what do I have to replace. icon_smile.gif
This is board_rules.php (wich will become chat.php):
Code:
<?php
/***************************************************************************
*                                  board_rules.php
*                            -------------------
*
*   copyright            : (C) 2002 PHPBB.COM
*                           Code in principle is copyright PHPBB.com.
*                 Alteration to variable names by fluffi.net
*   
*   email(fluffi)        : fluffi@fluffi.net
*   email(phpbb)         : support@phpbb.com
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_BOARD_RULES);
init_userprefs($userdata);
//
// End session management
//

//
// Load the appropriate Board Rules file
//
$lang_file = 'lang_main';
$l_title = $lang['Chat'];

//
// Include the rules settings
//
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);

//
// Pull the array data from the lang pack
//
$j = 0;
$counter = 0;
$counter_2 = 0;
$board_rules_block = array();
$board_rules_block_titles = array();

for($i = 0; $i < count($board_rules); $i++)
{
   if( $board_rules[$i][0] != '--' )
   {
      $board_rules_block[$j][$counter]['id'] = $counter_2;
      $board_rules_block[$j][$counter]['question'] = $board_rules[$i][0];
      $board_rules_block[$j][$counter]['answer'] = $board_rules[$i][1];

      $counter++;
      $counter_2++;
   }
   else
   {
      $j = ( $counter != 0 ) ? $j + 1 : 0;

      $board_rules_block_titles[$j] = $board_rules[$i][1];

      $counter = 0;
   }
}

//
// Lets build a page ...
//
$page_title = $l_title;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);


$template->set_filenames(array(
   'body' => 'chat_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);

$template->assign_vars(array(
   'L_BOARD_RULES_TITLE' => $l_title,
   'L_BACK_TO_TOP' => $lang['Back_to_top'])
);

for($i = 0; $i < count($board_rules_block); $i++)
{
   if( count($board_rules_block[$i]) )
   {
      $template->assign_block_vars('board_rules_block', array(
         'BLOCK_TITLE' => $board_rules_block_titles[$i])
      );
      $template->assign_block_vars('board_rules_block_link', array(
         'BLOCK_TITLE' => $board_rules_block_titles[$i])
      );

      for($j = 0; $j < count($board_rules_block[$i]); $j++)
      {
         $row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
         $row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

         $template->assign_block_vars('board_rules_block.board_rules_row', array(
            'ROW_COLOR' => '#' . $row_color,
            'ROW_CLASS' => $row_class,
            'BOARD_RULES_QUESTION' => $board_rules_block[$i][$j]['question'],
            'BOARD_RULES_ANSWER' => $board_rules_block[$i][$j]['answer'],

            'U_BOARD_RULES_ID' => $board_rules_block[$i][$j]['id'])
         );

         $template->assign_block_vars('board_rules_block_link.board_rules_row_link', array(
            'ROW_COLOR' => '#' . $row_color,
            'ROW_CLASS' => $row_class,
            'BOARD_RULES_LINK' => $board_rules_block[$i][$j]['question'],

            'U_BOARD_RULES_LINK' => '#' . $board_rules_block[$i][$j]['id'])
         );
      }
   }
}

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>


And this is board_rules_body.tpl (wich will become chat_body.tpl):
Code:
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
   <tr>
      <td align="left" class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></td>
   </tr>
</table>

<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
   <tr>
      <th class="thHead">{L_BOARD_RULES_TITLE}</th>
   </tr>
   <tr>
      <td class="row1">
         <!-- BEGIN board_rules_block_link -->
         <span class="gen"><b>{board_rules_block_link.BLOCK_TITLE}</b></span><br />
         <!-- BEGIN board_rules_row_link -->
         <span class="gen"><a href="{board_rules_block_link.board_rules_row_link.U_BOARD_RULES_LINK}" class="postlink">{board_rules_block_link.board_rules_row_link.BOARD_RULES_LINK}</a></span><br />
         <!-- END board_rules_row_link -->
         <br />
         <!-- END board_rules_block_link -->
      </td>
   </tr>
   <tr>
      <td class="catBottom" height="28">&nbsp;</td>
   </tr>
</table>

<br clear="all" />

<!-- BEGIN board_rules_block -->
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
   <tr>
      <td class="catHead" height="28" align="center"><span class="cattitle">{board_rules_block.BLOCK_TITLE}</span></td>
   </tr>
   <!-- BEGIN board_rules_row --> 
   <tr>
      <td class="{board_rules_block.board_rules_row.ROW_CLASS}" align="left" valign="top"><span class="postbody"><a name="{board_rules_block.board_rules_row.U_BOARD_RULES_ID}"></a><b>{board_rules_block.board_rules_row.BOARD_RULES_QUESTION}</b></span><br /><span class="postbody">{board_rules_block.board_rules_row.BOARD_RULES_ANSWER}<br /><a class="postlink" href="#Top">{L_BACK_TO_TOP}</a></span></td>
   </tr>
   <tr>
      <td class="spaceRow" height="1"><img src="templates/Chronicles/images/spacer.gif" alt="" width="1" height="1" /></td>
   </tr>
   <!-- END board_rules_row -->
</table>

<br clear="all" />
<!-- END board_rules_block -->

<table width="100%" cellspacing="2" border="0" align="center">
   <tr>
      <td align="right" valign="middle" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><br />{JUMPBOX}</td>
   </tr>
</table>

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Acaria
Board Member



Joined: 20 Feb 2009

Posts: 238



PostPosted: Tue Jul 07, 2009 9:48 pm 
Post subject: Re: How to put a chat as an extra page?

Sylver Cheetah 53 wrote:
But I've made it PHP. It is chat.php. icon_confused.gif


*pulls hair out*


Values such as {THIS}, {THAT}, {ETC} can not be used in PHP files. They are specifically for .TPL files.

If you have code like this:

Code:

<table>
<tr>
<td>
{EXAMPLE}
</td>
</tr>
</table>


in a file called chat.php, YOU ARE USING IT INCORRECTLY.

Those things must be in .tpl file. The PHP is what actually applies the overall_header, overall_footer, etc. It's what also allows things like {THIS} by code like this:

Code:

   $template->assign_vars(array(
      'THIS' => $this,
         ));



Okay, now your latest post is on the right track. chat.php needs the PHP, and chat_body.tpl needs the HTML code you posted earlier.


Do you understand now?
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Thu Jul 09, 2009 11:57 am 
Post subject: Re: How to put a chat as an extra page?

I don't know what PHP code to put in chat.php. icon_sad.gif The chat only has HTML code.
So now, the page looks like this: http://otvforum.com/chat.php
It looks good, except the chat is not appearing anymore. icon_sad.gif
So, in this momment this is my chat.php file:
Code:
<?php
/***************************************************************************
*                                  board_rules.php
*                            -------------------
*
*   copyright            : (C) 2002 PHPBB.COM
*                           Code in principle is copyright PHPBB.com.
*                 Alteration to variable names by fluffi.net
*   
*   email(fluffi)        : fluffi@fluffi.net
*   email(phpbb)         : support@phpbb.com
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_BOARD_RULES);
init_userprefs($userdata);
//
// End session management
//

//
// Load the appropriate Board Rules file
//
$lang_file = 'lang_main';
$l_title = $lang['Chat'];

//
// Include the rules settings
//
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);

//
// Pull the array data from the lang pack
//
$j = 0;
$counter = 0;
$counter_2 = 0;
$board_rules_block = array();
$board_rules_block_titles = array();

for($i = 0; $i < count($board_rules); $i++)
{
   if( $board_rules[$i][0] != '--' )
   {
      $board_rules_block[$j][$counter]['id'] = $counter_2;
      $board_rules_block[$j][$counter]['question'] = $board_rules[$i][0];
      $board_rules_block[$j][$counter]['answer'] = $board_rules[$i][1];

      $counter++;
      $counter_2++;
   }
   else
   {
      $j = ( $counter != 0 ) ? $j + 1 : 0;

      $board_rules_block_titles[$j] = $board_rules[$i][1];

      $counter = 0;
   }
}

//
// Lets build a page ...
//
$page_title = $l_title;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);


$template->set_filenames(array(
   'body' => 'chat_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);

$template->assign_vars(array(
   'L_BOARD_RULES_TITLE' => $l_title,
   'L_BACK_TO_TOP' => $lang['Back_to_top'])
);

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>


And this is chat_body.tpl:
Code:

<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
   <tr>
      <td align="left" class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></td>
   </tr>
</table>

<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
   <tr>
      <th class="thHead">{L_BOARD_RULES_TITLE}</th>
   </tr>
   <tr>
      <td class="row1">
         <!-- BEGIN board_rules_block_link -->
         <span class="gen"><b>{board_rules_block_link.BLOCK_TITLE}</b></span><br />
         <!-- BEGIN board_rules_row_link -->
         <span class="gen"><a href="{board_rules_block_link.board_rules_row_link.U_BOARD_RULES_LINK}" class="postlink">{board_rules_block_link.board_rules_row_link.BOARD_RULES_LINK}</a></span><br />
         <!-- END board_rules_row_link -->
         <br />
         <!-- END board_rules_block_link -->
      </td>
   </tr>
   <tr>
      <td class="catBottom" height="28">&nbsp;</td>
   </tr>
</table>

<br clear="all" />

<!-- BEGIN board_rules_block -->
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
   <tr>
      <td class="catHead" height="28" align="center"><span class="cattitle">{board_rules_block.BLOCK_TITLE}</span></td>
   </tr>
   <!-- BEGIN board_rules_row --> 
   <tr>
      <td class="{board_rules_block.board_rules_row.ROW_CLASS}" align="left" valign="top"><span class="postbody">
      <embed wmode="transparent" src="http://www.xatech.com/web_gear/chat/chat.swf" quality="high" width="640" height="480" name="chat" FlashVars="id=63876441&rl=Romanian" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.shtml" />
</embed>
</span></td>
   </tr>
   <tr>
      <td class="spaceRow" height="1"><img src="templates/Chronicles/images/spacer.gif" alt="" width="1" height="1" /></td>
   </tr>
   <!-- END board_rules_row -->
</table>

<br clear="all" />
<!-- END board_rules_block -->

<table width="100%" cellspacing="2" border="0" align="center">
   <tr>
      <td align="right" valign="middle" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><br />{JUMPBOX}</td>
   </tr>
</table>

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Mon Jul 13, 2009 11:03 am 
Post subject: Re: How to put a chat as an extra page?

I'm in the same place, still can't get it to work. icon_sad.gif
_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Fri Jul 17, 2009 6:27 pm 
Post subject: Re: How to put a chat as an extra page?

I've done it, but now I have another problem. The chat is working just fine in http. but not in www. icon_confused.gif

http://otvforum.com/chat.php <- Worsk like a charm
www.otvforum.com/chat.php <- Works like a sh*t icon_mad.gif

How is this possible? What can I do? icon_rolleyes.gif
I am very dissapointed. icon_sad.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Acaria
Board Member



Joined: 20 Feb 2009

Posts: 238



PostPosted: Tue Jul 21, 2009 2:13 am 
Post subject: Re: How to put a chat as an extra page?

Sometimes, and I mean sometimes as in not often, code decides to screw up on the HTTP but not WWW, or the WWW but not the HTTP.

I used to have a problem with that on an old board I was staff on. If you logged onto http://blah.com, you could go to www.blah.com and not be logged on. Same for if you logged onto the WWW.

I have no idea why it does it. Hopefully someone else can help you a little more.
Back to top
Slackervaara
Board Member



Joined: 01 Jan 2009

Posts: 70



PostPosted: Tue Jul 21, 2009 6:37 am 
Post subject: Re: How to put a chat as an extra page?

I think you can in .htaccess make so that http://otvforum.com/ is changed to http://www.otvforum.com/ automatically. Unfortunately, I don't remember how it is done.
Back to top
Ptirhiik
Board Member



Joined: 19 Nov 2008

Posts: 114


flag
PostPosted: Tue Jul 21, 2009 6:55 am 
Post subject: Re: How to put a chat as an extra page?

Set your cookies domain: .domain.com and your cookies path: /, then clear your browser cookies and relog.
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 2 of 2 All times are GMT
Goto page Previous  1, 2
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0179 seconds using 15 queries. (SQL 0.0018 Parse 0.0003 Other 0.0158)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo