custom fields in posts?

Started by Aedemmair, July 25, 2012, 12:39:20 PM

Previous topic - Next topic

Aedemmair

I'd like to add a custom field that will appear below the subject of each post if filled in. Basically, it'd be like a sub-title. Members would mostly use this to "tag" other members, or state a specific purpose for their thread. For instance:

What a great day!
tag; Bill!

I can't seem to find any mods for this. There's one that allows you to make custom forms, but I don't need an entirely different form... I just need one little custom field in the posting area. Kind of like custom profile fields, but for posts! It seems like such a small, simple thing to me, but I have a feeling that it's not actually simple to code. xD

Does anyone know of some place that I can find this? Or what code I need to edit for it to work?

Thanks in advance for you time!

All Colours Sam

Welcome to SMF.

Tagging users is not as simple as making a new text field under the topic subject.  Although, if you use a separate text field and use the smf auto-suggest tool, it is relatively easy to obtain an array of ID from it.

What exactly will happen when some user tags another user?  what will happen next?
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Aedemmair

Thank you!

And I should have been more clear -- tagging is just a term for letting someone know that you've posted for them to reply. It's used a lot in the roleplaying world. It also lets other people know that you don't want anyone else to post. But, the custom field would basically be like a second 'Subject' field... as in, they can put any text they want in it. I was just using the 'tagging' as an example, really. Ultimately, members could put anything they wanted in that second field. It would do the same exact thing as the 'Subject' field, but it would appear underneath the subject as a sub-title or sub-heading in the topic list. Am I making sense? xD

All Colours Sam

I honestly don't know why you want a separate field just for that, I mean, you can use the existing body and separate the message with something as simple as an hr




You still need to know what exactly this field will do, where this new field will be displayed, how it will be displayed, who can edit it, delete it, create it, etc.

If you want just a duplicate of the subject field, then take a look at the posting template and Subs-Post.php for creating the text field and Display.php, Display.template to show the field.  It's a lot of work to do and could lead to vulnerabilities if isn't done correctly.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Aedemmair

The field itself isn't so much to display in the actual post as it is to show up on the topic list. That way members can know at a glance whether a thread applies to them or not without actually having to view it. It's a very handy feature on RPG boards. The custom field displays smaller text beneath the subject, like a sub-heading, letting people know if the thread is meant for a specific member or purpose.

It would show up in the same places as the subject field, as smaller text, and can be edited by the member that creates the topic, as well as admin/mods. It's just an "extra feature," like many of the other mods one can download for SMF. I wasn't sure if something was out there for it, because I've seen mods for something similar for other forum softwares. I prefer SMF to those, though, so this certainly isn't a make it or break it issue.

Thank you for your help! I'll take a look at those files and see what I can do. Though I have a feeling I'll end up leaving it be, because I'd probably mess things up. ;)

Aedemmair

Oh geeze, I feel completely ridiculous.

While browsing the mods (and NOT looking for this particular feature), I found exactly what I needed:

Topic Descriptions Mod

Silly me. :x

Advertisement: