Do you mean the code tags without attribute for example code=csharp, etc......Yes, that is what I meant.
I learned something
[ nobbc ] unparsed content [ /nobbc ]
[color=red][size=14pt]unparsed content[/size] [/color]
quote the post to help visualise
I always use code blocks. I don't know the correct syntax for colorized code when I need it so I take the simple version.
https://www.theswamp.org/index.php?topic=44258.0;prev_next=prev8:
Array to string conversion
File: Subs.php
Line: 2322
// Don't parse the content, just skip it.
elseif ($tag['type'] == 'unparsed_equals_content')
{
// The value may be quoted for some tags - check.
if (isset($tag['quoted']))
{
$quoted = substr($message, $pos1, 6) == '"';
if ($tag['quoted'] != 'optional' && !$quoted)
continue;
if ($quoted)
$pos1 += 6;
}
else
$quoted = false;
$pos2 = strpos($message, $quoted == false ? ']' : '"]', $pos1);
if ($pos2 === false)
continue;
$pos3 = stripos($message, '[/' . substr($message, $pos + 1, strlen($tag['tag'])) . ']', $pos2);
if ($pos3 === false)
continue;
$data = array(
substr($message, $pos2 + ($quoted == false ? 1 : 7), $pos3 - ($pos2 + ($quoted == false ? 1 : 7))),
substr($message, $pos1, $pos2 - $pos1)
);
if (!empty($tag['block_level']) && substr($data[0], 0, 6) == '<br />')
$data[0] = substr($data[0], 6);
// Validation for my parking, please!
if (isset($tag['validate']))
$tag['validate']($tag, $data, $disabled);
$code = strtr($tag['content'], array('$1' => $data[0], '$2' => $data[1]));
$message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos3 + 3 + strlen($tag['tag']));
$pos += strlen($code) - 1 + 2;
}
// A closed tag, with no content or value.
elseif ($tag['type'] == 'closed')
{
$pos2 = strpos($message, ']', $pos);
$message = substr($message, 0, $pos) . "\n" . $tag['content'] . "\n" . substr($message, $pos2 + 1);
$pos += strlen($tag['content']) - 1 + 2;
}
// This one is sorta ugly... :/. Unfortunately, it's needed for flash.
elseif ($tag['type'] == 'unparsed_commas_content')
{
$pos2 = strpos($message, ']', $pos1);
if ($pos2 === false)
continue;
$pos3 = stripos($message, '[/' . substr($message, $pos + 1, strlen($tag['tag'])) . ']', $pos2);
if ($pos3 === false)
continue;
// We want $1 to be the content, and the rest to be csv.
$data = explode(',', ',' . substr($message, $pos1, $pos2 - $pos1));
$data[0] = substr($message, $pos2 + 1, $pos3 - $pos2 - 1);
if (isset($tag['validate']))
$tag['validate']($tag, $data, $disabled);
$code = $tag['content'];
foreach ($data as $k => $d)
$code = strtr($code, array('$' . ($k + 1) => trim($d)));
$message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos3 + 3 + strlen($tag['tag']));
$pos += strlen($code) - 1 + 2;
}
// This has parsed content, and a csv value which is unparsed.
elseif ($tag['type'] == 'unparsed_commas')
{
$pos2 = strpos($message, ']', $pos1);
if ($pos2 === false)
continue;
$data = explode(',', substr($message, $pos1, $pos2 - $pos1));
if (isset($tag['validate']))
$tag['validate']($tag, $data, $disabled);
// Fix after, for disabled code mainly.
foreach ($data as $k => $d)
$tag['after'] = strtr($tag['after'], array('$' . ($k + 1) => trim($d)));
$open_tags[] = $tag;
// Replace them out, $1, $2, $3, $4, etc.
$code = $tag['before'];
foreach ($data as $k => $d)
$code = strtr($code, array('$' . ($k + 1) => trim($d)));
$message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos2 + 1);
$pos += strlen($code) - 1 + 2;
}
// A tag set to a value, parsed or not.
elseif ($tag['type'] == 'unparsed_equals' || $tag['type'] == 'parsed_equals')
{
// The value may be quoted for some tags - check.
if (isset($tag['quoted']))
{
$quoted = substr($message, $pos1, 6) == '"';
if ($tag['quoted'] != 'optional' && !$quoted)
continue;
if ($quoted)
$pos1 += 6;
}
else
$quoted = false;
$pos2 = strpos($message, $quoted == false ? ']' : '"]', $pos1);
if ($pos2 === false)
continue;
$data = substr($message, $pos1, $pos2 - $pos1);
// Validation for my parking, please!
if (isset($tag['validate']))
$tag['validate']($tag, $data, $disabled);
// For parsed content, we must recurse to avoid security problems.
if ($tag['type'] != 'unparsed_equals')
$data = parse_bbc($data, !empty($tag['parsed_tags_allowed']) ? false : true, '', !empty($tag['parsed_tags_allowed']) ? $tag['parsed_tags_allowed'] : array());
$tag['after'] = strtr($tag['after'], array('$1' => $data));
$open_tags[] = $tag;
$code = strtr($tag['before'], array('$1' => $data));
$message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos2 + ($quoted == false ? 1 : 7));
$pos += strlen($code) - 1 + 2;
}
I already have a fix and will update the mod by the weekend.
Thank you.
{CODE} - {LANGUAGE}: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a>
As Administrator, look in the settings of the theme:
"Header above GeSHi Code Container:
You can use {CODE}, {TAG} and {LANGUAGE} keywords. For reference please see cb|GeSHi-mod help."
Replace the line of code generation titles:Code: [Select]{CODE} - {LANGUAGE}: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a>
:-)
How about search terms that include things like angle braces, etc.?
That doesn't seem to work for me
How about search terms that include things like angle braces, etc.?
That doesn't seem to work for me
I'm not sure I follow your meaning TT; `search terms'?
The `Select' doesn't work for you?
...
Try searching the '.NET' forum for 'GetObjects<T>', and you'll not find anything, even though there are plenty of posts with code that contains that string.
...
Try searching the '.NET' forum for 'GetObjects<T>', and you'll not find anything, even though there are plenty of posts with code that contains that string.
Oh, yes; the code is heavily reformatted by GeSHi and that would make searches a problem. Here's a "how long is a string question" for you; Are there a lot of instances (in .NET, I guess) where a user could be doing a search like that or would they mostly search `GetObjects' instead? ...Actually, I can see that happening quite a bit now that I think about it.
I know this isn't the answer your looking for, and I'm not trying to belittle the thought either, but I think that we will have to force the age-old "ask better questions" stance and force people to use better subject lines and whatnot.
const std::string trim(const std::string& pString, const std::string& pWhitespace = " \t") /*{{{*/
{
const size_t beginStr = pString.find_first_not_of(pWhitespace);
if (beginStr == std::string::npos)
// no content
return "";
const size_t endStr = pString.find_last_not_of(pWhitespace);
const size_t range = endStr - beginStr + 1;
return pString.substr(beginStr, range);
}
Note the extra 4 spaces of indentation on every line and removal of a leading space for the middle lines....
Try searching the '.NET' forum for 'GetObjects<T>', and you'll not find anything, even though there are plenty of posts with code that contains that string.
Oh, yes; the code is heavily reformatted by GeSHi and that would make searches a problem. Here's a "how long is a string question" for you; Are there a lot of instances (in .NET, I guess) where a user could be doing a search like that or would they mostly search `GetObjects' instead? ...Actually, I can see that happening quite a bit now that I think about it.
I know this isn't the answer your looking for, and I'm not trying to belittle the thought either, but I think that we will have to force the age-old "ask better questions" stance and force people to use better subject lines and whatnot.
Another option would be to quit using generics. :ugly:
Thanks also for your efforts.
I found that the search issue I mentioned above isn't limited to GeSHi-fication of code blocks, it also affects regular text. It appears that the search is done against the raw HTML, so the following search term will find "GetObjects<T>", but not in code blocks:Code - Text: [Select]
GetObjects<T>
I suppose that the search term could be encoded to make it work for regular content, but the actual issue for me is searching for something in posted code.
I guess it boils down to priorities (syntax colorization verses searchable code). For me, unsearchable code is a deal-breaker.
...
I will get back to you in a bit.