You are not logged in.
Pages: 1
Let's say I have a database full of articles and I want to be able to do the following within Xinha --
1) run a search on the database
2) select a radio button next to any given result
3) click an "embed" button, which will insert something like EMBED:12 in the document being edited.
Is this a plugin or a popup? What's the difference? Will it be very difficult to implement?
Thanks,
Denny
Learn how to astral project: [url]http://gnosticweb.org[/url]
Offline
If you don't know javascript it will be difficult. A popup is a popup window, a plugin is some javascript code to do something that Xinha doesn't do by default
I'd suggest using the XMLHTTPRequest object to do the communication between client and server, and writing a plugin that exposes a panel on the left/right of the editor to form the interface. See the existing plugins to learn how to do it.
James Sleeman
Offline
Thanks, James.
I've been looking through the source of the Linker plugin today.
I have a question --
if($hash)
{
session_start();
if(!isset($_SESSION[sha1($hash)]))
{
?>
[ ];
<?php
exit;
}
}
It looks like you're checking for the session variable here and sending an empty array to javascript if it's not found. However, I can't seem to find where the variable is being set. Would you be so kind as to clue me in?
Thanks,
Denny
Last edited by dhscompguy (2005-03-10 15:57:29)
Learn how to astral project: [url]http://gnosticweb.org[/url]
Offline
It's not, not in the plugin anyway. That's only used if you are going to set the backend config value to include a (base) dir parameter, so that any old joe bloggs can't just call the Linker backend with whatever directory they want. Example usage...
<?php
$dir = realpath($_SERVER['BASE_DIR'] . '/some_directory') . '/';
$_SESSION[sha1('dir=' . $dir)] = TRUE;
?>
<script language="Javascript">
myEditor.config.Linker.backend = _editor_url + 'plugins/Linker/scan.php?dir=<?php echo urlencode($dir) ?>';
</script>
James Sleeman
Offline
Pages: 1