Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Adding a second subject field
Avatar
critterGuide.ca
Canada
Member
sp_UserOfflineSmall Offline
Dec 16, 2015 - 1:52 pm

 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?

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Dec 16, 2015 - 3:06 pm

Not sure about butting them up with a '-', but are you already using the Topic Description plugin?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 16, 2015 - 9:09 pm

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...

Avatar
critterGuide.ca
Canada
Member
sp_UserOfflineSmall Offline
Dec 16, 2015 - 11:38 pm

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

Avatar
critterGuide.ca
Canada
Member
sp_UserOfflineSmall Offline
Dec 16, 2015 - 11:53 pm

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

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 17, 2015 - 2:55 am

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?

andy-signature.png
YELLOW
SWORDFISH
Avatar
critterGuide.ca
Canada
Member
sp_UserOfflineSmall Offline
Dec 18, 2015 - 5:20 pm

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?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 18, 2015 - 7:36 pm

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....

Avatar
critterGuide.ca
Canada
Member
sp_UserOfflineSmall Offline
Dec 25, 2015 - 2:01 pm

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 🙂

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 26, 2015 - 5:30 am

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.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626