Important: This page is using cookies (cookies). Using this website without turning off cookies in browser, means that you agree for using it.
Buy Now! Features Downloads

Earn with us!

If you would like to start earning money with vBET join to Affiliate Program.
Results 1 to 10 of 10

Thread: If thread title is exceeded by insertion of langtitle things break

  1. #1
    Senior Member
    Join Date
    Dec 2009
    Posts
    276

    Default If thread title is exceeded by insertion of langtitle things break

    I noticed that if someone posts a thread in another language that is just under the min characters for thread title, and the langtitle tags go over this limit, this screws up the display of the thread in forumdisplay, search results, and on the thread page itself. The same goes if a thread title is translated, someone replies to the thread, and 'Re:' sends the post title over its character limit.

    I can't show an example of this because I had to fix it on my forum. I'm sure if can be replicated here if you enter a title just under the thread title character limit that is translated from the default language.

  2. #2
    Retired ;)
    Join Date
    Aug 2011
    Posts
    441

    Default

    Could you please show us a problem, because i can hardly understand when the problem appears

  3. #3
    Senior Member
    Join Date
    Dec 2009
    Posts
    276

    Default

    The problem is when 'langtitle' is inserted into the thread title, it is not recognizing the thread title character limit. If the tag gets cut off and isn't closed properly, it breaks the page where the title appears.

  4. #4
    Retired ;)
    Join Date
    Aug 2011
    Posts
    441

    Default

    Ok, but i cannot reproduce this problem on my test forum, my [ langtitle] is never cut.
    Could you please send me detailed information about this problem. What is your langtitle lenght limit, and how long the tittle supposed to be(in what language) to break the line?
    Last edited by r.dziadusz; 17-09-11 at 09:26.

  5. #5
    Senior Member
    Join Date
    Dec 2009
    Posts
    276

    Default

    my title length limit was 85, but I increased it to 100. So, for example, if the user inserted a title that was 95 characters, then then langtitle tags would send it over the limit. The system truncated the closing langtitle tag which results in breaking the layout.

  6. #6
    Retired ;)
    Join Date
    Aug 2011
    Posts
    441

    Default

    Ok we were able to reproduce this problem, and now we are working on it
    Last edited by r.dziadusz; 20-09-11 at 07:45.

  7. #7
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    Hi. I was able to reproduce it. It was really hard to reproduce and I made it accidentally working on something else. It was hard, because it is vBulletin bug. vBET uses vBulletin function vbchop, which suppose to cut string according to desired length in safe way (keeping in mind encoded characters). Unfortunately vBulletin has bug there and for messages which are encoded to safe UTF-8 (characters like &#CODE gives wrong results.

    We send bug report to vBulletin (vBulletin bug) and created quick fix on vBET side. So right now vBET detects if vbchop returned longer result and cuts it to desired one. Also we have simple detection to check does letter encoded in format &#CODE; was not cut in the middle and if yes, then last word is also cut (simply by finding last space). Please see quick fix below.

    Quick Fix:
    • Open /includes/vbenterprisetranslator_functions_detection.php
    • Find:
      PHP Code:
      $title vbchop($title$vbulletin->options['titlemaxchars'] - 12).'[/langtitle]'
    • Replace by:
      PHP Code:
      $desiredLength $vbulletin->options['titlemaxchars'] - 12;
      $title vbchop($title$desiredLength);
      if (
      strlen($title) > $desiredLength) {
      $title substr($title0$desiredLength);
      $lastOpen strrpos($title,'&');
      $lastSpace strrpos($title' ');
      $lastClose strrpos($title,';');
      if (
      $lastOpen!==false && $lastSpace!==false && $lastClose!==false && ($lastSpace $lastOpen) && ($lastOpen $lastClose)) {
      $title substr($title0$lastSpace);
      }
      }
      $title .= '[/langtitle]'


    This will be included in next release.
    Last edited by vBET; 20-09-11 at 23:00.

  8. #8
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    Please note that previous post was edited to provide more sophisticated quick fix (solving issue of cut in the middle letter in format &#CODE. So if you already apply previous solution you can consider to use actual one, or just wait for new release

  9. #9
    Senior Member
    Join Date
    Dec 2009
    Posts
    276

    Default

    Thanks Michal - I knew something was up. Does the quick fix also account for replies as well? Sometimes the 're:' sent it over the limit.

  10. #10
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    We didn't check it. If you will find that issue still exists in such case, please contact us here and we will handle this

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •