[2.0.6] Anchor BBCode

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
4
44%
Very Good
2
22%
Good
1
11%
Fair
0
No votes
Poor
2
22%
 
Total votes: 9

User avatar
BondGamer
Registered User
Posts: 435
Joined: Mon Dec 15, 2003 7:49 pm
Contact:

Post by BondGamer » Thu Jul 22, 2004 6:15 pm

I finally got this mod installed with a bit of hand coding. But the mouseover help doesn't show up. I checked the lang_main file and the text is there for the help.

User avatar
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux » Sun Nov 14, 2004 10:16 pm

Hi!

Any chance to get an upgraded version of this MOD compatible with Multiple BBCode MOD 1.4.0c?


Cheers
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

abajan
Registered User
Posts: 1
Joined: Sun Dec 19, 2004 1:53 am
Location: Barbados

Post by abajan » Thu Jan 13, 2005 12:27 am

madnessmotors wrote: can we see a demo or something?...


I'm sure this isn't the first time this question has been asked regarding a MOD.

I've been looking through the MOD database and some of them look like they would be pretty useful but it would be nice to see them in action on a bulletin board before I use them on my own board.

Why not add 'Example' or 'Demo' to the format for submitting MODs?

This is what I mean:

MOD Name:
Author:
MOD Description:
MOD Version:
Installation Level:
Installation Time:
Example:

Download File:
File Size:

User avatar
ataylor20
Registered User
Posts: 189
Joined: Fri Apr 30, 2004 6:21 pm

Post by ataylor20 » Thu Jan 20, 2005 5:30 pm

cmisker wrote: Mmm... weird. I'm installing with EasyMod (your latest version) and I get this error:
Critical Error

FIND FAILED: In file [posting.php] could not find:

$EMBB_keys = array(''
$EMBB_widths = array(''
$EMBB_values = array(''

MOD script line #62


Your mod says this:

Code: Select all

# 
#-----[ FIND ]--------------------------------- 
# 
$EMBB_keys = array('' 
$EMBB_widths = array('' 
$EMBB_values = array('' 
My posting.php says this:

Code: Select all

$EMBB_keys = array('','x') ;
$EMBB_widths = array('','40') ;
$EMBB_values = array('',$lang['PHPCode']) ;
Looks to me it shouldn't have any trouble finding it... but somehow, it does..

Anyone know where I should start looking?
(Ofcourse... I could do this manually, but that's not what's easy mod is for. :P)


I do not see any advice on how to over come this problem? I have the same search problems and I am not using Subsliver. I have updeated to the Multi Quick BBCode Mod (1.2.1+).

I am also using firefox and would like to know if this does or does not work with it.

Thanks...

goa103
Registered User
Posts: 21
Joined: Thu May 27, 2004 3:05 pm

Re: Huh?

Post by goa103 » Sun Mar 06, 2005 5:43 pm

Makc666 wrote: First of all you couldn't find it because you DIDN'T READ here on forum instructions of how to install mods.


Where can we find these instructions ? I read the These guide tells you what each action in the MOD Template means, helping you install MODs article and couldn't find a solution to that not found problem.

As other users I can't find the $EMBB_keys string in the posting.php and yes I installed the Multiple BBCode MOD. I found the other lines in the includes/bbcode.php file.

mac-rolec
Registered User
Posts: 16
Joined: Sat Jun 18, 2005 5:34 pm
Location: Netherlands
Contact:

Post by mac-rolec » Sat Jun 18, 2005 5:38 pm

I have the same problem. It can not find that $EMBB_ string and there is nothing in posting.php that even looks like it.

I think it may be because this mod is not compatible with multi bbcode 1.4.0.

I hope the author will fix it.

humanbot
Registered User
Posts: 29
Joined: Wed Jul 13, 2005 6:22 pm

Post by humanbot » Wed Jul 20, 2005 12:55 am

I am no expert by any strech of imagination. Still i think since in multi BB mod
$EMBB_keys = array('') ;
$EMBB_widths = array('') ;
$EMBB_values = array('') ;


is replaced by a function
Multi_BBCode();
defined in includes directory.
i think if changes same are made there every thing shld work as expected.

but i am no expert therefore i am asking too...

mac-rolec
Registered User
Posts: 16
Joined: Sat Jun 18, 2005 5:34 pm
Location: Netherlands
Contact:

Post by mac-rolec » Sun Aug 14, 2005 11:45 am

I found a solution to this problem.

The $EMBB_ strings are not in posting.php, but in includes/bbcode.php

In includes/bbcode.php, you have to find this part:

Code: Select all

// MULTI BBCODE-begin
function Multi_BBCode()
{
	global $template, $lang;

	// DO NOT CHANGE THIS ARRAY
	$hotkeys = array('', 'd', 'e', 'g', 'h', 'j', 'k', 'm', 'n', 'r', 't', 'v', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0');

	//NOTE: the first element of each array must be ''   Add new elements AFTER the ''
	$EMBB_widths = array('') ;
	$EMBB_values = array('') ;
	for ($i=1; $i<count($EMBB_values); $i++)
	{
		// load BBcode MODs info
		$val = ($i*2)+16 ;
		$help_lang = ( !empty($lang['bbcode_help'][(strtolower($EMBB_values[$i]))]) ) ? $lang['bbcode_help'][(strtolower($EMBB_values[$i]))] : $lang['bbcode_help'][$EMBB_values[$i]];
		$template->assign_block_vars('MultiBB', array(
			'KEY' => $hotkeys[$i],
			'NAME' => "addbbcode$val",
			'HELP' => sprintf($help_lang, $hotkeys[$i]),
			'WIDTH' => $EMBB_widths[$i],
			'VALUE' => $EMBB_values[$i],
			'STYLE' => "bbstyle($val)")
		);
	}
}
// MULTI BBCODE-end
Here you can find this part:

Code: Select all

$EMBB_widths = array('') ;
	$EMBB_values = array('') ;
You fill in the values here written in the manual for the anchor mod:

Code: Select all

$EMBB_widths = array('','60','40','80') ;
	$EMBB_values = array('','Anchor','Goto','Gotopost') ;
There will be more values if you have installed more mods.

Note: As you can see you don't have to fill in the $EMBB_keys part, because the hotkeys are already defined (see first quote: $hotkeys = array('', 'd', 'e', 'g', 'h', 'j', 'k', 'm', 'n', 'r', 't', 'v', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0');)

After this you just continue the manual of the anchor mod, just like it says there. :wink:

My english can be poor because I am Dutch. 8)

Too bad this mod only works in IE and not in Firefox.

mac-rolec
Registered User
Posts: 16
Joined: Sat Jun 18, 2005 5:34 pm
Location: Netherlands
Contact:

Post by mac-rolec » Sun Aug 14, 2005 12:17 pm

Even better. I rewrote the mod a little so you can see the changes better and it works with multi bbcode 1.4.0. too (i don't know if this is allowed).

I did not test this with Easymod, I suggest you just do it manually!!

I tested it only on my forum and it works fine.

Don't forget to backup first!

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
posting.php

#
#-----[ FIND ]------------------------------------------
#
'L_EMPTY_MESSAGE' => $lang['Empty_message'],

#
#-----[ BEFORE, ADD ]------------------------------------------
#

	'L_BBCODE_2_HELP' => $lang['bbcode_2_help'],
	'L_BBCODE_3_HELP' => $lang['bbcode_3_help'],
	'L_BBCODE_4_HELP' => $lang['bbcode_4_help'],

#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php

# 
#-----[ FIND ]--------------------------------- 
# 
$EMBB_widths = array('' 
$EMBB_values = array('' 

# 
#-----[ IN-LINE FIND ]--------------------------------- 
# 
$EMBB_widths = array('' 


# 
#-----[ IN-LINE AFTER, ADD ]--------------------------------- 
# 
,'60','40','80' 


# 
#-----[ IN-LINE FIND ]--------------------------------- 
# 
$EMBB_values = array('' 


# 
#-----[ IN-LINE AFTER, ADD ]--------------------------------- 
# 
,'Anchor','Goto','Gotopost'

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

#
#-----[ AFTER, ADD ]------------------------------------------
#

	$bbcode_tpl['anchor'] = str_replace('{URL}', '#%s_\\1', $bbcode_tpl['anchor']); 

	$bbcode_tpl['goto_open_1'] = str_replace('{URL}', '#\\1', $bbcode_tpl['goto_open']); 
	$bbcode_tpl['goto_open_2'] = str_replace('{URL}', '#%s_\\1', $bbcode_tpl['goto_open']); 
	$bbcode_tpl['goto_open_3'] = str_replace('{URL}', '#\\1_\\2', $bbcode_tpl['goto_open']); 

	global $phpEx;
	$bbcode_tpl['gotopost_open_1'] = str_replace('{URL}', append_sid("viewtopic.$phpEx?p=" . '\\1') . '#\\1', $bbcode_tpl['gotopost_open']); 
	$bbcode_tpl['gotopost_open_2'] = str_replace('{URL}', append_sid("viewtopic.$phpEx?p=" . '\\1') . '#\\1_\\2', $bbcode_tpl['gotopost_open']);

#
#-----[ FIND ]------------------------------------------
#
$text = str_replace("[/size:$uid]", $bbcode_tpl['size_close'], $text);

#
#-----[ AFTER, ADD ]------------------------------------------
#

	$post_id = ( isset($GLOBALS['postrow'][$GLOBALS['i']]['post_id']) ) ? $GLOBALS['postrow'][$GLOBALS['i']]['post_id'] : ( ( isset($GLOBALS['post_id']) ) ? $GLOBALS['post_id'] : 0 ); 

	// anchor 
	$text = preg_replace("/\[anchor:$uid\]([a-zA-Z]\w*?)\[\/anchor:$uid\]/si", sprintf($bbcode_tpl['anchor'],$post_id), $text); 

	// goto 
	$text = preg_replace("/\[goto=([\d]+?):$uid\]/si", $bbcode_tpl['goto_open_1'], $text); 
	$text = preg_replace("/\[goto=([a-zA-Z]\w*?):$uid\]/si", sprintf($bbcode_tpl['goto_open_2'],$post_id), $text); 
	$text = preg_replace("/\[goto=([\d]+?),([a-zA-Z]\w*?):$uid\]/si", $bbcode_tpl['goto_open_3'], $text); 
	$text = str_replace("[/goto:$uid]", $bbcode_tpl['goto_close'], $text); 

	// goto post 
	$text = preg_replace("/\[gotopost=([\d]+?):$uid\]/si", $bbcode_tpl['gotopost_open_1'], $text); 
	$text = preg_replace("/\[gotopost=([\d]+?),([a-zA-Z]\w*?):$uid\]/si", $bbcode_tpl['gotopost_open_2'], $text); 
	$text = str_replace("[/gotopost:$uid]", $bbcode_tpl['gotopost_close'], $text);

#
#-----[ FIND ]------------------------------------------
#
$text = preg_replace("#\[size=([1-2]?[0-9])\](.*?)\[/size\]#si", "[size=\\1:$uid]\\2[/size:$uid]", $text);

#
#-----[ AFTER, ADD ]------------------------------------------
#

	// [goto] and [gotopost] and [anchor] 
	$text = preg_replace("#\[anchor\]([a-zA-Z]\w*?)\[/anchor\]#si", "[anchor:$uid]\\1[/anchor:$uid]", $text); 

	$text = preg_replace("#\[goto=([\d]+?)\](.*?)\[/goto\]#si", "[goto=\\1:$uid]\\2[/goto:$uid]", $text); 
	$text = preg_replace("#\[goto=([a-zA-Z]\w*?)\](.*?)\[/goto\]#si", "[goto=\\1:$uid]\\2[/goto:$uid]", $text); 
	$text = preg_replace("#\[goto=([\d]+?),([a-zA-Z]\w*?)\](.*?)\[/goto\]#si", "[goto=\\1,\\2:$uid]\\3[/goto:$uid]", $text); 

	$text = preg_replace("#\[gotopost=([\d]+?)\](.*?)\[/gotopost\]#si", "[gotopost=\\1:$uid]\\2[/gotopost:$uid]", $text); 
	$text = preg_replace("#\[gotopost=([\d]+?),([a-zA-Z]\w*?)\](.*?)\[/gotopost\]#si", "[gotopost=\\1,\\2:$uid]\\3[/gotopost:$uid]", $text); 

#
#-----[ OPEN ]------------------------------------------
# You need to do this for all of your installed template styles
#
templates/subSilver/bbcode.tpl

#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN size_close --></span><!-- END size_close -->

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- BEGIN anchor --><a name="{URL}"></a><!-- END anchor --> 

<!-- BEGIN goto_open --><a href="{URL}"><!-- END goto_open --> 
<!-- BEGIN goto_close --></a><!-- END goto_close --> 

<!-- BEGIN gotopost_open --><a href="{URL}"><!-- END gotopost_open --> 
<!-- BEGIN gotopost_close --></a><!-- END gotopost_close -->

#
#-----[ OPEN ]------------------------------------------
# You need to do this for all of your installed template styles
# 
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]------------------------------------------
#
f_help = "{L_BBCODE_F_HELP}";

#
#-----[ AFTER, ADD ]------------------------------------------
#

n2_help = "{L_BBCODE_2_HELP}";
n3_help = "{L_BBCODE_3_HELP}";
n4_help = "{L_BBCODE_4_HELP}";

#
#-----[ FIND ]---------------------------------
#
# NOTE: the actual line to find is MUCH longer, containing all the bbcode tags
#
bbtags = new Array(

#
#-----[ IN-LINE FIND ]---------------------------------
#
'[url]','[/url]'

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
,'[anchor]','[/anchor]','[goto=]','[/goto]','[gotopost=]','[/gotopost]'


#
#-----[ OPEN ]------------------------------------------
# You need to do this for all installed languages
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
# Full line in English is: $lang['bbcode_f_help'] = 'Font size: [size=x-small]small text[/size]';
# 
$lang['bbcode_f_help'] =

#
#-----[ AFTER, ADD ]------------------------------------------
# You need to do this for all installed languages
#
$lang['bbcode_2_help'] = 'Anchor: [anchor]name[/anchor]';
$lang['bbcode_3_help'] = 'Goto: [goto=name]text[/goto] [goto=post]text[/goto] [goto=post,name]text[/goto]';
$lang['bbcode_4_help'] = 'Gotopost: [gotopost=post]text[/goto] [gotopost=post,name]text[/goto]';

#
#-----[ OPEN ]------------------------------------------
# You need to do this for all installed languages
# 
language/lang_english/lang_bbcode.php

#-----[ FIND ]------------------------------------------
# Full line in English is too long too be included here
#
$faq[] = array("How to change the text colour or size", "

#
#-----[ AFTER, ADD  ]------------------------------------------
# 
// Anchor start
$faq[] = array("How to make anchors and link inside posts","This board has anchoring and linking within posts enabled.<ul><li>To make anchors within your posts, just specify <b>[anchor]</b><i>anchorname</i><b>[/anchor]</b>.</li><li>To link to that anchor:<ol type=\"1\"><li>From within that post, use <b>[goto=<i>anchorname</i>]</b>text<b>[/goto]</b>.</li><li>From another post on the same page, use <b>[goto=<i>postnum</i>,<i>anchorname</i>]</b>text<b>[/goto]</b>.</li><li>From another post on a different page, use <b>[gotopost=<i>postnum</i>,<i>anchorname</i>]</b>text<b>[/gotopost]</b>.</li></ol></li><li>You can also use goto and gotopost to link to the top of any post:<ol type=\"1\"><li> <b>[goto=<i>postnum</i>]</b>text<b>[/goto]</b> if the other post is on the same page,</li><li>Otherwise use <b>[gotopost=<i>postnum</i>]</b>text<b>[/gotopost]</b></li></ol>.</li></ul>");

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

User avatar
davidooh
Registered User
Posts: 135
Joined: Wed May 25, 2005 1:14 am
Location: Jacksonville, FL

Post by davidooh » Wed Sep 21, 2005 2:47 pm

Can someone repost the link to download this? When I select the one on the first page I get cannot connect IE error. Thanks in advance!

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers » Tue Nov 08, 2005 5:57 am

I ran into one very unexpected problem with this mod. It doesn't work with Firefox. It's hard to believe that Firefox doesn't support text anchors. Any suggestions for making this compatible?

User avatar
Lucas Malor
Registered User
Posts: 143
Joined: Tue Jun 28, 2005 7:12 pm
Contact:

Post by Lucas Malor » Sun Nov 13, 2005 6:27 pm

This mod does not works with phpbb 2.0.18.

Error with EasyMod:
Critical Error

FIND FAILED: In file [posting.php] could not find:

$EMBB_keys = array(''
$EMBB_widths = array(''
$EMBB_values = array(''

User avatar
MHobbit
Former Team Member
Posts: 4761
Joined: Thu Mar 18, 2004 5:32 pm
Location: There and Back Again

Post by MHobbit » Sun Nov 13, 2005 7:33 pm

Erm, yes it does work with 2.0.18. You just don't have the necessary Multiple BBCodes MOD installed. :wink:

Look in any of the other threads you posted with the same error for a link...
Former phpBB MOD Team member
No private support is offered.
"There’s too many things to get done, and I’m running out of days..."

User avatar
Lucas Malor
Registered User
Posts: 143
Joined: Tue Jun 28, 2005 7:12 pm
Contact:

Post by Lucas Malor » Mon Nov 14, 2005 9:39 pm

EM shows me this error also with Multi BBCode mod version 1.4.0c installed.

mac-rolec
Registered User
Posts: 16
Joined: Sat Jun 18, 2005 5:34 pm
Location: Netherlands
Contact:

Post by mac-rolec » Tue Nov 22, 2005 11:48 am

If you had read the post about 6 posts above yours, you had seen there is a solution to this problem (anchor mod is not compatible with multi bbcode 1.4.0c). :wink:

Post Reply

Return to “[2.0.x] MOD Database Cleanup”

Who is online

Users browsing this forum: No registered users and 6 guests