קוד: בחר הכל
<?
$tpl = read("file.tpl");
$tpl = str_replace("{something}","להחליף ל",$tpl);
?>
מנהל: צוות האתר
קוד: בחר הכל
<?
$tpl = read("file.tpl");
$tpl = str_replace("{something}","להחליף ל",$tpl);
?>
D!ma כתב:קל ופשוט :קוד: בחר הכל
<?
$tpl = read("file.tpl");
$tpl = str_replace("{something}","להחליף ל",$tpl);
?>
קוד: בחר הכל
$template->set_filenames(array(
'body' => 'index_body.tpl')
);
$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'],
'L_LASTPOST' => $lang['Last_Post'],
'L_NO_NEW_POSTS' => $lang['No_new_posts'],
'L_NEW_POSTS' => $lang['New_posts'],
'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
'L_MODERATOR' => $lang['Moderators'],
'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'],
'U_MARK_READ' => append_sid("index.$phpEx?mark=forums"))
);
$template->pparse('body');
איתי כתב:זה פשוט להשתמש בממשק הרגיל שלהם:קוד: בחר הכל
$template->set_filenames(array(
'body' => 'index_body.tpl')
);
$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'],
'L_LASTPOST' => $lang['Last_Post'],
'L_NO_NEW_POSTS' => $lang['No_new_posts'],
'L_NEW_POSTS' => $lang['New_posts'],
'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
'L_MODERATOR' => $lang['Moderators'],
'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'],
'U_MARK_READ' => append_sid("index.$phpEx?mark=forums"))
);
$template->pparse('body');
בגדול, שם יש עוד כמה ifים בשביל להעביר מידע על כל פורום. אם היית מסתכל בסוף של index.php היית רואה את זה גם.
D!ma כתב:איתי כתב:זה פשוט להשתמש בממשק הרגיל שלהם:קוד: בחר הכל
$template->set_filenames(array(
'body' => 'index_body.tpl')
);
$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'],
'L_LASTPOST' => $lang['Last_Post'],
'L_NO_NEW_POSTS' => $lang['No_new_posts'],
'L_NEW_POSTS' => $lang['New_posts'],
'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
'L_MODERATOR' => $lang['Moderators'],
'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'],
'U_MARK_READ' => append_sid("index.$phpEx?mark=forums"))
);
$template->pparse('body');
בגדול, שם יש עוד כמה ifים בשביל להעביר מידע על כל פורום. אם היית מסתכל בסוף של index.php היית רואה את זה גם.
מה ההבדל בין הקוד שלי לזה?
שיש פה שימוש מתקדם עם מערכים ומחלוקות ?
משתמשים הגולשים בפורום זה: אין משתמשים רשומים ו־ 353 אורחים