There are two ways given for displaying article codes in your web pages
- Using JavaScript - For Beginners
- Using PHP - For Advanced Users who have PHP installed on their website
JavaScript Usage
Code Example:
<SCRIPT LANGUAGE=javascript src="__VROOT_DIR__/article/displayarticle.php?ano=5"> </SCRIPT>
Step 1: Copy the desired JavaScript code from __SITE_NAME__.
Step 2: Paste in the HTML file anywhere you want it to display the article(s) between the <body> tags.
Step 3: Test by displaying your HTML file in the browser.
Note
__SITE_NAME__ provides the articles in a HTML Table code with width set at 100%.
This means that the table will try to occupy all of the horizontal space available to it on the web page on display.
For such an example: Click Here.
|
Note
For Display Purposes, you can bound the article display in to a smaller display area using normal HTML Tables.
By enclosing the script inside a custom HTML table, you can attain required display size.
Code Example:
<html>
<head>
<title>Untitled</title>
</head>
<body>
</font>
<table summary="" border=0 width=400>
<tr>
<td>
<SCRIPT LANGUAGE=javascript src="__VROOT_DIR__/article/displayarticle.php?ano=5"> </SCRIPT>
</td>
</tr>
</table>
</body>
</html>
For such an example: Click Here.
|
PHP Usage
For Advanced Users
Code Example:
$articleURL = "__VROOT_DIR__/article/article_manger.php?d=r";
$handle = fopen($articleURL,"rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
print $contents;
//$contents holds the article contents
Step 1: Copy the desired PHP code from __SITE_NAME__.
Step 2: Paste in the PHP file anywhere.
Step 3: The variable $contents contains the HTML code generated by __SITE_NAME__.
Step 4: Use variable $contents to populate your web page.
Note
- Same display help can be used for PHP generated Articles for bounding them to HTML table.
|
|