Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Querying and Displaying Language Name


SGershon

Recommended Posts

Posted

So.

 

I have made my reviews language independent. That is, all the reviews are shown no matter what language you are using to visit my site. There were no major changes to this, just the ones stated here: http://www.oscommerce.com/forums/index.php?showtopic=93406# . Again, I just removed the verification of the language, nothing too intrusive.

 

Now I want to state which language the review displayed is.

So I wrote, in the product_reviews page, about line 80:

$reviews_query_raw =

"select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name, lang.name

from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_LANGUAGES . " lang

where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = lang.languages_id

order by r.reviews_id desc";

 

And, below, about line 110 (between reviewer name and review date):

<td class="smallText" align="center">

<?php echo sprintf(TEXT_THIS_REVIEW_LANGUAGE, tep_output_string_protected($reviews['lang.name'])); ?>

</td>

 

TEXT_THIS_REVIEW_LANGUAGE was defined in Inc/lang/english/product_reviews.php as "This review was written in".

 

The problem: This is what appears in the reviews page:

by John Smkith          This review was written in          Date Added: 05/17/2004

 

I've tried using

- tep_output_string_protected($reviews['name'])

- "lang.name as langname" with "tep_output_string_protected($reviews['langname']"

to no avail.

 

What can be the problem? What am I missing? I am not in the intricacies of OSC yet, still learning my way in...

 

SGershon

If at first you don't succeed, you must be a programmer.

 

Tip Posted: Languageless Reviews

Posted
TEXT_THIS_REVIEW_LANGUAGE was defined in Inc/lang/english/product_reviews.php as "This review was written in".

Oh!

That was really dumb!

 

Solved -- missed the "%s" inside the definition.

 

Sorry for asking! :D

If at first you don't succeed, you must be a programmer.

 

Tip Posted: Languageless Reviews

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...