3,201

(6 replies, posted in PunBB 1.2 troubleshooting)

No, you need to use the kind of code you gave before

The "No permission" error means exactly what it says. extern.php views your forum as a Guest would. If a Guest can't read your forum, neither can extern.php

Delete all the .php files in the cache directory?

3,203

(35 replies, posted in PunBB 1.2 troubleshooting)

What specs?

3,204

(35 replies, posted in PunBB 1.2 troubleshooting)

Well, that doesn't make sense, since you have two copies of PunBB running and two files are affected on one where as only one is affected on the other wink

Try removing your cache files

3,206

(6 replies, posted in PunBB 1.2 troubleshooting)

The full URL is really what you need to use, including it locally means you can't pass it parameters like ?action=active, you have to set $_GET['active'], etc

Do what the error says: make sure PHP has write access to the cache directory. You'll probably need to chmod the folder (Google chmod if you don't know what it is/means). If that fails, you can always ask your host.

3,208

(6 replies, posted in PunBB 1.2 troubleshooting)

First of, the AP_News_Generator plugin keeps giving me permission issues whenever I click Generate News, stating: "Error: Unable to write news to ./plugins/AP_News_Generator/main.html. Please make sure PHP has write access to the directory ./plugins/AP_News_Generator/.". I've cleared the cache, which hasn't worked. Also, I've had this problem before, which I had to get my host to fix, that's why I was wondering if it was just a simple problem.

Did you try chmodding the folder?

The second, is when trying to use extern.php on the front page, all that comes up is: "No Permission". I tried different write permissions, and have used different path's to direct it to the correct file.

Can you give me an example of the line of code you use to include extern.php? I think I know the issue but I want to be sure.

3,209

(7 replies, posted in PunBB 1.2 troubleshooting)

Well, then it's not due to the closing brace wink

<?php
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
$page_title = pun_htmlspecialchars($pun_config['o_board_title']) . ' / Contact';        //Set the page title here
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
//echo "<PRE>"; print_r ($pun_config); echo "</PRE>";

if ($_POST['form_sent'] == 1)
{
//Process The Form
?>

<?php
$as = $_POST['antispam'];
$as2 = $_POST['spamvalidator'];
 if ($as != $as2){
?>
<div class="blockform">
    <h2><span>Contact <?php echo $pun_config['o_board_title']; ?></span></h2>
    <div class="box">
        <form id="contact" method="post" action="contact.php">
            <div class="inform">
                <fieldset>
                    <legend>Email not sent</legend>
                    <div class="infldset">
                        <b>Your mail could not be sent!</b> The antispamcode you entered did not match.
                    </div>
                </fieldset>
            </div>
        </form>
    </div>
</div>
<?php
      }
      else
      {
    $recipient = "$toName <".$toMail.">";
    $headers ="From: ".$_POST['name']." <".$_POST['email'].">";
    $subject = "WEBFORM:".$_POST['subject'];
    $message = str_replace("\\", "", $_POST['comments']);
    mail($pun_config['o_admin_email'], $subject, $message, $headers);
?>


<div class="blockform">
    <h2><span>Contact <?php echo $pun_config['o_board_title']; ?></span></h2>
    <div class="box">
        <form id="contact" method="post" action="contact.php">
            <div class="inform">
                <fieldset>
                    <legend>Email Sent</legend>
                    <div class="infldset">
                        <b>Thank you for contacting us!</b> The following information was sent to <?php echo $pun_config['o_board_title']; ?>.<br /><br />
                        <label>Name:<br /><?php echo $_POST['name']; ?><br /></label>
                        <label>Email:<br /><?php echo $_POST['email']; ?><br /></label>
                        <label>Subject:<br /><?php echo $_POST['subject']; ?><br /></label>
                        <label>Comments:<br /><?php echo $_POST['comments']; ?><br /></label>
                    </div>
                </fieldset>
            </div>
        </form>
    </div>
</div>

<?php }
}
else
{ 
//Display the Form
$antispam = dechex(rand(hexdec(000000), hexdec(FFFFFF)));
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must be an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must be a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must be a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following errors occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
<div class="blockform">
    <h2><span>Contact <?php echo $pun_config['o_board_title']; ?></span></h2>
    <div class="box">
        <form id="contact" method="post" action="contact.php">
            <div class="inform">
                <fieldset>
                    <legend>Enter your contact details</legend>
                    <div class="infldset">
                        Please enter your contact information and comments here. If you would like to share your comments with everyone, consider posting them on the <a href="forum.php">forum</a> instead!<br />
                        <input type="hidden" name="form_sent" value="1" /><br />
                        <label>Name<br /><input type="text" name="name" value="" size="40" maxlength="40" /><br /></label>
                        <label>Email<br /><input type="text" name="email" value="" size="40" maxlength="50" /><br /></label>
                        <label>Subject<br /><input type="text" name="subject" value="" size="40" maxlength="50" /><br /></label>
                        <label>Comments<br /><textarea name="comments" rows="5" cols="40"></textarea><br /></label>
                        <label>No spam:<br /><input name="antispam" type="text" class="tekst" size="6"> <?php echo $antispam; ?> <input type="hidden" value="<?php echo $antispam; ?>" name="spamvalidator" /></label>
                    </div>
                </fieldset>
            </div>
            <p><input type="submit" name="update" value="Submit"  onClick="MM_validateForm('name','','R','email','','RisEmail','subject','','R');return document.MM_returnValue" /></p>
        </form>
    </div>
</div>



<?php

}    //close if statement
 
require PUN_ROOT.'footer.php';

See if that works

3,210

(7 replies, posted in PunBB 1.2 troubleshooting)

<?php
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
$page_title = pun_htmlspecialchars($pun_config['o_board_title']) . ' / Contact';        //Set the page title here
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
//echo "<PRE>"; print_r ($pun_config); echo "</PRE>";

if ($_POST[form_sent] == 1)
{
//Process The Form
?>

<?php
    $as = $_POST['antispam'];
$as2 = $_POST['spamvalidator'];
 if ($as != $as2){
?>
<div class="blockform">
    <h2><span>Contact <?php echo $pun_config['o_board_title']; ?></span></h2>
    <div class="box">
        <form id="contact" method="post" action="contact.php">
            <div class="inform">
                <fieldset>
                    <legend>Email not sent</legend>
                    <div class="infldset">
                        <b>Your mail could not be sent!</b> The antispamcode you entered did not match.
                    </div>
                </fieldset>
            </div>
        </form>
    </div>
</div>
<?php
      }elseif($as == $as2){
    $recipient = "$toName <".$toMail.">";
    $headers ="From: ".$_POST[name]." <".$_POST[email].">";
    $subject = "WEBFORM:".$_POST[subject];
    $message = str_replace("\\", "", $_POST[comments]);
    mail($pun_config['o_admin_email'], $subject, $message, $headers);
?>


<div class="blockform">
    <h2><span>Contact <?php echo $pun_config['o_board_title']; ?></span></h2>
    <div class="box">
        <form id="contact" method="post" action="contact.php">
            <div class="inform">
                <fieldset>
                    <legend>Email Sent</legend>
                    <div class="infldset">
                        <b>Thank you for contacting us!</b> The following information was sent to <?php echo $pun_config['o_board_title']; ?>.<br /><br />
                        <label>Name:<br /><?php echo $_POST[name]; ?><br /></label>
                        <label>Email:<br /><?php echo $_POST[email]; ?><br /></label>
                        <label>Subject:<br /><?php echo $_POST[subject]; ?><br /></label>
                        <label>Comments:<br /><?php echo $_POST[comments]; ?><br /></label>
                    </div>
                </fieldset>
            </div>
        </form>
    </div>
</div>

<?php } } else { 
//Display the Form
$antispam = dechex(rand(hexdec(000000), hexdec(FFFFFF)));
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must be an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must be a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must be a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following errors occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
<div class="blockform">
    <h2><span>Contact <?php echo $pun_config['o_board_title']; ?></span></h2>
    <div class="box">
        <form id="contact" method="post" action="contact.php">
            <div class="inform">
                <fieldset>
                    <legend>Enter your contact details</legend>
                    <div class="infldset">
                        Please enter your contact information and comments here. If you would like to share your comments with everyone, consider posting them on the <a href="forum.php">forum</a> instead!<br />
                        <input type="hidden" name="form_sent" value="1" /><br />
                        <label>Name<br /><input type="text" name="name" value="" size="40" maxlength="40" /><br /></label>
                        <label>Email<br /><input type="text" name="email" value="" size="40" maxlength="50" /><br /></label>
                        <label>Subject<br /><input type="text" name="subject" value="" size="40" maxlength="50" /><br /></label>
                        <label>Comments<br /><textarea name="comments" rows="5" cols="40"></textarea><br /></label>
                        <label>No spam:<br /><input name="antispam" type="text" class="tekst" size="6"> <?php echo $antispam; ?> <input type="hidden" value="<?php echo $antispam; ?>" name="spamvalidator" /></label>
                    </div>
                </fieldset>
            </div>
            <p><input type="submit" name="update" value="Submit"  onClick="MM_validateForm('name','','R','email','','RisEmail','subject','','R');return document.MM_returnValue" /></p>
        </form>
    </div>
</div>



<?php

}    //close if statement
 
require PUN_ROOT.'footer.php';
andy smith (I am blind) wrote:

Hi,
I have something else:
Lets say, when you browse to the website, you need to click, for example, a link that says "forum." I can do:
<a href="http://xxx.com">forum</a>

So in the xxx part, what address do I put so it can link?
Thank you,
Andy

I don't know, that depends on your webhost

Yes, PunBB should work

And you should be able to use PunBB with a screenreader, yes

3,213

(35 replies, posted in PunBB 1.2 troubleshooting)

Yes, that shouldn't cause any problems

3,214

(35 replies, posted in PunBB 1.2 troubleshooting)

I'd try deleting and reuploading the files

3,215

(35 replies, posted in PunBB 1.2 troubleshooting)

Yeah, I saw that you only got the error on those two pages (you don't even get it when certain search URLs are triggered), which is why I was curious about that code.
I'm out of ideas, I would ask your host

3,216

(35 replies, posted in PunBB 1.2 troubleshooting)

Oh, sorry, forgot that tongue
header.php

Are you running Apache?

Oh, and PHP 4.1.2 is really out of date: you should upgrade wink

3,218

(35 replies, posted in PunBB 1.2 troubleshooting)

I'd talk to your host and see if they have any ideas

Edit: Or try this:

FIND

    if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php')))
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
    else
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';

REPLACE WITH

        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';

3,219

(5 replies, posted in PunBB 1.2 troubleshooting)

The update script only increments the version number and makes any necessary updates to the database. You're not replacing any files.

3,220

(5 replies, posted in PunBB 1.2 troubleshooting)

You need to download a copy of PunBB and run the update script in the extras folder

I can't think of any that don't require SOME dynamic programming language. If all you can do is serve static HTML, then you really can't do much in terms of a forum.

    if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php')))
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';

That's the code that shows it.
Out of curiosity, what are the specs for the setup where you're having the issue (eg: what version of PHP, what webserver, etc)

3,223

(7 replies, posted in PunBB 1.2 troubleshooting)

You're missing a closing }

3,224

(3 replies, posted in PunBB 1.2 troubleshooting)

Sounds to me like clearing your cache might fix the issue wink

andy smith (I am blind) wrote:

Like how to get this whole thing started. I have a bravehost website, and I just dont know what to upload,

As I said, the steps are as follows:
1. Download a copy of PunBB
2. Uncompress it
3. Upload the contents of the folder named "upload" to the server
To install, you simply go to your browser and type the address where you uploaded it to and add install.php at the end (so if my site is named mynewsite.com and I uploaded the files to the "forum" folder, I would browser to http://mynewsite.com/forum/install.php). Enter the details it asks for and PunBB will install. You then need to copy the text the script generates (it generates a PHP script), save the text as config.php, and upload it to the same place you uploaded all the other files

andy smith (I am blind) wrote:

how to run the php script (it is php right...),

PHP is run by the server when you browse to the page in your browser.

andy smith (I am blind) wrote:

and how to do that database thing that you need.

That's something your host's control panel should allow you to do, create a MySQL database and user

andy smith (I am blind) wrote:

It said something about my sql, what is that, and how can I get that?

MySQL is a database system that PunBB uses (PostgreSQL and SQLite are two others). They need to be installed on your server (your host most likely installed them, you wouldn't be able to, they're actual applications) or you can't use PunBB.