biggkev Posted August 10, 2007 Share Posted August 10, 2007 I'm new to php and mysql but quickly getting the basics down I've been sorting threw source file's and what not learning how different things are done... I am trying to figure out somthing i've seen in the phpBB .tpl files... when they use the variables like" {L_FAQ} and {L_LAST_VISIT} " it is printing a variable, that i understand. What i don't understand is how ? when i want to load a variable i thought the syntax was "$whatever" or $variable",somthing to that effect. thanks in advance !, hungry for knowlage! Quote Link to comment https://forums.phpfreaks.com/topic/64213-phpbb-template-question/ Share on other sites More sharing options...
HuggieBear Posted August 10, 2007 Share Posted August 10, 2007 It's probably a constant. <?php define('YOUR_CONSTANT', "This is my constant, it doesn't change"); echo YOUR_CONSTANT; ?> Regards Huggie Quote Link to comment https://forums.phpfreaks.com/topic/64213-phpbb-template-question/#findComment-320200 Share on other sites More sharing options...
biggkev Posted August 11, 2007 Author Share Posted August 11, 2007 hmmm i don't think so? Here's what i'm talking about... <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> <tr> <th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_FORUM} </th> <th width="50" class="thTop" nowrap="nowrap"> {L_TOPICS} </th> <th width="50" class="thTop" nowrap="nowrap"> {L_POSTS} </th> <th class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th> </tr> I just can't seem to find where these are given there values? Quote Link to comment https://forums.phpfreaks.com/topic/64213-phpbb-template-question/#findComment-320956 Share on other sites More sharing options...
eZe616 Posted August 11, 2007 Share Posted August 11, 2007 I've been thinking the same as you. I get all confused also. From what I understand. they have a function that goes through the template and replaces the { Last Name } for the actual variable using str_replace() or the preg_math() function. How exactly i'm not sure, but I think that's the way of using it... like how the BBcodes [b][/b] gets replaced with <b></b> Quote Link to comment https://forums.phpfreaks.com/topic/64213-phpbb-template-question/#findComment-321249 Share on other sites More sharing options...
LiamProductions Posted August 11, 2007 Share Posted August 11, 2007 Is'nt this Regex? Like if you use <i> </i> the script will turn it to if you choose it to. Quote Link to comment https://forums.phpfreaks.com/topic/64213-phpbb-template-question/#findComment-321252 Share on other sites More sharing options...
biggkev Posted August 12, 2007 Author Share Posted August 12, 2007 ok i've finally found somthing... i looked at the index.php and found this... $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), 'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'), 'FORUM_IMG' => $images['forum'], 'FORUM_NEW_IMG' => $images['forum_new'], 'FORUM_LOCKED_IMG' => $images['forum_locked'], 'L_FORUM' => $lang['Forum'], 'L_TOPICS' => $lang['Topics'], 'L_REPLIES' => $lang['Replies'], 'L_VIEWS' => $lang['Views'], 'L_POSTS' => $lang['Posts'], but i still can't figure out how it works?? like i said i'm VERY new to php just tryin to learn and thanks for all the pointers and advice,also after all of the searching i've yet to find anything describing the "=>" usage?? Quote Link to comment https://forums.phpfreaks.com/topic/64213-phpbb-template-question/#findComment-321428 Share on other sites More sharing options...
HuggieBear Posted August 12, 2007 Share Posted August 12, 2007 Take a look at the Array type in the manual. Regards Huggie Quote Link to comment https://forums.phpfreaks.com/topic/64213-phpbb-template-question/#findComment-321527 Share on other sites More sharing options...
biggkev Posted August 12, 2007 Author Share Posted August 12, 2007 thanks to everyone the array type link got me on my way!!! I am starting to see why everyone is a fan of php !! Quote Link to comment https://forums.phpfreaks.com/topic/64213-phpbb-template-question/#findComment-321694 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.