Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: jhaagmans on August 17, 2009, 04:42:27 AM

Title: Post Template Mod
Post by: jhaagmans on August 17, 2009, 04:42:27 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2041)

This mod will enable you to set a default text for new topics in a board. This can come in very handy if you have specific rules about how to post in certain boards, for example when you have a download board or a board in which you can buy or sell items.

The mod will only change the post template of a board for which you set such a template and can be changed in the Manage Board screen.

Untested with 2.0, any comments are highly appreciated!
Title: Re: Post Template Mod
Post by: Costa on August 17, 2009, 05:56:20 AM
Cool cool, nice mod!
Thank's for sharing this with us.

Farewell
-Costa
Title: Re: Post Template Mod
Post by: jhaagmans on August 17, 2009, 07:13:08 AM
No problem, I'm glad to help :)

I will of course make more mods in the future. We're running a forum that needs quite a few custom-made modifications. I will work on a version for 2.0 as we're planning on moving to it in the future.
Title: Re: Post Template Mod
Post by: Blinker on August 17, 2009, 08:53:12 AM
Hi jhaagmans

I just wanted to thank you for this absolutely brilliant mod!

SMF has needed something like this for a long time. I wanted a mod to perform this function a while ago and the best I could find were the rather messy workarounds here - http://www.simplemachines.org/community/index.php?topic=117088.0

Your mod is simple and elegant. It also installed FLAWLESSLY on a very heavily modded 1.1.10 (with no custom theme edits required either...that's always a bonus!). Credit where it's due for a job well done. :)
Title: Re: Post Template Mod
Post by: jhaagmans on August 17, 2009, 11:02:57 AM
Quote from: Blinker on August 17, 2009, 08:53:12 AM
Hi jhaagmans

I just wanted to thank you for this absolutely brilliant mod!

SMF has needed something like this for a long time. I wanted a mod to perform this function a while ago and the best I could find were the rather messy workarounds here - http://www.simplemachines.org/community/index.php?topic=117088.0

Your mod is simple and elegant. It also installed FLAWLESSLY on a very heavily modded 1.1.10 (with no custom theme edits required either...that's always a bonus!). Credit where it's due for a job well done. :)
Thank you very much. Nice to hear! The reason why it works on a heavily modded board is that we also have many mods installed, so I had to find some workarounds to make it work on our board and on a clean board. The only known issue is with the Age and Gender mod, which adds one comma too many somewhere. The only way to work around that issue is in fact editing the Age and Gender mod.
Title: Re: Post Template Mod
Post by: Jessikard on August 17, 2009, 11:31:12 AM
 8) would be nice - screenshots available to see ?
and is it possible o choose the boards where you want to use it ?

error: the package is invalid or damaged  :o
Title: Re: Post Template Mod
Post by: jhaagmans on August 17, 2009, 01:13:02 PM
Quote from: Jessikard on August 17, 2009, 11:31:12 AM
8) would be nice - screenshots available to see ?
and is it possible o choose the boards where you want to use it ?
I can't post screenshots right now, will get to that soon. Basically the only field it adds is a post template text area on your Board Management page.

It's not only possible to choose the board you want to use it, you can specify the default post template for every specific board! Downside is that you can't specify one forum-wide post template, I might include that option in the future. If you want a forum-wide post template, you will have to edit every board individually or run the MySQL query UPDATE smf_boards SET post_template = 'The text to add' WHERE post_template = NULL or something like that using phpMyAdmin. This will keep any post templates that are already set up intact.

Quoteerror: the package is invalid or damaged  :o
Try and use the .zip package on the mod page as an alternative. I've just added it and it might fix this.
Title: Re: Post Template Mod
Post by: Jessikard on August 17, 2009, 02:00:37 PM
 ;D perfect - it works

and it is wonderful to get one text for one board

great mod - thx
Title: Re: Post Template Mod
Post by: Sabre™ on August 18, 2009, 02:15:42 AM
Nice 8)

Keep up the good work :)
Title: Re: Post Template Mod
Post by: fals on August 31, 2009, 04:47:46 PM
Thanks !
Title: Re: Post Template Mod
Post by: 4b11l on September 08, 2009, 12:27:17 AM
Excellent mod!

Will there be a chance that we can apply a template for replies in a certain thread? Or to reply/threads in a board?

I have a board setup where I have 5 threads where people post reviews. The board is a reply only type board and an addition like this to just the replies on a thread would be great!

If it's an easy fix, will you be able to help me implement it? Thanks. :)

If not, hopefully a new version comes out soon.
Title: Re: Post Template Mod
Post by: JakJak on September 08, 2009, 02:13:28 AM
Nice mod. Except it doesn't let me upload it.  ::)
Title: Re: Post Template Mod
Post by: jhaagmans on September 08, 2009, 03:10:36 AM
Quote from: 4b11l on September 08, 2009, 12:27:17 AM
Excellent mod!

Will there be a chance that we can apply a template for replies in a certain thread? Or to reply/threads in a board?

I have a board setup where I have 5 threads where people post reviews. The board is a reply only type board and an addition like this to just the replies on a thread would be great!

If it's an easy fix, will you be able to help me implement it? Thanks. :)

If not, hopefully a new version comes out soon.
It could be done. I don't have time for it ATM and you would have to expand the mod for it.

As a hack to this mod, you could make a select list that says "apply to new topic, apply to reply, apply to both" and set the post template mod in replies as well. But it's not pretty.
Title: Re: Post Template Mod
Post by: jhaagmans on September 08, 2009, 03:11:00 AM
Quote from: JakJak on September 08, 2009, 02:13:28 AM
Nice mod. Except it doesn't let me upload it.  ::)
Tell me what happens.
Title: Re: Post Template Mod
Post by: JakJak on September 08, 2009, 03:21:40 AM
Quote from: jhaagmans on September 08, 2009, 03:11:00 AM
Quote from: JakJak on September 08, 2009, 02:13:28 AM
Nice mod. Except it doesn't let me upload it.  ::)
Tell me what happens.

It says one of the files can't do the edits.
Title: Re: Post Template Mod
Post by: jhaagmans on September 08, 2009, 07:52:20 AM
Quote from: JakJak on September 08, 2009, 03:21:40 AM
Quote from: jhaagmans on September 08, 2009, 03:11:00 AM
Quote from: JakJak on September 08, 2009, 02:13:28 AM
Nice mod. Except it doesn't let me upload it.  ::)
Tell me what happens.

It says one of the files can't do the edits.
Could you give me some more information? Which file and what other mods do you have installed? It's probably a problem with another mod, so I might not be able to help you. It's nearly impossible to keep a mod from colliding with any other mod. However, this has been tested along with many other mods.
Title: Re: Post Template Mod
Post by: 4b11l on September 08, 2009, 11:33:54 AM
Quote from: jhaagmans on September 08, 2009, 03:10:36 AM
Quote from: 4b11l on September 08, 2009, 12:27:17 AM
Excellent mod!

Will there be a chance that we can apply a template for replies in a certain thread? Or to reply/threads in a board?

I have a board setup where I have 5 threads where people post reviews. The board is a reply only type board and an addition like this to just the replies on a thread would be great!

If it's an easy fix, will you be able to help me implement it? Thanks. :)

If not, hopefully a new version comes out soon.
It could be done. I don't have time for it ATM and you would have to expand the mod for it.

As a hack to this mod, you could make a select list that says "apply to new topic, apply to reply, apply to both" and set the post template mod in replies as well. But it's not pretty.

Thanks. Hopefully a new update will come out soon.
Title: Re: Post Template Mod
Post by: jhaagmans on September 08, 2009, 11:38:29 AM
Quote from: jhaagmans on September 08, 2009, 07:52:20 AM
Quote from: JakJak on September 08, 2009, 03:21:40 AM
Quote from: jhaagmans on September 08, 2009, 03:11:00 AM
Quote from: JakJak on September 08, 2009, 02:13:28 AM
Nice mod. Except it doesn't let me upload it.  ::)
Tell me what happens.

It says one of the files can't do the edits.
Could you give me some more information? Which file and what other mods do you have installed? It's probably a problem with another mod, so I might not be able to help you. It's nearly impossible to keep a mod from colliding with any other mod. However, this has been tested along with many other mods.

In addition to this: there's a known problem with the Age & Gender Board Filter mod. That mod has a comma that shouldn't be there. I'm sure there are more problems than this, but it's quite a light mod, so it should have no problem with most other mods.
Title: Re: Post Template Mod
Post by: Mraza on September 09, 2009, 08:38:38 PM
awesome work.... works great... thanks

A question.. is that possible for you to make that template not editable. i mean if i will start a new topic there is the template of my message which i saved in setting and now i wants to write content in front of them like:

First Name: (here i can write) 

and the first name: which i store in my template is not editable in editor.?...can you do this plz... thanks
Title: Re: Post Template Mod
Post by: jhaagmans on September 10, 2009, 04:49:43 AM
Quote from: Mraza on September 09, 2009, 08:38:38 PM
awesome work.... works great... thanks

A question.. is that possible for you to make that template not editable. i mean if i will start a new topic there is the template of my message which i saved in setting and now i wants to write content in front of them like:

First Name: (here i can write) 

and the first name: which i store in my template is not editable in editor.?...can you do this plz... thanks
Hi,

No, that's not what I intended to do. I wanted this to be flexible so that it actually is a template. For what you want you'd need to add fields that users can fill in and you would need a new table in your database to fill these fields. I have no time to do this ATM.
Title: Re: Post Template Mod
Post by: MrCreatoR on October 01, 2009, 07:43:19 AM
Would be very usefull mod.
Is this mod will be updated for SMF 2.0 RC1.2?
Title: Re: Post Template Mod
Post by: jhaagmans on October 01, 2009, 07:53:15 AM
Quote from: MrCreatoR on October 01, 2009, 07:43:19 AM
Would be very usefull mod.
Is this mod will be updated for SMF 2.0 RC1.2?
When SMF2 is stable, we ourselves will be upgrading to SMF2, so it will probably be developed then.
Title: Re: Post Template Mod
Post by: MrCreatoR on October 01, 2009, 08:59:18 AM
Quote from: jhaagmans on October 01, 2009, 07:53:15 AM
Quote from: MrCreatoR on October 01, 2009, 07:43:19 AM
Would be very usefull mod.
Is this mod will be updated for SMF 2.0 RC1.2?
When SMF2 is stable, we ourselves will be upgrading to SMF2, so it will probably be developed then.
Well, SMF2 is prety stable, and i don't think that the final version will include many changes that are post-related.

Can you please tell me at least how i can adapt this mod to 2.0? I just need a direction of what changes do this and that, for example:
'permission_mode' => 'normal',
does not exist in «$sourcedir/ManageBoards.php» anymore, what this change should do?
Title: Re: Post Template Mod
Post by: jhaagmans on October 01, 2009, 10:40:00 AM
Quote from: MrCreatoR on October 01, 2009, 08:59:18 AM
Quote from: jhaagmans on October 01, 2009, 07:53:15 AM
Quote from: MrCreatoR on October 01, 2009, 07:43:19 AM
Would be very usefull mod.
Is this mod will be updated for SMF 2.0 RC1.2?
When SMF2 is stable, we ourselves will be upgrading to SMF2, so it will probably be developed then.
Well, SMF2 is prety stable, and i don't think that the final version will include many changes that are post-related.
I'm sure. But it isn't stable and this is a board I'm modifying for a client, so at this point, I can't upgrade. I'm sorry.

QuoteCan you please tell me at least how i can adapt this mod to 2.0? I just need a direction of what changes do this and that, for example:
'permission_mode' => 'normal',
does not exist in «$sourcedir/ManageBoards.php» anymore, what this change should do?
If you can, look at the source code ManageBoards.php in v1. This particular change is adding a rule to an array I guess (not sure and I'm not able to look right now). Just find the array it's adding to and change the line it should be added after. If the array doesn't exist any more, look for something replacing it or just go and try to do this without this specific line. See what happens.

Good luck! And if you want to submit an update to this mod for 2.0, you're free to do so.
Title: Re: Post Template Mod
Post by: MrCreatoR on October 02, 2009, 08:19:30 AM
jhaagmans [?] (http://www.simplemachines.org/community/index.php?topic=331419.msg2285785#msg2285785)
QuoteGood luck!
Thanks :) I managed to fix almoust all issues (except the one i mentioned before), and install test shows that all Success. But after installing i got this error:

QuoteFatal error: Call to undefined function db_query() in Z:\home\smf2.ru\www\Packages\temp\database.php on line 16
I tried to replace «db_query» with «$smcFunc['db_query']» (the variable i added to the top), but i got a syntax error then :( Any ideas?
Title: Re: Post Template Mod
Post by: jhaagmans on October 02, 2009, 10:39:35 AM
Quote from: MrCreatoR on October 02, 2009, 08:19:30 AMI tried to replace «db_query» with «$smcFunc['db_query']» (the variable i added to the top), but i got a syntax error then :( Any ideas?
Something must have changed in the way the database is queried in 2.0. Look at another mod which also does database changes and see what's changed. Is the global $db_prefix; still correct?
Title: Re: Post Template Mod
Post by: MrCreatoR on October 02, 2009, 12:13:06 PM
jhaagmans [?] (http://www.simplemachines.org/community/index.php?topic=331419.msg2287233#msg2287233)
QuoteLook at another mod which also does database changes and see what's changed.
Ok, i will check this.

QuoteIs the global $db_prefix; still correct?
I think yes, althought i noticed that instead of $db_prefix in the templates used db_prefix, without the dollar sign.
Title: Re: Post Template Mod
Post by: jhaagmans on October 02, 2009, 02:27:39 PM
Quote from: MrCreatoR on October 02, 2009, 12:13:06 PM
jhaagmans [?] (http://www.simplemachines.org/community/index.php?topic=331419.msg2287233#msg2287233)
QuoteLook at another mod which also does database changes and see what's changed.
Ok, i will check this.

QuoteIs the global $db_prefix; still correct?
I think yes, althought i noticed that instead of $db_prefix in the templates used db_prefix, without the dollar sign.
That might be it. I'm not familiar with 2.0, so if anyone is, please step in. I don't know whether anything else has changed, but do these other scripts also use the db_query() function?
Title: Re: Post Template Mod
Post by: MrCreatoR on October 02, 2009, 04:47:31 PM
jhaagmans [?] (http://www.simplemachines.org/community/index.php?topic=331419.msg2287497#msg2287497)
QuoteI don't know whether anything else has changed, but do these other scripts also use the db_query() function?
I found a few - they uses this:
$request = $smcFunc['db_query']('', "SHOW COLUMNS FROM ....

And now there is no errors after installing, but i get this when navigating to boards managing section:

Unknown column 'b.post_template' in 'field list'
File: Z:\home\smf2.ru\www\Sources\Subs-Boards.php
Line: 1031


Perhaps i can add data to database manualy?
Title: Re: Post Template Mod
Post by: MrCreatoR on October 02, 2009, 05:33:18 PM
Ok, i think i managed to make this mod work on SMF 2, but the issue with 'permission_mode' is still there, i just disabled it in the new version. I searched in smf version changes (upgrades) (http://custom.simplemachines.org/upgrades/), but i didn't found any change that related to this line, and i checked every version!

I am attaching now a new version (0.1.3), the new version is added by <install for="2.0 - 2.99.99">, so it's fully compatible with previous versions.
Title: Re: Post Template Mod
Post by: jhaagmans on October 03, 2009, 03:58:43 AM
Great stuff mate. I've added you to the author list, so I hereby invite you to add the file to the mod page yourself :)
Title: Re: Post Template Mod
Post by: MrCreatoR on October 04, 2009, 05:15:01 AM
Quote from: jhaagmans on October 03, 2009, 03:58:43 AM
Great stuff mate. I've added you to the author list, so I hereby invite you to add the file to the mod page yourself :)
Thanks. File has been added...

Changelog
0.1.3 - October 2th, 2009
- Mod now compatible with SMF 2.0 RC1.2.
- Added Russian translation.
Title: Re: Post Template Mod
Post by: jhaagmans on October 04, 2009, 07:30:49 AM
Quote from: MrCreatoR on October 04, 2009, 05:15:01 AM
Quote from: jhaagmans on October 03, 2009, 03:58:43 AM
Great stuff mate. I've added you to the author list, so I hereby invite you to add the file to the mod page yourself :)
Thanks. File has been added...

Changelog
0.1.3 - October 2th, 2009
- Mod now compatible with SMF 2.0 RC1.2.
- Added Russian translation.
Nice. Great stuff mate :)
Title: Re: Post Template Mod
Post by: digit on October 18, 2009, 08:34:28 AM
Very nice.  Installed and is working great. 

I was hoping this would put a bit of text above the text input field... uneditable...  just a bit of text to give board specific instructions.  Any idea how I could modify this mod to do that?   8)
Title: Re: Post Template Mod
Post by: jhaagmans on October 19, 2009, 04:39:21 AM
Quote from: digit on October 18, 2009, 08:34:28 AM
Very nice.  Installed and is working great. 

I was hoping this would put a bit of text above the text input field... uneditable...  just a bit of text to give board specific instructions.  Any idea how I could modify this mod to do that?   8)
This plugin only modifies the content of the text area. I believe there's another plugin that puts text above your submit button, but I'm not sure which one it is and whether it's still supported.
Title: Re: Post Template Mod
Post by: wladymeer on November 15, 2009, 01:09:32 AM
Looking forward for "every reply" enhancement - very useful mod for those who want form based posts :)

It would be nice if you could somehow include it inside of quick reply as well when you decide to enhance it (or maybe further enhancement - pre-defined form available for "topic starter" only - imagine someone doing reviews while others want to comment it)
Title: Re: Post Template Mod
Post by: lelkins on December 17, 2009, 09:53:19 AM
Hey guys, I tried to install this on RC2 but couldn't get it to work for some reason.
I was trying on the default/curve theme.

Can anyone give me some pointers on how to get it to work?

It installs and I can set the template in the 'modify board' section, but when I go to post a new topic it doesn't give the template.

Thanks!
Title: Re: Post Template Mod
Post by: dry3210 on March 02, 2010, 09:20:52 AM
Any updates for 2.0RC2?

Its looking for


<td valign="top" align="left">
<input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="check" />
</td>
</tr>';


But the code is now


<dd>
<input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
</dd>
</dl>
Title: Re: Post Template Mod
Post by: Nisorin on March 12, 2010, 11:17:20 PM
Anyone have a way to get it to work with SMF 1.1.11?
Title: Re: Post Template Mod
Post by: Eclipse16V on March 24, 2010, 05:06:05 AM
Any updates for 2.0RC3
Title: Re: Post Template Mod
Post by: SN on March 24, 2010, 05:18:13 AM
didn't realise there was a mod like this! I really need this would make mine and my staff job 100x easier.

any chance of a update for RC 3?
Title: Re: Post Template Mod
Post by: Omega_K2 on March 29, 2010, 09:17:00 AM
Yeah, an update to SMF 2.0RC3 would be pretty nice to have
Title: Re: Post Template Mod
Post by: TomW on May 20, 2010, 03:22:26 PM
Ditto that !
Title: Re: Post Template Mod
Post by: Eclipse16V on May 20, 2010, 03:58:38 PM
Please update to RC3
Title: Re: Post Template Mod
Post by: Rosenstein on June 15, 2010, 09:24:24 AM
I would love to see update.
Original author was Last Active: 25 January 2010
But the guy who updated it to RC2 is still active.
Title: Re: Post Template Mod
Post by: doughboy99 on September 09, 2010, 09:21:24 AM
To make this work with RC3 you will need to manually edit ManageBoards.template.php to reflect the changes made

FIND
    echo '
                    <div id="count_posts_div">
                        <dl class="settings">
                            <dt>
                                <strong>', $txt['mboards_count_posts'], ':</strong><br />
                                <span class="smalltext">', $txt['mboards_count_posts_desc'], '</span><br />
                            </dt>
                            <dd>
                                <input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
                            </dd>
                        </dl>
                    </div>';


AND ADD AFTER
// Text area for Post Template Mod
echo '
                  <div id="post_template_mod_div">
                  <dl class="settings">
                        <dt>
                                  <strong>', $txt['post_template_title'], '</strong><br />
                                <span class="smalltext">', $txt['post_template_description'], '</span><br />
                        </dt>
                        <dd>
                                <textarea name="post_template" rows="5" cols="35" style="width: 100%">'.
                                          $context['board']['post_template'] .
                                '</textarea>
                        </dd>
                  </dl>
                  </div>';


Title: Re: Post Template Mod
Post by: xufang on September 09, 2010, 10:03:34 AM
cool,very nice  ;)
Title: Re: Post Template Mod
Post by: KensonPlays on September 09, 2010, 10:14:48 AM
awesome! i will install this and do manual edit! thanks! i saw a phpBB forum promotion site and a few boards have pre-defined text, this will come in handy somewhere on my site! bookmarked!
Title: Re: Post Template Mod
Post by: KensonPlays on September 09, 2010, 11:22:57 AM
I installed, Subs-Boards.php and ManageBoards.template.php both failed. Here are a couple screenshots of what it looks like modifying a board. Two files also attached.
Title: Re: Post Template Mod
Post by: doughboy99 on September 09, 2010, 02:41:46 PM
Both the attached php files appear to be corrupt!
Title: Re: Post Template Mod
Post by: KensonPlays on November 03, 2010, 10:49:31 AM
When will this have support for RC4? I am waiting until my main modifications (the important ones) have RC4 support before I upgrade. This is holding me back.
Title: Re: Post Template Mod
Post by: shaka on May 20, 2011, 04:44:48 PM
anychance of an upgrade for RC5   please  ;D
Title: Re: Post Template Mod
Post by: KensonPlays on May 20, 2011, 08:09:49 PM
Agreed, I would love this mod again :)
Title: Re: Post Template Mod
Post by: 4b11l on June 16, 2011, 06:17:00 PM
bump for smf 2.0 please if original author or someone else can modify it to work would be great!
Title: Re: Post Template Mod
Post by: .Vapor on June 24, 2011, 07:58:46 AM
Can you please update this mod to work with 2.0 ?

Thanks, and nice work.
Title: Re: Post Template Mod
Post by: divecall on July 25, 2011, 03:57:34 PM
Please update for RC5 and 2.0

Thank you
Title: Re: Post Template Mod
Post by: studiowi33 on August 15, 2011, 02:33:43 PM
Can anyone figure out what to alter so that I can use this mod?

I'm using 2.0 final and everything installs except the one edit in ManageBoards.template.php. The code has changed substantially enough to prevent me from modifying the code myself.

Any insight is appreciated.

-s.w

EDIT: I went ahead and installed this and I manually edited the ManageBoards.template.php simply by pasting the 'Add after' code in what seemed to be the correct place. (I searched for:
input type="checkbox" name="count"
and pasted the code in after that <div>.)

So far, no errors, and it works.
Title: Re: Post Template Mod
Post by: OCJ on August 16, 2011, 01:45:46 PM
On SMF 2.0 final
I used the above topic manual edit (ManageBoards.template.php) then went to the admin section for the boards.
The setting was there but when I entered the template text and tried to save it gave an error message 'Hacking attempt', and does not save the post template text ...

Pity, it would've been a nice mod to have.
Andy
Title: Re: Post Template Mod
Post by: Draffi on September 08, 2011, 04:30:46 PM
Please, can somebody update this Mod ?

(if somebody have, or can do this for some money, please contact me with PM).

Thanks a lot!
Title: Re: Post Template Mod
Post by: shaka on November 09, 2011, 08:56:43 PM
can someone please update this mod  :-[
Title: Re: Post Template Mod
Post by: KensonPlays on November 09, 2011, 10:11:22 PM
Update for 2.0.1 gold?
Title: Re: Post Template Mod
Post by: divecall on December 08, 2011, 05:45:24 PM
Please, can somebody update this Mod/Idea to an RC5 / 2.0.1 - Release?

Thanks in advance
Title: Re: Post Template Mod
Post by: hcfwesker on December 28, 2011, 05:35:39 PM
Download the   post_template_mod_0.1.3.zip   on the MOD page.  It's compatible up to SMF 2.0.2

When you get an install error on /Themes/default/ManageBoards.template.php  , just do this edit in the file ...

Find
<input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
</dd>
</dl>
</div>';


Replace with
<input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
</dd>
</dl>
</div>';

// Text area for Post Template Mod
echo '
<tr>
<td valign="top">
<b>', $txt['post_template_title'], '</b><br />
', $txt['post_template_description'], '<br />
</td>
<td valign="top" align="right">
<textarea name="post_template" rows="5" cols="29">'.
$context['board']['post_template'] .
'</textarea>
</td>
</tr>';



Any other install errors you'll have to manually do yourself.  this was the only install error i got on a clean smf 2.0.2 forum, and it's because smf 2 and hogher stopped using the <tr> tags


Title: Re: Post Template Mod- 'Hacking attempt' - not work with some characters
Post by: OCJ on December 29, 2011, 09:40:24 AM
I said this before and even trying the edits here ... it does install but when you save the template it says
QuoteAn Error Has Occurred!
Hacking attempt...
Back

It does not save the template.
When I tried taking out everything except the first few words ... it worked. Seems like it is rejecting some special characters or its too long... I havent found out which yet.
First few lines did save ... will have to keep testing to see where it fails.

Text rejected by the template mod
QuoteUPDATES [更新]:
People signed up so far [人々はこれまでにサインアップ]:
Title and Date [タイトル, 日付]:
Location [場所]:
Event Grade [イベント等級]:
Contact Details (and sign up conditions) [連絡先詳細(と参加の条件)]
Organizer's email here, also phone number ok, or ask to sign up on the website page, or send you private message on the website (PM).

Event Details [イベント詳細], Route and Time [ルートと時間]
Maps and Useful links [地図と役に立つリンク]
Things to Bring [持参するもの]
Meeting Time and Place [集合時間と場所]
Travel Details [旅行の詳細]
Cost [費用]

REMEMBER - to join an event see the 'Contact Details'. Website reply, email, phone, PM-private message.

SAFETY! (Event Grade, Safety & Insurance / イベント等級、安全&保険) Read before joining events!

The board edit page is also squashed 1/2 width ... can live with that.
Also another error now trying slightly shorter text.

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's email here, also phone number ok, or ask to sign up on the website page, or se' at line 6
File: /home2/outdoor3/public_html/Sources/Subs-Boards.php
Line: 674

My system is up to date smf 202.
Title: Re: Post Template Mod
Post by: OCJ on December 29, 2011, 10:00:21 AM
Its some character in there ....
& ...? maybe.

Also it doesnt work when topic posted from the calendar   :P wonderful...
Not much use after I just potty trained everyone to always add events from the calendar.
Title: Re: Post Template Mod
Post by: marex86 on January 25, 2012, 09:13:55 PM
Did anybody made this to work on every reply not just on new topic?
Title: Re: Post Template Mod
Post by: dzembak on November 02, 2012, 06:12:44 AM
How to make it work for 1.1.16? Does manual installation "how to" exists?
Title: Re: Post Template Mod
Post by: KensonPlays on November 02, 2012, 10:35:03 AM
New suggestion? Allow "canned replies" as part of mod, or possibly part of a new, "pro" version?
Title: Re: Post Template Mod
Post by: Neek on December 22, 2012, 07:04:57 PM
I've updated this package for 2.0.3 and attached it to this reply. All tests in the package manager are successful and it installs without any errors.

<<Attachment removed by K@. Sorry and all that.>>
Title: Re: Post Template Mod
Post by: OCJ on March 24, 2013, 08:30:53 AM
The attached update files do indeed install perfectly (and on 2.04)
Title: Re: Post Template Mod
Post by: Arantor on March 24, 2013, 08:46:36 AM
/me notifies the administrators that the above package is technically illegal without the original author's permission to do so.
Title: Re: Post Template Mod
Post by: br360 on September 09, 2013, 03:00:21 PM
I know nobody has posted in this topic in months, and not sure it's even supported anymore; but I just found this mod, and it was exactly what I was looking for.

I have a question that hopefully someone that uses this mod can answer. I am interested in starting one board with a pre-filled template in it. When the person fills the template out, they will then have a drop down box with all the other boards of the forum in it (except the private boards they can't see or have access to), allowing them to simply choose the board they want their topic redirected to.

Has anyone added this to the mod, or does anyone have any idea of how something like this can be accomplished?

___________________________________________________________________________________________________

Edit: Um, nevermind. I just realized this can be accomplished by default by setting board permissions. ;)
Title: Re: Post Template Mod
Post by: Neek on January 29, 2014, 06:41:53 AM
I continue to get PMs asking me for my attachment that the moderators removed...

The forum policy here seems to be counter-productive in this particular case.

I still have the fixed package file if the original author or a moderator wants it to officially fix this mod.
Title: Re: Post Template Mod
Post by: Arantor on January 29, 2014, 07:02:27 AM
The policy is because of a little thing called copyright law which we are unfortunately bound to uphold.
Title: Re: Post Template Mod
Post by: von COLLINZO on January 29, 2014, 06:51:54 PM
Nice mod... :)
Title: Re: Post Template Mod
Post by: 2greedy on March 23, 2014, 01:14:05 AM
is there anything else like this? i really need a new topic template mod
Title: Re: Post Template Mod
Post by: minimono on May 26, 2019, 02:02:42 AM
is Error > Call to undefined function mysql_num_rows()
Title: Re: Post Template Mod
Post by: Arantor on May 26, 2019, 03:08:56 AM
The mod needs updating for PHP 7.
Title: Re: Post Template Mod
Post by: StarredSkies on July 31, 2019, 07:19:52 PM
Any hopes of adding this into 2.1? or adding responsiveness to the templates? This is something my site *adores* and I would love to keep it going.
Title: Re: Post Template Mod
Post by: Arantor on August 01, 2019, 01:32:00 AM
There is zero chance it will become part of 2.1 but it's not impossible to update for 2.1.
Title: Re: Post Template Mod
Post by: StarredSkies on August 02, 2019, 09:57:04 PM
Well if anyone has interest in updating it for 2.1, then that'd be awesome. We shall see! Thank you.
Title: Re: Post Template Mod
Post by: Arantor on August 03, 2019, 12:50:30 AM
Only the original author can do so.
Title: Re: Post Template Mod
Post by: shadav on October 01, 2019, 05:00:40 PM
I'd like to get this to work on 2.0.15

I did the following
Quote from: hcfwesker on December 28, 2011, 05:35:39 PM
Download the   post_template_mod_0.1.3.zip   on the MOD page.  It's compatible up to SMF 2.0.2

When you get an install error on /Themes/default/ManageBoards.template.php  , just do this edit in the file ...

Find
<input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
</dd>
</dl>
</div>';


Replace with
<input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
</dd>
</dl>
</div>';

// Text area for Post Template Mod
echo '
<tr>
<td valign="top">
<b>', $txt['post_template_title'], '</b><br />
', $txt['post_template_description'], '<br />
</td>
<td valign="top" align="right">
<textarea name="post_template" rows="5" cols="29">'.
$context['board']['post_template'] .
'</textarea>
</td>
</tr>';



Any other install errors you'll have to manually do yourself.  this was the only install error i got on a clean smf 2.0.2 forum, and it's because smf 2 and hogher stopped using the <tr> tags

but when trying to install I get this error
Call to undefined function mysql_num_rows()
Title: Re: Post Template Mod
Post by: Antechinus on October 01, 2019, 05:09:51 PM
At a guess I'd say that's because it's using invalid markup. It looks to be trying to just insert random table bits out of context, which could screw everything after that. That's probably causes a cascade of f*#kery (technical term, which you are probably familiar with) resulting in somehow having a db call showing up in the template.

Would suggest using a div instead. This should work (may need a bit of CSS to style it):

<input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
</dd>
</dl>
</div>';

// Text area for Post Template Mod
echo '
<div>
<div>
<b>', $txt['post_template_title'], '</b>
<br />
', $txt['post_template_description'], '
</div>
<textarea name="post_template" rows="5" cols="29">
'.$context['board']['post_template'] . '
</textarea>
</div>';



Of course you can add your own classes or ID's if it'll make the CSS easier.
Title: Re: Post Template Mod
Post by: shadav on October 01, 2019, 05:23:57 PM
bwahahaha yes, very familiar bwahahaha, usually because of my own doing even  :P
Quote from: Antechinus on October 01, 2019, 05:09:51 PM
At a guess I'd say that's because it's using invalid markup. It looks to be trying to just insert random table bits out of context, which could screw everything after that. That's probably causes a cascade of f*#kery (technical term, which you are probably familiar with) resulting in somehow having a db call showing up in the template.

Would suggest using a div instead. This should work (may need a bit of CSS to style it):

<input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
</dd>
</dl>
</div>';

// Text area for Post Template Mod
echo '
<div>
<div>
<b>', $txt['post_template_title'], '</b>
<br />
', $txt['post_template_description'], '
</div>
<textarea name="post_template" rows="5" cols="29">
'.$context['board']['post_template'] . '
</textarea>
</div>';



Of course you can add your own classes or ID's if it'll make the CSS easier.

thanks, i tried that still the same error when trying to install
Title: Re: Post Template Mod
Post by: Arantor on October 01, 2019, 05:37:49 PM
Nope, mod needs partial rewrite because it isn't using the correct $smcFunc code.
Title: Re: Post Template Mod
Post by: shadav on October 01, 2019, 05:55:49 PM
darn.... well hopefully they'll get around to updating it :D

would be nice to use this in my teachers advertising board to make sure that they post all required information for folks to get ahold of them
Title: Re: Post Template Mod
Post by: Antechinus on October 01, 2019, 06:06:25 PM
Well the markup in that suggested code was stuffed anyway, so I'd still advise using the div, etc. :D

ETA: The original author hasn't been active since 2010. The latest version of the mod on the download page claims to be compatible with 2.0 RC1, but according to the parser it isn't. The parser says that it's not compatible with anything later than 1.1.10.
Title: Re: Post Template Mod
Post by: shadav on October 01, 2019, 06:27:40 PM
mehhh
lol thank you for trying though :)
Title: Re: Post Template Mod
Post by: Antechinus on October 01, 2019, 06:35:43 PM
You claim to like messing with databases and stuff. You could always update it yourself. It's kosher to edit mods for your own use. You're just not supposed to distribute an edited package without permission.
Title: Re: Post Template Mod
Post by: shadav on October 01, 2019, 07:02:10 PM
Quote from: Antechinus on October 01, 2019, 06:35:43 PM
You claim to like messing with databases and stuff. You could always update it yourself. It's kosher to edit mods for your own use. You're just not supposed to distribute an edited package without permission.
:laugh: :laugh: :laugh:
I don't know about that, I said it could be fun playing in the db ;D
i may play with this later and see if I can't figure it out, still not fully used to smf and well..... I know enough to get myself into trouble is about all :p can kind of follow the logic in things and figure out how they work to tweak them but then that'd mean i'd need to understand smf first  ;D
years ago I could mod phpLD but I worked with it so much that I had figured out how things worked  :P this is still a learning curve for me
hahaha those qbasic classes umpteen years ago don't much apply these days ;)
Title: Re: Post Template Mod
Post by: shadav on October 01, 2019, 10:10:01 PM
ok with a bit of help pointing in the right direction i got past that error but now another one

Call to undefined function mysql_free_result()

and it's this code that's causing it
mysql_free_result ($request);

hahaha i tried the same fix to fix the above issue but then got this warning  :P
Function name must be a string
i knew it couldn't be that easy.....

ok figured it out after a bit of searching, it's depreciated.... using
mysqli_free_result($request);
instead seems to have worked
Title: Re: Post Template Mod
Post by: Diego Andrés on October 03, 2019, 10:23:42 PM
Yes, except you wouldn't have to update the lines manually if the mod was using $smcFunc