Well first you have my URL in the window.open function. But even still, you have to change some things in the upload.php that cuteseal posted. The first two lines are:

$URL = "http://www.ilovephysics.com/forum/images/upload/";
$maxsize = 153600

You have to move these lines after the first <?php and add a semicolon after 153600. Here is the upload.php that I have:

<html>
        <head>
            <title>ilovephysics.com :: Forums - image upload</title>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            <meta name="keywords" content="physics, math, science">
            <meta name="description" content="A community of Physics Phans!">

            <title>Shuttertalk Forums / Help</title>
            <link rel="stylesheet" type="text/css" href="../../style/Oxygen.css">
        </head>
        
        <body>
<table align="center" cellpadding="10">
  <td bgcolor="#FFFFFF"> 
      <?php

    $URL = "http://www.ilovephysics.com/forum/images/upload/";
    $maxsize = 153600;
    
if (isset($_POST['upload'])) 
{
    //Check first if a file has been selected
    $fileonserver = stripslashes($_FILES['uploaded']['name']);
    $tmpfile = stripslashes($_FILES['uploaded']['tmp_name']);
    while (file_exists($fileonserver))
    {
        $rand = rand(0, 99);
        $file_name = $rand."_".$fileonserver;
        $fileonserver = $file_name;
    }

    if (is_uploaded_file($tmpfile))
    {

        if ($_FILES['uploaded']['type'] == "image/pjpeg" || $_FILES['uploaded']['type'] == "image/jpeg" || $_FILES['uploaded']['type'] == "image/png" || $_FILES['uploaded']['type'] == "image/bmp" || $_FILES['uploaded']['type'] == "image/gif")
        { 

            //Get the Size of the File
            $size = $_FILES['uploaded']['size'];
        
            //Make sure that $size is less than 150KB
            if ($size > $maxsize)
            {
        
                //Print the error
                echo '<b>File Too Large. Please try again.</b>';
                echo '<p><a href="javascript:back()">Back</a>';
                exit();
        
            }
        
            //Move the File to the Directory of your choice
            if (move_uploaded_file($tmpfile,dirname($_SERVER['PATH_TRANSLATED']).'/'.$fileonserver)) 
            {
                //tell the user that the file has been uploaded
                echo '<center><font size="3"><b>File Uploaded!</font></center><br>URL to file is:</b><br>';
                echo $URL . rawurlencode($fileonserver);
                echo '<br><b>Cut and paste this code into message:</b><br>';
                echo '[img]'.$URL . rawurlencode($fileonserver).'[/img]';
                exit();    
            }
            else
            {
            
                //Print error
                echo '<b>Unable to move the File</b>';
                echo '<p><a href="javascript:back()">Back</a>';
                exit();
            
            }
        }
        else
        {
            //Print the error
            echo '<b>You can only upload image files. Please try again.</b>';
            echo '<p><a href="javascript:back()">Back</a>';
            exit();
        }
    }
    else
    {
    
    //Print error
    echo '<b>No File Selected</b>';
    echo '<p><a href="javascript:back()">Back</a>';

    }    
}

else {

?>
      <form action="upload.php" method="post" enctype="multipart/form-data">
        <b>Select an image file to upload (max 150KB):</b><br>
<input type="file" name="uploaded"><input type="Submit" value="Upload File">
<input type="hidden" name="upload" value="true">
</form>

<?php
}
?>


</td>
</table>
</body>
</html>

Note that I got rid of the javascript that automatically pastes the [ img ] tag in the post. I couldn't get it to work.

27

(15 replies, posted in PunBB 1.2 discussion)

Dreamweaver is the best I know of! Though, if you open the template file in dreamweaver you shouldn't see anything. Because there is nothing to see. The default template is just a table with the "funny tags" in it. Dreamweaver doesn't know what to do with those funny tags, so it doesn't show them. It would look the same in any WYSIWYG editor.

What I did, as you can see from the code in my post above, is make a four row table: 1 row for the header, 1 row for the menu, 1 row for the content, and 1 row for the footer. I cut and pasted the "funny tags" into the content row.

As far as changing the background color, you was to edit the CSS file. I just set the background color in the template file. It looked great in Dreamweaver, but when I posted it, the BG color was not what I wanted. PunBB actually calls the CSS stylesheet to get the BG color, and this overrides what I set in the template file. So I just changed the BG color in the Oxygen.CSS. I left the other style sheets alone. Some users like them. They don't go with the theme of the site, but hey, I don't like being a dictator.

Strange. I use OS X Panther. I just edited the readme template in the developers kit, so that is probably how they got mixed up.

Thanks Rickard. The problem was obvious: you're using Windows. That's always a problem smile

Download should be fixed now.

TextEdit for Mac OSX. I may have saved it wrong. I'll go back tonight and save the readme.txt file as ASCII only, rezip, and reupload.

I don't know why it's chopped off for you. I downloaded the zip and extracted it and here is what is in the readme file:

##
##
##        Mod title:  punLaTeX
##
##      Mod version:  1.0
##   Works on PunBB:  1.1, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5
##     Release date:  2004-10-12
##           Author:  Chris Moore (chris@ilovephysics.com)
##
##      Description:  Adds support for the LaTeX math mark-up language,
##              allowing equations to be posted in forums.
##
##   Affected files:  include/parser.php
##
##       Affects DB:  No
##
##            Notes:  This mod uses a LaTeX engine called mimeTeX. MimeTeX
##              parses a LaTeX math expression and emits the
##              corresponding gif image on-the-fly. It is a separate
##              program that doesn't use TeX or its fonts in any way.
##              It's just one cgi that you put in your site's cgi-bin
##              directory. This means that it can be used on servers that
##              do not have LaTeX installed, such as most free and paid
##              hosting.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##


#
#---------[ 1. UPLOAD ]-------------------------------------------------------
#


The supplied mimetex.cgi file has been compiled for Linux servers and may not
work for other platforms. The original source can be found at the following
URL with other platform compiled versions: http://www.forkosh.com/mimetex.html

mimetex.cgi to yourdomain/cgi-bin/


#
#---------[ 4. OPEN ]---------------------------------------------------------
#


include/parser.php


#
#---------[ 5. FIND (lines: 200-216) ]---------------------------------------------
#


200    $pattern = array('#\[b\](.*?)\[/b\]#s',
201         '#\[i\](.*?)\[/i\]#s',
202         '#\[u\](.*?)\[/u\]#s',
203         '#\[url\](.*?)\[/url\]#e',
204         '#\[url=(.*?)\](.*?)\[/url\]#e',
205         '#\[email\](.*?)\[/email\]#',
206         '#\[email=(.*?)\](.*?)\[/email\]#',
207         '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
208
209    $replace = array('<strong>$1</strong>',
210         '<em>$1</em>',
211         '<u>$1</u>',
212         'truncate_url(\'$1\')',
213         'truncate_url(\'$1\', \'$2\')',
214         '<a href="mailto:$1">$1</a>',
215         '<a href="mailto:$1">$2</a>',
216         '<span style="color: $1">$2</span>');

This section of code defines the various tags used in the forum. We are going
to add a new tag.


#
#---------[ 6. REPLACE WITH ]-------------------------------------------------
#


200    $pattern = array('#\[b\](.*?)\[/b\]#s',
201     '#\[i\](.*?)\[/i\]#s',
202     '#\[u\](.*?)\[/u\]#s',
203     '#\[url\](.*?)\[/url\]#e',
204     '#\[url=(.*?)\](.*?)\[/url\]#e',
205     '#\[email\](.*?)\[/email\]#',
206     '#\[email=(.*?)\](.*?)\[/email\]#',
207     '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
208     '#\[tex\](.*?)\[/tex\]#');
209
210    $replace = array('<strong>$1</strong>',
211     '<em>$1</em>',
212     '<u>$1</u>',
213     'truncate_url(\'$1\')',
214     'truncate_url(\'$1\', \'$2\')',
215     '<a href="mailto:$1">$1</a>',
216     '<a href="mailto:$1">$2</a>',
217     '<span style="color: $1">$2</span>',
218     '<img src="http://yourdmain/cgi-bin/mimetex.cgi?$1" border="0" 
        alt="LaTeX Image">');

We have now added a new tag: [tex] ... [/tex]. Everything between the [tex]
tags will be sent to mimetex.cgi and a gif image file of the corresponding
equation will be displayed. The new tag is added in line 208 and 218.

IMPORTANT: Make sure you replace "yourdomain" in line 218 with your actual
domain name.


#
#---------[ 12. SAVE/UPLOAD ]-------------------------------------------------
#

To learn more about mimeTeX and what you can do with it, visit:

http://www.forkosh.com/mimetex.html

For more information on the LaTeX math mark-up lnguage visit:

http://www.latex-project.org/

For questions about this MOD and integrating it into your site, visit:

http://www.ilovephysics.com/forum

This is what should be there.

What's missing? Everything is there on this end.

UPDATE: I just downloaded it to make sure it was uploaded in the proper mode and it came out fine.

##
##
##        Mod title:  punLaTeX
##
##      Mod version:  1.0
##   Works on PunBB:  1.1, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5
##     Release date:  2004-10-12
##           Author:  Chris Moore (chris@ilovephysics.com)
##
##      Description:  Adds support for the LaTeX math mark-up language,
##              allowing equations to be posted in forums.
##
##   Affected files:  include/parser.php
##
##       Affects DB:  No
##
##            Notes:  This mod uses a LaTeX engine called mimeTeX. MimeTeX
##              parses a LaTeX math expression and emits the
##              corresponding gif image on-the-fly. It is a separate
##              program that doesn't use TeX or its fonts in any way.
##              It's just one cgi that you put in your site's cgi-bin
##              directory. This means that it can be used on servers that
##              do not have LaTeX installed, such as most free and paid
##              hosting.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

This is a really simple to install MOD designed for forums that need to display formulas. For an example of its uses and to test it before installing it, visit:

http://www.ilovephysics.com/forum/viewtopic.php?id=3

Click here to download.

35

(15 replies, posted in PunBB 1.2 discussion)

I meant that the template file doesn't use php includes to include the forum. The tpl file has tags like <pun_title>, <pun_main>, <pun_footer> etc.

My original post I said I dropped the php includes into my site template. I actually dropped in the tags.

36

(15 replies, posted in PunBB 1.2 discussion)

Sorry, there aren't php includes in the template file. PunBB uses special tags in the template file. Main.tpl shouldn't be empty. It may appear that way in a WYSIWYG editor like dreamweaver.

Here is what my main.tpl file looks like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html dir="<pun_content_direction>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<pun_head>
</head>

<body bgcolor="#000066">
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td><img src="http://ilovephysics.com/images/header.gif" width="740" height="95" border="0"></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"><img src="http://ilovephysics.com/images/menu.gif" width="740" height="30" border="0" usemap="#Map"> 
      <map name="Map" id="Map"><area shape="rect" coords="119,0,190,21" href="http://www.ilovephysics.com/forum" />
        <area shape="rect" coords="49,1,103,21" href="http://www.ilovephysics.com" />
      </map>
    </td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"> <table align="CENTER" width="95%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td> <table class="punmain" cellspacing="1" cellpadding="4">
              <tr class="punhead"> 
                <td class="punhead"> <span class="puntitle"><pun_title></span><br> 
                  <pun_desc> </td>
              </tr>
              <tr> 
                <td class="puncon1"> <pun_navlinks><br> <br> <pun_status> </td>
              </tr>
            </table>
            <pun_announcement> <pun_main> <pun_footer> </td>
        </tr>
      </table>
      <p> </p></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"><img src="http://ilovephysics.com/images/footer.gif" width="740" height="25" border="0"></td>
  </tr>
</table>
</body>
</html>

The important part (no specific to my site) is:

<table class="punmain" cellspacing="1" cellpadding="4">
              <tr class="punhead"> 
                <td class="punhead"> <span class="puntitle"><pun_title></span><br> 
                  <pun_desc> </td>
              </tr>
              <tr> 
                <td class="puncon1"> <pun_navlinks><br> <br> <pun_status> </td>
              </tr>
            </table>
            <pun_announcement> <pun_main> <pun_footer> </td>
        </tr>
      </table>

37

(15 replies, posted in PunBB 1.2 discussion)

I used Dreamweaver to modify main.tpl. Very easy. I just dropped the php includes into my pre-existing template for my site and it was done. (I did have to change the background color in the CSS file, though.) Very simple modification was one of the main reasons I decided to go with punBB.

38

(3 replies, posted in PunBB 1.2 troubleshooting)

Bug fixed. When I added an image upload button, I had an extra <form> ... </form> tag within the tag for the submit button. Removed the extra tag and works fine.

39

(3 replies, posted in PunBB 1.2 troubleshooting)

I think the problem comes from the image upload mod I added in post.php. Because the submit button works fine with Quick Post, where I don't have the upload feature.

40

(0 replies, posted in PunBB 1.2 show off)

I just discovered punBB about 2 weeks ago. And I love it already smile

I've already fit it to my site, added instant message, image attachment, and LaTeX support.

Give LaTeX a try at the following URL:
http://www.ilovephysics.com/forum/viewtopic.php?id=3

To add LaTeX support to your site very easily, read this thread:
http://punbb.org/forums/viewtopic.php?id=4059

41

(36 replies, posted in Feature requests)

When I have IE 6 check for new page every visit, it dosen't work at all -- even after refreshing the page.

I'm not too worried about IE 5.2 for Mac, since hopefully anyone using a Mac (like myself) would be smart enough to use Safari or something else. Anyway, I don't think Microsoft is supporting IE for the Mac anymore since Mac came out with Safari and bundled it with OSX.

42

(36 replies, posted in Feature requests)

It doesn't work at all in IE 5.2 for Mac. Geez, I'm really starting to understand why people who know stuff about the internet don't like IE!

43

(4 replies, posted in Feature requests)

My site used to be based off of Web-App, which was a perl CMS and Forum that used flat file databases. It recently crashed, and I decided to rebuild from the bottom, since web-app was a little big and the forum was getting too big for flat text file databases.

I had about 600 members and over 2,000 posts. It be nice if I could somehow convert this to punBB.

The user database is a folder that has a textfile for each user such as:

admin.dat
someguy.dat
someoneelse.dat
etc.

In each text file is the username, encrypted password, email address and other info. All I care about is the username and email address since punBB uses a different type of encryption for the password. (Old users can just request a new pw, anyway.)

The forum database is similar, with a folder that has all of the posts in textfiles such as:

1.txt
2.txt
3.txt
4.txt
.....
2000.txt
etc.

The info in each textfile is the user who posted, the content, and the category it belongs to.

Is there any way that all of this junk can be piled into MySQL so punBB can make sense of it?

44

(3 replies, posted in PunBB 1.2 troubleshooting)

For some reason, the Submit button in post.php does not work when using IE 6. The submit button works fine in viewtopic.php for quick post. I usually use Safari, so I haven't noticed until today. I don't have any problems with the submit button on this site, though.

45

(36 replies, posted in Feature requests)

I don't think it is cache. It worked great last night while I was using Safari on OSX. Today I'm on a WinXP machine with IE. I have the same problem where it doesn't get small until you refresh. When you click on the topic with the image embedded, it is huge at first. When you refresh, it gets small again. I posted a new image and had the same problem.

I realize this thread has gotten a little old, but I found a pretty simple solution for punBB. Mimetex parses a LaTeX math expression and emits the corresponding gif image on-the-fly. It is a separate program that doesn't use TeX or its fonts in any way. It's just one cgi that you put in your site's cgi-bin directory. More at http://www.forkosh.com/mimetex.html.

Because the punBB code is soooo easy to understand and work with, I was able to get LaTeX support on my board using mimetex and adding only two lines of code to parser.php.

Here's what you do: download mimeTex from the URL above and compile it. Upload the cgi file into your cgi-bin directory. Open parser.php and add the following lines of code:

207         '#\[email=(.*?)\](.*?)\[/email\]#',
208         '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
209    ADD  '#\[tex\](.*?)\[/tex\]#');

217           '<a href="mailto:$1">$2</a>',
218               '<span style="color: $1">$2</span>',
219    ADD      '<img src="http://ilovephysics.com/cgi-bin/mimetex/mimetex.cgi?$1">');

That's it!

I just started with punBB, and I like it quite a bit so far. I'm not that much of a PHP programmer, but I can figure this out. Image upload is very important to me.

I took cuteseal's upload.php, dropped it in a 777 directory, modified it a bit, and then added the following javascript code in post.php at line 472:

<script type="text/javascript">
   function open_win()
   {
      window.open("http://www.ilovephysics.com/forum/images/upload/upload.php","my_new_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=450, height=150")
   }
</script>
<form>
   <input type="button" value="Upload Image" onclick="open_win()">
</form>

Worked like a charm smile although I'm sure there is a more elegant way of doing this.