wizardsandwars Posted July 22, 2003 Posted July 22, 2003 ok, i need to replace a link I hard coded in the following so that it goes through the tep_href_link variable, but I'm having some trouble with the embedded single and double quotes, and concatenations. Can someone take a quick look. <td valign="top" class="main"><?php echo sprintf(tep_image(DIR_WS_IMAGES . 'stars_' . $reviews_values['reviews_rating'] . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $reviews_values['reviews_rating']))) . ' – <i>' . $reviews_values['customers_name'] . ', ' . $date_added . '</i><br>' . htmlspecialchars($my_review) .'<a href="product_reviews_info.php?reviews_id=' . $reviews_values['reviews_id'] . '&products_id=' . $product_info_values['products_id'] . '"><font color="ffffff"><u>full review</u></font></a>' ?></td> Thnaks. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
Rumble Posted July 22, 2003 Posted July 22, 2003 try replacing the quotes and single quotes with ///" or ///' or even just /" or /' Reddy to Rumble Thank you osCommerce and all who Contribute to her!
wizardsandwars Posted July 22, 2003 Author Posted July 22, 2003 Rumble, Wouldn't that be ' or " As in escaping the single or double quote? I need to do something like <td valign="top" class="main"><?php echo sprintf(tep_image(DIR_WS_IMAGES . 'stars_' . $reviews_values['reviews_rating'] . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $reviews_values['reviews_rating']))) . ' – <i>' . $reviews_values['customers_name'] . ', ' . $date_added . '</i><br>' . htmlspecialchars($my_review) .'[b]<a href="' . tep_href_link("product_reviews_info.php", "reviews_id=")' . $reviews_values['reviews_id'] . '&products_id=' . $product_info_values['products_id'] . '"><font color="ffffff"><u>full review</u></font></a>[/b]' ?></td> but I just keep getting lost in the qoutes and concatenations. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
Rumble Posted July 22, 2003 Posted July 22, 2003 Sorry i misunderstood your query! Try this code <td valign="top" class="main"><?php echo sprintf(tep_image(DIR_WS_IMAGES . 'stars_' . $reviews_values['reviews_rating'] . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $reviews_values['reviews_rating']))) . ' – <i>' . $reviews_values['customers_name'] . ', ' . $date_added . '</i><br>' . htmlspecialchars($my_review) . '<a href="' . tep_href_link('product_reviews_info.php', 'reviews_id=' . $reviews_values['reviews_id'] . '&products_id=' . $product_info_values['products_id']) . '"><font color="ffffff"><u>full review</u></font></a>' ?></td> Reddy to Rumble Thank you osCommerce and all who Contribute to her!
Guest Posted July 22, 2003 Posted July 22, 2003 I think that $product_info_values['products_id']) . '"> needs to be $product_info_values['products_id']) . '"'> instead. Good luck, Matt
Rumble Posted July 22, 2003 Posted July 22, 2003 I might be wrong but dont think so because the " is wrapped in ' ' near the end of the line $product_info_values['products_id']) . '"><font color="ffffff"><u>full review</u></font></a>' ?></td> ie '"><font color="ffffff"><u>full review</u></font></a>' you might also want to put a # inf front of the ffffff. Reddy to Rumble Thank you osCommerce and all who Contribute to her!
wizardsandwars Posted July 22, 2003 Author Posted July 22, 2003 Yup, that's it, thanks Rumble! iiinetworks, that last single quote actually causes a parse error. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
wizardsandwars Posted July 22, 2003 Author Posted July 22, 2003 lol, you're right. this was my own version of a little hack to the reviews mod, as seen here, http://www.wizardsandwars.com/pc_game_info...products_id=174 Scroll to the bottom. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
Guest Posted July 26, 2003 Posted July 26, 2003 Looks good 8) . Don't forget to change your button_more_reviews.gif. :wink: I'd like to do something similar, but fiirst I need to figure out a way to apply reviews to multiple products; similar to the way amazon shows reviews for both the hardbacked & softbacked versions, and older editions. Is there a contribution I can customize to do this, or is it something I'd have to start from scratch?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.