1 (edited by MattF 2007-11-28 00:16)

Topic: Opinions. Is this a touch much?

Have added a toggleable option for making links in posts show in an object frame as well as just being a clickable link. Does it seem okay, or a touch too much?

http://forums.bauchan.org/testforum/viewtopic.php?id=3

Edit: Btw, hope no-one minds me using this forum as the test link? big_smile

Re: Opinions. Is this a touch much?

Nice...I would like that mod.

3

Re: Opinions. Is this a touch much?

Seems quite different to me, but it could be useful. It would definitely be an interesting modification, that's for sure. Good work I'd say smile.

Re: Opinions. Is this a touch much?

It could be useful on some specific cases, however I'm afraid if this is left open to everyone it would be misuse (i.e. used everytime, everywhere).

One topic that come right to mind is an encyclopedia, or dictionary. Like, instead of linking to a Wikipedia article, one could pull it (or part of it) in his post, like a quote (but updated in real time, and without the copy/paste manipulations) to illustrate a point. However, this would need an API or some kind of microformat pull or local filter to pull data and not a full web page with all its crap (navigation, etc.).

5 (edited by StevenBullen 2007-11-28 11:34)

Re: Opinions. Is this a touch much?

Does it work on old ie? I am guessing not as I am at work and dont work.
But! What does it do? does it open up links in the actual post in a frame?

I might check this out for my next project. wink



Off topic: when I read the title I thought it was about the itouch. tongue

6 (edited by MattF 2007-11-28 11:42)

Re: Opinions. Is this a touch much?

StevenBullen wrote:

Does it work on old ie? I am guessing not as I am at work and dont work. But! What does it do?

Open up links... in the post inline?

Not tried it with IE yet, so I'll ashamedly say I can't answer that truthfully. smile

It just shows the link in an inline frame in the post, (with a link underneath to open the site in a new tab/window if required). It uses <object> rather than <embed>, (for xhmtl validity), so that's most likely why it doesn't work in IE, I assume.

Edit: Adding to that though, I would think it should be easy enough to use the browser detection type script that I use for the xml or html switching to automatically toggle between embed/iframe or object, dependent upon the browser.

7

Re: Opinions. Is this a touch much?

StevenBullen wrote:

Off topic: when I read the title I thought it was about the itouch. tongue

big_smile big_smile My wording choices can be somewhat archaic on occasion. big_smile This is one of those ideas I had, implemented it for testing, and then thought, is it really such a good idea? big_smile

When I get the code polished, (I still need to add a user as well as admin toggle option), I'll post the code up.

One thing I'm trying to decide at the moment, (as Jeremie's post raises a very good point), is whether to leave it as a global and user specific toggleable effect for any posted uri link, or whether to make it only available via code tags.

Re: Opinions. Is this a touch much?

I would say making it a specific bbcode, and allowing this special code to be parsed only for a specific privilege. Yup, paranoia is good, but you should see some of the forum people out there smile

Re: Opinions. Is this a touch much?

I will keep a keen eye on this. smile

10 (edited by MattF 2007-11-28 18:31)

Re: Opinions. Is this a touch much?

Revision two. big_smile It is now on/off selectable at admin and individual user level. (No allowed groups defined yet, but a simple array could sort that, rather than using the db).

Straight url's in posts are now parsed as normal again, and this mod now uses [frame] bbcode tags. If the browser acknowledges that it accepts xhtm/xml, an object frame is used. If not, an iframe is used, so it should work across the Mozilla/IE range.

The only thing that still needs sorting is the quote nesting, to work in the same manner as the img tag in quotes where the uri rather than the image is shown. (I haven't figured out where that bit is done yet). big_smile

Edit: I've enabled the frame option for guest users on the test forum, so the frames should display okay. smile

11

Re: Opinions. Is this a touch much?

Jérémie wrote:

Yup, paranoia is good, but you should see some of the forum people out there smile

I know what you mean. That's why I've never added any of those flashing/scrolling text mods. I know they'd be annoying as hell with those. big_smile

Re: Opinions. Is this a touch much?

MattF wrote:

If the browser acknowledges that it accepts xhtm/xml, an object frame is used. If not, an iframe is used, so it should work across the Mozilla/IE range.

What kind of testing do you do for this?

I wander what a wget, or googlebot for example, would answer. I think it would be best to give a well formed, valid, xhtml as much as possible; and have a workaround for the few known UA that don't like the object tag.

13 (edited by MattF 2007-11-28 20:57)

Re: Opinions. Is this a touch much?

It's just using a straight HTTP_ACCEPT check for application/xhtml+xml. I know the W3C validator bots don't identify that they accept that, but I have no knowledge whatsoever of any other bots workings, so I'm not sure what would happen with them.

If they don't identify that they accept it, it's hard to know whether they would display correctly or not, hence the slightly awkward situation as to which choice is best.

14 (edited by MattF 2007-11-28 22:07)

Re: Opinions. Is this a touch much?

Partially sorted the quote scenario too.

http://forums.bauchan.org/testforum/viewtopic.php?id=3

Only scenario that doesn't work yet is where one quotes a post with a [frame] tag then puts a [frame] tag in the post with the quote. Both links are stripped at the moment.

15

Re: Opinions. Is this a touch much?

Steven, you're running IE? Any chance I could ask a small favour? smile I believe I've found why IE doesn't show the sites in object tags. It's one of it's 'security' settings. In Tools -> Security settings -> Miscellaneous, could you enable the option:

Access data sources across domains

and see if they are visible from your end then?


Cheers, smile

Matt

16

Re: Opinions. Is this a touch much?

Btw, when I pop the code up for this, (I've done a diff of profile.php and listed the other changes except for the parser in that file), will it be okay if I just pop the full copy of my parser file up, for you to grab the bits you need from it? Saves having to write up a list of changes to the parser. big_smile

17 (edited by MattF 2007-11-30 07:24)

Re: Opinions. Is this a touch much?

Here's the files with the changes. The frame.diff file lists the two extra columns/fields needed in the db, as well as the changes to admin_options and profile.php required, plus a couple of lang file additions. The db query in that file just has this difference: u.object_links, so adding that to the existing query in profile.php is all that is needed on the query bit.

The parser file, it's all the bits between these two lines that are the new additions:

//-----------------Frame mod additions start----------------//

//------------------Frame mod additions end-----------------//


With the user perms, to make it default to on for everyone except guest users, just run this:

UPDATE punbb_users SET object_links=1 WHERE username!='Guest';

Obviously, change the punbb_ prefix if yours is different. big_smile


I've removed the Iframe switch, with IE being capable of using object, but if anyone wants that adding back, let me know and I'll post the additional code.

Quote nesting works in a rudimentary fashion, but does the job for the time being. Could do with a proper regex setup on that, but works generally fine as is.

Btw, the frame will only be shown via viewtopic.php, so any portal/frontpage/index mods won't have a frame plastered in their news/info column.


Let me know what you think, and if anyone finds a problem I might have missed. smile


Edit: Adding the link to the files might help. big_smile

http://outgoing.bauchan.org/unix/frame_mod/