Issues with coding

Support for phpBB mods/hacks.

Moderator: Moderators

Issues with coding

Postby =cipher= on Sat May 14, 2005 4:46 am

Hello,

I am snooping around because I would like to learn more about how the phpBB System Works ... Well, in the admin/admin_board.php file, what are things like this:
"SMTP_USERNAME" => $new['smtp_username'],


what is the "SMTP_USERNAME" part?

what is the $news['smtp_username'] part?

How do I create my own for a MOD?
Best Regards:
Aaron McGowan / =cipher=

Status: Programming / Coding
Head Programmer for The Tech Base
Junior Programmer for Triplentry

www.thetechbase.com
User avatar
=cipher=
banned
banned
 
Posts: 189
Joined: Sat May 07, 2005 4:03 pm
Location: A Network Near You

Postby pentapenguin on Sat May 14, 2005 5:41 am

A few articles to get you started:
http://www.phpbb.com/kb/article.php?article_id=114
http://www.phpbb.com/kb/article.php?article_id=203
http://www.phpbb.com/kb/article.php?article_id=200

The $new array is automatically filled in with all config_name's from the phpbb_config table.
To get your own, add a new row to the database.
Like
Code: Select all
INSERT INTO phpbb_config (config_name, config_value) VALUES ('my_var', 'my_var_here');

To print out the value in a file, add this line in the others like it
Code: Select all
'MY_VAR' => $new['my_var'],

Now you have a {MY_VAR} in the template.
User avatar
pentapenguin
Moderator
Moderator
 
Posts: 1466
Joined: Tue Sep 14, 2004 4:15 pm
Location: Georgia, USA

Postby UseLess on Sat May 14, 2005 6:35 am

Greetings,

And if you want to see if there is any value in the var use: isset, empty etc on '$board_config['my_var']'
Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
UseLess
Registered User
Registered User
 
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Postby =cipher= on Sat May 14, 2005 3:29 pm

Great! :D THanks! :D
Best Regards:
Aaron McGowan / =cipher=

Status: Programming / Coding
Head Programmer for The Tech Base
Junior Programmer for Triplentry

www.thetechbase.com
User avatar
=cipher=
banned
banned
 
Posts: 189
Joined: Sat May 07, 2005 4:03 pm
Location: A Network Near You

Postby =cipher= on Sat May 14, 2005 8:39 pm

Does the new variable have to be ...
$new{MY_VAR} ... what I mean does it have to have $new or can it be something else like $mod ?
Best Regards:
Aaron McGowan / =cipher=

Status: Programming / Coding
Head Programmer for The Tech Base
Junior Programmer for Triplentry

www.thetechbase.com
User avatar
=cipher=
banned
banned
 
Posts: 189
Joined: Sat May 07, 2005 4:03 pm
Location: A Network Near You

Postby pentapenguin on Sat May 14, 2005 9:46 pm

Your confusing the two.
In the PHP pages the variables are like $variable
In standard tpl files you use {VARIABLE}

BTW: See the other post for more details.
User avatar
pentapenguin
Moderator
Moderator
 
Posts: 1466
Joined: Tue Sep 14, 2004 4:15 pm
Location: Georgia, USA


Return to phpBB Mods

Who is online

Users browsing this forum: No registered users and 0 guests

cron