Page 1 of 1

Custom BBCodes Page problem

Posted: 15 Mar 2010, 11:07
by Widmo
Hello,
I install this modyfication, but my page doesnt lool like your. How i make to change the page to be able to see HTML code.
Thank you for help, Greetings!

Re: Custom BBCodes Page problem

Posted: 15 Mar 2010, 12:57
by DoYouSpeakWak
Got a link for your site and this mod ?

Re: Custom BBCodes Page problem

Posted: 15 Mar 2010, 22:15
by Widmo
I install mod on localhost for test. I only can give you screenshot:
http://i44.tinypic.com/2sb9ahh.png

Re: Custom BBCodes Page problem

Posted: 19 Mar 2010, 01:37
by Widmo
Someone can help me?

Re: Custom BBCodes Page problem

Posted: 19 Mar 2010, 23:17
by Stoker
You can try this for the php:

Code: Select all

<?php
/** 
*
* @package phpBB3
* @version $Id: bbcodes.php,v 1.002 2007/02/21 15:39:00 nedka Exp $
* @copyright (c) 2007 nedka (Nguyen Dang Khoa)
* @version $Id: boardbbcodes.php,v 1.2.0 2008/11/12 10:04:00 Stoker Exp $
* @copyright (c) 2008 Stoker (www.phpbb3bbcodes.com) 
* This mod is made by nedka, modified by Stoker 2008/11/12
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('common');

$start = request_var('start', 0);

    // How many bbcodes do we have?
    $sql = 'SELECT COUNT(bbcode_helpline) AS total_bbcodes
        FROM ' . BBCODES_TABLE . "
          WHERE bbcode_helpline != ''
       ORDER BY bbcode_tag ASC";
    $result = $db->sql_query($sql);
    $total_bbcodes = (int) $db->sql_fetchfield('total_bbcodes');
    $db->sql_freeresult($result);

    $pagination_url = append_sid("{$phpbb_root_path}boardbbcodes.$phpEx");

// Grab BBCode tags details for display
$sql = 'SELECT bbcode_tag, bbcode_helpline, display_on_posting, bbcode_tpl, bbcode_match
       FROM ' . BBCODES_TABLE . "
          WHERE bbcode_helpline != ''
       ORDER BY bbcode_tag ASC";
$result = $db->sql_query_limit($sql, 30, $start);

while ($row = $db->sql_fetchrow($result))
{
	$template->assign_block_vars('bbcodes', array(
		'BBCODE_NAME'		=> $row['bbcode_tag'],
		'BBCODE_HELPLINE'	=> $row['bbcode_helpline'],
		'S_BBCODE_DISPLAY'	=> $row['display_on_posting'],
		'BBCODE_TPL'	=> $row['bbcode_tpl'],
		'BBCODE_MATCH'	=> $row['bbcode_match'],
	));
}
$db->sql_freeresult($result);

$template->assign_vars(array(
        'PAGINATION'           =>  generate_pagination($pagination_url, $total_bbcodes, 30, $start),
        'PAGE_NUMBER'           => on_page($total_bbcodes, 30, $start),
        'TOTAL_BBCODES'           => ($total_bbcodes == 1) ? $user->lang['BBCODE_COUNT'] : sprintf($user->lang['BBCODES_COUNT'], $total_bbcodes),
    ));

// Output page
page_header($user->lang['CUSTOM_BBCODES'] . ($start ? ' - ' . sprintf($user->lang['TITLE_PAGE_NUMBER'], floor($start / 30) + 1) : ''));

$template->set_filenames(array(
	'body' => 'boardbbcodes_body.html')
);

page_footer();

?>
and this for html:

Code: Select all

<!-- INCLUDE overall_header.html -->

<script type="text/javascript">
function showSpoiler(obj)
    {
    var inner = obj.parentNode.getElementsByTagName("div")[0];
    if (inner.style.display == "none")
        inner.style.display = "";
    else
        inner.style.display = "none";
    }
</script>

<h2>{L_CUSTOM_BBCODES}</h2>

<!-- IF PAGINATION or TOTAL_SMILIES -->
      <div class="pagination">
         {TOTAL_BBCODES}<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; {PAGE_NUMBER} &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
      </div>
   <!-- ENDIF -->
<div class="clear"></div><br />

<div class="forumbg">
	<div class="inner"><span class="corners-top"><span></span></span>
	 
	<table class="table1" cellspacing="1">
	<thead>
	<tr>
		<th class="info" style="width:130px;">{L_BBCODE_NAME}</th>
		<th class="name">{L_BBCODE_HELPLINE}</th>
		<th class="info" style="width:150px;">{L_BBCODE_DISPLAY}</th>
	</tr>
	</thead>
	<tbody>
	<!-- BEGIN bbcodes -->
	<!-- IF bbcodes.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF -->
		<td>[{bbcodes.BBCODE_NAME}]</td>
		<td><input type="button" class="button2" onclick="showSpoiler(this);" value="?" /> {bbcodes.BBCODE_HELPLINE}
		<div class="inner" style="display:none;"><br />BBCode usage:<br /><textarea onclick="select()" rows="3" cols="65" style="width:98%; height:16px;">{bbcodes.BBCODE_MATCH}</textarea><br /><br />HTML replacement:<br /><!-- IF not S_IS_BOT --><textarea onclick="select()" rows="3" cols="65" style="width:98%; height:50px;">{bbcodes.BBCODE_TPL}</textarea><!-- ENDIF --></div></td>
		<td style="text-align:center;"><!-- IF bbcodes.S_BBCODE_DISPLAY -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
	</tr>
	<!-- END bbcodes -->
</tbody>
	</table>
	
	<span class="corners-bottom"><span></span></span></div>
</div>

<!-- IF PAGINATION or TOTAL_SMILIES -->
      <div class="pagination">
         {TOTAL_BBCODES}<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; {PAGE_NUMBER} &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
      </div>
   <!-- ENDIF -->
<div class="clear"></div>
<div style="text-align:center;">BBCode page by <a href="http://www.phpbb3bbcodes.com">Stoker</a></div>
<br />

<!-- INCLUDE overall_footer.html -->

Re: Custom BBCodes Page problem

Posted: 20 Mar 2010, 03:09
by Widmo
Unfortunately, I received an error:

Code: Select all

Warning: include(./../common.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files\WebServ\httpd\boardbbcodes.php on line 20

Warning: include() [function.include]: Failed opening './../common.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\WebServ\httpd\boardbbcodes.php on line 20

Fatal error: Call to a member function session_begin() on a non-object in C:\Program Files\WebServ\httpd\boardbbcodes.php on line 23

Re: Custom BBCodes Page problem

Posted: 20 Mar 2010, 03:52
by cisco007
looks like you are using it on a localhost, make sure the files are uploaded to the correct location, or is httpd\ the root of your test forum?

Re: Custom BBCodes Page problem

Posted: 20 Mar 2010, 08:56
by Stoker
No its because I have givin you my files and my bbcodes.php is in another folder so the path is wrong.
Change this:

Code: Select all

$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
to this:

Code: Select all

$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';

Re: Custom BBCodes Page problem

Posted: 21 Mar 2010, 01:56
by Widmo
Works perfectly. Thank you! :)