| 236 | |
| 237 | ---- |
| 238 | |
| 239 | == '''''How can I create a custom page for my site?''''' == |
| 240 | |
| 241 | You will need to create three files for your custom page, these files are: |
| 242 | |
| 243 | '''my_page.php''' |
| 244 | '''templates/tmpl_uni/page_100.html''' |
| 245 | '''templates/tmpl_uni/css/my_page.css''' |
| 246 | |
| 247 | ''NB: The names are just examples'' |
| 248 | |
| 249 | '''1) my_page.php''' should contain the following lines: |
| 250 | |
| 251 | {{{ |
| 252 | <?php |
| 253 | /*************************************************************************** |
| 254 | * Dolphin Smart Community Builder |
| 255 | * ----------------- |
| 256 | * begin : Mon Mar 23 2006 |
| 257 | * copyright : (C) 2006 BoonEx Group |
| 258 | * website : http://www.boonex.com/ |
| 259 | * This file is part of Dolphin - Smart Community Builder |
| 260 | * |
| 261 | * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. |
| 262 | * http://creativecommons.org/licenses/by/3.0/ |
| 263 | * |
| 264 | * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 265 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 266 | * See the Creative Commons Attribution 3.0 License for more details. |
| 267 | * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, |
| 268 | * see license.txt file; if not, write to marketing@boonex.com |
| 269 | ***************************************************************************/ |
| 270 | require_once( 'inc/header.inc.php' ); |
| 271 | require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); |
| 272 | |
| 273 | $_page['name_index'] = 100; // this is the number of the html page linked with this php file; change it as you wish |
| 274 | $_page['css_name'] = 'my_page.css'; // this is the name of the CSS file linked with the above mentioned HTML file; change it as you wish |
| 275 | |
| 276 | $_ni = $_page['name_index']; |
| 277 | $_page_cont[$_ni]['page_main_code'] = PageCompMainCode(); |
| 278 | |
| 279 | PageCode(); |
| 280 | |
| 281 | function PageCompMainCode() |
| 282 | { |
| 283 | // here you should put PHP code to get results if you wish to display something dynamic on this page; for example return $_COOKIE['memberID']; |
| 284 | } |
| 285 | ?> |
| 286 | }}} |
| 287 | |
| 288 | '''2) templates/tmpl_uni/page_100.html''' (as soon as you specified '''100''' in the previous example, this is how you need to name the HTML page) should contain the following lines: |
| 289 | |
| 290 | {{{ |
| 291 | __include _header.html__ |
| 292 | <!-- here you should enter any HTML or Javascript code for your page for example: --> |
| 293 | <h2 class="my_page">Hello</h2> |
| 294 | <!-- to display the dynamic content from my_page.php you need to input: --> |
| 295 | __page_main_code__ |
| 296 | __include _footer.html__ |
| 297 | }}} |
| 298 | |
| 299 | '''3) templates/tmpl_uni/css/my_page.css''' should contain the following lines: |
| 300 | |
| 301 | {{{ |
| 302 | /* as soon as you're using the my_page class in the previous example, you need to specify it here */ |
| 303 | |
| 304 | .my_page |
| 305 | { |
| 306 | color: blue; |
| 307 | } |
| 308 | }}} |
| 309 | |
| 310 | '''4)''' Now you need to make a link to this custom page. |
| 311 | |
| 312 | Edit '''''templates/tmpl_uni/_header.html''''' and '''''templates/tmpl_uni/_footer.html''''' and insert the following elements among the other similar ones: |
| 313 | |
| 314 | in ''_header.html'' |
| 315 | {{{ |
| 316 | __TOP_MyPage__ |
| 317 | }}} |
| 318 | |
| 319 | in ''_footer.html'' |
| 320 | {{{ |
| 321 | __BMI_MyPage__ |
| 322 | }}} |
| 323 | |
| 324 | Now edit '''''inc/design.inc.php''' and insert the following lines among the other similar ones: |
| 325 | {{{ |
| 326 | $_page_cont[0]['TOP_MyPage'] = '<a class="menu_item_link" href="' . $site['url'] . 'my_page.php">' . _t("_MyPage") . '</a>'; |
| 327 | $_page_cont[0]['BMI_MyPage'] = '<a class="bottommenu" href="' . $site['url'] . 'my_page.php">' . _t("_MyPage") . '</a>'; |
| 328 | }}} |
| 329 | |
| 330 | Create the language key named '''_MyPage''' and you're done. |
| 331 | |
| 332 | ''NB: You may need to create more language keys and write more code depending on the purpose of your custom page.'' |