- Posts: 2
- Thank you received: 0
Kunena 7.0.4 Released
The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0
Before posting new topics in this category
K 1.5.x Support: Please read this first.
Question Translating BBCode
- NetPortaal
-
Topic Author
- Offline
- New Member
-
Less
More
15 years 8 months ago #58894
by NetPortaal
Translating BBCode was created by NetPortaal
I want to use Afrikaans BBCode on my forum and so I went to parser.php and added the translations as required, e.g.
V stands for "vet" (Afrikaans, "bold")
I have done so for the other BBCodes as well, but when I come to the more complicated ones, e.g. for images (which take parameters), the BBCode does not work on the forum. This is what I did with the image BBCode (the same as for the bold one):
And now when I go on the forum and type [beeld]image location[/beeld], it just doesn't parse at all. Look at this post: www.netportaal.com/forums/14-musiek/186-...die-vloed-nuwe-album
What the parser has done with it, is only hyperlink the URL of the image, leading me to think that it doesn't detect the BBCode at all:
However, a person can still use the image tag, for some reason! Look at www.netportaal.com/forums/71-fotos-van-o...e/125-hoe-lyk-jy#134
Why could this be? Do I need to translate the tags in more than one place? I don't understand why I can translate the tag but not the [image] tag.
I would greatly appreciate it if anyone could help me in this regard!
Code:
case 'b':
case 'v':
$tns = "<b>"; $tne = '</b>';
return TAGPARSER_RET_REPLACED;
break;
V stands for "vet" (Afrikaans, "bold")
I have done so for the other BBCodes as well, but when I come to the more complicated ones, e.g. for images (which take parameters), the BBCode does not work on the forum. This is what I did with the image BBCode (the same as for the bold one):
Code:
case 'beeld':
case 'img':
if($between) {
static $file_ext = null;
$matches = null;
if (empty($file_ext)) {
$params = &JComponentHelper::getParams( 'com_media' );
$file_ext = explode(',', $params->get('upload_extensions'));
}
preg_match('/\.([\w\d]+)$/', $between, $matches);
if (!in_array(strtolower($matches[1]), $file_ext)) break;
$tempstr = kunena_htmlspecialchars($between, ENT_QUOTES);
if ($kunena_my->id==0 && $fbConfig->showimgforguest) {
// Hide between content from non registered users
$tag_new = '<br/><b>' . _KUNENA_BBCODE_HIDEIMG . '</b>';
} else {
$task->autolink_disable--; # continue autolink conversion
// Make sure we add image size if specified and while we are
// at it also set maximum image width from text width config.
//
// NOTICE: image max variables from config are not intended
// for formating but to limit the size of uploads, which can
// be larger than the available post area to support super-
// sized popups.
$imgmaxsize = (int)(($fbConfig->rtewidth * 9) / 10); // 90% of text width
$imgtagsize = isset($tag->options["size"]) ? (int)kunena_htmlspecialchars($tag->options["size"]) : 0;
if($imgtagsize>0 && $imgtagsize<$imgmaxsize)
{
$imgmaxsize = $imgtagsize;
}
// Need to check if we are nested inside a URL code
if($task->autolink_disable == 0)
{
// This part: <div style=\"table-layout:fixed; display:table;\"> ... </div> compliments of IE8
$tag_new = "<a href='".$tempstr."' rel=\"lightbox\"><img src='".$tempstr.($imgtagsize ?"' width='".$imgmaxsize:'')."' style='max-width:".$imgmaxsize."px; ' alt='' /></a>";
} else {
// This part: <div style=\"table-layout:fixed; display:table;\"> ... </div> compliments of IE8
$tag_new = "<img src='".$tempstr.($imgtagsize ?"' width='".$imgmaxsize:'')."' style='max-width:".$imgmaxsize."px; ' alt='' />";
}
}
return TAGPARSER_RET_REPLACED;
}
return TAGPARSER_RET_NOTHING;
break;
And now when I go on the forum and type [beeld]image location[/beeld], it just doesn't parse at all. Look at this post: www.netportaal.com/forums/14-musiek/186-...die-vloed-nuwe-album
What the parser has done with it, is only hyperlink the URL of the image, leading me to think that it doesn't detect the BBCode at all:
Code:
<div class = "msgtext">[beeld]<a href="http://userserve-ak.last.fm/serve/500/378080/Foto+Na+Dans+Hierdie+is+n+promo+foto+waar+h.jpg" target="_blank" rel="nofollow">userserve-ak.last.fm/serve/500/378080/Fo...romo+foto+waar+h.jpg</a>[/beeld]<br />
However, a person can still use the image tag, for some reason! Look at www.netportaal.com/forums/71-fotos-van-o...e/125-hoe-lyk-jy#134
Why could this be? Do I need to translate the tags in more than one place? I don't understand why I can translate the tag but not the [image] tag.
I would greatly appreciate it if anyone could help me in this regard!
Please Log in or Create an account to join the conversation.
15 years 8 months ago #58949
by Matias
Replied by Matias on topic Re: Translating BBCode
Find all occurences of that tag in the whole file. Same tag can be in 2-3 places.
Please Log in or Create an account to join the conversation.
- NetPortaal
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
15 years 8 months ago #59005
by NetPortaal
Replied by NetPortaal on topic Re: Translating BBCode
Thank you, Matias! What is obvious to others might not occur to some of us... :blush:
I appreciate that you have taken the time to write a reply.
As we would say in Afrikaans: dankie
I appreciate that you have taken the time to write a reply.
As we would say in Afrikaans: dankie
Please Log in or Create an account to join the conversation.
Time to create page: 0.221 seconds