| 
	
 | 
 Posted by Michael Fesser on 11/24/06 14:25 
..oO(Sandman) 
 
>What I'm trying to say is that it's hard to say, when a new page  
>"starts" to know what member info will be presented when it has  
>finnished. 
 
OK, maybe it's not possible for the entire page, but at least for some 
main parts like an article listing, where a whole bunch of member 
informations is required. 
 
>I realize the benefit of that, but it can't be done *beforehand*. 
> 
>What *can* be done is doing it *after*. I.e. when presented with a  
>member id, the member_name() function only outputs a placeholder for  
>the information, like so: 
> 
>    Post from [[MEMBERINFO::1234]] on 2006-11-23: 
 
When you fetch articles from the database, you know who wrote them. It 
doesn't really matter if it's a member or a visitor. 
 
Actually I can't imagine that it should not be possible to fetch the 
articles, get the member IDs from them (if available) and then fetch the 
member informations. Would take just 2 or 3 queries. 
 
>And then, when processing the output buffer, I replace all these with  
>the proper information, and only fetch what member_name() has saved in  
>$GLOBALS["displayed_members"] or something like that. 
> 
>Problem with THAT is that the page may contain one hundred, or maybe  
>five hundred such placeholders, and selecting something with "and id  
>in(<list of 500 id numbers>)" takes a lot of time (a lot more than  
>0.16 seconds). 
 
Did you really test that? 
 
>And then preg_replacing() them after selecting them  
>also takes some time. 
 
str_replace() would be enough in this case, but of course it would still 
require some time. 
 
Micha
 
  
Navigation:
[Reply to this message] 
 |