|
Posted by Angelos on 11/17/05 11:51
I do this all the time.
>
> In pseudo code:
>
> $position=0;
> foreach ($menu as $m){
> $position++;
> $uplink = "admin.php?move=$m[id]&to=" ($position-1);
> $downlink = "admin.php?move=$m[id]&to=" ($position+1);
>
> print "(uplink icon) (downlink icon) row data....<br />";
> }
>
>
> Then you update the sortorder field when either link is clicked. Remember
> to
> update the field that it is moved TO so it is moved down/up respectively.
>
> Of course, if the row is the first or the last, you shouldn't have either
> a
> uplink or downlink.
>
> Plus, if you have a hierarchical menu (like I do), you need to keep track
> of
> the position number relative to the current hierarchy leve and send that
> along
> with the query (i.e. move=12&to=3&mother=23)
>
Now we are talking....
Nice One Sandman. ... I'll try that today ;-)
Navigation:
[Reply to this message]
|