We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    That’s odd... it’s a built-in PHP function. What version of PHP are you using?

    http://www.php.net/mb_strlen
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 4749
      • 623 Posts
      php 5.2.5

      [EDIT]: I deleted the cookies after I reinstalled 1.8 and the fatal error went away, but all I get is a blank screen.
        The MODx has you...
        Utah Web Design
        • 4749
        • 623 Posts
        even though mb_strlen() is part of PHP I’m still getting that error again - sorry I spoke too soon. Here’s the supposed offending piece of code:
         if (mb_strlen($this->searchString) >= $this->cfg['minChars']){
              //Clean the searchString
              $valid = $this->stripSearchString($this->searchString,$this->cfg['stripInput'],$this->advSearch);
              if (!$valid) $msgErr = $this->_lang['as_resultsIntroFailure'];
            }
            else {
              $valid = false;
              $msgErr = sprintf($this->_lang['as_minChars'],$this->cfg['minChars']);
            }
            return $valid;
          }


        Does anyone see anything wrong with that?

          The MODx has you...
          Utah Web Design
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          http://support.nusphere.com/viewtopic.php?p=20706

          "mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option."

          http://www.php.net/manual/en/mbstring.installation.php
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 5811
            • 1,717 Posts
            Hi Cbaone,

            which is your database charset (utf8 or latin1) ? & your html page chareset ?

            If you use latin1 and I use mb_strlen function, it’s an issue (latin1 don’t require muti-byte function).
            If you use UTF-8, and you have this kind of issue, as said by Sottwell, check that the mb_string PHP extension is activated on your server.
              • 4018
              • 1,131 Posts
              Ok, guys, got a problem maybe you can solve. Upon returning the search results off an AjaxSearch, I want to test for the existence of a value for a specific TV within my result template. The problem is that if I add the tv table in then all the values are concatenated into the `tv_content` placeholder. That doesn’t do me any good. I don’t need to filter anything based on this TV; I simply need to be able to get to its value within my result template to test for a value.

              The TV in question is an external link. So within my result template I planned to do something along the lines of this for the link:

              <a href="[+as.tv_external_url:is=``:then=`[+as.resultLink+]`:else=`[+as. tv_external_url+]`" title="[+as.longtitle+]">


              Basically, if the tv_external_url is empty then use the default link, else use the external link. Problem is that I can’t get the placeholder set for this. Thus my dilemma. Rather than spend more hours on this I figure I’d post it up and let someone who really knows the code tell me how to do this. smiley

              Thanks in advance!

              Jeff
                Jeff Whitfield

                "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                • 5811
                • 1,717 Posts
                Hi Jeff,
                let someone who really knows the code tell me how to do this
                I really know the code grin and it’s not possible with the current 1.8 beta 1 >:(

                With the current 1.8 beta 1 the Phx [+as. tv_external_url+] is unknown and not set by AjaxSearch

                To do that, I need for each document found, catch the id of TV linked and for each TV id, renders the TV output values as a ajaxSearch TV like [+as.TV_name+]
                May be, this new feature could be set with a global new parameter &tvPhx=`1`.
                The version 1.8 is now ready and tested (utf8 and latin1), but I could try to solve your request by adding this new feature, if somebody is also interested in.
                  • 4018
                  • 1,131 Posts
                  I’ll probably do it another way by just creating a snippet that passes the ID and do it that way. No biggie. But, yeah, I do think that TV’s should have their own placeholders. Would make the AjaxSearch stuff that much more powerful.
                    Jeff Whitfield

                    "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                    • 4749
                    • 623 Posts
                    Quote from: sottwell at Jul 19, 2008, 04:16 PM

                    http://support.nusphere.com/viewtopic.php?p=20706

                    "mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option."

                    http://www.php.net/manual/en/mbstring.installation.php

                    Thanks, that was it. I had my host activate it and everything is working great.
                      The MODx has you...
                      Utah Web Design
                      • 25663 MODX Staff
                      • 12,272 Posts
                      Regarding making the TV values available as a placeholder, that’d be ideal. Would pair nicely with being able to restrict searching to just a specific TV.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me