• 0

IPB 3.4 Hide Marked Solved button on ajax reply


Question

Yet another issue the ticket system on IPS doesn't support, but getting no luck in their p2p support forum.

 

We have successfully been able to hide the marked solved button from the OP on own posts in the topic, but it does show when the OP makes a fast reply, which defeats the entire purpose.

<if test="canAnswerTopic:|:$topic['Perms']['canAnswerTopic'] && $post['post']['post_count'] > 1">
<if test="isAnswered:|:$post['post']['_isMarkedAnswered']">
<if test="canUnanswer:|:$post['post']['_canMarkUnanswered']">
<li><a href="{parse url="module=extras&section=answer&do=unanswer&t={$this->request['t']}&pid={$post['post']['pid']}&auth_key={$this->member->form_hash}" base="publicWithApp"}"  data-post-button="unanswer" class='ipsButton_secondary important' data-pid="{$post['post']['pid']}"><img class='icon' src="{$this->settings['img_url']}/cross_white_10px.png">{$this->lang->words['topic_mark_unsolved']}</a></li>
</if>
<else />
<if test="notAnswered:|:$post['post']['_canAnswer'] && $topic['topic_firstpost'] != $post['post']['pid']">
<if test="$topic['_starter']['member_id'] != $post['author']['member_id']">
<li><a href="{parse url="module=extras&section=answer&do=answer&t={$this->request['t']}&pid={$post['post']['pid']}&auth_key={$this->member->form_hash}" base="publicWithApp"}"  data-post-button="answer" class='ipsButton_secondary' data-pid="{$post['post']['pid']}"><img class='icon' src="{$this->settings['img_url']}/tick_10px.png">{$this->lang->words['topic_mark_solved']}</a></li>
</if>
</if>
</if>
</if>

Second line under else marks where the permission is set (but ignored with fast reply).

<if test="$topic['_starter']['member_id'] != $post['author']['member_id']">

Maybe someone can help out here? :p

11 answers to this question

Recommended Posts

  • 0

Fixed using

<if test="$this->memberData['member_id'] != $topic['starter_id'] OR $this->memberData['member_id'] != $post['author']['member_id']">

instead of

<if test="$topic['_starter']['member_id'] != $post['author']['member_id']">
  • 0

Hello,

Yet another issue the ticket system on IPS doesn't support, but getting no luck in their p2p support forum.

 

We have successfully been able to hide the marked solved button from the OP on own posts in the topic, but it does show when the OP makes a fast reply, which defeats the entire purpose.

<if test="canAnswerTopic:|:$topic['Perms']['canAnswerTopic'] && $post['post']['post_count'] > 1">
<if test="isAnswered:|:$post['post']['_isMarkedAnswered']">
<if test="canUnanswer:|:$post['post']['_canMarkUnanswered']">
<li><a href="{parse url="module=extras&section=answer&do=unanswer&t={$this->request['t']}&pid={$post['post']['pid']}&auth_key={$this->member->form_hash}" base="publicWithApp"}"  data-post-button="unanswer" class='ipsButton_secondary important' data-pid="{$post['post']['pid']}"><img class='icon' src="{$this->settings['img_url']}/cross_white_10px.png">{$this->lang->words['topic_mark_unsolved']}</a></li>
</if>
<else />
<if test="notAnswered:|:$post['post']['_canAnswer'] && $topic['topic_firstpost'] != $post['post']['pid']">
<if test="$topic['_starter']['member_id'] != $post['author']['member_id']">
<li><a href="{parse url="module=extras&section=answer&do=answer&t={$this->request['t']}&pid={$post['post']['pid']}&auth_key={$this->member->form_hash}" base="publicWithApp"}"  data-post-button="answer" class='ipsButton_secondary' data-pid="{$post['post']['pid']}"><img class='icon' src="{$this->settings['img_url']}/tick_10px.png">{$this->lang->words['topic_mark_solved']}</a></li>
</if>
</if>
</if>
</if>
Second line under else marks where the permission is set (but ignored with fast reply).

<if test="$topic['_starter']['member_id'] != $post['author']['member_id']">
Maybe someone can help out here? :p
Daniweb has a HUGE resources of members for this type of thing, a lot into web dev :)
  • 0

Cheers (Y)

 

Can I ask a question, what code did you use for if topic is marked solved the custom message that neowin added disappears?

 

Custom message meaning the "This top is not marked as solved yet"

 

Would be grateful to know the information for just that.

  • 0

Where the badge 'answered' and goto post is displayed in the post (or whatever you have) add under it:

 

<else /><if test="canAnswerTopic:|:$topic['Perms']['canAnswerTopic']"><p title="Select a best answer below by using the Mark Solved button if your post has been answered." class="message error" style="width:390px; float:right; margin-bottom:0; clear:none;">This topic has not been Marked Solved yet, or doesn't require an answer.</p></if>
  • 0

 

Where the badge 'answered' and goto post is displayed in the post (or whatever you have) add under it:

<else /><if test="canAnswerTopic:|:$topic['Perms']['canAnswerTopic']"><p title="Select a best answer below by using the Mark Solved button if your post has been answered." class="message error" style="width:390px; float:right; margin-bottom:0; clear:none;">This topic has not been Marked Solved yet, or doesn't require an answer.</p></if>

 

okay well I've placed the code in the Topic View > post template. in the post_body as you will see below but this still only shows for admins where I'm wanting it to show for all members and guests.

 

here is the code i have. in the post_body.

<div class='post_body'>
 
<if test="isSolvedSausage:|:$post['post']['_isMarkedAnswered']"><div class='answerBadgeInPost'>✓  {$this->lang->words['topic_best_answer']}</div></if>
 
<if test="repHighlight:|:$this->settings['reputation_highlight'] AND $post['post']['rep_points'] >= $this->settings['reputation_highlight']">
<p class='rep_highlight'>{parse replacement="popular_post"}<br />{$this->lang->words['popular_post']}</p>
</if>
 
 
 
 
<div itemprop="commentText" class='post entry-content <if test="$post['post']['_repignored'] == 1">imgsize_ignore</if>'>
 
<if test="isSolvedSausage:|:$post['post']['_isMarkedAnswered']"><div class='ipsPad_top_bottom' style='padding-top: 0; display:none;'><span class='ipsBadge ipsBadge_green'>{$this->lang->words['topic_best_answer']}</span></div></if>
 
{$post['post']['post']}
{$post['post']['attachmentHtml']}
<br />
<if test="postEditBy:|:$post['post']['edit_by']">
<p class='edit'>
{$post['post']['edit_by']}
<if test="postEditByReason:|:$post['post']['post_edit_reason'] != ''">
<br />
<span class='reason'>{$post['post']['post_edit_reason']}</span>
</if>
</p>
</if>
<if test="$post['post']['post_count']%$this->settings['display_max_posts'] == 1">
<if test="bestAnswer:|:$displayData['best_answer_post_data']">
<br />
 
<div class='post post_block feature_box clearfix'>
    <if test="canSeeProfiles1:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $displayData['best_answer_post_data']['author'] ) )">
    <a itemprop="url" href="{parse url="showuser={$displayData['best_answer_post_data']['author']['member_id']}" template="showuser" seotitle="{$displayData['best_answer_post_data']['author']['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}: {$displayData['best_answer_post_data']['author']['members_display_name']}" class='ipsUserPhotoLink'>
    </if>
    <img itemprop="image" src='{$displayData['best_answer_post_data']['author']['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_medium left' />
    <if test="canSeeProfiles2:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $displayData['best_answer_post_data']['author'] ) )">
    </a>
    </if>
    <div class="ipsBox_withphoto">
    <p class='ipsType_sectiontitle'>
        <span class='ipsBadge ipsBadge_green' style='margin-right: 4px;'>{$this->lang->words['topic_best_answer']}</span>
        {parse template="userHoverCard" group="global" params="$displayData['best_answer_post_data']['author']"},
        <if test="samePageBA:|:isset($post_data[ $displayData['best_answer_post_data']['post']['pid'] ])">
            <if test="hasPagesBA:|:$this->request['page']">
                <a href='{parse url="showtopic={$topic['tid']}&page={$this->request['page']}{$post_data[ $displayData['best_answer_post_data']['post']['pid'] ]['post']['PermalinkUrlBit']}#entry{$displayData['best_answer_post_data']['post']['pid']}" template="showtopic" seotitle="{$topic['title_seo']}" base="public"}'>{parse date="$displayData['best_answer_post_data']['post']['post_date']" format="long"}</a>
            <else />
                <a href='{parse url="showtopic={$topic['tid']}{$post_data[ $displayData['best_answer_post_data']['post']['pid'] ]['post']['PermalinkUrlBit']}#entry{$displayData['best_answer_post_data']['post']['pid']}" template="showtopic" seotitle="{$topic['title_seo']}" base="public"}'>{parse date="$displayData['best_answer_post_data']['post']['post_date']" format="long"}</a>
            </if>
        <else />
            <a href="{parse url="app=forums&module=forums&section=findpost&pid={$displayData['best_answer_post_data']['post']['pid']}" base="public"}">{parse date="$displayData['best_answer_post_data']['post']['post_date']" format="long"}</a>
        </if>
    </p>
    <p class='ipsPad_top'>
        {$displayData['best_answer_post_data']['post']['post']} 
        <if test="samePageBA2:|:isset($post_data[ $displayData['best_answer_post_data']['post']['pid'] ])">
            <if test="hasPagesBA2:|:$this->request['page']">
                <a href='{parse url="showtopic={$topic['tid']}&page={$this->request['page']}{$post_data[ $displayData['best_answer_post_data']['post']['pid'] ]['post']['PermalinkUrlBit']}#entry{$displayData['best_answer_post_data']['post']['pid']}" template="showtopic" seotitle="{$topic['title_seo']}" base="public"}'>
            <else />
                <a href='{parse url="showtopic={$topic['tid']}{$post_data[ $displayData['best_answer_post_data']['post']['pid'] ]['post']['PermalinkUrlBit']}#entry{$displayData['best_answer_post_data']['post']['pid']}" template="showtopic" seotitle="{$topic['title_seo']}" base="public"}'>
            </if>
        <else />
            <a href="{parse url="app=forums&module=forums&section=findpost&pid={$displayData['best_answer_post_data']['post']['pid']}" base="public"}">
        </if>
            <span class='ipsBadge ipsBadge_lightgrey' style='margin-left: 4px;'>{$this->lang->words['answer_gotopost']} »</span></a>
    </p>
    </div>
 
</div>
 
<else />
<if test="canAnswerTopic:|:$topic['Perms']['canAnswerTopic']">
<p title="Select a best answer below by using the Mark Solved button if your post has been answered." class="message error" style="margin-bottom: 6px; width:390px; float:right; margin-bottom:0; clear:none;">This topic has not been Marked Solved yet, or doesn't require an answer.</p>
                          </if>
</if>
 
 
                          <php>$show_message = array(76, 32, 47, 57); </php>   <if test=" $this->registry->getCurrentApplication() == 'forums' && in_array($forum['id'], $show_message)">
                       </if>
                     </if>
                          <br />
                          </div>
  • 0

Yes, IPB is funny like that, you have to place it where mod controls aren't already in an if statement of sorts. I'll have a look later.

 

Edit pretty sure I have the not answered yet above the whole display answer stuff, because like I say that's where it gets funky with if statements for admins and for guests/members ;)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I'm aware. That information should have been included in the article, making it more complete and information.
    • Converseen 0.15.2.5-2 by Razvan Serea Converseen is a free and open-source batch image converter and resizer. It supports over 100 formats, including DPX, EXR, GIF, JPEG, JPEG-2000, PNG, SVG, TIFF, WebP, HEIC/HEIF, and many others. Users can convert, resize, rotate, flip, and compress multiple images at once. It can also transform entire PDF documents into individual image files. Powered by the ImageMagick library, Converseen features a user-friendly interface and is available in both installer and portable versions. Here’s a list of all the features you can find in Converseen: Batch image conversion (supports 100+ formats) Resize images in bulk Rotate and flip images in bulk Compress images to reduce file size Convert entire PDF documents into image files Support for multiple image formats (JPEG, PNG, TIFF, PDF, BMP, GIF, and more) Customizable output settings (quality, resolution, etc.) Image effects and adjustments (such as brightness, contrast, etc.) Convert images to PDF User-friendly graphical interface Support for drag-and-drop functionality Extract an image from a Windows icon file (*ico) Supports adding watermark to images Portable and installer versions available Leverages ImageMagick for processing power Allows renaming of images in bulk Supports EXIF data editing (for JPEG images) Easy-to-use GUI for non-technical users Command-line support for advanced users Free and open-source software Cross-platform availability Available in multiple languages Download: Converseen 0.15.2.5-2 | Portable | 32-bit | ~40.0 MB (Open Source) View: Converseen Homepage | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Regarding the AI photo, I LOVE AI in that regard, you ask it what you want and it gives you a lovey photo in under a minute, that would taken me an hour to make in photoshop and it wouldn't have looked nearly as good. 2 nights ago I spent a couple hours collaborating with AI.  I did not say write me an article. I would write one or 2  paragraphs, then I would ask it to clean it up so it read better but still keeps the information I was trying to convey.  Rinse repeat.  
    • for AI content? 😶
    • If anyone ever wondered about @Warwagon's MVP status, this is why. Excellent post!
  • Recent Achievements

    • First Post
      Tom Schmidt earned a badge
      First Post
    • One Month Later
      D0nn13 earned a badge
      One Month Later
    • Rookie
      +ChiefOfNeo went up a rank
      Rookie
    • One Year In
      Tom Schmidt earned a badge
      One Year In
    • One Month Later
      Tom Schmidt earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      454
    2. 2
      +Edouard
      176
    3. 3
      PsYcHoKiLLa
      123
    4. 4
      Michael Scrip
      81
    5. 5
      Xenon
      75
  • Tell a friend

    Love Neowin? Tell a friend!