Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2006
    Posts
    358
    Plugin Contributions
    0

    Weird Text Wrap Problem in Review Text area...

    I am testing out the Review feature of my cart.

    When I write a review in English it works fine, but when I write one in Japanese, the text gets wrapped after the 31st Japanese character on each line. Also, a hyphen gets placed at the end of each line! (Japanese is a two bit language so I guess it is wrapping after the 62nd character...)

    Does anyone have any ideas as to what might be causing this?

    Thanks in advance!

  2. #2
    Join Date
    Apr 2006
    Posts
    358
    Plugin Contributions
    0

    Default Re: Weird Text Wrap Problem in Review Text area...

    Have just discovered that the actual layout of the English review and the Japanaese review is significantly different, but I could not find the file that controls the layout.

    My best guess is it is a language file so I looked in all the language related areas but could not come up with anything, so I would still appreciate any suggestions...

  3. #3
    Join Date
    Jun 2003
    Posts
    33,720
    Plugin Contributions
    0

    Default Re: Weird Text Wrap Problem in Review Text area...

    The URL where this can be seen?

  4. #4
    Join Date
    Apr 2006
    Posts
    358
    Plugin Contributions
    0

    Default Re: Weird Text Wrap Problem in Review Text area...

    Hello Kim,

    Thanks for taking the time to look into this. Here is the URL...

    http://store.globalpeace.jp/index.ph...8&reviews_id=4

    The English side looks looks like this:

    http://store.globalpeace.jp/index.ph...78&language=en

    Looking forward to your reply!

  5. #5
    Join Date
    Apr 2006
    Posts
    358
    Plugin Contributions
    0

    Default Re: Weird Text Wrap Problem in Review Text area...

    In checking the links I just posted, I noticed that the formatting changes, depending on from where the page is accessed, while in the E side or the J side...

    Anyway, the best way to see it appears to be by going to the main page of the store:

    http://store.globalpeace.jp

    Then clicking on the book icon (red and blue) in the Review side box...

    Here is a sample, though as it is Japanese it will be garbled, but you will see how the text wraps...

    ??????????????????????????????-
    ??????????????????????????????-
    ??????????????????????????????-
    ??????????????????????????????-
    ???????????
    ???: 2006/08/25

  6. #6
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Weird Text Wrap Problem in Review Text area...

    First, the following have not tested with v1.3.5 and is based on the experiences of previous version.
    Therefore it may not the exact need and codes for the modifications.


    If your character set using double bytes, you may need to modify the following files.

    For english, the line break occur after the 60th characters and set by the code below in the related templates.
    60, '-<br />

    For override copy the below original file from
    includes/templates/template_default/templates/tpl_product_reviews_info_default.php

    And save it to you override directory of your template.
    includes/templates/YOUR_TEMPLATE/templates/tpl_product_reviews_info_default.php

    In the new saved file
    In Line 53 -
    PHP Code:
    <div id="reviewsInfoDefaultMainContent" class="content"><?php echo zen_break_string(nl2br(zen_output_string_protected(stripslashes($review_info->fields['reviews_text']))), 60'-<br />'); ?></div>
    Modify the codes above of:
    60, '-<br />'

    For line break at 60th characters which is double bytes, change it to
    120, '<br />'


    For override copy the below original file from
    includes/templates/template_default/templates/tpl_product_reviews_default.php

    And save it to you override directory of your template.
    includes/templates/YOUR_TEMPLATE/templates/tpl_product_reviews_default.php

    In the new saved file
    Line 68 -
    PHP Code:
    <div id="productReviewsDefaultProductMainContent" class="content"><?php echo zen_break_string(zen_output_string_protected(stripslashes($reviews['reviewsText'])), 60'-<br />') . ((strlen($reviews['reviewsText']) >= 100) ? '...' ''); ?></div>
    Modify the codes above of:
    60, '-<br />'

    For line break at 60th characters which is double bytes, change it to
    120, '<br />'


    There are also other files with the code of 60, '-<br />
    But had not tried to modify at the previous test.

    includes/templates/template_default/templates/tpl_reviews_default.php
    Line 43 -
    PHP Code:
    <div class="content"><?php echo zen_break_string(nl2br(zen_output_string_protected(stripslashes($reviews->fields['reviews_text']))), 60'-<br />') . ((strlen($reviews->fields['reviews_text']) >= 100) ? '...' ''); ?></div>
    includes/modules/sideboxes/reviews.php
    Line 41 -
    PHP Code:
    $review_box_text zen_break_string(nl2br(zen_output_string_protected(stripslashes($review_box_text->fields['reviews_text']))), 60'-<br />'); 
    A New Starter again

  7. #7
    Join Date
    Apr 2006
    Posts
    358
    Plugin Contributions
    0

    Default Re: Weird Text Wrap Problem in Review Text area...

    Thank you for your quick and detailed reply. I will be quite busy till this weekend and probably will not have time to make the adjustments till Sunday.

    I find it strange that only the tpl_product_reviews_info_default.php and reviews.php are affected by this problem! I wonder why? All the other php files seem to be OK...

    Anyway, thanks again!

  8. #8
    Join Date
    Apr 2006
    Posts
    358
    Plugin Contributions
    0

    Default Re: Weird Text Wrap Problem in Review Text area...

    Thanks Seethrou,

    Well, managed to get make some time and began modifying things! The very first one you suggested <includes/templates/template_default/templates/tpl_product_reviews_info_default.php> did the trick but not perfectly as it now wraps at 120, but there is still a hyphen where it wraps... Here is a sample that I know will end up unreadable because it is Japanese, but even so, you can get the idea, I hope:

    ????????????????????????????????????????????????????????????- (this is the hyphen and the wrap point)
    ???? etc....

    So now at 120 characters it wraps, but the formatting still looks strange! I have the feeling there is something else that needs to be adjusted...

    Perhaps this problem is because my cart has a liquid center section, it adjusts to the size of the browser window and these templates are for the old style unchanging width style templates...

    Anyway, I look forward to any further suggestions!

  9. #9
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Weird Text Wrap Problem in Review Text area...

    Please note the differents other than the numbers.
    In contrast
    60, '-<br />'
    120, '<br />'

    I didn't followed the code in detail and the - sign don't show up in english. I just remvoed it in my last test for it seems don't affect the english either although after the removal.
    A New Starter again

  10. #10
    Join Date
    Apr 2006
    Posts
    358
    Plugin Contributions
    0

    Default Re: Weird Text Wrap Problem in Review Text area...

    Hi,

    Finally found the time to get back to this problem...

    After reading your last post, I delete the space but the text still wrapped... So I thought I would give this a try. I changed

    120, '<br />')

    to

    120, '')

    i.e., I just deleted the break tag...

    That did the trick and the text wraps as it should now... I guess such a change should not cause any problems...

    Thanks for helping me to sort this problem out!

 

 

Similar Threads

  1. weird problem with brower tab text
    By modwerx in forum General Questions
    Replies: 2
    Last Post: 12 Sep 2010, 06:23 PM
  2. Replies: 3
    Last Post: 21 May 2008, 05:56 PM
  3. Text wrap problem with subcats in category sidebox
    By Dionysian in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 27 Aug 2007, 06:46 AM
  4. Tiled background and main text area problem
    By jconshue in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Jan 2007, 10:47 AM
  5. Text area - break line problem
    By tartgc in forum General Questions
    Replies: 2
    Last Post: 27 Nov 2006, 10:20 AM

Posting Permissions

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