Jump to content

billowingwillows

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

billowingwillows's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I know I'm a noob and everything, but at least a point in the right direction would be nice.
  2. Hello all, I'm pretty new to the world of php, my journey starting when I installed Simple Machines to run a forum on a website for someone (I see this forum is also SM ) Anyways, I'm trying to resolve something so that emoticon code that has no space between it and the next word still displays the emoticon, because default on SMF it won't display. Here's what I mean: :shrug:bob Anyways, that's not why I came here. I came here because an admin at another website was helping me figure this one out, as I haven't been receiving any attention regarding this on SMF's support forums. We worked out to modify the $smileyPregSearch regex, and he intuitively suggested to change something specific in the code without having even seen it. It didn't work though, and he told me to "echo $smileyPregSearch and print_r($smileyPregReplacements) and let me know what the output is". Now, how exactly would I do that? I think it entails writing a new document and putting in the echo code and everything, so that I can then access the document and have it display the results on screen, but I don't know how to properly associate that with all of SMF's stuff. I'm really trying to learn php through getting my hands dirty like this, and he seems much more capable of helping me than the people who haven't bothered to answer me on the support forums, but when I asked him more about how to do this, he shrugged it off 'cause he's busy and I'm a noob. If I could give him those results he was asking for though, I could resolve this problem. In case anyone might happen to have more input onto the specific problem, too, the code in question, as we seem to think, is this: // This smiley regex makes sure it doesn't parse smileys within code tags (so [url=mailto:David@bla.com] doesn't parse the smiley) $smileyPregReplacements = array(); $searchParts = array(); for ($i = 0, $n = count($smileysfrom); $i < $n; $i++) { $smileyCode = '<img src="' . htmlspecialchars($modSettings['smileys_url'] . '/' . $user_info['smiley_set'] . '/' . $smileysto[$i]) . '" alt="' . strtr(htmlspecialchars($smileysfrom[$i], ENT_QUOTES), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')). '" title="' . strtr(htmlspecialchars($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley" />'; $smileyPregReplacements[$smileysfrom[$i]] = $smileyCode; $smileyPregReplacements[htmlspecialchars($smileysfrom[$i], ENT_QUOTES)] = $smileyCode; $searchParts[] = preg_quote($smileysfrom[$i], '~'); $searchParts[] = preg_quote(htmlspecialchars($smileysfrom[$i], ENT_QUOTES), '~'); } $smileyPregSearch = '~(?<=[>:\?\.\s' . $non_breaking_space . '[\]()*\\\;]|^)(' . implode('|', $searchParts) . ')(?=[^[:alpha:]0-9]|$)~e' . ($context['utf8'] ? 'u' : ''); That last line on the end, he recommend removing the \s before the $non_breaking_space without ever seeing the code. Like I said, it didn't work, I showed him the code, and he asked for that output. How do I give it to him? Any help, advice, input, whatever is greatly appreciated 'cause I'm struggling to get help with this!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.