Custom BBCodes Page problem

Support for PhpBB3. Post here to get help with any phpBB3 related issue here
There is no support here! Only Read Access!
Forum rules
In order the get any support, you will have to do following:
1. Use a describing title!
2. Describe your problem and what happened when the problem occured
3. Tell us what version of phpBB3 you are currently using.
Else your topic may be ignored or locked!
Locked
Widmo
BBCoder II
BBCoder II
Posts: 11
Joined: 09 Mar 2010, 02:33

Custom BBCodes Page problem

Post 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!
User avatar
DoYouSpeakWak
BBCoder II
BBCoder II
Posts: 27
Joined: 05 Mar 2010, 16:47

Re: Custom BBCodes Page problem

Post by DoYouSpeakWak »

Got a link for your site and this mod ?
Widmo
BBCoder II
BBCoder II
Posts: 11
Joined: 09 Mar 2010, 02:33

Re: Custom BBCodes Page problem

Post by Widmo »

I install mod on localhost for test. I only can give you screenshot:
http://i44.tinypic.com/2sb9ahh.png
Widmo
BBCoder II
BBCoder II
Posts: 11
Joined: 09 Mar 2010, 02:33

Re: Custom BBCodes Page problem

Post by Widmo »

Someone can help me?
User avatar
Stoker
Site Admin
Site Admin
Posts: 3521
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Custom BBCodes Page problem

Post 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 -->
Board rules! No PM support
Widmo
BBCoder II
BBCoder II
Posts: 11
Joined: 09 Mar 2010, 02:33

Re: Custom BBCodes Page problem

Post 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
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Custom BBCodes Page problem

Post 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?
User avatar
Stoker
Site Admin
Site Admin
Posts: 3521
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Custom BBCodes Page problem

Post 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 : './';
Board rules! No PM support
Widmo
BBCoder II
BBCoder II
Posts: 11
Joined: 09 Mar 2010, 02:33

Re: Custom BBCodes Page problem

Post by Widmo »

Works perfectly. Thank you! :)
Locked