Improvementhtml entity encode

  • Author
    Posts
  • Dobakj
    Participant

    hello,

    there is problem when we use polish characters and plugin cut text near that character and we’ve got : kt&o.. insted of któ…

    I suggest to add
    $text_to_show=html_entity_decode($text_to_show);

    in this code

    // validate text to show
    $text_to_show = null;
    if( (int)$yuzo_options->text2_length > 0 ){

    if( ! isset($yuzo_options->text_show) ){
    $text_to_show = $post->post_content;
    }elseif( isset($yuzo_options->text_show) && $yuzo_options->text_show == 1 ){
    $text_to_show = $post->post_content;//get_the_content();
    }elseif( isset($yuzo_options->text_show) && $yuzo_options->text_show == 2 ){
    $text_to_show = $post->post_excerpt;
    }elseif( isset($yuzo_options->text_show) && $yuzo_options->text_show == 3 ){
    if (!empty($post->post_excerpt)) {
    $text_to_show = $post->post_excerpt;
    } else {
    $text_to_show = $post->post_content;
    if (stristr($text_to_show, ‘<!–more–>’)) {
    $text_to_show = substr($post->post_content, 0, strpos($post->post_content, ‘<!–more–>’));
    }

    }
    }
    /////////////
    $text_to_show=html_entity_decode($text_to_show);
    ///////////
    if( $yuzo_options->text_show == 3 ){
    /*$text_to_show = strtok(wordwrap($text_to_show, (int)$yuzo_options->text2_length, “…\n”), “\n”);
    $text2_extract = ‘<span class=”yuzo_text” style=”font-size:’.((int)$yuzo_options->font_size – 4).’px;” >’.$text_to_show.'</span>’; */
    $text_to_show = strtok(wordwrap($text_to_show, (int)$yuzo_options->text2_length, “…”), “”);
    $text2_extract = ‘<span class=”yuzo_text” style=”font-size:’.((int)$yuzo_options->font_size – 4).’px;” >’.$text_to_show.'</span>’;
    }else{
    $text2_extract = ‘<span class=”yuzo_text” style=”font-size:’.((int)$yuzo_options->font_size – 4).’px;” >’.$if_utils->IF_setHtml( $if_utils->IF_cut_text( $text_to_show , (int)$yuzo_options->text2_length, TRUE ) ).'</span>’;
    }

    also I reccomend to cut excerpts on spaces (” “), not inside words

    #5967
    iLen
    Keymaster

    Hello, thanks for the suggestion, I will take it into account for the next version.

    #5980
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.