• Welcome to Simple Machines Community Forum. Please login or sign up.

Newbie question, having trouble getting started with website code.

Started by spunky, November 29, 2021, 10:32:50 PM

Previous topic - Next topic

spunky

Hi, I'm new to web programming, and I'm having trouble getting started learning how to make any changes to a forum.

How do I find the file(s) that contains the code that gets run when the user clicks on something on the page?  I "view page source" with my browser and I see some things, but it doesn't always make sense, such as "form" elements have an action that shows a file but that file doesn't seem to be the right one.

Am I supposed to use an IDE?  Because I'm just using Notepad++ right now.  Will an IDE also automatically find the files where functions & classes are defined?  And if so, which IDE should I use?

Thanks!

shadav

I'm sorry but I have no idea what you are talking about

so what on your forum are you trying to change

and which version of smf are you using

what theme are you using

Kindred

the thing is -- like MANY web scripts, the functions that SMF calls are scattered throughout php files.

The DISPLAY is handled by the *.template.php files (in the Themes directories) ----  with each template file having a name that basically describes what part of the display it controls.

The actual DATA that fills the template is generated by the files in the Sources directory...
Again, the files are names based on the general area that they control, but it becomes somewhat more complicated because some files call functions from other files, which call functions from other files and so forth.

but the point about php and web programming in general (past the basic html) is that the files are compiled at run time by the server.... not by the client.

So, viewing the source from your web browser is absolutely useless to determine what file is generating the content.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

spunky

Quote from: Kindred on November 30, 2021, 11:05:25 AMthe thing is -- like MANY web scripts, the functions that SMF calls are scattered throughout php files.
...

Thanks!  That helps a little.  But I'm still kind of confused.  So, I just have to guess which file might have the code I want to change?

Do you guys use an IDE?  Will an IDE catalog all of the functions & classes in all the various files, making it easier to understand the code?

If I want to change the code that runs when the user clicks on a button/etc, how do I find the code in the files?  Do I just use my browser's "Inspect" feature to figure out some unique text to search for, and then search through all of the files (Notepad++ can search through multiple files in multiple folders)?

Sir Osis of Liver

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Kindred

QuoteSo, viewing the source from your web browser is absolutely useless to determine what file is generating the content.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sesquipedalian

Unfortunately, your current question is so vague and general that it is nearly impossible to give it a more precise answer than Kindred already has. 

Instead, if you have some particular goal in mind, try asking about that specifically, so that you can be given more specific answers. Right now, no one knows what you are trying to do, so no one can direct you anywhere.
I promise you nothing.
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Advertisement: