vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Add-On Releases - [AJAX] Helpful Answers - Allow users to rate individual posts (https://vborg.vbsupport.ru/showthread.php?t=233296)

CvP 07-21-2010 12:30 PM

1 Attachment(s)
Quote:

Originally Posted by pete_brady (Post 2072194)
sure is - can you share how you achieved this?

Quote:

Originally Posted by 10 Gauge (Post 2072228)
+1

I want this!

Here's what you need to do:

first open the helpfulanswers.php in your forum root.
then comment out the lines shown in image. our objective is to always use helpful_answers_roll.

Then go to admincp > style manager > edit template > help templates > helpful_answers_roll

replace all the code in that template with this:

Code:

                       
                        <vb:if condition="$show['helpfulanswer']">
                                <span id="helpfulanswers_box_{vb:raw post.postid}">
                                <span class="seperator">&nbsp;</span>
                                <vb:if condition="$show['rate_helpfulanswer']">
                                        <a class="rateuppost" href="./helpfulanswers.php?do=rate&postid={vb:raw post.postid}&rank=1" <vb:if condition="$vboptions[disable_ajax] != 2"> onclick="return helpfulanswers_rate({vb:raw post.postid}, 1);" </vb:if> rel="nofollow" >&nbsp;{vb:raw post.goodrank}</a>
<vb:if condition="$vboptions['helpans_neg']">
                                        <span class="seperator">&nbsp;</span>
                                        <a class="ratedownpost" href="./helpfulanswers.php?do=rate&postid={vb:raw post.postid}&rank=0" <vb:if condition="$vboptions[disable_ajax] != 2"> onclick="return helpfulanswers_rate({vb:raw post.postid}, 0);" </vb:if> rel="nofollow" >{vb:raw post.badrank}&nbsp;</a>
</vb:if>
                                <vb:else />
                                        <vb:if condition="!$show[guest]">
                                                <vb:if condition="$post[yesno]">
                                        <span class="rateuppost_u">&nbsp;{vb:raw post.goodrank}</span>
<vb:if condition="$vboptions['helpans_neg']">
                                        <span class="seperator">&nbsp;</span>
                                        <span class="ratedownpost">&nbsp;{vb:raw post.badrank}</span>
</vb:if>
                                                <vb:else />
                                        <span class="rateuppost">&nbsp;{vb:raw post.goodrank}</span>
<vb:if condition="$vboptions['helpans_neg']">
                                        <span class="seperator">&nbsp;</span>
                                        <span class="ratedownpost_u">&nbsp;{vb:raw post.badrank}</span>
</vb:if>
                                                </vb:if>
                                        </vb:if>
                                </vb:if>
                                <vb:if condition="$show['guest'] AND $vboptions['helpans_guestshow']">
                                        <a class="rateuppost" href="./helpfulanswers.php?do=guestrate" rel="nofollow" >&nbsp;{vb:raw post.goodrank}</a>
<vb:if condition="$vboptions['helpans_neg']">
                                        <span class="seperator">&nbsp;</span>
                                        <a class="ratedownpost" href="./helpfulanswers.php?do=guestrate" rel="nofollow" >&nbsp;{vb:raw post.badrank}</a>
</vb:if>
                                </vb:if>
                                </span>
                        </vb:if>

then go to admincp > style manager > edit template > postbit templates > postbit legacy
under
Code:

<div class="postfoot">
find
Code:

<a class="multiquote" href="{vb:raw post.replylink}" rel="nofollow" onclick="return false;" id="mq_{vb:raw post.postid}"><img id="mq_image_{vb:raw post.postid}" src="{vb:raw vboptions.cleargifurl}" alt="{vb:rawphrase multi_quote_this_message}" />&nbsp;</a> </vb:if>
so after that </vb:if> and before </span>, add
Code:

<vb:if condition="$show['helpfulanswer']">
                                                {vb:raw helpful_answers}
                                        </vb:if>

now go to admincp > style manager > edit template > css templates > additional.css
add
Code:

.postbitlegacy .postfoot .textcontrols a.rateuppost, .postbit .postfoot .textcontrols a.rateuppost, .eventbit .eventfoot .textcontrols a.rateupevent {
background:url("images/buttons/arrow_mini_up_gray.png") no-repeat scroll left center #E9E9E9;
border:0 solid #A8A8A8;
padding:0 0 0 20px;
color: #008000;
}
.postbitlegacy .postfoot .textcontrols a.rateuppost:hover, .postbit .postfoot .textcontrols a.rateuppost:hover, .eventbit .eventfoot .textcontrols a.rateupevent:hover {
background:url("images/buttons/arrow_mini_up_hover.png") no-repeat scroll left center transparent;
border:0 none;
padding:0 0 0 20px;
color: #008000;
}

.postbitlegacy .postfoot .textcontrols a.ratedownpost, .postbit .postfoot .textcontrols a.ratedownpost, .eventbit .eventfoot .textcontrols a.ratedownevent {
background:url("images/buttons/arrow_mini_down_gray.png") no-repeat scroll right center #E9E9E9;
border:0 solid #A8A8A8;
padding:0 20px 0 0;
color: #800000;
}
.postbitlegacy .postfoot .textcontrols a.ratedownpost:hover, .postbit .postfoot .textcontrols a.ratedownpost:hover, .eventbit .eventfoot .textcontrols a.ratedownevent:hover {
background:url("images/buttons/arrow_mini_down_hover.png") no-repeat scroll right center transparent;
border:0 none;
padding:0 20px 0 0;
color: #800000;
}

.postbitlegacy .postfoot .textcontrols span.rateuppost, .postbit .postfoot .textcontrols span.rateuppost {
background:url("images/buttons/arrow_mini_up.png") no-repeat scroll left center #E9E9E9;
border:0 solid #A8A8A8;
padding:0 0 0 20px;
color: #008000;
}

.postbitlegacy .postfoot .textcontrols span.ratedownpost, .postbit .postfoot .textcontrols span.ratedownpost {
background:url("images/buttons/arrow_mini_down.png") no-repeat scroll right center #E9E9E9;
border:0 solid #A8A8A8;
padding:0 20px 0 0;
color: #800000;
}
.postbitlegacy .postfoot .textcontrols span.rateuppost_u, .postbit .postfoot .textcontrols span.rateuppost_u {
background:url("images/buttons/arrow_mini_up_hover.png") no-repeat scroll left center #E9E9E9;
border:0 solid #A8A8A8;
padding:0 0 0 20px;
color: #008000;
}

.postbitlegacy .postfoot .textcontrols span.ratedownpost_u, .postbit .postfoot .textcontrols span.ratedownpost_u {
background:url("images/buttons/arrow_mini_down_hover.png") no-repeat scroll right center #E9E9E9;
border:0 solid #A8A8A8;
padding:0 20px 0 0;
color: #800000;
}

Finally, go to admincp > options > helpful options > enable manual placement.

I have only checked it in legacy postbit.
if you make the similar change in regular postbit, it should work.


NOTE: This layout is NOT for "ten-based" rating.

Please remember to backup your database before trying. and I'm not responsible if anything goes wrong.


edit: you need to extract the arrow_mini.zip in /images/buttons directory.

10 Gauge 07-21-2010 02:38 PM

1 Attachment(s)
Thanks for the guide CvP, after following the instructions this is the output I am getting.... Thanks for having a look.

10 Gauge 07-21-2010 02:41 PM

1 Attachment(s)
Edit: I'm a 'tard.... Didn't have it set to arrows in the options.....

Ok one last question, what bit of CSS do I need to change to make the non-rolled over arrows have my darker footer background. From the screenshot you can see that the background is lighter, the rollover color is correct.

Thanks.

2nd Edit: GOT IT! Thanks. Looking forward to the 0 bug fix for the up arrow.

CvP 07-21-2010 02:46 PM

find what you added in additional.css
remove all #E9E9E9
from
background:url("images/buttons/arrow_mini_up_gray.png") no-repeat scroll left center #E9E9E9;
to
background:url("images/buttons/arrow_mini_up_gray.png") no-repeat scroll left center;

10 Gauge 07-21-2010 02:57 PM

1 Attachment(s)
Thanks man, got it! Let us know when you get the 0 bug fixed. :)

Also, when I go to replace the Post Thank You Hack with this permanently, could you direct me where to place the code to have the up and down arrows at the far left of the footer bar instead of the far right? (This would put it where the Thanks button currently is)

CvP 07-21-2010 05:39 PM

Quote:

Originally Posted by 10 Gauge (Post 2072472)
Thanks man, got it! Let us know when you get the 0 bug fixed. :)

Also, when I go to replace the Post Thank You Hack with this permanently, could you direct me where to place the code to have the up and down arrows at the far left of the footer bar instead of the far right? (This would put it where the Thanks button currently is)

refer to the postbit legacy modification i posted.
there I asked you to place a code after </vb:if> and before </span>.
if you notice, there is another <span> right after that </span>.
move that piece of code right after this <span>.

btw, placing is far right makes no sense unless you are using RTL.

pete_brady 07-21-2010 06:35 PM

Quote:

Originally Posted by CvP (Post 2072419)
Here's what you need to do:



awesome. thanks a lot dude.

10 Gauge 07-21-2010 06:54 PM

Quote:

Originally Posted by CvP (Post 2072557)
refer to the postbit legacy modification i posted.
there I asked you to place a code after </vb:if> and before </span>.
if you notice, there is another <span> right after that </span>.
move that piece of code right after this <span>.

btw, placing is far right makes no sense unless you are using RTL.

Lemme pick ur brain on the CSS again real quick. Moving it to the left side, how do I move the divider bar from the left to the right?

Edit: Nevermind, think I got it.... Was lookin' in the wrong spot!

CvP 07-21-2010 07:01 PM

edit helpful_answers_roll
and move the
<span class="seperator">&nbsp;</span>
to where you want.

Ted S 07-21-2010 08:48 PM

Quote:

Originally Posted by CvP (Post 2072353)
I'm sorry but I'm not sure where to place it. 946 number line of which file? the main XML? it didn't work :(

In the XML file yes. Are all the fields blank or just goodrank?

Quote:

then you can try using the already built in post hiding method. the one vB uses for deleted posts. it has a view post button. so you can just reuse that template with a little modification.
then add a hide post button if necessary.
The function being used is from the core vbulletin... I'll take a look at this more down the road, several old feature requests to get too first.


All times are GMT. The time now is 08:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02246 seconds
  • Memory Usage 1,783KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete