2012-12-12, 12:43 AM
Hello,
I'm trying to set up my New Thread page in such a way that the subject input's value is preset (though not predetermined, ie can be altered by the user) as the result of an attribute within the URL.
For example, on a certain page there is a link to http://community.mybb.com/newthread.php?...ubject=Set a default value for a thread's subject by attribute within the URL. The words "Set a default value for a thread's subject by attribute within the URL" would already be in the input box.
I seem to remember coming across quite a simple solution to a task like this quite some time ago, so either I'm misremembering or being daft about it.
The desired result is that, when a user of my website (a fansite for The Rolling Stones) goes to an album's page (E.g. this), a PHP script checks whether a MYBB thread exists with the album's title. If so, the hyperlink takes the user to the specific thread. If not, the link takes the user to newthread.php, but with this desired pre-set subject input of the album title. With the example page I've given, there is no such discussion thread for 'Goats Head Soup', so the link should take the user to newthread.php with 'Goats Head Soup' already in the subject-input. (NB I have the script sussed)
I hope that I have explained this well and someone can help me out
Thanks a lot,
Patrick Todd
I'm trying to set up my New Thread page in such a way that the subject input's value is preset (though not predetermined, ie can be altered by the user) as the result of an attribute within the URL.
For example, on a certain page there is a link to http://community.mybb.com/newthread.php?...ubject=Set a default value for a thread's subject by attribute within the URL. The words "Set a default value for a thread's subject by attribute within the URL" would already be in the input box.
I seem to remember coming across quite a simple solution to a task like this quite some time ago, so either I'm misremembering or being daft about it.
The desired result is that, when a user of my website (a fansite for The Rolling Stones) goes to an album's page (E.g. this), a PHP script checks whether a MYBB thread exists with the album's title. If so, the hyperlink takes the user to the specific thread. If not, the link takes the user to newthread.php, but with this desired pre-set subject input of the album title. With the example page I've given, there is no such discussion thread for 'Goats Head Soup', so the link should take the user to newthread.php with 'Goats Head Soup' already in the subject-input. (NB I have the script sussed)
I hope that I have explained this well and someone can help me out
Thanks a lot,
Patrick Todd