Random Number Gen on Submission

Started by LostGeographer, December 01, 2011, 03:49:41 PM

Previous topic - Next topic

LostGeographer

Hey all,

Let me start off by for-warning you I have not ventured in to PHP in probably 7 years, but I am jumping back in. I am however not looking for someone to do the work for me, but point me in the right direction. I think this stuff is still in there, it just needs some help getting out.

Just installed SMF 2.0.1 on my box here and I want to add a mod that would create a random number, then display an associated outcome with that number on the finished post (not visible in preview). But I am completely baffled as to where to even go to begin this. I do remember my if/else statements so I think I can work out the code, just not sure where it would go.

Thanks for any help offered.

Matthew K.

Hey there, and welcome to the SMF Community!

SMF is programmed using an MVC, meaning logic/source is separated from the markup/templates.

So, there's the base directory for logic which is ./Sources, and the base directory for templates which is ./Themes (./Themes/default for Curve).

For a given action, there should be two primary files, with additional "Subs" files possible, for instance...?action=my_action would have a controller file "./Sources/MyAction.php" with the template loaded using the loadTemplate(); function, ./Themes/default/MyAction.template.php.

That's obviously a very brief explanation of how it actually works, and different possibilities there are.

You'll probably want to look at Display.php and Display.template.php (./Sources & ./Themes/default correspondingly)

Advertisement: