1

(9 replies, posted in Programming)

Forget my last post, this was nonsense.

I think, I found the missing point. In your last example, you had an 'e' at the end of your regular expression (after the final #) which was missing in your first examply. I guess, this is doing the eval() job.

2

(9 replies, posted in Programming)

druvans,

I still don't know exactly, what your problem is.

You are right, despite the ' ' around your function, the content gets eval()ed.

Now let's try this

$text=preg_replace('#\[x\](.*?)\[/x\]#e', "imagize('$1')", $text);

so that the $1 will be translated instead of taken literally.

3

(9 replies, posted in Programming)

druvans,

you might try to change your code in something like:

$text = preg_replace("#\[x\](.*?)\[/x\]#", imagize($1), $text);

but I'm not sure, whether it works out for you. I have never used a function inside a preg_replace(), so I really don't know about it. If this doesn't work you might choose an iterative approach replacing one email address after the other. A third variant would be to apply your differently modified $text to the eval() function.

There is at least one more source for trouble in your imagize() function, that I found at a first glance. You use only the first part of the email address to determine the filename, so if you have two people with info@domain1.com and info@domain2.com they both will show up with the info.png image which serves for domain2.com.

@ bogaa

You need to edit /include/functions.php as well.

Just replace:

$pages[] = '<a href="'.$link_to.'&p=1">1</a>';

with:

$pages[] = '<a href="'.$link_to.'/1">1</a>';

and:

$pages[] = '<a href="'.$link_to.'&p='.$current.'">'.$current.'</a>';

with:

$pages[] = '<a href="'.$link_to.'/'.$current.'">'.$current.'</a>';

and:

$pages[] = '<a href="'.$link_to.'&p='.$num_pages.'">'.$num_pages.'</a>';

with:

$pages[] = '<a href="'.$link_to.'/'.$num_pages.'">'.$num_pages.'</a>'

This should do the trick.

What about something like:

New Topic: /forum/forum-ID/new
New Post: /topic/topic-ID/new

although my favorite would be URIs like

/forum/punbb_discussions/2             for page 2 of forum punbb_discussions
/forum/punbb_discussions/new           for a new topic in forum punbb_discussions
/forum/punbb_discussions/t6254         for topic 6254
/forum/punbb_discussions/t6254/2       for page 2 of topic 6254
/forum/punbb_discussions/t6254/new     for a reply to topic 6254
/forum/punbb_discussions/t6254/p36091  for post 36091 on topic 6254

@ Connorhd

Why do you want to stick to a dialect? English is the language, British English is the original. wink tongue

7

(180 replies, posted in PunBB 1.2 troubleshooting)

Thank you Rickard, this will help me a lot.

8

(180 replies, posted in PunBB 1.2 troubleshooting)

Is there any good reason securitywise that should prevent me from having o_base_url = domainname.tld and then calling confirm_referrer(''); instead of confirm_referrer('scriptname.php'); in each affected script (or change confirm_referrer() in functions.php to ignore $script)?

I'd like to do this, because I heavily rewrite my URLs in my modded forum version and I'd like to do some admin stuff with the original version as well.

9

(15 replies, posted in PunBB 1.2 bug reports)

Rickard:

I just searched with Google for "regex debug". Is this something, that might be useful?

http://www.esperan.com/regex.html

Greetings

10

(30 replies, posted in Feature requests)

Rickard

What may feel natural to you is completely unnatural to me. When I click a link, I expect my browser to navigate to that link, not to open a new window.

I absolutely agree with you, and that's exactly what makes it so difficult for me. I have to guess the likings of my visitors and how many there are of each kind. I have 80.000 visitors per day and no one ever complained about my outgoing links open in a new window. This could be meaningless as people might not consider this something that could be changed easily, but if I think of all the other proposals that flood my mailbox every day...

And still I didn't make up my mind as your points make a lot of sense to me too.

11

(101 replies, posted in General discussion)

Firefox since the 0.9 days, now 1.0.

IE is a nuisance, Opera not more than a short try. However, I have to use both of them for web developing.

12

(30 replies, posted in Feature requests)

@ Rickard

I used to open links in new windows in many cases, long befor "_blank" links became popular. Over the time I realised that more and more websites implemented this behaviour already, and I rarely felt annoyed about it. What's annoying to me, however, are pure javascript links that I can not open in a new window. My sidebar usually shows ten to twenty browser windows open at the same time, and those windows are usually not just left over.

To me it's less important how the target attribute was meant initially, it's mainly important whether a certain behaviour seems natural to me or comes unexpectedly. That our expectations regarding the behaviour of browsers and websites are influenced by banner advertisers may be perfectly true, we may further curse them for doing so, but this doesn't change the simple fact that people are just used to the way it is.

Somewhere in this forum I read about a solution to switch between the two behaviours, maybe one could make it an option in the profile, but I agree with you, Rickard, that this doesn't neccessarily need to be in the default install. Maybe a mod would be an idea.

13

(30 replies, posted in Feature requests)

@ analogue

You're right, there might be a little disadvantage for the advanced user who insists in the freedom of choice where to open a link if a "_blank" link is used. If you want to open it in the same window, you can still do it, just right click the link and choose copy link adress, then paste it into the location bar.

What we need to do is to weight the advantages and disadvantages of normal and "_blank" links in relation to the likings and expectations of our users.

I consider myself an advanced user, I know about right clicks to open links in new windows or new tabs. Given the experience I made with most websites, I become accustomed to having a link leaving a website open in a new window. And you know what? I like it because it makes perfect sense to me. But as this is just my opinion we should not overweight it.

If I look at my forum (and yes, the following numbers are just a qualified guess), I would estimate that 70% don't know of the right click option, from the rest 70% never use it because of the extra click needed, and from the remaining rest 70% (like me) just don't want the external link open in the same window. So we have 2.7% of the users who - like you - insist in the choice to open external links in the same window. And we have 97.3% of the users, who would in one way or the other be bothered with unwanted or at least unexpected behaviour or having to make an extra click.

As you (and 2.7% of my visitors) still have the choice to open a "_blank" link in the same window, as I mentioned in the beginning, I will put this burden on your shoulders to save the other 97.3% from a negative experience in my forum. This doesn't mean that this needs to be the standard behaviour of PunBB but it shows my experience with my forum (which is not PunBB yet).

I understand Rickards point of staying xhtml compliant, so I will use a javascript solution like

<a href="http://domain.tld/path/to/file.php" onClick="return newwindow(this)">Linktext</a>

to have a solution that works fine even if javascript is disabled. function newwindow() needs to be included somewhere and "return false".

Hope this might calm down the emotions a little bit.

14

(5 replies, posted in PunBB 1.2 troubleshooting)

I did not even think of having my ideas implemented into the default code base. I just did some brainstorming to prevent myself from overlooking major arguments against them.

The problem with placing the search cache ID in a cookie is that people would only be able to have one search "active" at a time.

You're right, I realised that point a little later too. For my own test bed I found a solution by naming the cookie according to the search itself. E.g. /forum/user/2 a.k.a. forum/search.php?action=show_user&user_id=2 now places a cookie named user_2_search_id, thus several searches in a short period of time would not cause a problem.

In fact it will be more difficult to find a solution for full text searches. In this case there would be three possible solutions.

First solution: making the keyword of the search part of the URL, thus searching for punBB in all forums would result in /forum/search/punBB, in this forum would be /forum/troubleshooting/search/punBB etc.

If the first solution seems to strange (search in two but not all forums would be impossible etc.) I would suggest to submit the correct search ID by additional POST data (buttons to go to consecutive pages) or setting cookies on the client side (JavaScript).

A third way, but the least desirable, would be to have only one full text search at a time by overwriting the full_text_search_id every time POST data is sent. A concurrent search (e.g. in a second window) would still be allowed, but the search needed to be performed again. If however somebody would request a consecutive page of a search after another search has been performed in a second window, he would get the consecutive page's results of the second window's search. In this case, there would be no way to differentiate these two searches by their URL, a scenario which might not happen quite often, but it might cause a lot of confusion.

Although solution 1 has a lot of charme (I like the idea of being able to have bookmarks on search results), I will probably implement it the second way.

Anyhow, I really like your software, and even if I have to code all my ideas myself the basis (your software) seems to be a very sound one. This way is much more effective than turning off several useless features in one of the many bloated softwares out there.

I wish you and your family a happy New Year.

15

(5 replies, posted in PunBB 1.2 troubleshooting)

Thank you Rickard for your quick reply.

The described behaviour with search ID URLs particularly irritates me, because I value URLs much more than most web developers do. In my forum /forum/search.php?action=show_user&user_id=2 would be rewritten to /forum/user/2 or even better /forum/user/spider8, just to make the URL meaningfull as it is now with my current (custom made) software. An arbitrary search ID will inevitably lead to confusion. E.g. users will post these kind of URLs in their posts to help each other on how to find posts of another user etc.

In the case of user posts, the above mentioned URL forum/search.php?action=show_user&user_id=2 is not the result of POST data, so a redirection would not be neccessary. And for the caching benefit: What about deploying a cookie with the search ID? When the second page of the result set is requested the valid search ID can lead to the cached query results, interpreting the search ID if one is found and still valid, otherwise deleting invalid search IDs from the cookies and performing the search once more.

This method could also be used for POST data based searches, thus a redirect to itself (something like /forum/search) to avoid the annoying popup could do the trick. If the search ID is not valid anymore, a search form could be presented.

I understand, that my insisting in meaningful URLs sounds a bit strange to many people, but my members enjoy using these URLs, as they are selfexplaining. I also made the observation, that Google honours these URLs extremely well, my forum with about 1.000.000 posts ist indexed by Google with about 80% of its content.

16

(5 replies, posted in PunBB 1.2 troubleshooting)

I'm playing around with PunBB 1.2 and have two questions about the cached search results:

If I perform a search, e.g. search.php?action=show_user&user_id=2, I will be redirected to something like search.php?search_id=1267605516. Then I go back and request once more the same list of posts and I will be redirected to a cache-URL once more, but with a different ID. A look at the database shows me that there a two entries in search_cache, so I assume that the search was performed twice. So I ask myself:

1. Why is the search performed twice if there is a caching mechanism?

2. What's the purpose of redirecting to a cached result page instead of returning the cached results directly without changing the URL?