|
3.2 IMGOWL tags for Smarty Engine.
IMGOWL fully supports Smarty template engine. it has own tags
for Smarty,it's one pair of container tags,look like {imgowl}{/imgowl}.
You just need to put them into your template files to contain image HTML
tags which want to show and protect.
Here's a simple example.You will understand IMGOWL powerful function.
| Template
File: mysite.html |
| |
<html> <head>
<meta http-equiv="Content-Type" content="text/html;>
<title>Propagator's IMGOWL Sample (Work with Smarty Template)</title>
</head> <body>
<div align="center">
{imgowl name="sample1"}
<a href="http://www.163.com"><img src="images/sample01.jpg"
width="400" height="300" alt="01"></a>
{/imgowl}
<br><br>
{imgowl name="sample2"}
<img src="images/sample02.jpg" width="400"
height="300" alt="02">
{/imgowl}
</div>
</body>
</html>
|
| Main
File: mysite.php |
| |
<?php
session_start();
require_once("smarty/Smarty.class.php");
require_once("slidecrab/imgowl.class.php");
$smarty
= new Smarty;
$smarty->display("mysite.html");
?> |
Voila.It's really simple and incredible,right?
SlideCrab will capture all required attributes from <IMG> HTML tags
and <A> HTML tags which contain <IMG> to generate protection.
It can capture your image's linkage from <A> tags and image's URL,alternate
text,resize setting from <IMG> tags.
Tips: You can set your default configuration in imgowl.conf.php(Please
see 2.1 Configuration) , and just put{imgowl}{/imgowl}
tags to your templates,let's work automatically.
Notice: IF you have more than one image want to protect
in a page, you have to assign different name attribute for each pair of
slidecrab tags.
|