We have implemented punBB at www.e-liberty.org.  You can view the forum at www.e-liberty.org/forum/.  We chose punBB mainly for its XHTML validation.  We also were able to pass comments for our posts off to punBB via a script.  Thanks for a great product!

I am currently trying to modify generate_navlinks() in the functions.php file in order to remove rules, login, logout, and register from the nav links.  I have integrated a working site wide login and do not need the rundundancy.

If I comment out or removed any of the $links[] =  it causes an error immediately. 

Parse error: parse error, unexpected T_VARIABLE, expecting ';' in /home/electrp1/public_html/e-liberty.org/forum/include/functions.php on line 1058

Line 1058 is the following portion of the function dump():

for ($i = 0; $i  $num_args; ++$i)


Any suggestions?

3

(8 replies, posted in General discussion)

Ok, I have attempted to do this and have been partially successful.  I have written a PHP script that will make a post in punBB from outside the punBB folder on the server.  It is as follows:


<?


define('PUN_ROOT', './forum/'); require PUN_ROOT.'/include/common.php';
require PUN_ROOT.'/include/search_idx.php';
// require PUN_ROOT.'/botlogin.php';

$now = time();
$message = "this is a test";
$subject = "this is a test";
$fid = 13;
$username = "username";
$hide_smilies = isset($_POST['hide_smilies']) ? 1 : 0;
$email = "email@email.com";


// Create the topic

    $db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, last_poster, forum_id) VALUES(\''.$db->escape($username).'\', \''.$db->escape($subject).'\', '.$now.', '.$now.', \''.$db->escape($username).'\', '.$fid.')') or error('Unable to create topic', __FILE__, __LINE__, $db->error());

    $new_tid = $db->insert_id();

// Create the post ("topic post")

    $email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
   
    $db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', 12, \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$new_tid.')') or error('Unable to create post', __FILE__, __LINE__, $db->error());
    $new_pid = $db->insert_id();

    $db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', 12, \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', \''.$hide_smilies.'\'');
    $db->query('UPDATE '.$db->prefix.'topics SET last_post_id='.$new_pid.' WHERE id='.$new_tid) or error('Unable to update topic', __FILE__, __LINE__, $db->error());



    update_search_index('post', $new_pid, $message, $subject);



    update_forum($fid);

    $low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';

    $db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());

?>


The only task now is to incorporate it into MT.  Since the script can be used outside the punBB folder then MT tags can be used for the title of the thread and so on.  Any suggestions on integrating it so that the script will be ran once and only once when a new MT post is published?