So we have done the following in our previous lessons.
Remember the functions.php in the 'main' directory!!
Let us define some functions in 'functions.php'.
The functions are described below
- setup xampp!
- created 'stupid' database with essential tables.
- coded all the essential classes (database,theme).
- completed our engine.php script.
Remember the functions.php in the 'main' directory!!
Let us define some functions in 'functions.php'.
- Open the file in an editor and write the following code.
/*************************** Shows the title of the page ****************************/ function title($title) { echo '<title>'.SITENAME.' : '.$title.'</title>'; } /*************************** if your module has title use this function to show title of app inside app block ****************************/ function app_title($app_title) { echo '<div id="app_title">'.$app_title.'</div>'; echo '<div id="spacer"></div>'; } /*********************************** get site logo ***************************************/ function get_site_logo() { global $theme; return $theme->get_sitelogo(); }
The functions are described below
- title ==> TO DEFINE THE TITLE OF A PAGE.
- app_title ==> TO DEFINE THE TITLE OF APP.
- get_site_logo ==> RETURNS THE SITELOGO.
Now its time to create our first theme 'default'.
Please download the code and extract it into 'themes' folder.
Now open the 'index.php' in the stupid folder.
Include our 'engine.php' there.
<div id="container"> <div id="wrapper"> <?php require 'main/engine.php'; ?> </div> </div>
After doing all these,run xampp.
Go to http://localhost/stupid/ from your browser.
If all came in our way,you will see a congratulation message.Otherwise please comment here so that I can understand the details of the error.
<<< PREVIOUS || NEXT >>>
Hello!!! Thank you very much for this great tutorial!!!!!! Can you please reupload the "default.rar" file?
ReplyDeleteThanks!!!!
sorry for the broken download link.
ReplyDeleteYou can get the theme in the next posts.
I didn't see that! Thank you very much!! You are the best!! :)
ReplyDeleteget the theme from here
ReplyDeletehttp://dl.dropbox.com/u/63550684/default.rar
it says "cannot connect to database"
ReplyDeleteMake sure that your database constants defined in base.php file are correct.
ReplyDeleteCheck whether the database table defined in base.php exists.
hey help me, i tried but nothing happened all blank
ReplyDeleteI am getting this error:
ReplyDeleteParse error: syntax error, unexpected T_OBJECT_OPERATOR in C:\xampp\htdocs\stupid\main\engine.php on line 15
any ideas?
check the engine.php for any syntax error.
ReplyDeleteIf you can't find any errors please go on with the tutorial and download the full source file stupid cms.
it says Call to undefined function is_logged_in() in C:\xampp\htdocs\TA\include\header.php on line 5
ReplyDeleteWarning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\stupid\index.php:3) in C:\xampp\htdocs\stupid\include\session_class.php on line 5
ReplyDelete:(
Fatal error: Call to undefined function is_logged_in() in C:\wamp\www\stupid\themes\default\include\header.php on line 5
ReplyDeleteplease help
ReplyDeletePlease go on with the tutorial and download the full source file stupid cms from next chapters.