Tutorials: Custom style

 

1. Create files

Create new folder, for example My design
and create files in the folder template.phpince.php and style.phpince.php
*style.phpince.php file is not required.

 

2.- Functions

Open file template.phpince.php and put all the code from template to the file template.phpince.php.

Content

This function insert to line where you want to repeat content.

Kód
<?php
    bl_temp_content(array(), $PHPince_logon, $PHPINCE_system, $PHPINCE_LANG);
?>

Custom style for bl_temp_content

 

Sample code

Kód
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>PHPince - Tutorial</title>
    <link rel="stylesheet" type="text/css" href="data/file.css">
</head>
<body>
    <nav>
        <ul>
            <li><a href="index.html">Home</a></li>
            <li><a href="support.html">Support</a></li>
            <li><a href="contact.html">Contact</a></li>
        </ul>
    </nav>
    <section>
        <div id="topic">
            <h1>Lorem impsum dolor</h1>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        </div>
        <div id="topic">
            <h1>Phasellus lacus ipsum</h1>
            <p>Nullam vel sagittis tortor, vitae accumsan eros.</p>
        </div>
    </section>
    <footer>Copyright 2013 phpince.org</footer>
</body>
</html>

 

Finished

Kód
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>PHPince - Tutorial</title>
    <link rel="stylesheet" type="text/css" href="data/file.css">
</head>
<body>
    <nav>
        <ul>
            <li><a href="index.html">Home</a></li>
            <li><a href="support.html">Support</a></li>
            <li><a href="contact.html">Contact</a></li>
        </ul>
    </nav>
    <section>
        <?php
            bl_temp_content(array(), $PHPince_logon, $PHPINCE_system, $PHPINCE_LANG);
        ?>
    </section>
    <footer>Copyright 2013 phpince.org</footer>
</body>
</html>

 

Navigation

This function insert to the UL or OL tag and insert id.

Kód
<?php
    bl_temp_nav(NAVIGATION_ID, $PHPince_logon);
?>

 

Sample code

Kód
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>PHPince - Tutorial</title>
    <link rel="stylesheet" type="text/css" href="data/file.css">
</head>
<body>
    <nav>
        <ul>
            <li><a href="index.html">Home</a></li>
            <li><a href="support.html">Support</a></li>
            <li><a href="contact.html">Contact</a></li>
        </ul>
    </nav>
    <section>
        <?php
            bl_temp_content(array(), $PHPince_logon, $PHPINCE_system, $PHPINCE_LANG);
        ?>
    </section>
    <footer>Copyright 2013 phpince.org</footer>
</body>
</html>

 

Finished

Kód
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>PHPince - Tutorial</title>
    <link rel="stylesheet" type="text/css" href="data/file.css">
</head>
<body>
    <nav>
        <ul>
            <?php
                bl_temp_nav(1, $PHPince_logon);
            ?>
        </ul>
    </nav>
    <section>
        <?php
            bl_temp_content(array(), $PHPince_logon, $PHPINCE_system, $PHPINCE_LANG);
        ?>
    </section>
    <footer>Copyright 2013 phpince.org</footer>
</body>
</html>

 

SEO

This function insert to HEAD tag

Kód
<?php
    bl_metaheader($PHPINCE_system, $PHPince_logon);
?>

 

Sample code

Kód
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>PHPince - Tutorial</title>
    <link rel="stylesheet" type="text/css" href="data/file.css">
</head>
<body>
    <nav>
        <ul>
            <?php
                bl_temp_nav(1, $PHPince_logon);
            ?>
        </ul>
    </nav>
    <section>
        <?php
            bl_temp_content(array(), $PHPince_logon, $PHPINCE_system, $PHPINCE_LANG);
        ?>
    </section>
    <footer>Copyright 2013 phpince.org</footer>
</body>
</html>

 

Finished

Kód
<!DOCTYPE HTML>
<html>
<head>
    <?php
        bl_metaheader($PHPINCE_system, $PHPince_logon);
    ?>
    <link rel="stylesheet" type="text/css" href="data/file.css">
</head>
<body>
    <nav>
        <ul>
            <?php
                bl_temp_nav(1, $PHPince_logon);
            ?>
        </ul>
    </nav>
    <section>
        <?php
            bl_temp_content(array(), $PHPince_logon, $PHPINCE_system, $PHPINCE_LANG);
        ?>
    </section>
    <footer>Copyright 2013 phpince.org</footer>
</body>
</html>

Footer

Add license text

Kód
Powered by PHPince, copyright © 2011 - 2013 by Dominik Hulla.
Released as free software without warranties under GNU GPL v3(or later).

 

Code

Kód
Powered by <a href="http://phpince.org">PHPince</a>, copyright © 2011 - 2013 by Dominik Hulla.
Released as free software without warranties under <a href="http://www.gnu.org/licenses/gpl.html">GNU
 GPL v3</a>(or later).

 

3. Edit links

Open file template.phpince.php and edit lines:

 

Change all internal links

Kód
<link type="text/css" rel="stylesheet" href="style.css" />
<img src="images/dot.jpg" alt="Image" />
<script type="text/javascript" src="javascript.js"></script>
and other...

and add script

Kód
<?php bl_temp_link($PHPINCE_system); ?>

 

Sample

Kód
<link type="text/css" rel="stylesheet" href="<?php bl_temp_link($PHPINCE_system); ?>style.css" />
<img src="<?php bl_temp_link($PHPINCE_system); ?>images/dot.jpg" alt="Image" />
<script type="text/javascript" src="<?php bl_temp_link($PHPINCE_system); ?>javascript.js"></script>
and other...

 

Finished

Kód
<!DOCTYPE HTML>
<html>
<head>
    <?php
        bl_metaheader($PHPINCE_system, $PHPince_logon);
    ?>
    <link rel="stylesheet" type="text/css" href="<?php bl_temp_link($PHPINCE_system); ?>data/file.css">
</head>
<body>
    <nav>
        <ul>
            <?php
                bl_temp_nav(1, $PHPince_logon);
            ?>
        </ul>
    </nav>
    <section>
        <?php
            bl_temp_content(array(), $PHPince_logon, $PHPINCE_system, $PHPINCE_LANG);
        ?>
    </section>
    <footer>Copyright 2013 phpince.org</footer>
</body>
</html>

 

4.- Style (Automatically update style) (optional)


1.- Open file style.phpince.php and fill lines

Example final code

Kód
<?php
$PHPINCE_STYLE = array(
    "topic_style" => "<h1>{PHPINCE_TITLE} | 7.2.2013 - 12:38 pm</h1><p>{PHPINCE_TEXT}</p><hr>",
    "topic_style_active" => "<h1>{PHPINCE_TITLE}</h1><p>{PHPINCE_TEXT}</p>",
    "topic_error" => "No topic writed",
    "topic_notfound" => "Sorry, topic not found",
    "page_style" => "<h1>{PHPINCE_TITLE}</h1><p>{PHPINCE_TEXT}</p>",
    "page_notfound" => "Sorry, page not found",
    "plugin_notfound" => "Plugin not found",
);
?>

LEGEND

topic_style - Custom style for articles - Read tutorial for layout
topic_style_active - Custom style for active article (domain.tld/topic/id) - Read tutorial for layout
topic_error - Report if not written any article
topic_notfound - Report if the article does not exist
page_style - Custom style for page (domain.tld/page/id) - Read tutorial for layout
page_notfound - Report if the page does not exist
plugin_notfound - Report if the plugin does not exist