Hey... I just "installed" the ratings module into my 4.1.6 following the instructions as stated. Nothing happens on the front side. I do see the modules in the admin. Have I done something wrong on the install? Have I added the code in the wrong part of the listing.tpl file? Please advice.
Since you didnt share with us exactly what you did on the install, what you edited in the listing template file or what version of the rating mod you downloaded how can anyone here be certain what the problem is.
Larry, thank for your reply. I did exactly as the install instructions state. I uploaded the ratings folder to the modules folder. I then activated the module from the admin module settings. I then included the following code Listing Rating For listing rating add the following code in your viewlistings.tpl file {assign var="rating" value=$smarty.const.FILESYSTEM_PATH}{include file="$rating/modules/rating/templates/listing_rating.tpl"} and... Restrict to Registered Users If you would like to restrict reviews to only registered users you could open the template file rating.tpl and add this: {if $smarty.session.username<>""}{$smarty.const.LANG_WRITE_REVIEW}{else}Please login to add a review.{/if} Though I wasn't completely sure where to add the before mentioned code. let me know what you think. Thank again...
One thing to check is that you are actually using viewlisting.tpl and not viewlisting2.tpl. Add the same code to it as well to check if that is the reason. Another thing is to make sure you edit the template in your template set (if it has one).
No need to reiterate the installation instructions, thats easy enough for people to find out its the little details we dont know. You said the directions said to edit viewlistings.tpl but in what folder and what template set are you using. As Eric eluded to the little details of exactly what you did beyond "following the directions" is what allows people to have a glimpse at your scenario.
Thank you Larry & Eric... I guess I was using viewlisting2. I added the code to both files and it is now showing the review section above the listing. I am able to see the review section in the listing. 3 things I need to address. 1. Change the language of the module title on the front side 2. When I click on "write a Review", it does not do anything. 3. How can I place the review under the listing itself instead than above the listing. (placing the code elsewhere on viewlisting file? NREVER MIND>>> THIS IS DONE BY PLAACING WHERE U WANT ON THE .tpl file. Thank you!
There may be a language file in the module that you can manually edit, if not, then you can edit the module templates just like you would the 68C templates to alter the text in them. Where did you download the module from? Sometimes there are links to old modules here in the forum that down work with the newer versions of 68C, this is why I asked you what module version you are using but you never answered that question. The line of code you added to your template is in essence more html so where you place it in your template will have a direct impact on where it displays in the page.
I downloaded the module from the module section on 68Classifieds website. I believe it is version v1.7 – August 13, 2009. here is the link i used: ClassifiedMods Rating Module This is the link that appears on "Write a Review": javascript:writereview() the module does contain a language folder, but the file in it does not contain the word shown in the front page... i'll try the template.
I dont totally follow what you are saying in the quote above. What appears inline with the ad itself? just the words Write a Review or do you see the javascript peice as well? What happens when you click the link?
when I right click in the "write a Review" link and go to properties the supposed action or link that it follows is javascript:writereview() it appears like if it were a link but it doesnt do anything when clicked. please see the actual listing: PRanuncia.com Casa 4 cuartos en tremenda ubicacion!
Im seeing the following on yoru page, but its between the script tags, where did you add this? {if $smarty.session.username<>""}{$smarty.const.LANG_WRITE_REVIEW}{else}Please login to add a review.{/if}
rating.tpl as stated in the install instructions... I am not sure where in the template was I supposed to add it though. I just removed it from the listing_rating.tpl file. id like to add it though as it prevents unregistered users to review the listings.
I took it off and the link now works. It opens a Pop up where i can leave comment. How or where should I included the code to restrict comments to registered users only?
The following is a logical expression it compares the value of a smarty variable to a static variable, in the case whats between double quotes which is nothing...... Code: {if $smarty.session.username<>""} So, in other words, if the username isNOT empty they are logged in so display what comes after the logical evaluation and before the {else} what comes after the {else} happens IF the logical condition IS empty. So, what do you want to happen? You want the link to leave a comment to appear IF the user is logged in and if not then show the message that they need to log in. Look in the listing_rating.tpl and find the link you want to hide if they are not logged in..... Code: <a href="javascript:writereview()">{$smarty.const.LANG_WRITE_REVIEW}</a> and then you put that inside the logical operation that checks for a username like so... Code: {if $smarty.session.username<>""} <a href="javascript:writereview()">{$smarty.const.LANG_WRITE_REVIEW}</a> {else} Please login to add a review. {/if}
Larry, thank you very much for the detailed explanation. Its comments like this that teaches us newbies the "why" of things. is there a particular area were i need to include this code? I added the code you suggested to the section of the template where it calls for the pop up review window. Nothing happened again.
Since your not sharing details of exactly where you placed the code all I can do is assume your doing it right and then I have no idea why its not working. Works fine for me.
This is the code for the template and the blue is the coded i added. <script> {if $smarty.session.username<>""} <a href="javascript:writereview()">{$smarty.const.LANG_WRITE_REVIEW}</a> {else} Please login to add a review. {/if} {literal} function writereview() { window.open("modules/rating/add.php?listing={/literal}{$lid}{literal}", "reviews", "width=400, height=400, location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=no"); } {/literal} </script> <table class="tableborder"> <tr> <th colspan="3"><strong>Comentarios y Calificación</strong></th> </tr> <tr> <td class="formleft" width="50%">{$smarty.const.LANG_TOTAL_REVIEW}</td> <td class="formright" colspan="2" width="50%">{$totalReviews}</td> </tr> {if $avgReview > 0} <tr> <td class="formleft" width="50%">{$smarty.const.LANG_AVG_RATING}</td> <td class="formright" colspan="2" width="50%">{$avgReview} {$smarty.const.LANG_OUT_OF_STARS}</td> </tr> {/if} <tr> <td class="formstrip" colspan="3" align="center"><a href="javascript:writereview()">{$smarty.const.LANG_WRITE_REVIEW}</a></td> </tr> </table> <br /> {if $reviews<>""} <table class="tableborder"> <tr> <th colspan="3"><strong>Comentarios</strong></th> </tr> {foreach from=$reviews item="rev"} <tr> <td class="{cycle values="row1,row2" advance=false}">{$rev.person}</td> <td class="{cycle values="row1,row2" advance=false}">{$rev.added|date_format:$dateformat}</td> <td class="{cycle values="row1,row2" advance=false}">{$rev.score} {$smarty.const.LANG_OUT_OF_STARS}</td> </tr> <tr> <td colspan="3" class="{cycle values="row1,row2"}">Comentario: {$rev.review}</td> </tr> {/foreach} </table> {/if}
You dont just ADD the code I had in my post above. I said to locate the LINK already in the template and surround it with the codee and gave you an example of what it looked like. The following line is ALREADY IN THE TEMPLATE <a href="javascript:writereview()">{$smarty.const.LANG_WRITE_REVIEW}</a> Find it and then place the code around it so it looks like the code you have in blue.