Page 3 of 8

Posted: Thu Oct 28, 2004 10:00 am
by wang5555
markus_petrux wrote:
wang5555 wrote:It's only "Script Error!", no more information.
This doesn't help much. Where do you see this error? If it's a javascript error, double clicking the browser's status bar should popup a small window with information related to all current javascript errors.

Thank your help! :D

Below is two main wrong news:

Code: Select all

========== 1 ==========
Line: 454
(ps. very much...)

Character: 63
(ps. very much...)

Wrong: 'SXBB' not yet defines

Code: 0

Url: http://61.70.203.175/phpbb2/viewtopic.php?t=3314
========== 2 ==========
Line: 49

Character: 149

Wrong: Is unable to determine the character string constant the ending

Code: 0

Url: http://61.70.203.175/phpbb2/viewtopic.php?t=3314

Posted: Thu Oct 28, 2004 2:32 pm
by markus_petrux
wang5555 wrote: Below is two main wrong news:

Code: Select all

Wrong: 'SXBB' not yet defines

Make sure you have uploaded the select_expand_bbcodes.js file to your templates folder.

Posted: Thu Oct 28, 2004 2:42 pm
by richard_5421
These are above and below line 121

Code: Select all

global $lang;

	$bbcode_tpl['olist_open'] = str_replace('{LIST_TYPE}', '\\1', $bbcode_tpl['olist_open']);

	$bbcode_tpl['color_open'] = str_replace('{COLOR}', '\\1', $bbcode_tpl['color_open']);

	$bbcode_tpl['size_open'] = str_replace('{SIZE}', '\\1', $bbcode_tpl['size_open']);

	$bbcode_tpl['quote_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_open']);

	$bbcode_tpl['quote_username_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_username_open']);
	$bbcode_tpl['quote_username_open'] = str_replace('{L_WROTE}', $lang['wrote'], $bbcode_tpl['quote_username_open']);
	$bbcode_tpl['quote_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['quote_username_open']);

	$bbcode_tpl['code_open'] = str_replace('{L_CODE}', $lang['Code'], $bbcode_tpl['code_open']);

	$bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']);
	// LEFT-RIGHT-start
	$bbcode_tpl['left'] = str_replace('{URL}', '\\1', $bbcode_tpl['left']);
	$bbcode_tpl['right'] = str_replace('{URL}', '\\1', $bbcode_tpl['right']);
// LEFT-RIGHT-end

	// We do URLs in several different ways..
	$bbcode_tpl['url1'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']);
	$bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url1']);

	$bbcode_tpl['url2'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);
	$bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']);

	$bbcode_tpl['url3'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']);
	$bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']);

	$bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']); 
	$bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']);

	$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
	$bbcode_tpl['show'] = str_replace('{HTEXTE}', '\\1', $bbcode_tpl['show']);

//+MOD: Select Expand BBcodes MOD
	global $phpbb_root_path;
	$u_sxbb_jslib = $phpbb_root_path . 'templates/select_expand_bbcodes.js';
	// Replacing BBCode variables, but also adding CR to preserve HTML comment delimiters for JS code.
	$expand_ary1 = array('<!--', '//-->', '{L_SELECT}', '{L_EXPAND}', '{L_CONTRACT}', '{U_SXBB_JSLIB}');
	$expand_ary2 = array("\r<!--\r", "\r//-->\r", $lang['Select'], $lang['Expand'], $lang['Contract'], $u_sxbb_jslib);
	$expand_ary3 = array('<!--', '//-->');
	$expand_ary4 = array("\r<!--\r", "\r//-->\r");

	$bbcode_tpl['quote_open'] = str_replace($expand_ary1, $expand_ary2, $bbcode_tpl['quote_open']);
	$bbcode_tpl['quote_username_open'] = str_replace($expand_ary1, $expand_ary2, $bbcode_tpl['quote_username_open']);
	$bbcode_tpl['code_open'] = str_replace($expand_ary1, $expand_ary2, $bbcode_tpl['code_open']);

	$bbcode_tpl['quote_close'] = str_replace($expand_ary3, $expand_ary4, $bbcode_tpl['quote_close']);
	$bbcode_tpl['code_close'] = str_replace($expand_ary3, $expand_ary4, $bbcode_tpl['code_close']);
//-MOD: Select Expand BBcodes MOD
	define("BBCODE_TPL_READY", true);

	return $bbcode_tpl;
}


function hide_in_quote($text)
{
        $text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","--- phpBB : The Protected Message is not copied in this quote --
-", $text);
        return $text;
}

function bbencode_third_pass($text, $uid, $deprotect)
{
        global $bbcode_tpl;

        // pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
        // This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
        $text = " " . $text;

        // First: If there isn't a "[" and a "]" in the message, don't bother.
        if (! (strpos($text, "[") && strpos($text, "]")) )
        {
                // Remove padding, return.
                $text = substr($text, 1);
                return $text;
        }
        // Patterns and replacements for URL and email tags..
        $patterns = array();
        $replacements = array();
 
        if ( $deprotect ) {
        $patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
        $replacements[0] = $bbcode_tpl['show'];
        }
        else
        {
        $patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
        $replacements[0] = $bbcode_tpl['hide'];
        }

        $text = preg_replace($patterns, $replacements, $text);
 
        // Remove our padding from the string..
        $text = substr($text, 1);

        return $text;
}

I can't see any errors in my bbcode.tpl im guessing there is just an error
in the php file somewhere above ..

Parse error: parse error, unexpected '>' :?


Can you see it at all

Posted: Thu Oct 28, 2004 3:09 pm
by wang5555
markus_petrux wrote:
wang5555 wrote:Below is two main wrong news:

Code: Select all

Wrong: 'SXBB' not yet defines

Make sure you have uploaded the select_expand_bbcodes.js file to your templates folder.

Hi, dear author:

I am successful.

Thank you very much! :D

Below is my MOD:
#
#-----[ OPEN ]----------
#
templates/select_expand_bbcodes.js

#
#-----[ FIND ]----------
#

Code: Select all

return '&nbsp;?nbsp;<a class="genmed" style="text-decoration:none;" href="javascript:void(0)" onclick="SXBB[\''+this.id+'\'].'+cmd+'(\''+txt+'\');" onfocus="this.blur();"><b>'+txt+'</b></a>&nbsp;?;
#
#-----[REPLACE]----------
#

Code: Select all

return '<a class="genmed" style="text-decoration:none;" href="javascript:void(0)" onclick="SXBB[\''+this.id+'\'].'+cmd+'(\''+txt+'\');" onfocus="this.blur();"><b>'+txt+'</b></a>';
Demo
http://61.70.203.175/phpbb2/viewtopic.php?t=9165

Posted: Thu Oct 28, 2004 3:14 pm
by markus_petrux
richard_5421 wrote: I can't see any errors in my bbcode.tpl im guessing there is just an error in the php file somewhere above ..

Parse error: parse error, unexpected '>' :?

Can you see it at all

There's seomthing wrong in your bbcode.tpl file, though. Find this:

Code: Select all

<!-- BEGIN quote_username_open --><table class="bodyline" width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
And replace with:

Code: Select all

<!-- BEGIN quote_username_open --></span>
<table class="bodyline" width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
Find this:

Code: Select all

<!-- BEGIN quote_open --><table class="bodyline" width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
And replace with:

Code: Select all

<!-- BEGIN quote_open --></span>
<table class="bodyline" width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
Find this:

Code: Select all

</table><!-- END quote_close -->
And replace with:

Code: Select all

</table>
<span class="postbody"><!-- END quote_close -->
I can't see anything wrong in your bbcode.php file. :?

Maybe the problem is somewhere else. Try to remove this MOD and test. Works? ...then try reinstalling this MOD again. Works?

It's really difficult to figure out these kind of problems without access to the system files.


wang5555: Glad it's working.

Posted: Thu Oct 28, 2004 9:25 pm
by richard_5421
I think it must be some other files, because with the original bbcode.php
file here not with this mod added and the bbcode.tpl file modded added
I get the error. :cry:

Posted: Thu Oct 28, 2004 9:51 pm
by markus_petrux
richard_5421:
1) Make backups of your files, now.
2) Restore both, fresh copies of bbcode.php and bbcode.tpl
3) Reinstall all BBCode related MODs one by one.

...and good luck ;)

Posted: Thu Oct 28, 2004 11:23 pm
by richard_5421
ha :P

I'll leave it, i'll be doing it for days :wink:

Its okay, nice MOD but i'll leave it for now...

Posted: Fri Nov 19, 2004 3:04 am
by drumstix42
I wonder would it be possibly that instead of have a distinct defaulet set size (like the file you include is set at 40). How about making so I set it something like 90, that if what is posted using it is very small and doesn't even fill up the 90 it would downsize?

I find that it's nice to have the expand/collapse dissappear if it's pretty close after expanding the first time. But for things like quotes or code in maybe like a signature, I tried changing the 40 to a 90, but now things that are only 1-3 lines have a box that's a little too big.

Thanx for any input. I'll try messing around with it for now.

Posted: Fri Nov 19, 2004 5:12 am
by markus_petrux
There's no easy way to automatically downsize the height of the layer. AFAIK, the required height can't be computed.

So, I just documented several parameters in the javascript that affect the expand/contract behaviour for you to play with and adapt to your own needs.

That's all can do here, I'm afraid.

Posted: Sat Nov 20, 2004 9:16 pm
by onigumo
Your MOD works great, markus_petrux, and I've just installed it on four of the five templates I have installed on my forum.

I was wondering if you could make instructions for installation of this MOD in the redIce template.

Posted: Sat Nov 20, 2004 9:37 pm
by markus_petrux
Give me a link to download redIce and I'll see what can I do.

I'm very busy right now, though. :?

Posted: Sat Nov 20, 2004 9:40 pm
by onigumo

Posted: Sun Nov 21, 2004 2:41 am
by markus_petrux
Hopefully you may know a bit of HTML in case I introduced any mistakes while writing it. What does that mean? ...correct! I haven't tested the result. ;)

Here we go... to make this MOD work on redIce by vereor... just modify the file bbcode.tpl with the following changes instead of those described in the MOD installation script.

Code: Select all

#
# ---[ OPEN ]----------
#
templates/redIce/bbcode.tpl
#
# ---[ FIND ]----------
#
  <!-- BEGIN quote_username_open -->
  <blockquote><span class="smalltext">
quote:</span> 
  <hr>
  <i>Originally posted by {USERNAME}</i><br>
<!-- END quote_username_open -->
    <!-- BEGIN quote_open -->
<hr>
</blockquote>
<blockquote>
<span class="smalltext">
    quote:</span> 
    <hr>
    <!-- END quote_open -->
    <!-- BEGIN quote_close -->
<hr>
</blockquote>
      <!-- END quote_close -->
      <!-- BEGIN code_open -->
<blockquote>
    <span class="smalltext">code:</span> 
    <hr><font face="Courier">
    <!-- END code_open -->
    <!-- BEGIN code_close -->
</font>
    <hr>
    <br>
</blockquote>
    <!-- END code_close -->
#
# ---[ REPLACE WITH ]----------
#
  <!-- BEGIN quote_username_open -->
  <blockquote><span class="smalltext">
quote: <script type="text/javascript" src="{U_SXBB_JSLIB}"></script>
<script type="text/javascript">
<!--
	var id = 'SXBB' + (1000 + Math.floor(Math.random() * 5000));
	SXBB[id] = new _SXBB(id);
	SXBB[id].T['select'] = '{L_SELECT}';
	SXBB[id].T['expand'] = '{L_EXPAND}';
	SXBB[id].T['contract'] = '{L_CONTRACT}';
	SXBB[id].writeCmd();
//-->
</script></span> 
  <hr>
  <i>Originally posted by {USERNAME}</i><br>
<script type="text/javascript">
<!--
	SXBB[id].writeDiv();
//-->
</script>
<!-- END quote_username_open -->
    <!-- BEGIN quote_open -->
<hr>
</blockquote>
<blockquote>
<span class="smalltext">
quote: <script type="text/javascript" src="{U_SXBB_JSLIB}"></script>
<script type="text/javascript">
<!--
	var id = 'SXBB' + (1000 + Math.floor(Math.random() * 5000));
	SXBB[id] = new _SXBB(id);
	SXBB[id].T['select'] = '{L_SELECT}';
	SXBB[id].T['expand'] = '{L_EXPAND}';
	SXBB[id].T['contract'] = '{L_CONTRACT}';
	SXBB[id].writeCmd();
//-->
</script></span> 
    <hr><script type="text/javascript">
<!--
	SXBB[id].writeDiv();
//-->
</script>
    <!-- END quote_open -->
    <!-- BEGIN quote_close -->
<script type="text/javascript">
<!--
	document.write('</div>');
//-->
</script>
<hr>
</blockquote>
      <!-- END quote_close -->

      <!-- BEGIN code_open -->
<blockquote>
    <span class="smalltext">code: <script type="text/javascript" src="{U_SXBB_JSLIB}"></script>
<script type="text/javascript">
<!--
	var id = 'SXBB' + (1000 + Math.floor(Math.random() * 5000));
	SXBB[id] = new _SXBB(id);
	SXBB[id].T['select'] = '{L_SELECT}';
	SXBB[id].T['expand'] = '{L_EXPAND}';
	SXBB[id].T['contract'] = '{L_CONTRACT}';
	SXBB[id].writeCmd();
//-->
</script></span> 
    <hr><script type="text/javascript">
<!--
	SXBB[id].writeDiv();
//-->
</script><font face="Courier">
    <!-- END code_open -->
    <!-- BEGIN code_close -->
</font>
<script type="text/javascript">
<!--
	document.write('</div>');
//-->
</script>
    <hr>
    <br>
</blockquote>
    <!-- END code_close -->
#
# ---[ SAVE ]----------
#
:?: :roll:

Posted: Sun Nov 21, 2004 2:53 am
by onigumo
The one for code isn't complete. Here's a screen shot of after I made the edit: http://pb.exocrew.com/haruko/download.php?id=96

And here's all the code taken from bbcode.tpl after the editing:
<!-- BEGIN ulist_open -->
<ul>
<!-- END ulist_open -->
<!-- BEGIN ulist_close -->
</ul>
<!-- END ulist_close -->


<!-- BEGIN olist_open -->
<ol type="{LIST_TYPE}">
<!-- END olist_open -->
<!-- BEGIN olist_close -->
</ol>
<!-- END olist_close -->

<!-- BEGIN listitem -->
<li>
<!-- END listitem -->

<!-- BEGIN quote_username_open -->
<blockquote><span class="smalltext">
quote: <script type="text/javascript" src="{U_SXBB_JSLIB}"></script>
<script type="text/javascript">
<!--
var id = 'SXBB' + (1000 + Math.floor(Math.random() * 5000));
SXBB[id] = new _SXBB(id);
SXBB[id].T['select'] = '{L_SELECT}';
SXBB[id].T['expand'] = '{L_EXPAND}';
SXBB[id].T['contract'] = '{L_CONTRACT}';
SXBB[id].writeCmd();
//-->
</script></span>
<hr>
<i>Originally posted by {USERNAME}</i><br>
<script type="text/javascript">
<!--
SXBB[id].writeDiv();
//-->
</script>
<!-- END quote_username_open -->
<!-- BEGIN quote_open -->
<hr>
</blockquote>
<blockquote>
<span class="smalltext">
quote: <script type="text/javascript" src="{U_SXBB_JSLIB}"></script>
<script type="text/javascript">
<!--
var id = 'SXBB' + (1000 + Math.floor(Math.random() * 5000));
SXBB[id] = new _SXBB(id);
SXBB[id].T['select'] = '{L_SELECT}';
SXBB[id].T['expand'] = '{L_EXPAND}';
SXBB[id].T['contract'] = '{L_CONTRACT}';
SXBB[id].writeCmd();
//-->
</script></span>
<hr><script type="text/javascript">
<!--
SXBB[id].writeDiv();
//-->
</script>
<!-- END quote_open -->
<!-- BEGIN quote_close -->
<script type="text/javascript">
<!--
document.write('</div>');
//-->
</script>
<hr>
</blockquote>
<!-- END quote_close -->

<!-- BEGIN code_open -->
<blockquote>
<span class="smalltext">code:</span>
<hr><script type="text/javascript">
<!--
SXBB[id].writeDiv();
//-->
</script><font face="Courier">
<!-- END code_open -->
<!-- BEGIN code_close -->
</font>
<script type="text/javascript">
<!--
document.write('</div>');
//-->
</script>
<hr>
<br>
</blockquote>
<!-- END code_close -->


<!-- BEGIN b_open -->
<span style="font-weight: bold">
<!-- END b_open -->
<!-- BEGIN b_close -->
</span>
<!-- END b_close -->

<!-- BEGIN s_open --><span><s><!-- END s_open -->
<!-- BEGIN s_close --></s></span><!-- END s_close -->

<!-- BEGIN ref_dict --><a href="http://dictionary.reference.com/search?q={QUERY}" target="_blank">{STRING}</a><!-- END ref_dict -->
<!-- BEGIN ref_thes --><a href="http://thesaurus.reference.com/search?q={QUERY}" target="_blank">{STRING}</a><!-- END ref_thes -->
<!-- BEGIN ref_trans --><a href="http://babelfish.altavista.com/babelfis ... ext={QUERY}" target="_blank">{STRING}</a><!-- END ref_trans -->

<!-- BEGIN tab --><pre style="display:inline;"> </pre><!-- END tab -->


<!-- BEGIN flash --><!-- URL's used in the movie-->
<!-- text used in the movie-->
<!-- -->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shoc ... on=5,0,0,0"
WIDTH={WIDTH} HEIGHT={HEIGHT}>
<PARAM NAME=movie VALUE="{URL}"> <PARAM NAME=loop VALUE={LOOP}> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=noborder> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#000000> <EMBED src="{URL}" loop={LOOP} quality=high scale=noborder wmode=transparent bgcolor=#000000 WIDTH={WIDTH} HEIGHT={HEIGHT} TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/dow ... h"></EMBED>
</OBJECT><!-- END flash -->

<!-- BEGIN cf --><!-- URL's used in the movie-->
<!-- text used in the movie-->
<!-- -->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shoc ... on=5,0,0,0">
<PARAM NAME=movie VALUE="{URL}"> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=noborder> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#000000> <EMBED src="{URL}" quality=high scale=noborder wmode=transparent bgcolor=#000000 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/dow ... h"></EMBED>
</OBJECT><!-- END cf -->


<!-- BEGIN u_open -->
<span style="text-decoration: underline">
<!-- END u_open -->
<!-- BEGIN u_close -->
</span>
<!-- END u_close -->

<!-- BEGIN i_open -->
<span style="font-style: italic">
<!-- END i_open -->
<!-- BEGIN i_close -->
</span>
<!-- END i_close -->

<!-- BEGIN color_open -->
<span style="color: {COLOR}">
<!-- END color_open -->
<!-- BEGIN color_close -->
</span>
<!-- END color_close -->

<!-- BEGIN size_open -->
<span style="font-size: {SIZE}; line-height: normal">
<!-- END size_open -->
<!-- BEGIN size_close -->
</span>
<!-- END size_close -->

<!-- BEGIN img -->
<img src="{URL}" border="0">
<!-- END img -->

<!-- BEGIN url -->
<a href="{URL}" target="_blank" class="postlink">{DESCRIPTION}</a>
<!-- END url -->

<!-- BEGIN email -->
<a href="mailto:{EMAIL}">{EMAIL}</A>
<!-- END email -->

<!-- BEGIN ruby --><ruby><rb>{BASE}</rb><rp>(</rp><rt>{RUBY}</rt><rp>)</rp></ruby><!-- END ruby -->

<!-- BEGIN glow_open --><span style="filter: glow(color={GLOWCOLOR}); height:20"><!-- END glow_open -->
<!-- BEGIN glow_close --></span><!-- END glow_close -->

<!-- BEGIN shadow_open --><span style="filter: shadow(color={SHADOWCOLOR}); height:20"><!-- END shadow_open -->
<!-- BEGIN shadow_close --></span><!-- END shadow_close -->

<!-- BEGIN php_open -->
</span>
<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1">
<tr>
<td><span class="genmed"><b>{L_PHP}:</b></span></td>
</tr>
<tr>
<td class="code">
<!-- END php_open -->
<!-- BEGIN php_close -->
</td>
</tr>
</table>
<span class="postbody">
<!-- END php_close -->