By: shadow
Date: 2004-02-07
Time: 14:30
|
Mergeblock bigproblemHello,
i use TBS 1.92 with ezsql in php i have this:
and in templet ist only this:
No data will display on output. wehn i make a mysql query then i have data in all var. can any one help me? |
|||||
By: shadow
Date: 2004-02-07
Time: 19:41
|
Re: Mergeblock bigproblemin the header.php I include domain.php and in the header tpl I use
in the domain.php only one php code :
and this only in the domain.tpl:
all datas will be merge not the code in domain.tpl. when i Use only var.xyz then work merge correct not with mergeblock or other merges.... Please help me i sit here over 6 hours on the problem.... |
|||||
By: Pirjo Posio
Date: 2004-02-07
Time: 21:36
|
Re: Mergeblock bigproblemHello shadow!
Have you somewhere before the MergeBlock a sentence like this? $TBS->LoadTemplate('tbs_us_examples_datamysql.htm') ; In stead of $TBS you should use the names $TPL and $TPL2. I don't see kunde in your SELECT fields, so it can't be merged... Is the server_ip set in your last SELECT with * or not? Hope this helps. - Pirjo |
|||||
By: shadow
Date: 2004-02-07
Time: 22:18
|
Re: Mergeblock bigproblemSorry i have made many changes ojn my source for found the bug....
I use only one $TPL |
|||||
By: shadow
Date: 2004-02-07
Time: 22:27
|
Re: Mergeblock bigproblemI have use mergefield ('test', $var) and this is also not display in the output.
Can method merge not work in tbs_include???? when i use this in my tpl files. in the moment i will make my project to the trash....:_((((((( sorry for my bad english, i can my problem better explain in german |
|||||
By: Pirjo Posio
Date: 2004-02-07
Time: 22:57
|
Re: Mergeblock bigproblemIn your second post you have:
[tbs_include.onshow;file=[var.includedatei_html]] This will be automatically merged, if in your .php file you have a variable $includedatei_html and you call $TPL2->Show() Here you still have TPL2, so that's why I used it. Why do you in your SELECT use $db_local and not $db which is a global variable set by EzSQL and used in TBS custom function for EzSQL? Ich kann nicht Deutsch gut lesen/schreiben. Es ist unmöglich Dich auf Deutsch zu helfen. :-) - Pirjo |
|||||
By: shadow
Date: 2004-02-07
Time: 23:16
|
Re: Mergeblock bigproblemi use 3 mysqls on 2 Server and so i can not use with one $db this is not my problem...
when i use [var.xyz] the merge all vars when i use method merge.. this not to work her the original code: global.inc --------cut-------------------
header.php --------cut-------------------
header.tpl --------cut-------------------
domain.php
domain.tpl
when i user click on menu domain then use domain.php... |
|||||
By: shadow
Date: 2004-02-07
Time: 23:17
|
Re: Mergeblock bigproblemin domain.php is $TPL not $TPL2 sorry
|
|||||
By: shadow
Date: 2004-02-07
Time: 23:22
|
Re: Mergeblock bigproblemwhen i use it in a normal php code with a single file then work very fine...
when i use this in my complicatet code then works this not .... WHY????????? |
|||||
By: Skrol29
Date: 2004-02-08
Time: 00:21
|
Re: Mergeblock bigproblemHi Shadow,
It's difficult to help you because we can't see when you create $TPL2. Could you also describe what bad result you have. Is the table (<table>...</table>) with no row, or the table with the row not merged, or something else? Do you have any TBS error message? |
|||||
By: shadow
Date: 2004-02-08
Time: 00:28
|
Re: Mergeblock bigproblemhello,
i use only one $TPL (no one $TPL2) i be cam no error message and in the website i see was i set in the TPL file [blk1.server_ip;block=tr] not more the rest of my site is ok and i see it.... |
|||||
By: Pirjo Posio
Date: 2004-02-08
Time: 00:28
|
Re: Mergeblock bigproblemHi Skrol29 and shadow!
I think I understand now, what happens here. At least I hope so. Shadow is reading the data directly with EzSQL and not with custom TBS ezSQL functions explained in the TBS Support page. He can do so, but then he has to read the data first in an array and then use in TBS Data Source Type "PHP Array Case-2" as explained in TBS manual. Here's how I used it when testing, and it worked fine. if ( $users = $db->get_results("SELECT res_name, res_score, res_date FROM t_tbs_exemples order by res_name",ARRAY_A) ) { $TBS->MergeBlock('blk2',$users) ; } else { echo ("No data found."); } - Pirjo |
|||||
By: shadow
Date: 2004-02-08
Time: 00:33
|
Re: Mergeblock bigproblemmergeblock with array also not work :-(((
no merge.. methode work with my site :-( only i use single files and that is not good work with tmplets |
|||||
By: shadow
Date: 2004-02-08
Time: 00:40
|
Re: Mergeblock bigproblemi include my php files in php files and include the tpl file in tpl files
is that the problem??? or have any one a idee .. |
|||||
By: Pirjo Posio
Date: 2004-02-08
Time: 00:41
|
Re: Mergeblock bigproblemIn your post where you sent all the code,
you say your first file is "global.inc" but in the header.php on the first line it's "global.php". Which one is true??? Maybe you just don't have something declared "global" so it can't be seen in the other place where you try to use it? - Pirjo |
|||||
By: Skrol29
Date: 2004-02-08
Time: 00:42
|
Re: Mergeblock bigproblemHi Shado, Hi Pirjo :) It's nice to read you :)
It's not normal that you can see the block source wile $TPL->MergeBlock() has been called. Could you have to test to make sure that the line with MergeBlock is well executed? For example, add the fallowing line just before your $TPL->MergeBlock() line: echo '-> this message should appear the web page<br>' ; |
|||||
By: shadow
Date: 2004-02-08
Time: 00:46
|
Re: Mergeblock bigproblemi have cut the header file....
the global.inc is include in the header.php and so is all define ... |
|||||
By: shadow
Date: 2004-02-08
Time: 00:49
|
Re: Mergeblock bigproblemglobal.php is correct....
|
|||||
By: Pirjo Posio
Date: 2004-02-08
Time: 00:52
|
Re: Mergeblock bigproblemHope you noticed my answer, which is above your post here, because we sent them at the same time.
You should test print the array before merging with print_r to see if it contains the data you expect. - Pirjo |
|||||
By: shadow
Date: 2004-02-08
Time: 00:59
|
Re: Mergeblock bigproblemi have use example
domain.php
Result:
|
|||||
By: Skrol29
Date: 2004-02-08
Time: 01:02
|
Re: Mergeblock bigproblemMaybe you missed my previous post.
Are your sure that the line $TPL->MergeBlock(...) in domaine.php is executed? |
|||||
By: shadow
Date: 2004-02-08
Time: 01:04
|
Re: Mergeblock bigproblemhi...
say you wee can i see that is use... |
|||||
By: Pirjo Posio
Date: 2004-02-08
Time: 01:06
|
Re: Mergeblock bigproblemWhen I above said "declare global" I did not mean your global.php.
I meant "Do you use any functions where you should declare the global variables "global" so they will be seen outside your functions?" Look at the PHP Manual, if needed. - Pirjo |
|||||
By: shadow
Date: 2004-02-08
Time: 01:11
|
Re: Mergeblock bigproblemi have no var names "global" or what do you mean...
this complet site run without templet now I will and must new coding with templets... |
|||||
By: Pirjo Posio
Date: 2004-02-08
Time: 01:22
|
Re: Mergeblock bigproblemSkrol29 is very right when he said you should test print something to see where the problem lies.
In domain.php
put the following line between these two lines: print_r ($array_type1); This tells you if the merging is done and also what goes in the merge. - Pirjo |
|||||
By: shadow
Date: 2004-02-08
Time: 01:27
|
Re: Mergeblock bigproblemthis is the result of print_f:
Array ( [France] => 33 [England] => 44 [Spain] => 34 [Italy] => 39 [Deutchland] => 49 ) and the table is not merge |
|||||
By: Skrol29
Date: 2004-02-08
Time: 01:37
|
Re: Mergeblock bigproblemOk. So MergeBlock is effectivelly executed and the array is correct.
NOw, can you check that $TPL->LoadTemplate(...) is run **before ** $TPL->MergeBlock(...). If MergeBlock is before LoadTemplate, then you merge no template. |
|||||
By: shadow
Date: 2004-02-08
Time: 01:55
|
Re: Mergeblock bigproblemhi,
i have recode the header.php so that the LoadTemplet now on the Top of file is...
Result in domain.php is not merge :-(((( the rest on site is ok and run |
|||||
By: shadow
Date: 2004-02-08
Time: 02:11
|
Re: Mergeblock bigproblemthis: $TPL->MergeField('header_titel',header_titel);
will also not merge :-((( |
|||||
By: Skrol29
Date: 2004-02-08
Time: 02:16
|
Re: Mergeblock bigproblemOk.
Could you replace the line
This will display the state of the template when you try to merge the block. Check if the [blk1.*] tags are in the template at this state. If is not, that exlains why the block is not merged, and you will have to understant why the sub-template is not merged at this state. (I have to go to bed now, it's very late in France. I'll be back on your problem) |
|||||
By: Pirjo Posio
Date: 2004-02-08
Time: 02:19
|
Re: Mergeblock bigproblemI have not a solution to you, but some notes:
1. Read the PHP manual page http://www.php.net/function.include as you don't see what I mean by "global". 2. Try using "require" instead of "include" so your code crashes if an included file is not found and you then know where the problem is. 3. If you use EzSQL together with TBS, you must use TBS array_type2 instead of array_type1. 4. On the following line: $TPL->MergeField('header_titel',header_titel); there should probably be $header_titel and not header_titel. And now, Good Night! - Pirjo |