Advertisement:

Author Topic: Post Template Mod  (Read 42371 times)

Offline StarredSkies

  • Semi-Newbie
  • *
  • Posts: 72
    • Beasts of Beyond
Re: Post Template Mod
« Reply #80 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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,647
    • StoryBB/StoryBB on GitHub
Re: Post Template Mod
« Reply #81 on: August 03, 2019, 12:50:30 AM »
Only the original author can do so.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Post Template Mod
« Reply #82 on: October 01, 2019, 05:00:40 PM »
I'd like to get this to work on 2.0.15

I did the following
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
Code: [Select]
<input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
</dd>
</dl>
</div>';

Replace with
Code: [Select]
<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
Code: [Select]
Call to undefined function mysql_num_rows()

Online Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,763
  • Master of BBC Abuse
Re: Post Template Mod
« Reply #83 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):

Code: [Select]
<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.

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Post Template Mod
« Reply #84 on: October 01, 2019, 05:23:57 PM »
bwahahaha yes, very familiar bwahahaha, usually because of my own doing even  :P
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):

Code: [Select]
<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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,647
    • StoryBB/StoryBB on GitHub
Re: Post Template Mod
« Reply #85 on: October 01, 2019, 05:37:49 PM »
Nope, mod needs partial rewrite because it isn’t using the correct $smcFunc code.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Post Template Mod
« Reply #86 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

Online Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,763
  • Master of BBC Abuse
Re: Post Template Mod
« Reply #87 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.

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Post Template Mod
« Reply #88 on: October 01, 2019, 06:27:40 PM »
mehhh
lol thank you for trying though :)

Online Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,763
  • Master of BBC Abuse
Re: Post Template Mod
« Reply #89 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.

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Post Template Mod
« Reply #90 on: October 01, 2019, 07:02:10 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 ;)

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Post Template Mod
« Reply #91 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

Code: [Select]
Call to undefined function mysql_free_result()
and it's this code that's causing it
Code: [Select]
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
Code: [Select]
mysqli_free_result($request);instead seems to have worked
« Last Edit: October 01, 2019, 10:41:22 PM by shadav »

Offline Diego Andrés

  • Customizer
  • SMF Hero
  • *
  • Posts: 3,348
  • Gender: Male
    • DiegoSetroc on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: Post Template Mod
« Reply #92 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

SMF Tricks - Free & Premium Responsive Themes for SMF.