Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Anonymous Reviews?


chelle40

Recommended Posts

Hi,

 

Is there a way to make reviews anonymous. I am using oscommerce ver 2.3.1. We are a brand new company and have had 1 great review but need more. We've had people who have wanted to write reviews but they don't want their name shown. The only way people can write a review is if they log in and their name is automatically shown. Seeing as how we sell home brew products I can see how people wouldn't want their names public on the internet for this.

 

Thank you,

 

Shelli

Link to comment
Share on other sites

This question has come up before. You could change $reviews['customers_name'] to 'Anonymous', or find some way to break apart the customers_name string into a first and last name, and initialize the last name: Shelli Catacci becomes Shelli C. . I think the latter way is better, as having people show up as "anonymous" (or completely unsigned) tends to encourage irresponsible posting. However, there's no foolproof way to take a name string and process it. An alternative might be to initialize everything: Shelli Catacci becomes S. C. . That way, if you gave the name as Catacci, Shelli it wouldn't reveal the last name, but would be C., S.. Just some thoughts...

Link to comment
Share on other sites

I suppose that with Javascript on the client side, and PHP code checking form input on the server side, you can force whatever minimum and maximum number of characters you want. Does the current code force at least one character for a name? That should be sufficient (as long as it's a letter, which is another check). It shouldn't be too hard to take a name string and collapse each run of two or more consecutive letters to just the initial letter. Ludwig von Beethoven becomes L v B -- is that adequate? You could add a period wherever letters are dropped: L. v. B. etc. Harry S Truman becomes H S T or H. S T. Somewhat riskier would be to take the last multiletter substring and reduce it to one letter: "Shelli Catacci" becomes "Shelli C.", but "Mao Zedong" becomes "Mao Z.", which is not what's desired ("M. Zedong"). Likewise, "Catacci, Shelli" becomes Catacci, S., unless you spot the comma and assume it's last name first. It gets complicated fast, which is why I would suggest just sticking with initials.

Link to comment
Share on other sites

I found this php code but don't know exactly where it would go. Any suggestions?

 

function getInitials($name){

//split name using spaces

$words=explode(" ",$name);

$inits='';

//loop through array extracting initial letters

foreach($words as $word){

$inits.=strtoupper(substr($word,0,1));

}

return $inits;

}

 

 

Thank you

 

Shelli

Link to comment
Share on other sites

Thanks again Phil,

 

Sorry it has take me so long to reply. LVB is fine with me.

When you say "in any .php file that happens to be loaded on the page where you need to call it" - how would I know which files I would need? Would it be the ones where in the oscommerce merchant --> Modules --> Boxes --> Reviews - would it be those I have marked under "Display in pages"? I opened up one of those files and added the code just before the last ?>

And this is what it looks like (Well, the end). Is that right?

 

<?php

require(DIR_WS_INCLUDES . 'template_bottom.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');

 

function getInitials($name){

//split name using spaces

$words=explode(" ",$name);

$inits='';

//loop through array extracting initial letters

foreach($words as $word){

$inits.=strtoupper(substr($word,0,1));

}

return $inits;

}

 

?>

Link to comment
Share on other sites

If you want this function in only one place, go ahead and stick it in the file (e.g., ..../product_review.php) that is used. If you want it used in multiple places, you'll have to put it in a file that is common to all the places. I'm unable to get to my copy of osC to look, but there ought to be some file commonly used.

 

If

<?php
require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

was all there was before, that's fine. Just be careful not to leave spaces or blank lines after the ?>.

 

Remember, that only defines the function. Now you have to figure where to use it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...