cryysis
New Member
KitKats and Whiskey
Posts: 6
inherit
268184
0
Jul 26, 2023 8:59:54 GMT -8
cryysis
KitKats and Whiskey
6
July 2023
cryysis
|
Post by cryysis on Jul 16, 2023 18:46:45 GMT -8
Hello everyone! Thanks for taking a peak. Would it be possible to have a plug in that would allow for members of a board to choose a pre-created "form" when creating a new thread or post? Another way to explain: When someone makes a post or a thread, they can choose from a dropdown menu that allows them to change fonts faces and sizes. What I'm hoping for is a way to allow members to do something similar, but with a custom made form by admins. (An extra bonus, but not one I would reasonably see working with proboard permissions, would be for members to make their own copies of these forms and let them choose from those as well.) Example Form Names: IC Post Form New Character Form Ad Form Request Form The Alter's plug in would be a solution to one of these, but because the theme I'm using is heavily customized I don't think they're compatible.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jul 16, 2023 20:24:20 GMT -8
Have you tried these? - Posting Templates
Updates:Scott I understand how to set this plugin up for a affiliate post but the only thing I can't grasp is the code part of the post. ex. [b] Your code:[/b] <a href=" ? " ><img src=" ? "></a>
ok what goes in place of the question marks? $[input.add-1] or something else? Thanks in advance I'm not Scott, but I'll try to help you out. To answer your question, you'll put #[input.value-#], where # is the position of the field in the UI based on it's category ID. You may want to review the linked post in my previous post - just above yours - for additional information. If you still need help, feel free to ask here - I'll help the best I can. To get you started, if those are the only 2 in that category - with the 1st listed item being the HREF URL and the and the 2nd item being the image URL, it would look something like this: [b] Your code:[/b] <a href="$[input.value-1]"><img src="$[input.value-2]"></a>
NOTE: I haven't personally used URL's or quotes in the plugin on my forums, so you'll need to test those to see if it yields the correct results. if you're looking to have the URL's in a code box, try this route instead: Let me know if you need further assistance. Lynx I have this listed in customized post part 1.$[input.name-1] 2.$[input.address-2] 3.$[input.image-3] 4. Your code: <a href="$[input.address-2]"><img src="$[input.image-3]"></a> when I test it the input values (after create post) it looks Name $[input.address-2] $[input.image-3] Your code: <a href="$[input.address-2]"><img src="$[input.image-3]"></a> Have a look: linkNote:Update I figured it out thanks again Lynx No problem! Glad you got it figured out! There is ONLY $[input.name-#] and $[input.value-#]. There are no other replacement variables, regardless of what they represent. If you're looking for what the field name is in the UI, use the $[input.name-#]. If you're looking for what the person entered for that field, even if it's a URL or image URL, use $[input.value-#]. $[input.address-#] and $[input.image-#] are not valid replacement variables - as I'm sure you found out. Using what I think you're getting from the user (Affiliate info), here's one way to show what they represent: Field Name: Name User Enters: MSG Field Name: Forum URL User Enters: https://something.proboards.com Field Name: Affiliate Image User Enters: https://some_image_host.com/direct_link_to_image.jpg The Field Name is the name you have given the field in the UI, and is accessed via $[input.name-#]. What the User Enters is what the user put in that field, and is accessed via $[input.value-#]. Given the above, the customize post tab could be: $[input.name-1]: $[input.value-1] $[input.name-2]: $[input.value-2] $[input.name-3]: $[input.value-3] and would result in the post being posted like this: Name: MSG Forum URL: https://something.proboards.com Affiliate Image: https://some_image_host.com/direct_link_to_image.jpg Hopefully, that helps clear up what the 2 replacement variables are and what they represent. kerrigan81 , I've created a reservoir plugin to add another 64K (download here). It is designed to support multiple versions of itself. To do so simply copy (export/import) and increment the Plugin ID: custom_template_reserve0, custom_template_reserve1, custom_template_reserve2, etc. (in that order) Only tested against the latest (Custom Posts Template v1.0.1) by adding a secondary field to a form and its field created in the original plugin. See if it suits your needs A field created in a reservoir plugin can reference the ID of a form created in the main plugin and vice versa. It treats all data entered from main as well as reservoir plugins as all coming from the main plugin with 64K chunks of data being added to the data pool per reservoir plugin (minus coding overhead). /post/7312404/thread - Custom Post Template
Updates:Alright, thank you Chris. Maybe I can figure it out then. I could help you with it but I would need the details v2.0Pheobe Black , here is a modified version that includes predefined templates. The one I posted in my previous reply (see details) also has predefined templates but it allows the user to edit and overwrite it with their own then save to their own key. The version in this post does not allow editing by the user and also adds ability to limit a default template to appear only in certain boards in addition to only for certain groups. It appears the change made by Proboards (added a second class of "js-form-post-quick-reply" to the quick reply form) has a few plugins that specifically look for a single class on that form now unable to find that form since it now possesses two classes (simple image upload is another plugin with this problem). I didn't really mess with the form detection portion of the plugin when I modified it for admin defined templates but it shouldn't be too hard to fix once I find where I had stored the source code. Edit:
As I suspected, it was the same as I saw in the simple upload plugin where an attribute selector was being used to determine the class on the form so changing the line at 43 from this.addPostingOptions('form[class=form_post_quick_reply]','textarea[name=message]');to this.addPostingOptions('.form_post_quick_reply','textarea[name=message]');appears to have fixed the problem [v0.2.2]Edit2:
this may be a dumb question, but is there any way we can get this to work on the new pm page by chance? i know it works in the quick replies all over the site, including replying to pms. but if we can get it to come up in the new pm page that'd be great! Find the following by going to build mode and look in the javascript component for the following and add the red portion (it starts at line 33 in the modified version I gave you) // Posting pages if(/^new_post|edit_post|edit_thread|quote_posts|new_thread|new_conversation|new_message$/i.test(page_id)) { this.loadPluginData(); this.templates = $.extend({},this.getGlobalTemplates(),this.templates); this.addPostingOptions('ul.wysiwyg-tabs','div.editor.bbcode-editor textarea'); }
|
|
cryysis
New Member
KitKats and Whiskey
Posts: 6
inherit
268184
0
Jul 26, 2023 8:59:54 GMT -8
cryysis
KitKats and Whiskey
6
July 2023
cryysis
|
Post by cryysis on Jul 17, 2023 0:51:38 GMT -8
I had not, thank you for showing them to me! The Custom Template isn't what I need, for the Posting Templates are perfect! The only problem is that the plug-in doesn't seem to work on my forum properly, but that's something to discuss in the support thread.
|
|