If you want to add a picture as an illustration of your article. Effect "ą la CNN" guaranteed. 
Database Tables edited:
- unp_news
- unp_settings
Files edited:
- news.php
- settings.php
- postnews.php
- editnews.php
Templates edited:
- news_newsbit
Access to unp_news table and add the SQL query:
ALTER TABLE `unp_news` ADD `picture` VARCHAR( 100 ) NOT NULL AFTER `subject` ;
Access to unp_setting table and add the SQL query:
INSERT INTO `unp_setting` VALUES (23, 21, 'URL to Image Directory', 'sitepics', '', 'The URL to the main folder containing the oploaded pictures for each article. <b>With</b> final slash (/). (Requires preceding http://)', 'text');
INSERT INTO `unp_setting` VALUES (24, 22, 'Image Alignment', 'alignpic', 'left', 'Whether the pictures will appear on the left or on the right of the text.', 'text');
Open news.php and find the while loop in "Process News - Standard" with the values:
while ($news = $DB->fetch_array($getnews))
{
$newsid = $news['newsid'];
$subject = $news['subject'];
$newstext = $news['news'];
$poster = $news['poster'];
$posterid = $news['posterid'];
$date = $news['date'];
$postdate = unp_date($dateformat, $date);
$posttime = unp_date($timeformat, $date);
$avatar = unp_checkAvatar($posterid);
...
}
Add this value among them:
$picture = $news['picture'];
Open settings.php and find the 22 values in "Process Settings Submission" and add this at the end of it:
$value23 = addslashes($_POST['23']);
$value24 = addslashes($_POST['24']);
then add this at the end of "UPDATE SETTINGS QUERIES":
$DB->query("UPDATE `unp_setting` SET value='$value23' WHERE id='23'");
$DB->query("UPDATE `unp_setting` SET value='$value24' WHERE id='24'");
Open postnews.php and find in "Process News Submission":
if ($action == '')
{
if (isset($_POST['submitnews']))
{
$subject = addslashes(trim($_POST['subject']));
$news = addslashes(trim($_POST['news']));
$posttime = time();
$newsposter = $USER['username'];
$newsposterid = $USER['userid'];
...
}
Add this to those values:
$picture = addslashes(trim($_POST['picture']));
then find the following query:
$submitnews = $DB->query("INSERT INTO `unp_news` (`date`, `subject`,
`news`, `posterid`, `poster`) VALUES ('$posttime','$subject','$news','$newsposterid','$newsposter')");
change it into:
$submitnews = $DB->query("INSERT INTO `unp_news` (`date`, `subject`,
`picture`, `news`, `posterid`,`poster`) VALUES ('$posttime','$subject','$picture','$news','$newsposterid','$newsposter')");
then find the html table in "Process Post News Page Content" and add the row between the Subject and News fields:
<tr>
<td width="15%"><strong>Picture:</strong></td>
<td width="85%"><input type="text" size="35" tabindex="2" maxlength="100" name="picture" /></td>
</tr>
Open editnews.php and find in "Process News Edit Query":
// make shorter vars
$subject = $_POST['subject'];
$news = $_POST['news'];
add this value:
$picture = $_POST['picture'];
then find in "Edit News":
// make shorter vars
$newsid = $newsarray['newsid'];
$subject = $newsarray['subject'];
$date = $newsarray['date'];
$news = $newsarray['news'];
add this value:
$picture = $newsarray['picture'];
then in the html table following add this row between the Subject and News fields:
<tr>
<td width="15%"><strong>Picture:</strong></td>
<td width="15%"><input type="text" name="picture" maxlength="100" size="35" tabindex="'.newsid.'2" value="'.htmlspecialchars($picture).'" /></td>
</tr>
Now go to your UNP templates page and edit the template news_newsbit. Between {$useravatar} and {$newstext}, add this:
<img src="{$sitepics}{$picture}" align="{$alignpic}" style="margin: 0 5px 5px; border: 1px solid #000" />
Be sure now to:
- create the default image directory,
- upload the pictures needed,
- have avatars NOT allowed, (what a mess it could make)
- modify in your UNP settings the URL to the default image directory,
- edit your old posts, writing the name of the picture in the Picture Field
Voilą! Doesn't that look nice?
* If you have any suggestions for a direct upload of the picture file... please, let me know.