Skip to content

microblog personalized home page

OpenCode edited this page May 10, 2011 · 9 revisions

With Scribble is possible for anyone to create a custom template, easily compatible with the use of very little php code. They were created for this purpose the great features that allow you to print the title of an article, its content, the site name and other information. This allows webmasters to focus primarily on HTML and CSS code without worrying about complicated functions implenterare useful information on the web pages.

How to customize a web page

Structure

To enter your web page to Scribble is necessary to respect some basic rules to allow the script to recognize the desired template.

  • The home page should be renamed article.php;
  • The structure of the web page (pages, css, images folder, other folders) must be contained within the folder scribble/

Article title

To insert the title of an article on the web page you can use the following code:

<?php
   include_once('class/articlesmanagement.php');
   PrintTitle(ARTICLE_ID, HTML_TAG);
?>

where:

  • ARTICLE_ID is the id of the selected article
  • HTML_TAG is the tag selected for the title (f.e. h1, h2, h3, etc....)

This is an exemple that show the last published article title in your web page between <h3> tags:

<?php
   include_once('class/articlesmanagement.php');
   PrintTitle($_GET['id'], 'h3');
?>

Article post

To insert the content of an article on the web page you can use the following code:

<?php
   include_once('class/articlesmanagement.php');
   PrintArticle(ARTICLE_ID);
?>

where:

  • ARTICLE_ID is the id of the selected article

This is an exemple that show the last published article content in your web page:

<?php
   include_once('class/articlesmanagement.php');
   PrintArticle($_GET['id']);
?>

This is an exemple that show the first article content in your web page:

<?php
   include_once('class/articlesmanagement.php');
   PrintArticle('1');
?>

Previous and Next article link

To insert the relative link on the web page you can use the following code:

PREVIOUS

<?php
   include_once('class/articlesmanagement.php');
   echo PreviousUrl(ARTICLE_ID, TEXT);
?>

NEXT

<?php
   include_once('class/articlesmanagement.php');
   echo NextUrl(ARTICLE_ID, TEXT);
?>

where:

  • ARTICLE_ID is the id of the actual article on the page

  • TEXT is the text that we want acnhor to the link

This is an exemple that show the links:

<?php
   include_once('class/articlesmanagement.php');
   echo NextUrl($_GET['id'], '<<< Previous ') . ' | ' . NextUrl($_GET['id'], ' Next >>>');
?>

Site name and description

Since version 0.0.5 introduced the ability to print the video name and description of the site set in the preferences. This allows you to further customize your web page or keep the default template provided without making any modifications to the source of the page, simply by setting your preferences.

To insert the site name on the web page you can use the following code:

NAME

<?php
   include_once('class/articlesmanagement.php');
   PrintSiteName();
?>

DESCRIPTION

<?php
   include_once('class/articlesmanagement.php');
   PrintSiteDescription();
?>

This is an exemple that show how to write the site name in the title:

<head>

   <title>
      <?php
         include_once('class/articlesmanagement.php');
         PrintSiteName();
      ?>
   </title>
</head>

Clone this wiki locally