We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Post Template in Certain Forums
Topic Started: Jun 1 2013, 01:15 AM (329 Views)
Byzantine
Member Avatar
Zathyus Networks Greek
[ *  *  *  * ]
Board Address: Private
Board Software: (ZetaBoards or InvisionFree) ZB
Description: (What you want your code to do) When you click on 'New Topic', the topic title, topic description and reply area are filled in. I'd like this code to be modified to where certain templates can be used for certain forums. Code
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
//<![CDATA[
function aTemp(fID, title, description, post) {
if (location.href.indexOf('/post/?type=1&mode=1&f=' + fID + '') !== -1) {
$('input[name="title"]').val(title);
$('input[name="description"]').val(description);
$('textarea[name="post"]').val(post);
}
}

aTemp('FORUM_ID', 'TITLE', 'DESCRIPTION', 'POST_CONTENT');
//]]>
</script>
Change the capitalized text as necessary and you can repeat that line to add more forum-specific templates.

Make sure to escape apostrophes if you use them and insert line breaks properly:

Escapement:
Code:
 
\'
Line-break:
Code:
 
\n
Offline Profile Goto Top
 
Byzantine
Member Avatar
Zathyus Networks Greek
[ *  *  *  * ]
Awesome, Thanks Cory! :wub:
Offline Profile Goto Top
 
Eccentric Feline
Member Avatar
梦想
[ *  *  *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic