Posted on September 23rd, 2009
5319 views
First the code then i'll explain
page.php page.tpl I'll explain by line number because the p2l system strips some chars from regex page.php Line 2: With that function we get the contents from page.tpl and store them into variable $file Line 4: Here we extract the data between <!-- BEGIN user --> and <!-- END user --> the regex matches all characters and symbold Line 6 - 9: Here we have the data that we will add between the <!-- BEGIN user --> and <!-- END user -->. This data can be extracted from the database Line 14, 15: Now we replace {USER} and {USER_ID} with the data from Line 6 - 9 Line 21: With this function we replace all the data between <!-- BEGIN user --> and <!-- END user --> with $data that results from the loop. Line 23 - 27: Here we replace the static vars with the text we need Line 29: Now we return the page :D There might be spelling errors. If you have anything to add please contact me or post a comment. File Download: page.zip |