Autofil form for new topic [phpBB3]
2 posters
Page 1 of 1
Autofil form for new topic [phpBB3]
Let's say you have a forum for movies and you want when user click on the button to open a new topic to give him already made template so that he doesn't have to type over and over. You can do so with the script I will give you. This is how it looks:
To achieve this there are some thing needed to be done. Let's go and :
Go to AP -> Modules -> Javascript management and make a new script. Name it "Autofill form" and for placement choose "In the topics".
Paste this code:
Pay close attention here. You can see "?f=11&mode=newtopic" but that's for my forum, your forum number is different. How to know this? Let's say I found my forum I want to use autofill:
I would click on that forum and look in URL to find: ".forumotion.me/f5-skriptni-problemi-kodiranje" and there you go. You have what is the number next to letter f (it's five).
So, you put that number here "??f=11&mode=newtopic'" (instead of 11).
What else? Well, you can change what is being presented when user clicks to open new topic inside:
Bonus: If you want you can post many scripts inside the same script to cover many other forums with different things like this:
To achieve this there are some thing needed to be done. Let's go and :
Go to AP -> Modules -> Javascript management and make a new script. Name it "Autofill form" and for placement choose "In the topics".
Paste this code:
- Code:
$(function() {
if (location.pathname === '/post' && location.search === '?f=11&mode=newtopic') {
$('#text_editor_textarea').val(
'[b]IMDB:[/b]\n[b]IMDB score:[/b]\n[b]Trailer:[/b]'
);
}
});
Pay close attention here. You can see "?f=11&mode=newtopic" but that's for my forum, your forum number is different. How to know this? Let's say I found my forum I want to use autofill:
I would click on that forum and look in URL to find: ".forumotion.me/f5-skriptni-problemi-kodiranje" and there you go. You have what is the number next to letter f (it's five).
So, you put that number here "??f=11&mode=newtopic'" (instead of 11).
What else? Well, you can change what is being presented when user clicks to open new topic inside:
- Code:
val(
'[b]IMDB:[/b]\n[b]IMDB score:[/b]\n[b]Trailer:[/b]'
)
Bonus: If you want you can post many scripts inside the same script to cover many other forums with different things like this:
- Code:
$(function() {
if (location.pathname === '/post' && location.search === '?f=11&mode=newtopic') {
$('#text_editor_textarea').val(
'[b]IMDB:[/b]\n[b]IMDB score:[/b]\n[b]Trailer:[/b]'
);
}
});
$(function() {
if (location.pathname === '/post' && location.search === '?f=8&mode=newtopic') {
$('#text_editor_textarea').val(
'[b]Game name:[/b]\n[b]Game description:[/b]\n[b]Screenshot:[/b]'
);
}
});
SarkZKalie, TonnyKamper and كونان2000 like this post
Wizzard likes this post
Similar topics
» Posting a new topic with the use a form
» Our new form when opening a topic
» Add a form on creation of a new topic
» about the code of add a form creation of a new topic
» Form creation topic does not work
» Our new form when opening a topic
» Add a form on creation of a new topic
» about the code of add a form creation of a new topic
» Form creation topic does not work
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum