[Phpwm] RE: Phpwm Digest, Vol 41, Issue 6

Phil Beynon phil at infolinkelectronics.co.uk
Fri Nov 3 18:18:34 GMT 2006


> >if you get stuck then just give me a shout, its a while since I
> wrote that
> >bit but I should be able to review just how I did it pretty quickly.
> >I dont recall it taking me hugely a long time to get it sorted once I'd
> >worked out what it was supposed to do.
> >One thing that I do recall was afterwards figuring that in fact you didnt
> >actually technically need two buttons, just a down one - since you could
> >always drop down the one above the one you wanted to go up to
> get the same
> >result.
> >Didnt look quite as intuitive for the user though as up/down buttons!
>
> Well have a look at this:
> I've gone with the Ajax solution, but as I've never used ajax
> before I have
> a question.
>
> http://www.pickledegg.orchardhostings6.co.uk/cmf/index.php/admin/
>
> ( just the draggable bit-  its all WIP ) :-)

OK - you have "about us" and "contact us" inverted by the way :-)

> In the article where I got it from (
> http://www.phpriot.com/d/articles/client-side/sortable-lists-with-
> php-and-ajax/index.html
> ), he mentions this:
>
> "One possible way to handle this would be to send a success/failure
> indication from processor.php, and then to read this response in
> index.php,
> rolling back the drag and drop if failure was returned."
>
> Do you have any idea how he would 'roll back' the drag and drop
> if a failure
> was returned?

Since that would have to be client side then you could store the initial
order as a cookie and feed that to the javascript for the ordering system as
an initial value if failure was indicated. That's my immediate thought
anyway.
Using the arrows system doesnt have this problem since if the result didn't
get written back the order simply wouldnt have altered, though the user
might be presented with some sort of MySQL type error depending on what had
happened.

> PS, I got it working and transferred it to a codeigniter
> environment, that
> why the urls look the way they do.
>
> If you want any of the code, just yell.
>
Viewing your underlying source code it looks to be search engine friendly in
that proper A tags are used. The title tags in there should be used properly
and not ignored as these could assist in page rankings quite a lot. Engines
such as Google tend to treat a <li> tag as a paragraph so the text used is
also good for position / ranking.

Phil




More information about the Phpwm mailing list