BLHTML.org

BLHTML.org / Web Programming / BLHTML / BLHTML Manual / BLHTML Project / AJaB / AJaB functions /

 
  Example 1367 0
Picture galleri from start page:

Pictures läses in from table flower Pictures är satta under My Pictures 1 to 5 If you har fler pictures är det bara att change max value for $data_1 Att lagra picture informationen in en table can vara bra if you vill gruppera pictures for att styra vilka pictures som skall show.

Page that calls the ID=8 page=C
Number of pictures:<br>
<a onclick="
clr(); object('bar'); send('a=-1'); echo(8, 'C');"><img src="images/left.png" alt=previous border=0></a>
#DATA[data_2] id=data_2 post=new size=3 value=5 class=txtbox#
<a onclick="clr(); object('bar'); send('a=1'); echo(8, 'C');"><img src="images/right.png" alt=next border=0></a><br>

<div id=
bar style="height: 60;"><input id=data_1 type=hidden value=#$data_1#>#1 id=11 width=50##2 id=11 width=50##3 id=11 width=50##4 id=11 width=50##5 id=11 width=50##DATA[data_1] id=data_1 post=hidden value=0#</div>

Page that is called: ID=8 page=C
#SUM value($data_1 $a) return=data_1#

#IF($data_1 < 0) then(#$data_1=29#)#
// If picture -1 show last pictures
#IF($data_1 > 29) then(#$data_1=0#)# // If last pictures show forsta

#IF($data_2) then(#$m=$data_2#) else(#$m=5#)# // Show $m amount pictures
#IF($m > 14) then(#$m=14#)# // Show MAX 14 pictures

#DATA[flowers] id=11 post=set field=flower type=fieldlist# // Tar ut pictures from account 11
<input id=data_1 type=hidden value=#$data_1#> // Save current picture data_1

#: loop#
#PIC id=11 no($flowers[$data_1]) width=50#
// Writes ut picture: $flowers[$data_1]

// Tar ut next picture from informationen hämtad from table flower
#SUM value($data_1 1) return=data_1##IF($data_1 > 29) then(#$data_1=0#)#

#SUM value($n 1) return=n#
// Räknar upp amount visade pictures
#IF($n < 5) then(#GOTO loop#)# // Sätter att vi shows 5 pictures

Samma example med #DO#:
#SUM value($data_1 $a) return=data_1#
#IF($data_1 < 0) then(#$data_1=29#)#
#IF($data_1 > 29) then(#$data_1=0#)#
#IF($data_2) else(#$data_2=5#)#
#IF($data_2 > 14) then(#$data_2=14#)#

<input id=data_1 type=hidden value=#$data_1#>

#DO from=1 to=30 skip=$data_1 limit=$data_2 loop=true
        value(#PIC id=11 no($post) width=50#)
#

Returns:
Number of pictures:


More information:
  • AJaB functions
  • #DO#
  • DO with AJAB Asynkron stegning
  • BLHTML forum  


    apache MySQL PHP No to software patents! BLHTML
    © 2003, 2010 BLHTML
    This page is created with BLHTML in 0.0946 seconds