Skip to content

microblog personalized home page

OpenCode edited this page May 7, 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($_SERVER['DOCUMENT_ROOT'] . "/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($_SERVER['DOCUMENT_ROOT'] . "/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($_SERVER['DOCUMENT_ROOT'] . "/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($_SERVER['DOCUMENT_ROOT'] . "/class/articlesmanagement.php");
   PrintArticle($_GET['id']);
?>

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

<?php
   include($_SERVER['DOCUMENT_ROOT'] . "/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($_SERVER['DOCUMENT_ROOT'] . "/class/articlesmanagement.php");
   echo PreviousUrl(ARTICLE_ID, TEXT);
?>

NEXT

<?php
   include($_SERVER['DOCUMENT_ROOT'] . "/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($_SERVER['DOCUMENT_ROOT'] . "/class/articlesmanagement.php");
   echo NextUrl($_GET['id'], '<<< Previous ') . ' | ' . NextUrl($_GET['id'], ' Next >>>');
?>

Clone this wiki locally