Support Forum

Adding a second subject field

CC critterGuide.ca
critterGuide.ca
Member

 Hi,

In one of my forums I want the users to be able to choose from a drop down menu or write in plain text what country/region they are from when they create a post

and display that info as part of my subject ,example : Place – subject

“Ontario – how to eat bread?”

“New York – selling a potatos”

 

The ‘place’ must be entered to submit the post… Basically I want two subjects to my posts smushed together with a ‘ – ‘  🙂

Possible?

9 Answers

New Answer

MP Mr Papa
Mr Papa
Member

no, topic description wont do that for specific user input…  its certainly supported via our api, but not sure we have anything that will do it as is…  you would need to hook into the post form and display the dropdown…  then process it on submit…  we have plugins that add stuff to the post form, but not this…

we could give you a quote for a custom plugin to do this if desired…

CC critterGuide.ca
critterGuide.ca
Member

i think that wil work…with some tweeking…

i need to change the “topic description” to something else and make it only visible in a particular forum

CC critterGuide.ca
critterGuide.ca
Member

function sp_topic_description_do_edit($out, $topic) {
$out.= ‘<div class=”spHeaderName”>’.__(‘Topic Description‘, ‘sp-topic-description’).’:</div>’;
$out.= ‘<div><textarea class=”spControl” name=”topicdesc” rows=”2″>’.esc_textarea($topic->topic_desc).'</textarea></div>’;
return $out;
}

 

im unformiliar with all of this but from that can i understand:

the one above is the one to edit right? in components.php to change “topic description” …

not sure how to limit to one forum.

i also want to add some text before the text entred, could you help me out with that aswell?

can i just put a topicdesc = “my text here: ” + topicdesc rolleys

so it will show something like this under the topic

Topic

my text here: topicdesc text here

YS Yellow Swordfish
Yellow Swordfish
Member

The function that actually displays on the new topic form is:

sp_topic_description_do_topic_form()

The one you are looking at is the one that allows that to be edited later.

if you plan to go down this route then you will need to edit the whole plugin to change all references, names, file names etc. Otherwise it will get automatically updated the next time there is any update to the original topic description plugin code. Is that your plan here?

CC critterGuide.ca
critterGuide.ca
Member

Yes,

I think it’s close enough to what I am looking for.

I am looking at the files in the plugin.zip I downloaded from the store.

I want the title to say ‘Loaction’ instead of topic description and I want this to be only available in one forum group…

And in the description I would like to have the entered text preceded by ‘Item location : entered text’

Doesn’t seem that hard to tweek 🙂 

What should I do to make sure it will be used as a different new Plugin?

MP Mr Papa
Mr Papa
Member

fundamentally, in the main plugin fie, sp-topic-description-plugin.php, just change the name (Topic Description) of the plugin on line 3…  you will not be asked to upgrade then…

you have control over the text…just look for it in the plugin.. you will find it in the sp-topic-description-components.php file…  line 17….

CC critterGuide.ca
critterGuide.ca
Member

1) so is there a way i can limit the second title by forum or group?

 

2)

sp-topic-description-plugin.php, – change the name (Topic Description) of the plugin on line 3..

isnt that in the coment? are yopu using the comment text ? are you sure?

 

3)

also, cant i just eddit the upgrade file to not check for upgrades? like balnking the whole file or somehing 🙂 ?

 

LAST EDIT :

1) – still need it fixed

2) – ‘Topic Description’ is now ‘Item Location’

3) – either way i just wont upgrade 🙂

YS Yellow Swordfish
Yellow Swordfish
Member

For the forum view template – which is the one where the topic description plugin operates – you can use the global standard object $spThisForum which will give you access to all the data you need regarding the forum and the forum group it belongs to.

I would suggest you go to the forum admin > toolbox > data inspector. Turn in the data for spThisForum and then run the forum view. You will see the data contained in the object at the top of the page. Any of that data can be used in the template using the above global object.