3,501

(10 replies, posted in Programming)

grant all privileges on databasename.* to any_user@localhost identified by 'secretpassword';

where databasename is the name of the database, any_user is the username for your user, and secretpassword is the password you want for the user.

3,502

(10 replies, posted in Programming)

You'll need a database and a user with permissions over the database smile

3,503

(10 replies, posted in Programming)

Sorry, I missed that: try specifying the host as 127.0.0.1?
I think the .sock file got deleted, so hopefully the TCP/IP connection should work

3,504

(10 replies, posted in Programming)

Make sure MySQL is running

guardian34 wrote:

I've changed the announcement to only appear on index.php before.

In header.php, find:

// START SUBST - <pun_announcement>
if ($pun_config['o_announcement'] == '1')

Replace with:

// START SUBST - <pun_announcement>
if ($pun_config['o_announcement'] == '1' && (strpos($_SERVER['SCRIPT_NAME'], '/index.php') != false)) // mod: front page only

(Not sure if that's the best conditional statement to use, but it worked for me at the time.)

The issue with that is that you then lose the use of the announcement wink

3,506

(98 replies, posted in News)

Rickard wrote:
tomekf wrote:

I have question about index in table online. Now phpmyadmin says:

UNIQUE and INDEX keys should not both be set for column `user_id`

Is it correct ?

Hmm. Let me look into this. If anything, we have a redundant index, but it's not something to worry about.

That's a warning as far as I know, and as far as my research goes it's untrue due to the fact that online is a heap table (it would be redundant if it were a MyISAM table)

Bastien: Actually, I am from the USA wink

Yemgi i understand what you wanna say me but in the code listing you showed me what happens with the forum and my content? Will they be displayed the same time? So that the content is over the forum and the forum is visible the whole time?

No. Again, I think you're misunderstanding how web pages work.
When you click on a link in a web page, your browser sends a request to the web site. The site then sends the entire page that you requested. Every bit of HTML on that page is sent, headers and footers included.
So, when you're viewing the forums, PunBB parses the template and generates a page. If you put your header and footer in there, PunBB will use it when generating the page. Then, when you click on the links, your site will process the requests and generate its full page and send it to the browser. PunBB's full page will have only the forum is the content div and your site's full page will only have whatever the user clicked on.

Then I don't know what the problem is wink

3,509

(15 replies, posted in Programming)

I have to agree with Paul: it's MUCH easier to read with proper newlines and tabbing. Just like with source code, tabbing makes it easier to see where certain tags begin/end

Create a file, pun_include it in main.tpl in the proper position. In the file, you'll have something like

if (basename($_SERVER['PHP_SELF']) == 'index.php')
{
// stuff
}

3,511

(9 replies, posted in Programming)

Aha smile

The beginning of the parameters in $_GET are marked by a ? and the individual parameters are seperated by &s
So, http://punbb.org/forums/viewtopic.php?p … er=unknown

No, I really don't tongue
Clicking the link to the plugins page loads an entirely new page. The new page doesn't have anything to do with the forum.

3,513

(9 replies, posted in Programming)

One note before I start: $HTTP_POST_VARS is deprecated, you should use the $_POST superglobal instead
I'm not exactly sure what you mean, $_POST (and all the superglobals) are simply arrays with the keys being the parameters passed. So here for example, if my URL is http://punbb.org/forums/viewtopic.php?pid=91477, $_GET will contain one element, pid, with a value of 91477.

Aha, I see smile
Like I said, divs don't act like iframes. When you click the link it loads an entirely new page, it doesn't just load the content div. Therefore, clicking the link to Plugins from the forum will load the Plugins page like normal

I'm afraid you misunderstand me wink
I understand that you have a content div. My question is, when viewing the forum, would anything else be in that content div? If not, what's the issue with editing PunBB's template so that the layout of the forum is the same?

At the same time as the forums?

I'm missing something: what's the content for the forums page, other than the forum?

Wouldn't the forum be the content?

3,519

(9 replies, posted in Programming)

1. rm is not a PHP function
2. button should be input
3. PHP is done server side, so you need the user to submit a form with all the data

You have to use the pun_include feature of the templates if you want to include PHP.

main.tpl is the file used by most pages in PunBB as a basic template. If you were to put the div logo, div menu bar, and div footer in the main.tpl file, PunBB would use them when displaying the pages.

Those pages are about getting PunBB features into your normal pages.
Divs are not like iframes, you can't have an entirely new web page open in them and say there. What you can do is edit main.tpl and integrate your site's header/footer into the forum. That way, the header/footer will be shown on every page.

$pun_user is populated by a query which grabs all the information from the users table, groups table, and some information for the online table for the current user. There's also $pun_user['is_guest'] which simply is a boolean that says if the person is a Guest or not.

3,523

(5 replies, posted in PunBB 1.2 troubleshooting)

Yeah, if something's wrong with MyPunBB only Connor can really fix it. And I'm pretty sure the database management plugin doesn't exist yet for MyPunBB, so there's no way to get a database dump (and even if you did, InvisionFree probably wouldn't convert it for you and upload it)

Template files don't accept PHP: you need to include PHP files with pun_include

I would suggest the database management plugin, the backup plugin has had some issues