My solution, starts with this easy to install an addon. How this was mostly achieved is by exploiting an odd feature of ISC’s %%include function and its insistence of being uncompromising.
Firstly, make a side panel and call it (say) sitenews. Save this into yoursitetemplate/panels folder.
<div class="Block Moveable Panel SiteNews" id="SiteNews">
<h2>Site News</h2>
<div class="BlockContent">
<ul>
%%Include.calltophpscriptgoeshere%%
</ul>
</div>
</div>
Now create a folder call it News and in this place the following –
A text file with nothing in it named news.txt
Plus the php code below, calling this whatever you wish and can remember –
Code: Select all
<?
if ($_POST) {
// submit changes
$file = fopen($uploaddir . 'news.txt', 'w', 1);
fwrite($file, $_POST['textarea']);
fclose($file);
?>
<textarea name="textarea2" cols="17" rows="15"><?
include("news.txt");?></textarea>
<?
} else {
// display text and wait for changes
?>
<form name="outtext" method="post" action="?ac=outtext">
<textarea name="textarea" cols="17" rows="15"><?
include("news.txt");?></textarea>
<br><input type="submit" name="Submit" value="Submit"></form>
<?
}
?>
When called and used, this will display a textarea window for you to enter any text. Including html formatted. Once you ‘Enter’ this, the screen will display the now saved content of the textarea window into text.txt. You might need to refresh the screen if cache prevents this.
And to complete the link to the page where the text to be displayed add the following into the panel script (from above)-
%%Include.%%GLOBAL_ShopPath%%/news/news.txt%%
Working example see here - http://www.ihost4u.co.uk/xcart2/