Warning: preg_match_all() [function.preg-match-all]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /home/socialne/public_html/wiki/includes/MagicWord.php on line 671

Warning: preg_replace() [function.preg-replace]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /home/socialne/public_html/wiki/includes/MagicWord.php on line 671

Warning: preg_replace() [function.preg-replace]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /home/socialne/public_html/wiki/includes/MagicWord.php on line 671

Warning: preg_replace() [function.preg-replace]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /home/socialne/public_html/wiki/includes/MagicWord.php on line 671

Warning: preg_replace() [function.preg-replace]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /home/socialne/public_html/wiki/includes/MagicWord.php on line 671

Warning: preg_replace() [function.preg-replace]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /home/socialne/public_html/wiki/includes/MagicWord.php on line 671

Warning: preg_replace() [function.preg-replace]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /home/socialne/public_html/wiki/includes/MagicWord.php on line 671

Warning: preg_replace() [function.preg-replace]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /home/socialne/public_html/wiki/includes/MagicWord.php on line 671

Warning: preg_replace() [function.preg-replace]: Compilation failed: group name must start with a non-digit at offset 4 in /home/socialne/public_html/wiki/includes/MagicWord.php on line 675
Devdoc:Theme Development - Social Networking Software - Online Social Network Software
From Social Networking Software - Online Social Network Software
Jump to: navigation, search
(Recommended theme files)
(Theme Development)
 
Line 1: Line 1:
=Theme Development=
=Theme Development=
-
<p class="note">Note: This is a technical document. It discusses technical aspects of theme module and developing a custom theme which requires a good knowledge of advanced PHP, HTML, CSS and Javascript and is not meant for non-technical users. Know more about themes: [[Help:Themes|What are themes?]] | [[Help:Using Themes|Using Themes]] | [[Help            :Templating Engines]].</p>
+
<p class="note">Note: This is a technical document. It discusses technical aspects of theme module and developing a custom theme which requires a good knowledge of advanced PHP, HTML, CSS and Javascript and is not meant for non-technical users. Know more about themes: [[Help:Themes|What are themes?]] | [[Help:Themes#How to change Themes|How to change Themes]].</p>
__TOC__
__TOC__
Line 7: Line 7:
==Nature of themes==
==Nature of themes==
-
Themes are neither solid, liquid or gas. They are collection of PHP scripts, HTML/CSS files and images, living under themes folder at root with folder name same as theme name. For Example: Theme '''Demo''' will be at ROOT/themes/demo. Theme files are interlinked and hooked together to form the actual website.
+
Themes are collection of PHP scripts, HTML/CSS files and images, living under themes folder at root with folder name same as theme name. For Example: Theme '''Demo''' will be at ROOT/themes/demo. Theme files are interlinked and hooked together to form the actual website.
-
 
+
-
==Why develop themes?==
+
-
 
+
-
These are the reasons why should you learn theme development of Social Network Software.
+
 +
==Why learn developing themes?==
*Complete control over layout, presentation and various design elements.
*Complete control over layout, presentation and various design elements.
-
*Tweaking already existing themes according to your and your community taste.
+
*Tweaking already existing themes according to you and your community taste.
*When your requirements are too unique and specific to be found in our theme gallery.
*When your requirements are too unique and specific to be found in our theme gallery.
*Migrating from a non-Social-Network-Software powered website to a Social-Network-Software powered one.
*Migrating from a non-Social-Network-Software powered website to a Social-Network-Software powered one.
Line 141: Line 138:
===left.php===
===left.php===
 +
 +
Contains the navigation panel of a registered user in form of a left sidebar. So its not a global element and is set according to the whether a user is logged in or not.
 +
 +
Minimal code sets {LEFT_HTML} placeholder:
 +
 +
<pre>
 +
<?php
 +
    if(check_login("user")) {
 +
        // if page is not the home page, include the user-navigation
 +
        if(!(strtolower($_SERVER['PHP_SELF'])=="/".PATH_TO_MAIN.FILENAME_INDEX)) {
 +
            define('LEFT_HTML','
 +
<div id="user-sidebar">
 +
    <div id="userphoto">'.$user_photo_html.'</div>
 +
    <div id="mailbox">'.$mailbox_html.'</div>
 +
    <div id="usernav">'.$usernav_html.'</div>
 +
    <div id="invite">'.$invite_friend_html.'</div>
 +
</div>');
 +
        } else {
 +
        <!-- Default sidebar when user is not logged in-->
 +
        define('LEFT_HTML','');
 +
        }
 +
?>
 +
</pre>
===left_community.php===
===left_community.php===
Line 147: Line 167:
==Miscellaneous theme files==
==Miscellaneous theme files==
 +
 +
Absence of any of these files do not lead to any problem and they provide additional features which do not alter theme functionality or theme development.
===index.php===
===index.php===
 +
 +
This file do not contribute to theme development but is a security feature. It contains a simple line:
 +
<?php header('../'); ?>
 +
It simply redirects anyone trying to reach the theme folder one directory back. e.g. user trying to go to folder of default theme i.e. {ROOT}/themes/defaulttheme will bounce back to {ROOT}/themes.
 +
 +
As {ROOT}/themes again have identical index.php redirection script, so user is redirected again one directory back to homepage i.e. at {ROOT}/index.php.
 +
 +
<div class="note">Though directory listing in Apache is prevented by setting directory permissions which shows an Apache's untidy access denied error, so this is just a nice and friendly way to tell user that he is not allowed to do so.</div>
===screenshot.gif===
===screenshot.gif===
 +
 +
This contains the screenshot of the theme's homepage which is shown as a thumbnail in admin panel theme choosing screen so that a particular theme can be visually recognized.
 +
 +
If absent, no thumbnail is shown.
===info.txt===
===info.txt===
 +
 +
This text contains information about theme which is displayed again in admin panel theme selection screen. Information contains, theme's name, description and version in following format.
 +
 +
Theme Name: Default theme
 +
Description: This is default theme for social network software.
 +
Version: 1.0
 +
 +
If absent, theme folder name is displayed as theme name and rest information is not displayed.
===theme specific images===
===theme specific images===
 +
 +
Theme related images can be stored inside a separate folder named '''images''' inside respective theme directory.
 +
 +
<div class="note">Only theme dependent images (e.g. bullets, backgrounds, buttons and icons etc.) must be stored inside images folder and images which are part of website instead (e.g. logo and products images) must be put at {ROOT}/images so that they can be shared among all themes.</div>

Latest revision as of 12:26, 28 July 2011

Main Page
About SNS
Developer Documentation
Personal tools