![]() |
PreDefined Text in New Thread
is it possible to have it when a user clicks new thread in a specific forum there can be a predefined text in the text editor?
so say i had a section where members describe themselves they click new thread and already in the posting box it shows Quote:
|
easyly doable via a template condition of the newthread template :)
you might find the answer already at vbulletintemplates.com or if not, someone there will be able to help you i'm sure :) |
Quote:
|
https://vborg.vbsupport.ru/showthread.php?t=65780 (this thread)
Reply was Quote:
http://www.vbulletintemplates.com/mo...ead.php?t=6494 No Reply http://www.vbulletin.com/forum/showt...981#post681981 reply was Quote:
|
Well, i know that you could probaly get this into the new thread template, but im not sure if it would be possible for the enhanced wysiwyg with out abit of code hacking
|
Quote:
|
Quote:
but i fear, this time i was wrong.... vb3 doesn't allow this as a template codition, so you have to edit newthread.php find that: PHP Code:
PHP Code:
|
Quote:
|
very easy as well, just replace
PHP Code:
PHP Code:
|
Quote:
[.b]Phone Detail[./b] [.b]Color[./b] ?? |
well, your predefined text then should look like that:
Code:
[disable]"Phone Detail\nColor"[/disable] |
thats not what i did
|
i did this
PHP Code:
|
nope, keep it that way, that's possible and ok as well (and also looks better when reviewing the file ;)
|
Quote:
|
Xenon,
Thank you! IMHO, this should be added as a hack or "how to" as this is quite a handy bit of coding. One question: How would I go about adding a second set of prepopulated text (for a different [additional] array of forum ids)? |
you can cascade the iif's so something like:
Code:
construct_edit_toolbar(iif($newpost['message'] == '', iif($foruminfo['forumid'] == 1,'Your predefinied text for forum 1 here', iif($foruminfo['forumid'] == 2,'Your predefinied text for forum 2 here', iif($newpost['message'])), 0, $foruminfo['forumid'], $foruminfo['allowsmilies']); |
Quote:
PHP Code:
|
Quote:
|
You lack a lot of closing )
I suggest that you start with only 1 iif, test it. Then keep adding them and testing until you got them all. |
Quote:
Warning: Missing argument 2 for iif() in /includes/functions.php on line 326 |
Well like i said, build the line by adding the iif's one by one. Sorry to tired now to go analyze your line.
|
Quote:
|
Post the code you used with only 1 and i will have a look
|
Quote:
PHP Code:
|
1 Attachment(s)
Have a look at the following code. If you try to indend pieces of code that belong together, things might be easier to follow:
PHP Code:
Just edit is until you got it right, then implement it in your real code, using real text. PS Instead of putting those long multi-line text in you function call and iif statements, i suggest that you assign var's (or better an array) with these texts, and then use those vars in your statement. This will reduce the size of the source for that statement, making it easier to see where you are going wrong. |
Quote:
|
All times are GMT. The time now is 08:32 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|