From: Tyler A. <fi...@ru...> - 2001-04-26 16:54:29
|
> This makes good sense. Do we have a specific set of includes to make > this available, or just including the i18n.php file? Also, any > specifics on including validate.php? Yes. I'm going to set them too. :-) 1) Include validate.php at the top of every file that produces *its own* page of output. For instance, typically your setup.php file will not need the validate.php on top. For the attachment_common plugin, both the image.php and vcard.php should include validate.php. 2) When you include validate.php, it should look something like this -- nothing else should come before it (besides comments and the <?PHP thing). chdir('..'); include('../src/validate.php'); 3) Do not use this format: if (! isset($prefs_php)) include('../functions/prefs.php'); Instead, use this one, since we now automatically only load files once. include('../functions/prefs.php'); 4) Validate.php includes config.php, i18n.php, strings.php and auth.php. Do not include those in your plugin anymore. Validate.php also calls stripslashes if it is needed, and tries to remove the "\r\n" before form entries for compose.php. Do not call stripslashes anymore. You don't need to know if gpc_magic_quotes() or whatever is true. Gettext (the _() function) is always loaded or else our substitute function is in its place. Config variables are always loaded. Do not use session_start(). Do not check if the user is logged in. Do not output a message if they are not logged in. Need I say more? :-) 5) When you make these changes, the plugin will only work with 1.1.1 or later. Make a note of that. |