News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Remove thread title on replies?

Started by lordrene, December 08, 2014, 09:13:55 PM

Previous topic - Next topic

lordrene

Is there any mod or code to replace out there to remove the thread title on replies?

OP


Replies

Arantor

Well, it sort of wouldn't work properly if you did that, mostly because the title is physically stored on every post, rather than at topic level. Apart from performance concerns, this is done because per-post titles are possible.

It could be done to just hide it but that would result in breaking *other* things, namely the quick modify function that relies on it being available.

lordrene

Quote from: Arantor on December 08, 2014, 09:20:50 PM
Well, it sort of wouldn't work properly if you did that, mostly because the title is physically stored on every post, rather than at topic level. Apart from performance concerns, this is done because per-post titles are possible.

It could be done to just hide it but that would result in breaking *other* things, namely the quick modify function that relies on it being available.
Oh i see, Thanks, We'll see if it's possible in the future!

Arantor

I know this was tweaked in SMF 2.1 but it was buggy when implemented (since they ran into the exact same problem). I don't remember if everything got fixed or the extra option ultimately got ditched though.

lordrene

I really need this removed, Anyone know of a mod?

kat

It's not that simple, as Arantor's already suggested.

If you click "Reply", you'll see that there's the facility to actually change the topic title, on a per-post basis.

Although that's rarely used, as far as I know, you'd break that, along with some other things.

Plus, it's quite useful, if you think about it.

I can link you to a topic, dead easily. I can also link you to a single post, like this:

http://www.simplemachines.org/community/index.php?topic=530993.msg3770705#msg3770705

Without that title, I can't.

So, sure, if you REALLY want it removed, you can have it removed. But, it'll break your forum.

Do you want it THAT badly?

Probably not.

Steve

I'd say he's been warned if someone wants to tell him how to do it. Of course, I'm betting he won't get much support if he comes back looking for help with things that have broken because of it. ;)
DO NOT pm me for support!

kat

Sadly, some people have blinkers on and only see what they want to see.

Let's hope that lordrene isn't like that... ;)

Arantor

If the SMF dev team can't get it right first time, what chance do the rest of us mere mortals have?

Hj Ahmad Rasyid Hj Ismail

I have no comment to the experts but just to assist the OP. To remove thread title on replies is a little bit tricky but to simply hide the same may be easier to do. Try to find:
<h5 id="subject_', $message['id'], '">

And replace it with:
<h5 id="subject_', $message['id'], '" style="', empty($message['counter']) ? '' : 'display:none', '">

I think that should do the trick without breaking anything.

Arantor

Quick modify will not play nicely with that.

Hj Ahmad Rasyid Hj Ismail

I dunno but so far it works just find on my test. But, since the link to each post is now hidden, if the OP wishes to easily "track" each replies, he may want to the the following modification. Find:
<div class="smalltext">« <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter']

Change it to:
<div class="smalltext">« <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' <a href="' . $message['href'] . '" rel="nofollow">#' . $message['counter'] . '</a>'

The reply number (eg. #123) will now carry the post link instead.

Arantor


Hj Ahmad Rasyid Hj Ismail

Yes. Both, inline edit and quick reply, work just fine on my test using portable WAMP Server (Uniform) on my PC. That is after I add the second mentioned modification code above.

Arantor


Hj Ahmad Rasyid Hj Ismail

Mine is Chrome but it is not browser difference I think, as I realized one thing about quick reply. There are two states of it and mine was show, on by default. So I tried the other one, show, off by default and bingo, it doesn't work if it is set off by default.

lordrene

Quote from: ahrasis on December 12, 2014, 12:52:14 PM
I have no comment to the experts but just to assist the OP. To remove thread title on replies is a little bit tricky but to simply hide the same may be easier to do. Try to find:
<h5 id="subject_', $message['id'], '">

And replace it with:
<h5 id="subject_', $message['id'], '" style="', empty($message['counter']) ? '' : 'display:none', '">

I think that should do the trick without breaking anything.
THANKS It worked


but do you know how to remove the thread title on OP's post?

Hj Ahmad Rasyid Hj Ismail

No problem. Simply change the given code from:
<h5 id="subject_', $message['id'], '" style="', empty($message['counter']) ? '' : 'display:none', '">
to this code:
<h5 id="subject_', $message['id'], '" style="display:none">

This way thread title including in the OP will be hidden. However, if you need to track the post as stated in here:

Quote from: ahrasis on December 12, 2014, 01:01:37 PM
I dunno but so far it works just find on my test. But, since the link to each post is now hidden, if the OP wishes to easily "track" each replies, he may want to the the following modification. Find:
<div class="smalltext">« <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter']

Change it to:
<div class="smalltext">« <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' <a href="' . $message['href'] . '" rel="nofollow">#' . $message['counter'] . '</a>'

The reply number (eg. #123) will now carry the post link instead.

the change should be a little different. In other words, you have to modify the whole line of that code. So instead of doing the above mod, do find the whole line instead:
<div class="smalltext">« <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' »</div>

Change that to:
<div class="smalltext"><strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' <a href="' . $message['href'] . '" rel="nofollow" title="' . $message['subject'] . '">#' . $message['counter'] . '</a>' : ' <a href="' . $message['href'] . '" rel="nofollow" title="' . $message['subject'] . '">Open</a>', ' ', $txt['on'], ':</strong> ', $message['time'], '</div>

Now, not only the reply number (eg. #123) carries the post link, the word "Open" will also carry the OP post link. You can change the word "Open" to any other word of your own choice.

Good luck!

lordrene

Quote from: ahrasis on December 13, 2014, 01:12:33 AM
Thank you! Appreciate it, It worked!

Quick question! would you happen to know if this can be done?


Have the edited time next to the time posted?

Hj Ahmad Rasyid Hj Ismail

Sure. But I think it is better for you tomark this topic as solved and open a new thread for that.

lordrene

Quote from: ahrasis on December 13, 2014, 02:22:38 AM
Sure. But I think it is better for you tomark this topic as solved and open a new thread for that.
You're right! Thank you!

Hj Ahmad Rasyid Hj Ismail

#21
As I said in the other topic, I packaged this mod. This mod uses hooks which means no direct file changes or manual modifications. The package is attached.

Edited: Package changed. Minor $context undefined error detected.

Advertisement: