• Welcome to Simple Machines Community Forum. Please login or sign up.
September 26, 2021, 06:28:42 AM

News:

Follow SMF on Twitter.


Post Template Mod

Started by jhaagmans, August 17, 2009, 04:42:27 AM

Previous topic - Next topic

StarredSkies

Well if anyone has interest in updating it for 2.1, then that'd be awesome. We shall see! Thank you.

Arantor

Only the original author can do so.
No good deed goes unpunished
All helpful urges should be circumvented

shadav

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()

Antechinus

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.

shadav

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

Arantor

Nope, mod needs partial rewrite because it isn't using the correct $smcFunc code.
No good deed goes unpunished
All helpful urges should be circumvented

shadav

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

Antechinus

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.

shadav

mehhh
lol thank you for trying though :)

Antechinus

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.

shadav

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 ;)

shadav

October 01, 2019, 10:10:01 PM #91 Last Edit: October 01, 2019, 10:41:22 PM by shadav
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

Diego Andrés

Yes, except you wouldn't have to update the lines manually if the mod was using $smcFunc

SMF Tricks - Free & Premium Responsive Themes for SMF.

Advertisement: