The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
+2
Pizza Boi
Van-Helsing
6 posters

    How can I add Best Answer Box under the titlebox?

    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Thu May 15, 2014 12:24 pm

    Hi all,
    How can I add best answer box under the title box like this http://prntscr.com/3jebh4 ?

    Best Regards,
    Dark-Avenger


    Last edited by Dark-Avenger on Tue May 20, 2014 12:20 pm; edited 1 time in total
    Pizza Boi
    Pizza Boi
    Hyperactive


    Male Posts : 2016
    Reputation : 160
    Language : French
    Location : Pizza Hut!

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Pizza Boi Thu May 15, 2014 1:57 pm

    Hi Very Happy

    Check J0k3R^'s profile. He asked the same thing :rose: . I believe the topic was called "Best Topics in replies" or near that :rose:

    Regards,
    Pizza Boi
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Thu May 15, 2014 5:49 pm

    Hi all,
    I have read this topic about best answer but I think its a little different due the titlebox reason. I have found this tutorial http://coding-spot.darkbb.com/t299-best-answer-ipb-style-cs-theme-2-plugin but it needs some modifications in the viewtopic_body template but I dont know how can I adapt my template.

    With Best Regards,
    Dark-Avenger


    Last edited by Dark-Avenger on Tue May 20, 2014 11:54 am; edited 1 time in total
    J0k3R^
    J0k3R^
    Forumember


    Male Posts : 742
    Reputation : 28
    Language : Greek > English > Russian > Spanish
    Location : C:\>r00t

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by J0k3R^ Thu May 15, 2014 6:06 pm

    Thid tutorial is only working for the people that they got his theme installed. Its needs to be customized in order to be used in other forums aswell.. Sir Chivas made an attempt for this project but then, nothing, i think he dropped it Smile
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Sat May 17, 2014 4:37 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Mon May 19, 2014 11:22 am

    Bump
    SocialAcademy
    SocialAcademy
    Forumember


    Male Posts : 145
    Reputation : 11
    Language : JavaScript, CSS, Html, JQuery, C#, C++, Php, Python
    Location : Forumotion

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by SocialAcademy Mon May 19, 2014 11:44 am

    Try this add this to your CSS

    Code:
    .post_feature_box {
      margin-top: 5px;
      max-width:100%;
      background-color: rgb(234, 248, 226);
      border: 1px dotted rgb(51, 51, 51);
      padding: 6px;
      min-height: 60px;
    }
    #best-res {
    margin-left: 3%;
    background: #7ba60d;
    display: inline-block;
    height: 16px;
    line-height: 16px;
    padding: 0 5px;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    vertical-align: middle;
    }
    .ipsUserPhoto {
    float: left;
    padding: 1px;
    border: 1px solid #d5d5d5;
    background: #fff;
    -webkit-box-shadow: 0px 2px 2px rgba(0,0,0,0.1);
    -moz-box-shadow: 0px 2px 2px rgba(0,0,0,0.1);
    box-shadow: 0px 2px 2px rgba(0,0,0,0.1);
    margin-right: 8px;
    }
    .ipsUserPhoto:hover {
    border-color: #7d7d7d;
    }
    .ipsUserPhoto img {
    width: 50px;
    height: 50px;
    }
    .ipsBadge {
    background: #7ba60d;
    display: inline-block;
    height: 16px;
    line-height: 16px;
    padding: 0 5px;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 8px;
    }


    then to your Javascript

    Placement: In the topics



    Code:
    $(function(){
        $('.post[style="background-color:#eaf8e2;"] .posthead h2').append('<span id="best-res"">Best Answer</span>');
        var topicauthor = $('.post #best-res').parents('.post').find('.user .username a').html();
        var topicavatar = $('.post #best-res').parents('.post').find('.postmain .postbody .user .user-ident .user-basic-info a img').attr('src');
        var topicpost = $('.post #best-res').parents('.post').find('.posthead a').attr('href');
        var topicdata = $('.post #best-res').parents('.post').find('.posthead h2 .data-post').html();
        var bestTopic = $('.post #best-res').parents('.post').find('.entry-content').html();
    if($('#best-res').length){
        $('.main.paged').before('<div class="post_feature_box">
    <span class="ipsUserPhoto"><img src="'+topicavatar+'" /></span>
    <span class="ipsBadge">Best Answer</span> '+topicauthor+', '+topicdata+'<div style="border: 1px solid #ddd; border-bottom: 1px solid #ececec; margin: 3px;"></div><div style="display: inline-block;">'+bestTopic+'</div><a href="'+topicpost+'">
            <span class="ipsBadge" style="background: #B3B3B3;font-weight: normal !important;">Go to the Full Post <img class="icon" src="http://i.imgur.com/omzqZnf.png"></span></a>
    </div>');}
        });


    Dont forget to change the color in "Thank Message" --> #eaf8e2
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Mon May 19, 2014 11:58 am

    Hi social academy:D ,
    its not working. The best answer box is not displayed.

    Best Regards,
    Dark-Avenger
    SocialAcademy
    SocialAcademy
    Forumember


    Male Posts : 145
    Reputation : 11
    Language : JavaScript, CSS, Html, JQuery, C#, C++, Php, Python
    Location : Forumotion

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by SocialAcademy Mon May 19, 2014 12:06 pm

    Can you send me your Viewtopic Body ? =D
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Mon May 19, 2014 12:09 pm

    Yes sure here it is:

    viewtopic_body template:
    Spoiler:

    Update1: 22:50
    I have forced the default templates to check if the javascript is working without success. I think the problem is in the javascript.
    SocialAcademy
    SocialAcademy
    Forumember


    Male Posts : 145
    Reputation : 11
    Language : JavaScript, CSS, Html, JQuery, C#, C++, Php, Python
    Location : Forumotion

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by SocialAcademy Tue May 20, 2014 12:51 am

    Find this in your Viewtopic_body
    Code:
        <h3>
                        <span class="post_id right ipsType_small desc blend_links">
                                    <a itemprop="replyToUrl" data-entry-pid="424042" href="{postrow.displayed.POST_URL}" rel="bookmark" title="{postrow.displayed.POST_SUBJECT}: post #{postrow.displayed.COUNT_POSTS}">
                                #{postrow.displayed.COUNT_POSTS}
                                      <img src="http://i78.servimg.com/u/f78/17/31/71/58/icon_s10.png" class="small" title="{postrow.displayed.POST_SUBJECT}: post #{postrow.displayed.COUNT_POSTS}" />
                                </a>
                            </span>
                        <div class="post_username">
                                              <div class="post_online">{postrow.displayed.ONLINE_IMG}</div>&nbsp;
                          <span itemprop="creator name" class="author vcard">
                                                      <span hovercard-ref="member" hovercard-id="35095" class="url fn name  ___hover___member _hoversetup" title="" id="anonymous_element_2">
                                                        <span itemprop="name">{postrow.displayed.POSTER_NAME}</span>
                                                      </span>
                                                    </span>
                        </div>
                    </h3>

    then replace with this


    Code:
                                  <h3 {postrow.displayed.THANK_BGCOLOR}>

                        <span class="post_id right ipsType_small desc blend_links">
                                    <a itemprop="replyToUrl" data-entry-pid="424042" href="{postrow.displayed.POST_URL}" rel="bookmark" title="{postrow.displayed.POST_SUBJECT}: post #{postrow.displayed.COUNT_POSTS}">
                                #{postrow.displayed.COUNT_POSTS}
                                      <img src="http://i78.servimg.com/u/f78/17/31/71/58/icon_s10.png" class="small" title="{postrow.displayed.POST_SUBJECT}: post #{postrow.displayed.COUNT_POSTS}" />
                                </a>
                            </span>
                        <div class="post_username">
                                              <div class="post_online">{postrow.displayed.ONLINE_IMG}</div>&nbsp;
                          <span itemprop="creator name" class="author vcard">
                                                      <span hovercard-ref="member" hovercard-id="35095" class="url fn name  ___hover___member _hoversetup" title="" id="anonymous_element_2">
                                                        <span itemprop="name">{postrow.displayed.POSTER_NAME}</span>
                                                      </span>
                                                    </span>
                        </div>
                    </h3>


    Replace your JS with this

    Code:
    $(function(){
            $('.post h3[style="background-color:#e8f7e1;"]').append('<div id="best-res" class="answerBadgeInPost">✓  Best Answer</div>').attr('style','background-image: -moz-linear-gradient(top, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.3)), color-stop(100%,rgba(255,255,255,0)));
        background-image: -webkit-linear-gradient(top, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%);background-image: -o-linear-gradient(top, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%);background-image: -ms-linear-gradient(top, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%);background-image: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%);-webkit-box-shadow: inset rgba(255,255,255,0.35) 0px 1px 0px;-moz-box-shadow: inset rgba(255,255,255,0.35) 0px 1px 0px;box-shadow: inset rgba(255,255,255,0.35) 0px 1px 0px;background: #dfedd1;text-shadow: rgba(255,255,255,0.8) 0px 1px 0px;border: 1px solid #accf8b;');
            var topicauthor = $('.post #best-res').parents('.post').find('.author').html();
            var topicavatar = $('.post #best-res').parents('.post').find('.postmain .postbody .user .user-ident .user-basic-info a img').attr('src');
            var urlavt= $('.post #best-res').parents('.post').find('.postmain .postbody .user .user-ident .user-basic-info a').attr('href');
            var topicpost = $('.post #best-res').parents('.post').find('h3 a').attr('href');
            var topicdata = $('.post #best-res').parents('.post').find('.published').html();
            var bestTopic = $('.post #best-res').parents('.post').find('.entry-content div').last().prev().html();
        if($('#best-res').length){
            $('.main.paged').before('<div class="post_feature_box">
        <span class="ipsUserPhoto"><img src="'+topicavatar+'" /></span>
        <span class="ipsBadge">Best Answer</span> '+topicauthor+', '+topicdata+'<div style="border: 1px solid #ddd; border-bottom: 1px solid #ececec; margin: 3px;"></div><div style="display: inline-block;">'+bestTopic+'</div><a href="'+topicpost+'">
                <span class="ipsBadge" style="background: #B3B3B3;font-weight: normal !important;">Visualizar todo o conteúdo do post <img class="icon" src="http://i.imgur.com/omzqZnf.png"></span></a>
        </div>');}
            });


    and your CSS


    Code:
    .post_feature_box {
       margin-top: 5px;
       max-width:100%;
       background-color: rgb(234, 248, 226);
       border: 1px dotted rgb(51, 51, 51);
       padding: 6px;
       min-height: 60px;
    }

    #best-res {
       color: #436500;
       background: #dfedd1;
       text-shadow: rgba(255,255,255,0.8) 0px 1px 0px;
       border: 1px solid #accf8b;
       border-top: 0;
       padding: 0 12px;
       height: 30px;
       line-height: 30px;
       position: relative;
       float: right;
       margin: -1px -2px 8px 8px;
       -webkit-border-bottom-left-radius: 3px;
       -webkit-border-bottom-right-radius: 3px;
       -moz-border-radius: 0px 0px 3px 3px;
       border-radius: 0px 0px 3px 3px;
    }

    .ipsUserPhoto {
       float: left;
       padding: 1px;
       border: 1px solid #d5d5d5;
       background: #fff;
       -webkit-box-shadow: 0px 2px 2px rgba(0,0,0,0.1);
       -moz-box-shadow: 0px 2px 2px rgba(0,0,0,0.1);
       box-shadow: 0px 2px 2px rgba(0,0,0,0.1);
       margin-right: 8px;
    }

    .ipsUserPhoto:hover {
       border-color: #7d7d7d;
    }

    .ipsUserPhoto img {
       width: 50px;
       height: 50px;
    }

    .ipsBadge {
       background: #7ba60d;
       display: inline-block;
       height: 16px;
       line-height: 16px;
       padding: 0 5px;
       font-size: 9px;
       font-weight: bold;
       text-transform: uppercase;
       color: #fff;
       -moz-border-radius: 4px;
       -webkit-border-radius: 4px;
       border-radius: 4px;
       vertical-align: middle;
       margin-right: 8px;
    }
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Tue May 20, 2014 1:13 am

    Hi SocialAcademy:),
    I have done these modifications but it still not working Sad
    SocialAcademy
    SocialAcademy
    Forumember


    Male Posts : 145
    Reputation : 11
    Language : JavaScript, CSS, Html, JQuery, C#, C++, Php, Python
    Location : Forumotion

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by SocialAcademy Tue May 20, 2014 2:29 am

    you forgot to change the "Thank message color " replace into this #e8f7e1
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Tue May 20, 2014 2:43 am

    I have change it
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by SLGray Tue May 20, 2014 4:22 am

    Did you change it to the one you are using?



    How can I add Best Answer Box under the titlebox? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Tue May 20, 2014 9:47 am

    Yes I have done all of the modifications which gave me SocialAcademy but it still not working.

    viewtopic_body template:
    Spoiler:

    Javascript[In the topics]:
    Spoiler:

    CSS:
    Spoiler:

    and in the ACP the thanked message color:

    http://prntscr.com/3kvb70

    Is it needs something else to work?
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by TheCrow Tue May 20, 2014 12:16 pm

    This feature works only with the thanks button! And the thanks button only the OP can press it just once. It should work if you press the Thanks button @ a post that you have made. Are you sure its not working?



    How can I add Best Answer Box under the titlebox? Thecro10
     Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Tue May 20, 2014 12:18 pm

    Ok now it works fine. I was confused with LGLike js.
    J0k3R^
    J0k3R^
    Forumember


    Male Posts : 742
    Reputation : 28
    Language : Greek > English > Russian > Spanish
    Location : C:\>r00t

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by J0k3R^ Tue May 20, 2014 12:25 pm

    is it solved -avenger?
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by Van-Helsing Tue May 20, 2014 12:53 pm

    yes it solved.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: How can I add Best Answer Box under the titlebox?

    Post by SLGray Tue May 20, 2014 9:21 pm

    Topic Solved & Archived



    How can I add Best Answer Box under the titlebox? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.

      Current date/time is Sun Sep 22, 2024 9:20 pm