Doesn't work.

Dunno... first of all, I think pressing submit has become quite automatic.
Second, there are admins and there are admins... smile

I think CodeDucks solution is ideal. Pretend there is a highly important button and leave it up to the user (admin) to use it or not wink

Might work in general; however, in order to tell xajax to go to that anchor you'd have to write an extra JS snippet that would clutter the whole page even more. I think the above is as ideal as it can get.

So, will you now take that "messy" out? wink

Would you be OK with this version?

    $quote_link = '<a id="p'.$cur_post['id'].'" href="post.php?tid='.$id.'&qid='.$cur_post['id'].'" onClick="this.href=\'#req_message\';xajax_quote('.$cur_post['id'].')">';

Still two functions, but in one call.
Passing the href to xajax does not work.
This one should although I haven't tested on IE so far.
If it's problematic then onmousedown instead of onclick should do.

Connorhd wrote:

You are adding 2 javascript events to every url, which i think is messy. and the wiki is for discussion.

Yes?OK, then I misunderstood the concept.

Connorhd wrote:

you have the onclick and onmousedown, anyway i'll find the javascript so you don't have to do that later.

Would be great. The simpler the better.
There is a possibility to pass the call for "#" to a JavaScript function referenced by xajax so you would save the onmousedown. However, that I found messy.... smile
I'll fix that up later on and you can tell which one you find better.

Why?
What is messy about changing a URL dynamically?
Every Javascript function that is related to links uses two events. The HTML-click event that triggers something totally non-JavaScript and the JavaScript-onClick event that triggers some JS function.
That's absolutely normal.
If you find this messy you will find every Javascript code messy that sits inside an <a> tag. in fact, that would mean JavaScript as such being messy....

By the way - it is one JavaScript event, not two.
Unless you can tell me how to
a) detect a Javascript-disabled browser without Javascript and
b) set a normal HTML link for JavaScript disabled browser *with* Javascript
you should not call this solution messy I think (I mean sure you can do that here but not in a wiki that should contain rather unbiased information IMO)

Why not?
I mean, when you do a layout in, say, Illustrator, don't you save your work? Or do you expect the layout program to do that for you?
I think people actually expect to find something like a "Yes, save this beautiful sort order" button somewhere. I for one would not believe that it has been done in the background. People want to be reassured, that's why. But that's just my opinion, I guess it can all be done flexible enough with or without dynamic saving.

Connorhd wrote:

as for "Bit of a messy way of making it work without javascript" i mean onmouseover is a bit intensive since it gets called every time the mouse goes over it, a better way is to make javascript "intercept" the click, i dunno how to do that though wink

Although I don't see why mouseover is a problem (I mean, it does not consume big resources or so...) I changed it to onmousedown in my board and that works as well.
OK ? smile

Well, is it too hard to climb 3 flights of stairs although there is a lift?
No, it is certainly not but most people would prefer the lift anyway wink

You are right anyway, ajax does add bloat so I agree that it should be used with care.
When have the choice to submit a simple form the old fashioned way or with ajax, just to show users the "Thank you for sending" screen a second earlier I will always go with your opinion.

However, for the board admin it's great.
In order to resort your categories and forums you really have to click a lot - and wait a lot.
It is much easier and more intuitive to just drag and drop.

BTW
This has not too much to o with ajax anyway. Even worse, it's just JavaScript and DHTML.
The result can/should still be submitted the old way.

Thought I open a topic here because it's not really a feature request.
Going from Rods enthusiasm of all these DHTML/JavaScript toys I found this on the net:
http://tool-man.org/examples/sorting.html
It shouldn't be too dificult to modify it so it's possible to sort categories/forums with it.
I am not too sure though if I will find enough time son to do someting about it.
So if somebody else is already planning this feature maybe the link is worth looking at.

As for the Drag&Drop forum sorting:
It may be a bit more tricky than it sounds.
After draggging and dropping everything in place you will still have to press a submit button.
Else all minor changes on your way will become effective immediately, this will totally confuse your current visitors I bet smile
Otherwise it's a nice idea.
I played around with Drag'n'drop way back in 1999, but at that time it was a pain in the arm. No DOM, just a bunch of somewhat incomatible browsers, so I left it at that time.
I think I'll give it another try now...

Nice!
I entered that email/username verification thing there as well.

Btw. what do you mean with "Bit of a messy way of making it work without javascript"?
It does work without and it doesn't seem to break any standards doing so.
Or did I miss something?

Since the punBB user table includes a lot more information than just the basics I think this would be difficult.
F.e. their status, register date a.s.o. you will not find in other tables.
You could import users into the punBB user table by hand and give them default values for the fields you don't have, then update them.

Same here.
In 10% of all login tries I get this error.
Looks like the db takes a nap quite frequently.

IdleFire wrote:

The fact is, it's not really that feasible.

?? It's easy, really.
I did it before and I don't see a real problem with it.

godp777 wrote:

wanted to know if it's possible to build a forum offline

Well.. you can but it is more complicated than with simple HTML.
First of all you need a webserver and MySQL installed on your computer.
Make sure it works.
Then follow the installation instructions.
Once you are happy with the design get an account with PHP 4.3+ and MySQL
Do not copy the files from your machine there immediately, it's easier to do a fresh installation there, make sure everything works.
Now you copy all PunBB files *except* the config.inc.php that you've created on both machines to the web server.

that works unless you have a lot of root or relative links leading outside of the PunBB directory.

Please note that you must have a minimal understanding of MySQL and a webserver to do this.

I found a way to have it working with and without JavaScript. Yes.

If you have the mod installed, go to viewtopic.php line 273 and replace this line

   
$quote_link = '<a href="#req_message" onClick="xajax_quote('.$cur_post['id'].')">';

with this one

   
 $quote_link = '<a href="post.php?tid='.$id.'&qid='.$cur_post['id'].'" onMouseOver="this.href=\'#req_message\'" onClick="xajax_quote('.$cur_post['id'].')">';

This way the "normal" link is active but is changed on mouseover - of course only if JavaScript is enabled.

I am now updating the download files and since it's now working without Javscript as well I'll put it also on Punres.

Another issue I found on the script.gr board using JavaScript:
The beautiful german umlaut characters lead to a JS error, I therefore added a utf8_encode() call to the quote.server.php

Connorhd wrote:

Yeh, if you leave the current punbb functions and use javascript to "intercept" it if javascript is enabled

Interesting. would be a solution indeed. How would you do that?
I mean, possibly without  ugly "document.write" directives ? smile

Connorhd wrote:

also it only lets you quote one message?

I tested it with more than one succesfully. Which browser are you using?

##        Mod title:  InstantQuote
##
##      Mod version:  1.0
##   Works on PunBB:  1.2.9
##     Release date:  2005-10-28
##           Author:  Tobi (tobi@script.gr)
##
##      Description:  This mod needs the xajax library.
##                    It is written by and copyright (c) 2005 by J. Max Wilson
##                    and it is included in this mod package.
##                    The homepage of xajax is here:
##                    http://xajax.sourceforge.net

##                    This mod replaces the quote - function in viewtopic.
##                    For this mod JavaScript must be enabled.
##                    It inserts a quote to the quick reply box at te bottom.
##                    of viewtopic.php without reloading the page and scrolls down there.
##                    Multiple quotes can be made.

##                 
##   Affected files:  header.php
##                    viewtopic.php
##
##       Affects DB:  No

This one contradicts my last post inasmuch as it replaces the quote function of punBB. So - no JavaScript, no fun here.
And therefore I consider it more an experiment than a real mod.
If you're interested check it out:
mod-InstantQuote-1.0.tgz
or
mod-InstantQuote-1.0.zip

Demo here:
http:www.script.gr/board/

Connorhd wrote:

I'll look for it, i was just doing it for fun and i have no idea where it is now, the bbcode tags were easy all i did was convert punbbs regexes to javascript ones

Yes, please look for it.
Sounds good...

Paul wrote:

The only nut to be cracked now is the accesibility issues which AJAX poses.

Do you have more information on that?
I have no idea f.e. about the way these braille and reader tools work, but it would definitely a good idea to have them working as well.

Btw: The registration functions like before without JavaScript. You;ll get the same error messages from the server, it's just that you'd have to wait for it.

In general you have a point tere I think. Apps that rely 100% on Ajax are not (yet) a good idea I guess.

Jansson wrote:

That's exactly what it did. And it didn't put any load on the server.

When you do it in JavaScript only it won't, that's right. What I meant was doing it with ajax=using the punBb parser engine.

Connorhd wrote:

I already made one in javascript, only i couldn't make all of punbbs code and quote box stuff as javascript since i was just editing examples lol, not sure where i put it though.

So you both have done a live preview?
That's great. Can't you make it available somehow? I would definitely like to have it....
How did you deal with bbcode? Isn't it difficult to preview text inside an open bbcode tag?
Really, I'd like to have that thing...

Jansson wrote:
Tobi wrote:

Sure it could.
The instant preview, however, would put some load on the whole thing, all this constant parsing/sending of data...
I guess that would be a bit big.

Instant preview can be done with javascript only. I made a live preview mod for PunBB 1.0.* once.

What I meant with "instant" was something like "Preview while you type".
I am just sitting on that anyway, I think it is better to do it with ajax because then you can use the punBB parser and you don't have to write one in JavaScript.

piniyini wrote:

hey a demo page would be nice

Here you go:

http://www.script.gr/board/register.php

It doesn't have the email verification field because it has the beautiful captcha mod installed but you'll get the idea.

Sure it could.
The instant preview, however, would put some load on the whole thing, all this constant parsing/sending of data...
I guess that would be a bit big.

The search function, however, is more or less what google did with google suggest if I'm getting you right.
You get some search words that other people had typed while you type, or you get potential hits.
Edit: You could use the PREFIXsearch_words table for that.