Re: [PHP] include path file errors
2006-04-08 (토), 18:20 +0900, kmh496 쓰시길: > hi, > my webroot is > > /a/b/current/ > > i am in /a/b/current/d/file.php > > file.php has a line > > require_once ($_SERVER[document_root]."/d/common.php"); > > common.php has a line which says > > require_once ($_SERVER[document_root]."/_common.php"); > // main include file for whole site > > it sends me no errors about missing files, but the variables inside main > include file _common.php are not set and don't exist in file.php > > where is my mistake? I am going to say this is screwed up. i can't include a file inside another included file and access its variables. all i can do is include the main file in every single file in a backwards manner -- reaching down the chain -- because i find that if i do 2 includes then the initail data is no longer included. but sometimes there is magic going on, but then i move one file and then the whole system breaks, it makes me crazy. even more so because i can't explain it well because it's so freaky. is there no tutorial on advanced php with all this include stuff? i RTMFM but the page didn't address advanced questions like that. and despite my english i believe i am advanced level. thankx everybody. joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [SPAM] Re: [PHP] a php image gallery
2006-04-08 (토), 20:32 +1000, chris smith 쓰시길: > On 4/8/06, Ross <[EMAIL PROTECTED]> wrote: > > > > Does anyone know know of a good php image gallery? I want to generate the > > pages automatially from stored images. > > > > Please don't reply with 'search google under php gallery' or some other > > useless reply. I want someone to advise, who has used code either free or > > paid for that is decent and is easy use. > > There was a recent thread: > http://marc.theaimsgroup.com/?l=php-general&m=114439402126801&w=2 > > which lists a few. > > I use coppermine (coppermine.sf.net), gallery is pretty popular too > (gallery.sf.net). gallery is bug city. i ran 2 versions of it for a year to show pics of my familiy and it was down for most months of the year. it ran fine, actually, until an upgrade lost all my pictures. then, i found it again, and it wouldn't log me in. i don't know what i did to it to deserve that kind of treatment. just read the forum links on sourceforge. everybody is reporting some new and different error on the install alone. let alone running it. and it's a 10 MB download. the problem is it's overcoded. there are 36 developers listed. most projects have just a couple. coppermine is better coded. it's more straightforward. the integration is a pain, though, if you want to integrate with another user table from another application. just my 2cents -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include path file errors
2006-04-08 (토), 12:18 -0400, John Hicks 쓰시길: > kmh496 wrote: > > 2006-04-08 (토), 18:20 +0900, kmh496 쓰시길: > > > >>hi, > >>my webroot is > >> > >>/a/b/current/ > >> > >>i am in /a/b/current/d/file.php > >> > >>file.php has a line > >> > >>require_once ($_SERVER[document_root]."/d/common.php"); > >> > >>common.php has a line which says > >> > >>require_once ($_SERVER[document_root]."/_common.php"); > >>// main include file for whole site > >> > >>it sends me no errors about missing files, but the variables inside main > >>include file _common.php are not set and don't exist in file.php > >> > >>where is my mistake? > > > Just a thought: > > Are your variable definitions, by any chance, inside functions? That > would explain why they aren't set when you continue. The 'global' > statement will help in that case. > > I can assure you that includes are not "advanced PHP". You should be > able to do what you are trying to do. There is no doubt a simple > explanation for your problem. Finding it is always the hard part. > Patience and perserverence and calm rational thought will get you there. the problem is when i want to expand a site with a new application, usually that comes in its own directory. but, to include the new application i have to wrap it inside the main directory -- in this case /a/b/current which requires of course that i call first /a/b/current/common.php which starts the sessions, sends the cookies, checks post variables. but that doesn't work, really, because then all of the includes for the application says "include(main.php)" ... but php thinks it's in /a/b/current not in /a/b/current/d/ . so it says "cannot find include file "main.php" in path: path:::;; .." my wish list: 1) applications came with a configurable directory to preced every include or require. like, change "include(main.php)" --> include( $config[dir] . "main.php" ) alternatively, 2) all applications come with a unique prefix affixed to the files so they can simply be laid out in the document root and be visually and mentally and upgradably separate from the files of the other applications existing in the same $_SERVER[document_root] i honestly don't understand the include mechanism. i have encountered many cases ( sorry, can't be explicit) where a file which was 2 includes away wouldn't have any variables in the main script, unless i added a line to include that file in that file directly. as an example: /a/b/current/index.php include("common.php"); include("lib/functions2.php"); /a/b/current/lib/functions2.php you would think would be able to simply run with what was included "above" it but you can't. you have to redeclare include_once($g4[bbs]. "/dbconfig.php"); include_once($g4[bbs]. "/common.php"); the include of the common.php file. i am looking for the rule for that they say it's global, but it's not. However, i found that if you include "common.php" again then it finds the functions it misses, because it itself was included by "common.php". as if the direction of the includes matters . explicitly: if common.php includes lib/functions.php common.php can access lib/functions.php but if lib/functions.php needs common.php then lib/functions.php needs to include common.php is that correct? because of these problems, when i have to wrap another application inside an existing SKIN and common.php, i end up changing the file names, running a SED script to replace all occurrences of filenames with their newly-uniquely-prefixed-names . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] internationalization of web site
i put the files in one place for you. to do what you want. http://www.sirfsup.com/code/php/i18n_php/http_server_encoding 2006-04-12 (수), 16:24 -0300, Martin Alterisio "El Hombre Gris" 쓰시길: > Ussually, the browsers send a header with information about the language > preferences of the user. > This header is HTTP_ACCEPT_LANGUAGE. > You can retrieve its value in PHP through the array $_SERVER: > $_SERVER['HTTP_ACCEPT_LANGUAGE'] > > Here you can find about the format of this header: > http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 > > Alain Roger wrote: > > >Hi, > > > >Sorry to send this email on both mailing lists but as i suppose that both > >are concerned by it, i did. > > > >i would like to make my web site tune to user language. > >for that i was thinking to create some XML files where all words can be > >found and based on the icon (country flag) that user clicked, i will load a > >specific XML file to tune my PHP pages. > > > >i know from Java exprience that it exists also another possibility via > >browser setup for preference in language, but i do not know how it works in > >PHP. > > > >please, could you give me some tips, helps, or tutorial for such request ? > > > >thanks a lot, > >Alain > > > > > > > -- my site http://www.myowndictionary.com";>myowndictionary was made to help students of many languages learn them faster. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
2006-04-16 (일), 19:35 +0900, kmh496 쓰시길: > can somebody explain why > > $this->param = $this->SYSTEM->db->answer + $this->param; > > is causing the error > > > Fatal error: Unsupported operand types > in /var/www/current/mjguest/modules/settings.php on line 52 > > > > context is > > > function settings(&$SYSTEM) > { > $this->SYSTEM = &$SYSTEM; > $this->SYSTEM->db->ask(1, 'settings_load'); > $this->SYSTEM->db->get_row(); > > $this->param = $this->SYSTEM->db->answer + $this->param; > } > > > > > -- what are they trying to do//? for what "does param mean" question, param is just above that part.. class settings { var $SYSTEM; var $param = array // Maximum length for web site title ( 'titlelen' => 28 # DEFAULT: 28 # MAXIMUM: 50 // Maximum length for administrator email , 'adminmaillen' => 50 # DEFAULT: 50 # MAXIMUM: 80 // Max Width and Height of avatars thumbnails (in pixels) , 'userpic' => array ( 'width' => 60 # Width in pixels # DEFAULT: 60 # EDIT ACCORDING TO CUSTOM LAYOUT , 'height'=> 60 # Height in pixels # DEFAULT: 60 # EDIT ACCORDING TO CUSTOM LAYOUT ) // Available date-time formats (valid patterns for php "date()" function) , 'dateformats' => array ( 'd.m.Y h:ia'=> 'D.M.Y 12h' # Business international , 'm/d/Y h:ia'=> 'M/D/Y 12h' # American , 'Y-m-j h:ia'=> 'Y-M-D 12h' # Asian , 'd/m/Y H:i' => 'D/M/Y 24h' # European , 'F, jS Y h:ia' => 'MM, Dth Y 12h' # English , 'd.m.Y @ B .\b\e\a\t' => 'D.M.Y @ .beat' # Swatch(R) Internet time )# PATTERN => REPRESENTATION ); function settings(&$SYSTEM) { $this->SYSTEM = &$SYSTEM; $this->SYSTEM->db->ask(1, 'settings_load'); $this->SYSTEM->db->get_row(); $this->param = $this->SYSTEM->db->answer + $this->param; } the db->answer is ... function ask() { $qparams = func_get_args(); $this->__lastquestion = $qparams[1]; $this->query($qparams[0], strtr(vsprintf($this->questions[$qparams[1]], array_slice($qparams, 2)), $this->tables)); } function get_field($num = 0) { $this->answer = @mysql_fetch_row($this->__cachedquery); return ($this->answer ? $this->answer[$num] : $this->__error()); } function get_row() { $this->answer = @mysql_fetch_assoc($this->__cachedquery); return ($this->answer ? true : $this->__error()); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Unsupported operand types
2006-04-16 (일), 21:02 +1000, chris smith 쓰시길: > On 4/16/06, kmh496 <[EMAIL PROTECTED]> wrote: > > 2006-04-16 (일), 19:35 +0900, kmh496 쓰시길: > > > can somebody explain why > > > > > > $this->param = $this->SYSTEM->db->answer + $this->param; > > > > > > is causing the error > > > > > > > > > Fatal error: Unsupported operand types > > > in /var/www/current/mjguest/modules/settings.php on line 52 > Sounds like you have a bad query and instead of answer being a row, > it's something else. > > Print out everything before you use it: > > instead of: > $this->param = $this->SYSTEM->db->answer + $this->param; > > $answer = $this->SYSTEM->db->answer; > $param = $this->param; > > echo "Answer: " . $answer . ""; > > If that's not an array, that's your problem and you'll have to debug > why it's not an array. > > -- list and especially dmajick @ gmail, thanks for your help. i will have to debug later, i am sorry, i have to run right now. frankly speaking, i am simply having a bad day. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php