Yes, I got it. I won't look at it until tomorrow though, since I just got back from a party with 20 danish people. I currently feel as I deserve :)
7,677 2003-08-23 11:11
Re: Image and page layout (24 replies, posted in PunBB 1.2 troubleshooting)
Ah, of course. Silly me! set_include_path() and get_include_path() were added in PHP 4.3.0. Here's an alternative that should work with older versions of PHP as well:
ini_set('include_path', ini_get('include_path').':../forums');
About the relative path to your forums directory. I believe it should be ./punbb and not ../punbb since:
. = current directory
.. = parent directory
In you case we want the directory punbb which is a subdirectory of the "website directory", so we don't need to go one step back like in my case. Are you following me?
7,678 2003-08-23 11:01
Re: The work continues (87 replies, posted in PunBB 1.2 discussion)
Nope, PUN_INACTIVE is a registered member who hasn't logged in yet. The first time the user logs in, he/she becomes PUN_USER. It's only applicable to forums with "Validate registrations" set to yes.
7,680 2003-08-22 22:22
Re: Image and page layout (24 replies, posted in PunBB 1.2 troubleshooting)
About the dutch translation. Great! You can e-mail me the updated language pack. Don't forget to tell me what name you want me to enter in the credits.
About "Recent discussions". I'll tell you how it's done here on punbb.org.
My directory structure is as follows:
/home/www/site/ - this is where the website stuff is located
/home/www/forums/ - the forums (duh!)
My index.php for the website starts out like this:
<?php
// We add the forums directory to the PHP path so that PHP can find the scripts we include later
set_include_path(get_include_path().':../forums');
@include 'config.php';
// If PUN isn't defined, config.php is missing or corrupt
if (!defined('PUN'))
exit('config.php doesn\'t exist or is corrupt. Please run install.php to install PunBB first.');
// The next line tells PunBB to not update the cookie of the visiting user
// A visit to the front page shouldn't affect stuff like new post indicators
define('PUN_DONT_UPDATE_COOKIE', 1);
require 'include/common.php';
After we have run this code we have access to $db, which is the database abstraction layer, $cookie, which holds information about the visiting users cookie, $cur_user, which is all the user information about the currently logged in visitor (the array isn't set if the visitor is a guest), $options, which is all the forum options and $permissions, which is well, the permissions :) Probably a few more variables, but there are the most interesting.
Please not that you have to alter the set_include_path()-line to reflect your own directory structure. You should change ../forums to the relative path to your forum directory.
After that code, I do a little bit of that and a little bit of that. Then, when it's time to display the "recent discussions", I run this code:
<?php
$result = $db->query('SELECT id, subject FROM '.$db->prefix.'topics WHERE moved_to IS NULL ORDER BY last_post DESC LIMIT 14') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
while ($cur_topic = $db->fetch_assoc($result))
{
if ($options['censoring'] == '1')
$cur_topic['subject'] = censor_words($cur_topic['subject']);
if (strlen($cur_topic['subject']) > 30)
$cur_topic['subject'] = trim(substr($cur_topic['subject'], 0, 24)).' ...';
echo "\t\t\t\t\t\t\t".'<b>·</b> <a href="http://punbb.org/forums/viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a><br>'."\n";
}
?>
That should do it.
Another thing to note is that the above code will display recent topics from all forums, be they admin/mod only or not, regardless of whether the visitor has access to such forums or not.
Hope this helped!
Edit: I noticed you are running 1.0. You must upgrade to 1.0.1 for the above code to work correctly.
7,681 2003-08-22 21:57
Re: Need a french translations (3 replies, posted in Feature requests)
I don't think so. At least I haven't heard anything. Are you perhaps interested in doing one?
7,682 2003-08-22 21:55
Re: Logo again (3 replies, posted in Feature requests)
old_mac wrote:
May we use the logos from this site in a smaller size to advertise the forum. Powered by: punbb
Yes, you may. I should make real graphics for linking, but I just haven't found the time.
old_mac wrote:
Wishes:
1. Like to see the ability to upload and download attachments
2. User selectable language in preferences
1. See Frank H's post :)
2. Noted. I'm thinking about it for 1.1.
old_mac wrote:
Did you code it from scratch or did you build on some other scripts.
Some parts of it are quite familiar.
Almost all of it. The search indexing, search script and SMTP e-mailing code is "heavily inspired" by code from phpBB2, but otherwise, I do believe I've written the rest of it from scratch.
old_mac wrote:
Do I need any .htaccess files?
No, not unless you want to restrict access to certain directories or something like that, but I can't think of a reason why you would want to.
7,684 2003-08-22 13:50
Re: I hate databases... (6 replies, posted in Feature requests)
Yeah, that's an options. If anything, it would then be SQLite (which is bundled with PHP5 btw). It supports almost all of SQL92.
Edit: I've been checking out SQLite a bit, and it seems really cool. It's faaast!
Edit2: Checking out SQLite more thoroughly is now on the TODO-list.
7,685 2003-08-22 13:32
Re: I can see no images (8 replies, posted in PunBB 1.2 troubleshooting)
Gribber wrote:
644 feels safe, rw for the owner and just read for others?
it´s public at the web so i can´t se any reason not having it system worldreadable.
Nope, I was just wondering if 644 was enough. I noticed that in phpBB they chmod to 777. I can't think of a reason why though :)
Gribber wrote:
i just added the "@chmod($options['avatars_dir'].'/'.$id.'.gif', 0644);" line for each filetype, is there a better way?
No, I don't think so. The code right there isn't all that pretty anyway :)
7,686 2003-08-22 13:14
Re: I can see no images (8 replies, posted in PunBB 1.2 troubleshooting)
Ah, of course. Perhaps I should add something similar to the PunBB source code. I wonder what would be the best default umask.
7,687 2003-08-22 13:09
Re: I hate databases... (6 replies, posted in Feature requests)
Having a plain text alternative would be very cool, but it would also involve a whole lot of coding. Frankly, I doubt I will ever add flatfile db support to PunBB. Sorry :/
7,688 2003-08-22 10:52
Topic: Downtime (2 replies, posted in General discussion)
I woke up this "morning" to find that my girlfriend had switched off the server when she was going to switch on the workstation. There goes 180 days uptime :P I think everything is back to normal now.
I guess I was begging for it to happen considering how the two computers are placed: http://galleri.sweclockers.com/galleri_ … hassi_id=3
:)
7,689 2003-08-22 02:02
Re: Image and page layout (24 replies, posted in PunBB 1.2 troubleshooting)
First of all. Do you know any PHP? I could tell you how it's done, but if I have to "start from scratch", I'd rather not :)
7,690 2003-08-22 01:57
Re: Customizing PunBB & Helping (16 replies, posted in PunBB 1.2 discussion)
Ah, I see. A kind of "karma" system where you can use up you accumulated karma points. I believe it would be quite a massive mod, but be my guest :)
7,691 2003-08-22 00:48
Re: Avatar Problems (13 replies, posted in PunBB 1.2 troubleshooting)
Well, we could do a little trial and error. First, open up profile.php and go to line 342. It looke something like this:
$temp = @move_uploaded_file($uploaded_file['tmp_name'], $options['avatars_dir'].'/'.$id.'.gif');
There, remove the @ in front of move_uploaded_file. Do the same on lines 348 and 354. Then try uploading a file again and see if PHP outputs a warning. If it does, paste it here.
If that doesn't work, we'll try the following. Go to line 359. It looks something like this:
if (!$temp)
Before that line, enter:
dump($uploaded_file);
Then paste here what is outputted on the screen when you try to upload.
7,692 2003-08-21 19:27
Re: posts/topics per page (6 replies, posted in PunBB 1.2 bug reports)
Gribber wrote:
Hm, just check witch users who have default before update, then update there profiles to :)
Yeah, but how do you if a users actually want the same value as the old default or if they want to "go with the flow"?
I can't really understand what's wrong with how it works now. There is a text saying "Leave blank to use forum default". I'm positive people notice it.
7,693 2003-08-21 19:15
Re: posts/topics per page (6 replies, posted in PunBB 1.2 bug reports)
Yeah, but if you chose to have the forum default, and someone then changed the default, you wouldn't have the default anymore :)
7,694 2003-08-21 19:09
Re: Ugly posts (4 replies, posted in PunBB 1.2 bug reports)
I am open to suggestions though :)
7,695 2003-08-21 19:06
Re: posts/topics per page (6 replies, posted in PunBB 1.2 bug reports)
There's one problem with that. What happens when an admin changes the default?
7,696 2003-08-21 19:02
Re: It's time for scrubs! (2 replies, posted in General discussion)
7,697 2003-08-21 18:36
Topic: It's time for scrubs! (2 replies, posted in General discussion)
My favorite sitcom. I'll go watch that now :P
7,698 2003-08-21 18:32
Re: Ugly posts (4 replies, posted in PunBB 1.2 bug reports)
You are correct, that is not an option :)
7,699 2003-08-21 18:28
Re: Customizing PunBB & Helping (16 replies, posted in PunBB 1.2 discussion)
Gribber wrote:
Or fanatic users who insist to donate something? :)
Yeah, I guess that counts as well :)
7,700 2003-08-21 18:27
Re: Ugly posts (4 replies, posted in PunBB 1.2 bug reports)
True. I'm not sure how it should be solved though. I want to avoid adding any more tables or table cells to the layout.