|
Assume that you have the MySQL table and want
to create a script to output results.
First table structure - News (ID, title, author, author_email,
text, date, image.itype)
SP.DE picture's table corresponding to it, was created automatically
by a "Database Engine"
Second table structure -
News_image ( ID, image, itype, x, y)
Main question: How to create this script?
1) Include sp_start.php script in the beginning of news.php
<?include(“./sp/sp_start.php”);?>
2) Include sp_end script in the end of the file
<?include(“./sp/sp_end.php”);?>
3) For more convenience describe SET in the beginning of the file
( but
after
<? include (“./sp/sp_start.php ”);?>)
| |
<? include(“./sp/sp_start.php”); ?>
[SET__News
^MYSQL : SELECT * FROM News
^WHERE :
^TABLE : News
^ID : ID
^LIMIT : 4
]
<html>
<body>
[TEMPLATE__$News]
{author} -
{DATE__date(format=Y M D)} - {title}
{IMG__image(x=100)}
{TXT__text(bbcodes)}
[END__TEMPLATE__News]
</body>
</html>
<? include(“./sp/sp_end.php”); ?>
|
4) Create "image_cache" folder under your /public_html/
(www) directory and set CHMOD to 777 or try to use CHMOD 764 and ask your
hosting company to CHOWN this directory to a web server group (usually it's "nobody")
5) That is all.
|