Smartys wrote:

Apache works absolutely fine with PunBB, there is no need to replace it wink

I believe Jeremie was referring to the point that Lighttpd is reportedly far less resource intensive than Apache. Never having run Apache myself, I honestly couldn't say, but that's the general opinion. big_smile

952

(24 replies, posted in General discussion)

And the id does match: navblogs? If so, there's no reason why it shouldn't be working. Make sure the containing div id and <a tag id match and that should work.

953

(24 replies, posted in General discussion)

You're working on a combination of div id and href id. Unless that page is active, that div id won't exist.

954

(24 replies, posted in General discussion)

A slight alteration may need making to the navlink inclusion in the functions file, just to generate the id. I'll have a peek later.

Edit: Come to think of it, why don't you just add an id to each <a tag in the extra links input box?

955

(24 replies, posted in General discussion)

Does it work with the other links assigned in that tabs.css file?

That error may not mean it's an invalid search term. I seem to think, (from the error messages I've seen occur on Punres), that the error message function has a somewhat modified output from default. It appears to be the old obscurity method.

957

(24 replies, posted in General discussion)

Just add a punblogs line:

#punsearch       #brdmenu li#navsearch a,
#punblogs       #brdmenu li#navblogs a

and then do whatever you want with that CSS.

958

(24 replies, posted in General discussion)

You don't need to touch functions.php at all. Forget the functions file. CSS, yes, functions, no. Again, look in your page source. The id is already there. For example, with the blogs which you mentioned:

<div id="punblogs" class="pun">

959

(24 replies, posted in General discussion)

bingiman wrote:

to recognize all external links to use that.

If you look in the source on each page, each page is prefixed with pun[pagename], minus the .php extension.

Out of curiosity though, how can you style external links? Or, are you meaning external in a different context to what I'm interpreting? big_smile

960

(24 replies, posted in General discussion)

So that they only change colour whilst you are on the respective page for that navbar link you mean? If so, look through the CSS code for that tabs mod. That does the same thing, just in a different fashion.

961

(26 replies, posted in PunBB 1.2 discussion)

qie wrote:

I think necessarily plugin is spam control and rewrite!( So both reaaly need added in 1.3 )

I really cannot see the point of url rewriting, personally. It's a bastardisation of a legitimate uri scheme because, in simple terms, the search engines like it. I honestly cannot understand how people wish to humour the search engines when they have designed indexing systems and parsers, (to work with a with a known and documented system, i.e: http vars), and written a parser/indexing system that theoretically is following/preferring filesystem semantic rules.

962

(40 replies, posted in Programming)

Jérémie wrote:

- is a word separator, and & is here a logical operator.

In proper context of the English language, however, & is also a word unto itself, and the hyphen is a word join/combine, rather than a separator. I don't know regarding other languages, but the hyphen is perfectly legitimate occuring somewhere within a word, and some words are actually incorrect without it's use.

Code and language are two separate things. big_smile

To keep it in sync with the rest of the PunBB code, that line:

$db = $GLOBALS['db'];

would be:

global $db;

The author of the thread just edits the topic title when they have found the solution.

smitty wrote:

I see a lot of people using <username> wrote in PunBB forums, but I don't know how to do it. I tried to search google, but nothing results that I see.
Also, is there a list of commands for PunBB that you can use in posts somewhere? Thanks a bunch.

You mean like this? Click the quote link. PunBB uses standard bbcode, so just do a search on that. The help page lists the common codes used, i.e: /path/to/your/forum/help.php

966

(17 replies, posted in Programming)

That's definitely the truth about it not being simple. big_smile

So the straight strip replace is definitely not upto the job then. What feasible way is there of matching and extracting inside the query function the parts that need to go into the dblink function? Is it a case of going for full blown preg_replace/preg_match type regexes?

Thanks for all the advice, btw. smile


Matt

967

(17 replies, posted in Programming)

elbekko wrote:

Looks like annoying syntax when doing joins.

Only if it worked. big_smile

Just given it a whirl using that select * inside the dblink function. It's not a happy bunny. This is what it logged:

STATEMENT:  SELECT u.*, g.*, o.logged FROM dblink('dbname=userdb', 'select * from users') AS u INNER JOIN dblink('dbname=userdb', 'select * from groups') AS g ON u.group_id=g.g_id LEFT JOIN dblink('dbname=userdb', 'select * from online') AS o ON o.ident='[I.P]' WHERE u.id=1
ERROR:  42601: a column definition list is required for functions returning "record"

968

(17 replies, posted in Programming)

My minds obviously in thick mode again. big_smile The bit which I'm just totally not grasping is this:

dblink('dbname=userdb', 'SELECT * FROM ".$this->prefix."users')

With the SELECT statement being hardcoded in, how would it know what to do when a DELETE or such was part of the query, rather than SELECT?

Ninety percent of the time when this has cropped up in the past, it's been down to a second instance of PunBB running which had lax restrictions, which they were literally using as a backdoor to the main forum. smile

Only other way to find out is to check your webserver logs and see what it says there.

970

(17 replies, posted in Programming)

How would things be done for the likes of delete/insert/update? Just been thinking about that. (Dangerous thing for me, I know). big_smile But, the statement/action part couldn't be wildcarded or similar as such, could it?

Would it be simpler to just run a second instance of the dblayer, (adjusted accordingly), in parallel with the existing one specifically for the user/group/online tables, rather than trying to work this dblink into the existing dblayer class?

You wouldn't happen to have a test forum or an old forum or such that uses the same tables, would you?

972

(17 replies, posted in Programming)

$sql = str_replace($this->prefix."users", "dblink('dbname=userdb', '".$this->prefix."users')", $sql);

That would be roughly the alternative to the MySQL method above?

However, by the looks of that first dblink doc, the select statement for that table also needs to be within that dblink function, along the lines of:

$sql = str_replace($this->prefix."users", "dblink('dbname=userdb', 'select [userdb required columns here] from ".$this->prefix."users')", $sql);

Unless I've misinterpreted that dblink documentation, that wouldn't be feasible using that str_replace method above, would it? Or, have I completely misinterpreted that documentation, as is my usual forte? big_smile


Thanks again,

Matt

973

(17 replies, posted in Programming)

It is indeed PgSQL. smile

With it not being a native function, (but I've found there is an addon to achieve the functionality, in a fashion), is there any plausible way of integrating this into the query:

http://www.postgresql.org/docs/8.3/stat … blink.html
http://www.postgresql.org/docs/8.3/static/dblink.html

By the looks of that documentation, str_replace wouldn't be upto the job for that syntax. big_smile


Thanks again,

Matt

974

(17 replies, posted in Programming)

Would that need to be done throughout the code itself, or should using that within the dblayer query function work?

i.e:

        function query($sql, $unbuffered = false)
        {
                $sql = str_replace($this->prefix.'users', 'userdb.'.$this->prefix.'users', $sql);
                $sql = str_replace($this->prefix.'groups', 'userdb.'.$this->prefix.'groups', $sql);
                $sql = str_replace($this->prefix.'online', 'userdb.'.$this->prefix.'online', $sql);

I've just tried that method within the query function, and it error logs as:

STATEMENT:  SELECT u.*, g.*, o.logged FROM userdb.users AS u INNER JOIN userdb.groups AS g ON u.group_id=g.g_id LEFT JOIN userdb.online AS o ON o.ident='[I.P address]' WHERE u.id=1
ERROR:  3F000: schema "userdb" does not exist
LOCATION:  LookupExplicitNamespace, namespace.c:1289
STATEMENT:  SELECT user_id FROM userdb.online WHERE idle=0
WARNING:  25P01: there is no transaction in progress
LOCATION:  EndTransactionBlock, xact.c:2931

Apologies if I'm missing the point again. big_smile


Thanks again,

Matt

975

(17 replies, posted in Programming)

Been searching the board, and so far haven't found anything other than the solution for using a separate user table in the same db. Would it be feasible to have all the user information on a completely separate db, and if so, what, roughly, would need doing to achieve it? Would it need a separate function adding in the dblayer and altering the code throughout PunBB to point to the new function wherever user/group queries are concerned?


Cheers,

Matt