Categories > TinyButStrong general >

ondata result problem

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: KarIst
Date: 2006-01-24
Time: 11:28

ondata result problem

Helo!

I've got a question, please answer as you can:

//-----------------------
PHP side, the pictopen function:

function pictopen($BlockName,&$CurrRec,$RecNum){
  //this only for the example, but really here swap the 'kep' value to the big picture name, if it is in the image dir.
  $CurrRec['kep']='--';
}


I need this result:

<img src="images/shop/kep.jpg" height="60" class="kepkeret" style="cursor:pointer" OnClick="javascript: nagykep('--');">


I probed this:
(1)
//--HTML side:

<img src="images/shop/[blk1.kep;block=table;ondata=pictopen]" height="60" class="kepkeret" style="cursor:pointer" OnClick="javascript: nagykep('[blk1.kep]');">

The wrong result was(2):

<img src="images/shop/--" height="60" class="kepkeret" style="cursor:pointer" OnClick="javascript: nagykep('--');">


AND then
I probed this:
(2)
//--HTML side:

<img src="images/shop/[blk1.kep;block=table]" height="60" class="kepkeret" style="cursor:pointer" OnClick="javascript: nagykep('[blk1.kep;ondata=pictopen]');">


The wrong result was(2):

<img src="images/shop/kep.jpg" height="60" class="kepkeret" style="cursor:pointer" OnClick="javascript: nagykep('kep.jpg');">

//- in HTML side the img tag is inside a table tag
//the MergedBlock is:
$TBS->MergeBlock('blk1',$cnx_id,'SELECT * FROM nail_termek WHERE fo_id=1 order by sorrend') ;


Thank you: KarIst - Hungary.
By: Skrol29
Date: 2006-01-24
Time: 15:05

Re: ondata result problem

Hello KarIst,

In your function pictopen(), column 'kep' is erased with a new value. Just just have to create a new colmun instead of erasing it.

Like this, PHP:
function pictopen($BlockName,&$CurrRec,$RecNum){
  $CurrRec['kep_big']='--'; // can be calculated using $CurrRec['kep']
}

HTML:
<img src="images/shop/[blk1.kep;block=table;ondata=pictopen]" height="60" class="kepkeret" style="cursor:pointer" OnClick="javascript: nagykep('[blk1.kep_big]');">
By: KarIst
Date: 2006-01-25
Time: 14:04

Re: ondata result problem

Thank you!

It's OK!