Well, the standard layout...OK, it's different....

The source code is pretty clean. However, I doubt that PHP beginners will be able to tweak it as easily as they can with PunBB.
It's all class files, parser, templates and such.
It's not a bad approach but not noob friendly at all.

I wonder if it's possible to give it a decent layout.

But what they have against statistics I don't know... smile

I'm not 100% sure but I think these three lines in your index file will do:

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';

and PUN_ROOT has to be changed to the installation dir of your forum, like

define('PUN_ROOT', './my_board/');

Then, on the bottom of your page you can put the stuff from index.php line 177ff.

153

(1 replies, posted in General discussion)

Yes, if you're an admin.
Just click on "Stick Topic" - it's on the bottom of the viewtopic page wink

Oh, that's what you mean... for that to work you must incorporate the online check of PunBB in your main site as well.
It's all hiddden in include/functions.php.
Don't know if it's that easy but it should be no science as well..

Not sure hat exactly you want to do.
You want to show the forum to people using www.yourhost.com as well as sub.yourhost.com?

Then it's OK to write
$cookie_domain = 'yourhost.com';

Did you tweak the HTML then?
Could it be that for some reason the HTML is not formatted right anymore?
And - does it happen with all pages or can you limit the problem to certain topics/areas?

Rickard wrote:

I'm sure there are people out there who will want this.

Possibly yes, but I am wondering who would find it useful as it really does not show any relevant data.
It doesn't count visits but any single hit on any single page people are calling.
But as a fun element - OK. Just to impress people wink

On the other hand: A real visit counter would be hard to implement I think.

Because you will not need it outside viewtopic.php.
functions.php is for common functions used by all or at least most scripts.
If you stuff everything in there then all scripts have to load an overweight include file which will be bad for performance if you are not careful.
That's one reason.

The other one is:

Tobi wrote:

so take it as an idea, not a complete recipe

wink

That is tricky.
You could do the following:

open viewtopic.php and in line 29 enter

function GroupPips($groupid)  {
  $group2pip = array("1"=>6,
                     "2"=>3,
                     "3"=>2,
                     "4"=>1,
                     "5"=>4,
                     "6"=>5);
  if(!array_key_exists($group2pip,$groupid))  return '';
  else  {
    for($i = 1;$i <= $group2pip[$groupid];$i++) {
      $outpips .= '<img src="img/pip.gif" alt="" />';
      }
    return $outpips;
    }
  }

Then, find around line 216

        $username = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['username']).'</a>';

and after that, add

    $username .= '<br/>'.GroupPips($pun_user['g_id']);

Note:
In the function GroupPips you have an array group2pip.
The keys represent the group id of your groups, the values the number of pips you want to show for it.

Note 2 I haven't tested all this so take it as an idea, not a complete recipe. wink

No, <pun_head> is a tag that is parsed by header.php .
You find header.php ritgh in your punbb installation directory.

Most PunBB scripts call header.php which in turn parses main.tpl

Well, the page including the extern.php must be a php file as well.
And of course your PHP configuration must allow the inclusion of URLs. Some don't but your host can tell you.

Rickard wrote:

One problem with that is that the files you want to include must be placed in /include/user/. You could also add symbolic links to the files if they are located somewhere else.

Which is really a problem if you already have a site that you don't want to move completely to /include/usr/ smile

And Symlinks are one good way to solve these issues - unless your apache config doesn't allow it or you are on a windows server where it's a pain in the ass.

But really - I found it terribly easy to invent some tags for main.tpl and have them replaced by the include() result that I want in header.php .
That way you can also add more logic to it, like having different includes depending on the page you're on and such.

Well, in your php page that you put wherever you like you place the line

<?include "http://lettertogod.net/letters/extern.php?action=active";?>

where you want the list to appear.
That's all.

I ran into the same issue.
One of the very, very few drawbacks of PunBB is that it keeps spitting out HTML before it's finished.
You just cannot use the scripts as includes for something else.
So you really have to go the other way round. This will limit our layout possibilities a bit but it's not that hard.
For one thing Connor is right, mots things happen in the main.tpl.
And if you want to place dynamic content there just create a new tag and have this tag replaced in head.php

165

(4 replies, posted in PunBB 1.2 show off)

Offline board reader? Interesting idea although I'm not sure if it is so much needed. But who knows....
will it be free?

I think it will be a very good idea to add a confirm_referrer() call to the misc.php, like so:

Change line 92 ff:

    if (isset($_POST['form_sent']))
    {

to

    if (isset($_POST['form_sent']))
    {
 confirm_referrer('misc.php');

I will not join the chorus of those who want all their favourite hacks to become standard- but it would be really good if this one did I guess...

So, what is your punBB installation directory then?

Is it /home/httpd/vhosts/lettertogod.net/httpdocs/
or is it /home/httpd/vhosts/lettertogod.net/httpdocs/letters/ ?

Maybe you have to change the open_basedir restriction in your php settings :
http://gr.php.net/features.safe-mode

If you cannot do it then maybe your host will do it.
Otherwise you have to move extern.php to /home/httpd/vhosts/lettertogod.net/httpdocs , but then you also have to change PUN_ROOT and such.

looks like your host is running a very old version of PHP or he has disabled the PCRE functions. You'd have to see what a phpinfo() call tells you.
It should be version 4.2. or higher in order for preg_match to function.

Just in case you're waiting:
I have the viewtopic, viewforum and login parts done but they're anything elase than stable or even clean.
Server side is php, client side is currently php as well but of course you could use anything. (I think that's the meaning behind SOAP.. smile )
The drawback is that the SOAP functions are new to PHP, so 5+ is a must.
I will not release this very soon because it is absolutely pre-alpha yet but if you're really after it or want to have a look if you can use something like that I can mail you what I have.

BTW: For lists there is really no way around arrays, however I tried not to use native ones.

Do you mean "Group" or "Title"?

The latter would be quite easy.
There is a function get_title() that extracts the Titlle name and displays it.
It sits in include/functions.php around line 441.
All you'd have to do is change he titles from, say, "Newbie" to "*" and from "Expert" to "***" and so on.
Then, in the function you replace the asterisks with the pip IMG tags.

If you mean "Group" then it's an extra to display because currently the group is not displayed everywhere.
It can be done but it's a lot more complicated

There is a bug in the upgrade function of the installer.
In line 35, it should say

    $sql = 'ALTER TABLE '.$db->prefix.'spam_protect ADD total TINYINT(2)';

instead of

    $sql = 'ALTER TABLE spam_protect ADD total TINYINT(2)';

wink

173

(1 replies, posted in PunBB 1.2 troubleshooting)

If you are sure your mysql entries in config.php are correct then there's something wrong with your mysql installation and you should ask your host about it.

Is your inde.html a php file?
I mean, is your webserver configured to parse files with the ending .html as php?
Most servers are not.

So maybe you have to change the name from index.html to index.php

Could be that the ad doesn't load completely and the browser waits for that before it continues building the page.
I've seen that on some sites.
Try putting the ad somewhere else or remove it and see what happens.