From: Marek T. <ma...@gn...> - 2003-01-15 16:19:38
|
Hi, I had two problems with the image uploads in latest CVS 1) Calls GD function imagetypes() even if GD isn't installed Fix: # diff apc-aa/include/imagefunc.php3 /var/www/apc-aa/include/imagefunc.php3 12c12,19 < --- > if (!extension_loaded('gd')) > { > // if (!dl('gd.so')) > // { > return(false); > // } > } > return(true); 92a100 > if (!GDInstalled()) return(false); 2) Echoes some debug ? info which causes Warning: Cannot add header information - headers already sent by (output started at /var/www/apc-aa/include/itemfunc.php3:830) in /v ar/www/apc-aa/include/util.php3 on line 71 Fix: diff apc-aa/include/itemfunc.php3 /var/www/apc-aa/include/itemfunc.php3 830,831c830,832 < echo $fid;print_r($arr_stop); < echo $stop=false; --- > // echo $fid; > print_r($arr_stop); > // echo $stop=false; 843c844 < { echo "tu"; --- > { // echo "tu"; Could someone fix it in cvs please ? Best Marek > -----Original Message----- > From: apc...@li... [mailto:apc...@li...]On Behalf Of Honza Malik > Sent: 15 January 2003 11:01 > To: apc...@so... > Subject: Re: [Apc-aa-coders] Creating an instance of class item > > > Described functions are already there (grabbed from slice.php3): > > // 'slice_aliases' - is splited to two functions > list($fields,) = GetSliceFields($slice_id); > $aliases = GetAliasesFromFields($fields); > > // read_content_from_db - axactly what does GetItemContent() > // the $ids could be array of ids or single $id, $use_short_id is > // boolean indicating type of $ids (default is false => unpacked) > $content = GetItemContent($ids, $use_short_ids) > > Honza > > On St, 2003-01-15 at 09:16, Mitra wrote: > > So should we have a generic function that takes an itemid, reads the > > aliases from the slice's info, and then the content from the db and > > then creates an item? > > > > That function itself is easy, but needs two functions to make it work i.e. > > > > > > $aliases = slice_aliases($sliceid); > > $content = read_content_from_db($itemid); > > new $item("","",$aliases,"",""); > > $item->columns = read_content_from_db($itemid); > > > > I don't think the format string is needed? Since we are going to be > > expanding a view. > > > > The two functions I'm using above - i.e. slice_aliases($sliceid) and > > read_content_from_db($itemid) both seem to be missing, although they > > both seem pretty generic to me. > > > > > > - Mitra > > > > At 1:22 AM +0100 15/1/03, Honza Malik wrote: > > >Grabbed from admin/discedit.php3: > > > > > >// $dcontent - well known "Abstract Data Structure": > > >// $dcontent[$d_id]["d_state........."][0][value] > > >// $dcontent[$d_id]["d_state........."][0][flag] > > >$dcontent = GetDiscussionContent($item_id, "", "", false); > > > > > >// aliases array in standard form: > > >// $aliases["_#SUBJECT_"] = array( "fce" => "f_h", > > >// "param" => "d_subject.......", > > >// "hlp" => "L_D_SUBJECT_ALIAS" ); > > > > > >// prepare > > >$item = new item("","",$aliases,"","",""); > > > > > >// format string > > >$text = "<tr><td> ..._#SUBJECT# </td> > > > <td>_#AUTHOR## .._#DATE####</td></tr>"; > > > > > >// assign format > > >$item->setformat($text); > > > > > >// assign item data > > >$item->columns = $dcontent[$d_id]; > > > > > >// print > > >echo $item->get_item(); > > > > > > > > > Honza > > > > > > > > >On Út, 2003-01-14 at 01:10, Mitra wrote: > > >> > > > >> >> P.S. I'd still like a hint on how to create a new "item" refering to > > >> > > an item id, this would be very useful for use of the site module, but > > >> >> I can't figure out if this is possible. > > >> > > > >> >I'm not sure I understand, what you need. > > >> > > >> > > >> In the site, I have a parameter like --m1234 > > >> > > >> So I have an id of an item, - (actually a short id, but it doesn't > > >> really matter. ) > > >> > > >> What I would like to do is in module/site/sites/site_greenpages.php3 > > >> create an instance of the class "item" (as in include/item.php3) so > > >> that I can then do my unaliasing in that context. This would mean > > >> that within the site definition I could put > > >> > > >> _#HEADLINE or {headline........} or > > >> {alias:related........1:f_v:view.php3?vid=23&cmd[]=x-23-_#this} > > >> > > >> etc etc > > >> > > >> But the code for creating the instance of the class item is pretty > > >> obscure, it is tightly coupled to the places it is used now, I'm > > >> looking for some guidelines to creating an instance of the class item > > > > starting with an id. > > > > > > > > - Mitra > > > > > > > > > > > >------------------------------------------------------- > > >This SF.NET email is sponsored by: Take your first step towards giving > > >your online business a competitive advantage. Test-drive a Thawte SSL > > >certificate - our easy online guide will show you how. Click here to get > > >started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en > > >_______________________________________________ > > >Apc-aa-coders mailing list > > >Apc...@li... > > >https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: Take your first step towards giving > your online business a competitive advantage. Test-drive a Thawte SSL > certificate - our easy online guide will show you how. Click here to get > started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en > _______________________________________________ > Apc-aa-coders mailing list > Apc...@li... > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders > |