htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0 - Add-Ons:
Post deleted by dsearles


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

First page Previous page 1 2 3 4 5 6 7 8 Next page Last page  View All


mapg
Novice

Sep 4, 2003, 10:38 PM

Post #176 of 194 (12889 views)
Shortcut
Re: [dsearles] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

What Murrat doesn't comment you about his problem in Win XP (with Apache W32 running) and with your PHP Tool is what Apache's Error log alerts us...

Note for Murray: Apache has methods to inform about what is running bad! Please do not confuse developer with so vague information!

Well, I having the same problem that Murray on WinXP and everything running fine with PHP tool, but your application doesn't resize images because calls to NETPBM aren't done fine.

Apache reports ...




"." is not recognized as an internal or external command




This is the main problem.

Maybe the cause is this (from your readme.txt file) ...

July 25 - Replace fully-qualified path to NETPBM commands with "." to avoid issues with Apache suEXEC under *nix servers.

But I run a Windows XP server with Apache 2.0.47 and PHP 4.3.2

Let me knot what I can do to fix it.

Manuel


dsearles
User

Sep 5, 2003, 9:21 AM

Post #177 of 194 (12872 views)
Shortcut
Post deleted by dsearles [In reply to]

 


mapg
Novice

Sep 5, 2003, 10:57 AM

Post #178 of 194 (12866 views)
Shortcut
Re: [dsearles] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

Path hasn't any blank space. I follow your instructions of course.

I have removed " to add ' but the problem continues, namely ...

Apache reports ... "." is not recognized as an internal or external command






Neither with ...

define("NETPBM_DIR", trim("E:/Apache2/news/admin/editor/popups/win32/"));

Nor with ...

define('NETPBM_DIR', trim('E:/Apache2/news/admin/editor/popups/win32/'));






Others paths are as follow, but they are running fine ... (at least to call your tool and managing images)

define("IMAGE_DIR", trim("E:/Apache2/news/s_img/"));
define("IMAGE_URL", trim("/news/s_img/"));

define("SCRIPT_DIR", trim("E:/Apache2/news/admin/editor/popups/"));
define("SCRIPT_URL", trim("/news/admin/editor/popups/"));






I insist that ...

July 25 - Replace fully-qualified path to NETPBM commands with "." to avoid issues with Apache suEXEC under *nix servers.

... Couldn't be a good solution for Win32 envirotment.

Let me know then how call to resize images at a Win32 SO and across your php tool.


dsearles
User

Sep 5, 2003, 11:16 AM

Post #179 of 194 (12895 views)
Shortcut
Post deleted by dsearles [In reply to]

 


mapg
Novice

Sep 5, 2003, 11:54 AM

Post #180 of 194 (12894 views)
Shortcut
Re: [dsearles] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

Now is working, but I was right. I had to remove ./ and add .exe like this ...


define("NETPBM_BMP", "bmptopnm.exe \"%s\" | pnmscale.exe %s | ppmtobmp.exe >\"%s\"");
define("NETPBM_GIF", "giftopnm.exe \"%s\" | pnmscale.exe %s | ppmtogif.exe >\"%s\"");
define("NETPBM_JPG", "jpegtopnm.exe \"%s\" | pnmscale.exe %s | ppmtojpeg.exe >\"%s\"");
define("NETPBM_PNG", "pngtopnm.exe \"%s\" | pnmscale.exe %s | pnmtopng.exe >\"%s\"");



Now Apache error.log says me ...



jpegtopnm.exe: WRITING PPM FILE




I do not know why Apache has to report this at error.log and not at access.log

Sorry but I was right about ".", at least in my case.

I am running Apache2triad 1.1.4 with Perl 5.8, maybe PHP 4.3.2 is working as CGI interpreter. I do not know.

Full information about my server is ...

Apache/2.0.47 (Win32) mod_perl/1.99_10-dev Perl/v5.8.0 mod_python/3.0.3 Python/2.2.2 PHP/4.3.2

Take a look at http://apache2triad.org

(This post was edited by mapg on Sep 5, 2003, 12:00 PM)


dsearles
User

Sep 5, 2003, 12:31 PM

Post #181 of 194 (12887 views)
Shortcut
Post deleted by dsearles [In reply to]

 


mapg
Novice

Sep 5, 2003, 12:45 PM

Post #182 of 194 (12887 views)
Shortcut
Re: [dsearles] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

Here you have attached my phpinfo.
Attachments: phpinfo.zip (6.39 KB)


mapg
Novice

Sep 5, 2003, 4:42 PM

Post #183 of 194 (12880 views)
Shortcut
Re: [dsearles] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

Well, then... Is there something that you could do to avoid this problem in the future?, namely for cases like mine, and I suppose that for others, like Murray and so on.

By other hand, I do not think that I have a special version of WinXP Pro.

Are you going to do something then?

Best Regards

Miguel


dsearles
User

Sep 5, 2003, 7:54 PM

Post #184 of 194 (12866 views)
Shortcut
Post deleted by dsearles [In reply to]

 


mapg
Novice

Sep 5, 2003, 8:26 PM

Post #185 of 194 (12862 views)
Shortcut
Re: [dsearles] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

Simply you are annoyed because I saw an error in your code. This is the main reason.

I saw your attitude at your first reaction some messages ago.

Later I asked if you are going to do something, and you replied like that. Annoyed and asking if you are working for me.

First all, change your attitude or don't develop anything to reacts like that. If you had a bad day, this is not my problem. Keep your bad days for yourself because everyone has its own problems.

Do not take simple questions as exigencies. I asked something so simple not a hurried requesting, not even a requesting, simply an question.

Go to sleep that tomorrow will be another day.

Best Regards and Good Luck annoyed Guy.

Miguel


Ben Robinson
Novice

Sep 10, 2003, 11:13 PM

Post #186 of 194 (12790 views)
Shortcut
Re: [mapg] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

Nice job, mapg. You have managed to piss off an excellent developer of htmlarea. You must keep in mind that everyone working on the project is doing so out of a labor of love. Therefore, it is not in the best interests of everyone for people to become demanding of developers. dsearles does not owe you anything. So, any asistance that he may have offered you should be taken with extreme gratitude. Do not ask someone, "are you going to do something about this?" when they are a volunteer.

dsearles was very prompt and thorough in helping me about a week ago. His choice to help me was his decision. I'm glad I was able to get a copy of dsearles work before you pissed him off and caused him to delete all of his posts. His image manager was amazing! Please refrain from having such attitudes in these circles.

Ben


dsearles
User

Sep 15, 2003, 11:54 AM

Post #187 of 194 (12724 views)
Shortcut
Re: [Ben Robinson] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

Ben,

Thanks for the understanding and kind words. In light of all those who DO appreciate the effort put in by us volunteers, I have re-posted the Image Manager MOD at http://dsear.org/htmlArea/phpImageManager-htmlArea-2.03.zip and it even includes the fix that mapg got so upset about (which SHOULD resolve the problems with NETPBM on some Windows servers).

I guess I can't let one person spoil things for everyone else...


chet
User

Sep 15, 2003, 2:32 PM

Post #188 of 194 (12719 views)
Shortcut
Re: [dsearles] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

Thanks for this great addon dsearlesWink
and welcome back.

Thanks to guys like you we all have more fun playing and using htmlarea.

I have one question. Is it possible to do the resize function with GD2 ?


dsearles
User

Sep 15, 2003, 6:02 PM

Post #189 of 194 (12713 views)
Shortcut
Re: [chet] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

The primary reason I avoided using GD was that as of GD 1.6 it no longer supports GIF images (due to Unisys's ridiculous patent issues; imagine having to enforce old patents because you can't think of any new ideas...). I'll investigate what's up with GD2...


dsearles
User

Sep 15, 2003, 7:06 PM

Post #190 of 194 (12710 views)
Shortcut
Re: [dsearles] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

I checked the GD Project site (http://www.boutell.com/gd/) and GD will not support writing GIF images again until after the world-wide patent expires on July 7, 2004. So since a GD implementation would not support GIF images (still very popular on the web), I'll stick with the NETPBM implementation which does support writing GIF images.


gurechan
Novice

Oct 9, 2003, 11:58 AM

Post #191 of 194 (12507 views)
Shortcut
Re: [dsearles] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

Hey dsearls, great add on.

This works a treat and was easy to set up and get working. I have one question. Is it possible to just have the image url outputed to the text area rather than the image itself? I'm no GURU at javascript! I'm setting up a PHP selfmanagement system, and want users to be able to preview the image that they want to insert, but only need the url to be inserted into a text area that is set up to handle this and then insert this into the DB.

Any advice would be great. Cheers.


dsearles
User

Oct 9, 2003, 12:12 PM

Post #192 of 194 (12505 views)
Shortcut
Re: [gurechan] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

The creation of the IMG tag is actually handled by the htmlArea script itself; my add-in just provides an improved image selection (with preview and upload capability). Therefore, such a change would need to be made in the htmlArea script itself.

An "ugly workaround" would be to insert the image then switch to HTML mode and delete the "<IMG SRC=" before the URL and the ">" after the URL. I know, that hardly a solution that you want end users to exercise but making htmlArea simply insert the URL would require you to create a "clone" on the "Insert Image" tool which did everything except generate the IMG tag.


gurechan
Novice

Oct 9, 2003, 8:14 PM

Post #193 of 194 (12498 views)
Shortcut
Re: [dsearles] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

Thanks, I kind of thought that might be the case. Still this is a fantastic add on. Cheers.


digit
New User

Sep 23, 2004, 11:57 PM

Post #194 of 194 (10490 views)
Shortcut
Re: [gurechan] Revised Version of PHP Image Manager for HtmlArea 2.03 [In reply to] Can't Post

It does look fantastic but i am having technical issues with it :-(

Note i split all bar admin to
personalcomputers.co.nz
and the admin section to
admin.personalcomputers.co.nz

example error message: File 'spacer.gif' could not be created

admin.personalcomputers.co.nz/htdocs/includes/configure.php



<?php
/*
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
define('HTTP_SERVER', 'http://admin.personalcomputers.co.nz/'); // eg, http://localhost - should not be empty for productive servers
define('HTTP_CATALOG_SERVER', 'http://personalcomputers.co.nz/');
define('HTTPS_CATALOG_SERVER', '');
define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
define('DIR_FS_DOCUMENT_ROOT', '../htdocs/'); // where the pages are located on the server
define('DIR_WS_ADMIN', '/'); // absolute path required
define('DIR_FS_ADMIN', ''); // absolute pate required
define('DIR_WS_CATALOG', 'http://personalcomputers.co.nz/'); // absolute path required
define('DIR_FS_CATALOG', '../../personalcomputers.co.nz/htdocs/'); // absolute path required
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backup/');
define('BACKUP', DIR_FS_ADMIN . 'backups/');

// Added for Templating
define('DIR_FS_CATALOG_MAINPAGE_MODULES', DIR_FS_CATALOG_MODULES . 'mainpage_modules/');
define('DIR_WS_TEMPLATES', DIR_WS_CATALOG . 'templates/');
define('DIR_FS_TEMPLATES', DIR_FS_CATALOG . 'templates/');

// define our database connection
define('DB_SERVER', 'secret'); // eg, localhost - should not be empty for productive servers
define('DB_SERVER_USERNAME', 'secret');
define('DB_SERVER_PASSWORD', 'secret');
define('DB_DATABASE', 'secret');
define('USE_PCONNECT', 'false'); // use persisstent connections?
define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
?>



admin.personalcomputers.co.nz/htdocs/popups/config.inc.php



<?php

require('../../includes/configure.php');

/*
** Change ONLY the following lines to match your server setup
*/

// CONSTRAIN_* indicates the image constraints used to scale uploads (0 = none)
define("CONSTRAIN_HEIGHT", 0);
define("CONSTRAIN_WIDTH", 0);

// IMAGE_DIR and IMAGE_URL identify the Image directory "root" (MUST end in "/")
// Do NOT include "http://my.hostname.com" in IMAGE_URL; just the path from the
// DocumentRoot of your webserver.
define("IMAGE_DIR", trim(DIR_FS_CATALOG . DIR_WS_IMAGES));
define("IMAGE_URL", trim(DIR_WS_CATALOG_IMAGES));

// NETPBM_DIR identifies the directory where NETPBM is located (MUST end in "/")
// Not used if either CONSTRAIN_HEIGHT or CONSTRAIN_WIDTH (above) is specified as "0".
define("NETPBM_DIR", trim(DIR_FS_CATALOG));

// SCRIPT_DIR and SCRIPT_URL identify where these scripts reside (MUST end in "/")
// Do NOT include "http://my.hostname.com" in SCRIPT_URL; just the path from the
// DocumentRoot of your webserver.
define("SCRIPT_DIR", trim(DIR_FS_ADMIN . "htmlarea/popups/"));
define("SCRIPT_URL", trim(DIR_WS_ADMIN . "htmlarea/popups/"));

// SUPPORT_* identify optional features
define("SUPPORT_BITMAP", TRUE); // supported by Internet Explorer ONLY!
define("SUPPORT_CREATE", TRUE);
define("SUPPORT_DELETE", TRUE);
define("SUPPORT_METAFILE", TRUE);// supported by Internet Explorer ONLY!
define("SUPPORT_UPLOAD", TRUE);

// UPLOAD_LIMIT indicates the maximum file size (in BYTES!) which can be uploaded (0 = unlimited)
define("UPLOAD_LIMIT", 0);

/*
** Change ONLY the preceeding lines to match your server setup
*/

/*
** DO NOT CHANGE beyond this point UNLESS you have
** modified 'insert_image.html' OR any of the scripts
*/
$dpi = 0;
if(isset($HTTP_GET_VARS["DPI"])) {
$dpi = $HTTP_GET_VARS["DPI"];
}
else if(isset($HTTP_POST_VARS["DPI"])) {
$dpi = $HTTP_POST_VARS["DPI"];
}
if($dpi < 72 || $dpi > 150)
$dpi = 96;

// AGENT_DPI identifies the DPI setting being used by the web browser
define("AGENT_DPI", $dpi);

// ICON_* identify the icons to be used by the "tree" pane
define("ICON_CLOSED", "closed.gif");
define("ICON_INDENT", "indent.gif");
define("ICON_OPENED", "opened.gif");
define("ICON_BMP", "bmp.gif");
define("ICON_GIF", "gif.gif");
define("ICON_JPG", "jpg.gif");
define("ICON_PNG", "png.gif");
define("ICON_WMF", "wmf.gif");

// IMAGE_* identify the image type values (most returned by PHP's getImageSize)
define("IMAGE_BMP", 6);
define("IMAGE_GIF", 1);
define("IMAGE_JPG", 2);
define("IMAGE_PNG", 3);
define("IMAGE_WMF", 42);

// LISTER_* identify elements used by the "tree" pane
define("LISTER_DELETE", "font: italic 7pt 'MS Shell Dlg', Helvetica, sans-serif;");
define("LISTER_NAME", "lister");
define("LISTER_PADDING", "4");
define("LISTER_SPACING", "0");
define("LISTER_STYLE", "font: 8pt 'MS Shell Dlg', Helvetica, sans-serif;");
define("LISTER_TAG", "IFRAME");

// MANAGER_* identify elements used to connect the panes to the "action" form
define("MANAGER_NAME", "manager");
define("MANAGER_SRC", "txtFileName");
define("MANAGER_TAG", "TABLE");

// METAFILE_* indentify constants used in decoding Placeable Metafile Headers
define("METAFILE_DPI", 96);
define("METAFILE_KEY", "9ac6cdd7");

// NETPBM_* indentify commands used in image constraining (WMFs cannot be constrained!)
define("NETPBM_BMP", "bmptopnm \"%s\" | pnmscale %s | ppmtobmp >\"%s\"");
define("NETPBM_GIF", "giftopnm \"%s\" | pnmscale %s | ppmtogif >\"%s\"");
define("NETPBM_JPG", "jpegtopnm \"%s\" | pnmscale %s | pnmtojpeg >\"%s\"");
define("NETPBM_PNG", "pngtopnm \"%s\" | pnmscale %s | pnmtopng >\"%s\"");

// PANE_* identify the geometry and conversion factors used by the panes
define("PANE_XFACTOR", ((AGENT_DPI == 96) ? 1 : (AGENT_DPI / ((AGENT_DPI < 96) ? 95 : 97.5))));
define("PANE_YFACTOR", ((AGENT_DPI == 96) ? 1 : (AGENT_DPI / ((AGENT_DPI < 96) ? 95 : 99.5))));
define("PANE_HEIGHT", floor((115 * PANE_YFACTOR)));
define("PANE_LABEL", ceil((35 * PANE_YFACTOR)));
define("PANE_WIDTH", floor((200 * PANE_XFACTOR)));

// TEXT_* identify literal text used by the "tree" and "preview" panes
define("TEXT_DELETE", "[delete]");
define("TEXT_ROOT", "Images Root");
define("TEXT_SELECT", "<i>No<br>Image<br>Selected<br>for<br>Preview</i>");

// VIEWER_* identify elements used by the "preview" pane
define("VIEWER_NAME", "viewer");
define("VIEWER_NONE", "font: italic 12pt 'MS Shell Dlg', Helvetica, sans-serif;");
define("VIEWER_PADDING", "2");
define("VIEWER_SPACING", "0");
define("VIEWER_STYLE", "font: 8pt 'MS Shell Dlg', Helvetica, sans-serif; background-color: #c0c0c0;");
define("VIEWER_TAG", "IFRAME");

// WRAPPER_* identify elements used to connect the "tree" and "preview" panes
define("WRAPPER_NAME", "wrapper");
define("WRAPPER_TAG", "TABLE");

/*
** Globals
*/
$base = "";
$dirs = array();
$error = "";
$info = "";

/*
** Returns a complete Path from the Base.
**
** Params: $path - Path to complete
** $nodes - Count of Nodes to include
*/
function basePath($path, $nodes = 999) {
global $base, $dirs;

// initialize context
$result = "";
$count = count($dirs);

// for ALL desired Nodes ...
for($index = 0; $nodes > 0 && $index < $nodes && $index < $count; $index++)

// ... if Node is NOT null ...
if(strlen($dirs[$index]) > 0)

// ... append the Node and separator
$result .= $dirs[$index] . "/";

// append the Path
$result .= $path;

// return the Path
return $result;
}

/*
** Parses, cleans and sets the Base path.
**
** Params: $path - Path to parse and clean
*/
function cleanPath($path) {
global $dirs, $base;

// initialize context
$nodes = 0;
$clean = "";

// parse the Path
$dirs = split('[/\\]', "$path");

// for ALL Directories in the Path ...
foreach($dirs as $dir) {

// ... if this is a Relative path ...
if(!(strcmp($dir, ".."))) {

// ... if NOT at the ROOT ...
if($nodes > 1)

// ... decrement Node depth
$nodes--;
}

// ... otherwise, if Directory is NOT null ...
else if(strlen($dir) > 0) {

// ... based on Node depth ...
switch($nodes++) {

default:
// ... append a Path separator
$clean .= "/";

//
// fall-thru is intentional
//

case 0:
// ... append the Directory
$clean .= $dir;
break;
}
}
}

// re-parse the Path (w/o any relative nodes!)
$dirs = split('[/\\]', "$clean");
$base = implode("/", $dirs);

// return the Path
return $dirs;
}

/*
** Returns a fully-qualified URL for the specified Image file
**
** Params: $path - Path to Image
** $encode - TRUE if URL is to be encoded; FALSE otherwise
**
** Returns: Fully-qualified URL
*/
function imageInfo($path) {

// if Image info is NOT available ...
if(!($size = @getImageSize($path))) {

// ... if Metafile support is desired AND File opens ...
if(SUPPORT_METAFILE && ($fp = fopen($path, "rb"))) {

// ... read the File
$key = readDWORD($fp);

// if File is a Windows Metafile (WMF) ...
if(!(strcasecmp(dechex($key), METAFILE_KEY))) {

// ... read remainder of WMF header
readWORD($fp);
$x2 = readSHORT($fp);
$y2 = readSHORT($fp);
$x = readSHORT($fp);
$y = readSHORT($fp);
$inch = readWORD($fp);

// calculate the size
$width = abs(($x2 - $x));
$height = abs(($y2 - $y));
$width = round((($width * METAFILE_DPI) / $inch));
$height = round((($height * METAFILE_DPI) / $inch));

// return the Info
$size = array($width, $height, IMAGE_WMF, "width=\"$width\" height=\"$height\"");
}

// close the File
fclose($fp);
}
}

// return the Info
return $size;
}

/*
** Returns a fully-qualified URL for the specified Image file
**
** Params: $path - Path to Image
** $encode - TRUE if URL is to be encoded; FALSE otherwise
**
** Returns: Fully-qualified URL
*/
function imageURL($path, $encode = FALSE) {
global $HTTP_SERVER_VARS;

// initialize context
$url = (IMAGE_URL . $path);

// if URL is to be encoded ...
if($encode) {

// ... encode the URL
$url = rawurlencode($url);
$url = str_replace("%2F", "/", $url);
}

// return the URL
return ("http://" . $HTTP_SERVER_VARS["HTTP_HOST"] . $url);
}

/*
** Returns the Windows status.
**
** Returns: TRUE if server is Windows hosted; FALSE otherwise
*/
function isWindows() {
global $HTTP_SERVER_VARS;

// return the Windows status
return isset($HTTP_SERVER_VARS["WINDIR"]);
}

/*
** Reads a BYTE from the specified file.
**
** Params: $fp - File to read
**
** Returns: BYTE read
*/
function readBYTE($fp) {

// return the BYTE
return ord(@fread($fp, 1));
}

/*
** Reads a DWORD from the specified file.
**
** Params: $fp - File to read
**
** Returns: DWORD read
*/
function readDWORD($fp) {

// create the DWORD
$lo = readWORD($fp);
$hi = readWORD($fp);
$dword = (($hi << 16) | $lo);

// return the DWORD
return $dword;
}

/*
** Reads a SHORT from the specified file.
**
** Params: $fp - File to read
**
** Returns: SHORT read
*/
function readSHORT($fp) {

// create the SHORT
$short = readWORD($fp);

// if SHORT is signed ...
if($short & 0x8000)

// ... make it negative
$short |= 0xffff0000;

// return the SHORT
return $short;
}

/*
** Reads a WORD from the specified file.
**
** Params: $fp - File to read
**
** Returns: WORD read
*/
function readWORD($fp) {

// create the WORD
$lo = readBYTE($fp);
$hi = readBYTE($fp);
$word = (($hi << 8) | $lo);

// return the WORD
return $word;
}

/*
** Returns a fully-qualified URL for the specified Script
**
** Params: $path - Path to Script
** $encode - TRUE if URL is to be encoded; FALSE otherwise
**
** Returns: Fully-qualified URL
*/
function scriptURL($path, $encode = FALSE) {
global $HTTP_SERVER_VARS;

// initialize context
$url = (SCRIPT_URL . $path);

// if URL is to be encoded ...
if($encode) {

// ... encode the URL
$url = rawurlencode($url);
$url = str_replace("%2F", "/", $url);
}

// return the URL
return ("http://" . $HTTP_SERVER_VARS["HTTP_HOST"] . $url);
}
?>
<meta http-equiv="expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<script language="javascript">
function findAncestor(element, name, type) {
while(element != null && (element.name != name || element.tagName != type))
element = element.parentElement;
return element;
}
</script>


thanks for your help people, I am very impressed with OSC, its been about 2-3 days now and i have spent about 30 hours tweaking and testing :-)

example site:

www.personalcomputers.co.nz
username: wholesale
password: preview

thanks in advance

First page Previous page 1 2 3 4 5 6 7 8 Next page Last page  View All
 
 


Search for (options)