View Single Post
  #584  
Old 04-28-2009, 04:44 PM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Ted,

thanks for your work.

There might be a bug in the product file, tho: I tried to install, but the script threw a mysql error at me, saying there was no field "helpfulanswerid" in the fieldset of table "helpfulpost".
I checked and found that there had been no tables installed into my database and thought: Well, of course, there's no field if the tables did not get installed. So I looked at your product file and took out the mysql-CREATEs and created the tables in phpmyadmin.
I tried to install again, and yet again the script threw the same error at me, tho I was pretty sure the tables were created as they were supposed to be. Indeed, there was no such field in helpfulpost. After a closer look at your script, I was pretty sure that the line
Code:
SELECT COUNT(helpfulanswerid) as count FROM " . TABLE_PREFIX . "helpfulpost
was supposed to read
Code:
SELECT COUNT(helpfulanswerid) as count FROM " . TABLE_PREFIX . "helpfulanswer
i.e., the query was going to the wrong table. After changing this, I had no further problems installing, and the mod works just fine (at least, I did not find any errors up to now).

Another question concerning phrase helpfulanswer_postshavebeen. It reads "{1}'s Posts have been rated good {2} out of {3} times</span>". Is that </span>-Tag really supposed to be there?

Then I did a little modification to the helpful_answers_roll-Template. I was somewhat disappointed that there was no way to have icons when I want to allow only positive ratings (or did I miss something?). So I set the options to "Images - Thumbs with rollover" anyway and changed the template code as follows:

Find:
Code:
                    <if condition="$show['rate_helpfulanswer']">
                        <strong>$vbphrase[helpfulanswer_didyoufind] <a href="./helpfulanswers.php?do=rate&postid=$post[postid]&rank=1">$vbphrase[helpfulanswer_yesidid]</a></strong>
                    </if>
Replace with:
Code:
                    <if condition="$show['rate_helpfulanswer']">
                        $vbphrase[helpfulanswer_didyoufind] <a href="./helpfulanswers.php?do=rate&postid=$post[postid]&rank=1" <if condition="$vboptions[disable_ajax] != 2"> onclick="return helpfulanswers_rate($post[postid], 1);" </if> rel="nofollow" onmouseover="document.post_$post[postid]_up.src='images/buttons/ha_thumbsup.gif';" onmouseout="document.post_$post[postid]_up.src='images/buttons/ha_thumbsup_gray.gif';"><img name="post_$post[postid]_up" src="images/buttons/ha_thumbsup_gray.gif" width="11" height="20" border="0" alt="$vbphrase[helpfulanswer_yes]" align="absmiddle" /></a>

                    <if condition="$show['guest'] AND $vboptions['helpans_guestshow']">
                       $vbphrase[helpfulanswer_didyoufind]
                        <a href="./helpfulanswers.php?do=guestrate" <if condition="$vboptions[disable_ajax] != 2"> onclick="return helpfulanswers_rate($post[postid], 1);" </if> rel="nofollow" onmouseover="document.post_$post[postid]_up.src='images/buttons/ha_plus.png';" onmouseout="document.post_$post[postid]_up.src='images/buttons/ha_plus_gray.png';"><img name="post_$post[postid]_up" src="images/buttons/ha_plus_gray.png" width="20" height="20" border="0" alt="$vbphrase[helpfulanswer_yes]" align="absmiddle" /></a>
                    </if>
It will also show the green thumbsup for posts the user has already rated.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01575 seconds
  • Memory Usage 1,786KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete