Topic: [request & help] Footer Chat
help me make the extension
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.3 extensions → [request & help] Footer Chat
help me make the extension
As far as I understand, there is no need to make an extension. You can just add those <script> tags to the "main.tpl" template of your style.
Yeah, it is embedded chatbox, you just need to C&P.
teguh kemangi, you should learn javascript
i mean this
<script type="text/javascript" src="http://www.footerchat.com/chat/cons.js"></script>
<script type="text/javascript" >
autoLogin('Username');
</script>
i put in my footer.php
plis tell me what must i replace the bold text
I guess you need this code:
if (!$forum_user['is_guest'])
echo '<script type="text/javascript">autoLogin("'.$forum_user['username'].'");</script>';
$forum_user['is_guest'] is true for guests, $forum_user['username'] contains the username.
You're welcome
but it's still something problem
<?php
/**
* Outputs the footer used by most forum pages.
*
* @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org
* @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
* @package PunBB
*/
// Make sure no one attempts to run this script "directly"
if (!defined('FORUM'))
exit;
// START SUBST - <!-- forum_about -->
ob_start();
($hook = get_hook('ft_about_output_start')) ? eval($hook) : null;
// Display the "Jump to" drop list
if ($forum_user['g_read_board'] == '1' && $forum_config['o_quickjump'] == '1')
{
($hook = get_hook('ft_about_pre_quickjump')) ? eval($hook) : null;
// Load cached quickjump
if (file_exists(FORUM_CACHE_DIR.'cache_quickjump_'.$forum_user['g_id'].'.php'))
include FORUM_CACHE_DIR.'cache_quickjump_'.$forum_user['g_id'].'.php';
if (!defined('FORUM_QJ_LOADED'))
{
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
require FORUM_ROOT.'include/cache.php';
generate_quickjump_cache($forum_user['g_id']);
require FORUM_CACHE_DIR.'cache_quickjump_'.$forum_user['g_id'].'.php';
}
}
($hook = get_hook('ft_about_pre_copyright')) ? eval($hook) : null;
?>
<script type="text/javascript" src="http://www.footerchat.com/chat/cons.js"></script>
<script type="text/javascript" >
if (!$forum_user['is_guest'])
echo '<script type="text/javascript">autoLogin("'.$forum_user['username'].'");</script>';
</script>
<p id="copyright"><?php echo sprintf($lang_common['Powered by'], '<a href="http://punbb.informer.com/">PunBB</a>'.($forum_config['o_show_version'] == '1' ? ' '.$forum_config['o_cur_version'] : ''), '<a href="http://www.informer.com/">Informer Technologies, Inc</a>') ?></p>
<?php
($hook = get_hook('ft_about_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_about -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_about -->
// START SUBST - <!-- forum_debug -->
if (defined('FORUM_DEBUG') || defined('FORUM_SHOW_QUERIES'))
{
ob_start();
($hook = get_hook('ft_debug_output_start')) ? eval($hook) : null;
// Display debug info (if enabled/defined)
if (defined('FORUM_DEBUG'))
{
// Calculate script generation time
list($usec, $sec) = explode(' ', microtime());
$time_diff = forum_number_format(((float)$usec + (float)$sec) - $forum_start, 3);
echo '<p id="querytime">[ '.sprintf($lang_common['Querytime'], $time_diff, forum_number_format($forum_db->get_num_queries())).' ]</p>'."\n";
}
if (defined('FORUM_SHOW_QUERIES'))
echo get_saved_queries();
($hook = get_hook('ft_debug_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_debug -->', $tpl_temp, $tpl_main);
ob_end_clean();
}
// END SUBST - <!-- forum_debug -->
// Last call!
($hook = get_hook('ft_end')) ? eval($hook) : null;
// End the transaction
$forum_db->end_transaction();
// Close the db connection (and free up any result data)
$forum_db->close();
// Spit out the page
exit($tpl_main);
It's because you've not placed the php-code inside <?php and ?>. The correct code is
...
?>
<script type="text/javascript" src="http://www.footerchat.com/chat/cons.js"></script>
<?php
if (!$forum_user['is_guest'])
echo '<script type="text/javascript">autoLogin("'.$forum_user['username'].'");</script>';
?>
<p id="copyright"><?php echo sprintf($lang_common['Powered by'], '<a href="http://punbb.informer.com/">PunBB</a>'.($forum_config['o_show_version'] == '1' ? ' '.$forum_config['o_cur_version'] : ''), '<a href="http://www.informer.com/">Informer Technologies, Inc</a>') ?></p>
<?php
...
wow nice extension i hope that it will work!!!
thank you very much parpalak
it's fix
I tried in my footer, but it won't recognize that i'm already logged. It still ask me to login. Why?
http://www.aoi-castellano.com.ar/ForoBB/
Reading the source code through the navigator, i can see this actually printed:
<script type="text/javascript" src="http://www.footerchat.com/chat/cons.js"></script>
<script type="text/javascript">autoLogin("mayid");</script>
Does the chat works with a database? I guess no. You could write any arbitrary name in autoLogin? I don't figure how it works because pressing "login to chat" nothing happens. I can see that link hasn't defined a function.
PunBB Forums → PunBB 1.3 extensions → [request & help] Footer Chat
Powered by PunBB, supported by Informer Technologies, Inc.