Forum Replies Created

Viewing 4 replies - 31 through 34 (of 34 total)
  • Knowing what theme you’re using will probably help a lot, too. What theme?

    Forum: Fixing WordPress
    In reply to: UTC time wrong
    Thread Starter Emily

    (@cleanup)

    Thanks, t-p. I’ve ruled out plugin and theme issues by installing a clean copy of WordPress, completely unrelated to the main site. And it does exactly the same thing.

    I don’t know what else to check in Apache and am hoping someone can give me some guidance!

    Thread Starter Emily

    (@cleanup)

    Aha! I didn’t even notice that I could edit that part. Thank you very much!

    p.s. I hope your wish list was up-to-date and that you can still use the baseball calendar. Enjoy!

    Happy holidays. 🙂

    Emily

    Greetings!

    I’ve used punbb along with another piece of software (sitelok). First you would have to decide which database will be the primary database. I chose the sitelok database to be the one controlling the logins, and then modified the sitelok login script to log in the user to punbb. Also in that modification, I did a lookup on the user in punbb… if they weren’t there, I inserted them into the punbb database. I’m not sure this is an optimal solution, maybe there’s a better way, using WP as the primary database. Anybody out there have suggestions? FYI, I posted the code I used in sitelok, below.

    Emily

    // EKB Add login to punbb
    // Feb 11 2007
    define('PUN_ROOT', '/path/to/punbb/');
    require PUN_ROOT.'include/common.php';
    
    // Load the login.php language file
    require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
    
    $form_username = $_POST['username'];
    $form_password = $_POST['password'];
    
    $username_sql = ($db_type == 'mysql' || $db_type == 'mysqli') ? 'username=\''.$db->escape($form_username).'\'' : 'LOWER(username)=LOWER(\''.$db->escape($form_username).'\')';
    
    $result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
    			list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result);
    
    $authorized = false;
    
    if (!empty($db_password_hash))
    {
    	$authorized = true;
    	$form_password_hash = pun_hash($form_password);
    }  // end if we found a user record
    
    // if we don't find the person, assume they just haven't been in the forum yet.
    // Insert them into the database... using the same user info as sitelok
    if (!$authorized) {
    	$sql = 'INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($form_username).'\', 4, \''.pun_hash($form_password).'\', \''.$Email.'\', 2, 1, -5, \''.$db->escape($pun_config['o_default_lang']).'\', \''.$pun_config['o_default_style'].'\', '.time().', \''.get_remote_address().'\', '.time().')';
    	$result = $db->query($sql) or error('Unable to insert user into punbb', __FILE__, __LINE__, $db->error());
    	$result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
    	list($user_id, $group_id, $form_password_hash, $save_pass) = $db->fetch_row($result);
    }  // end if not authorized
    
    // Update the status if this is the first time the user logged in
    if ($group_id == PUN_UNVERIFIED)
    	$db->query('UPDATE '.$db->prefix.'users SET group_id='.$pun_config['o_default_user_group'].' WHERE id='.$user_id) or error('Unable to update user status', __FILE__, __LINE__, $db->error());
    
    // Remove this users guest entry from the online list
    $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape(get_remote_address()).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
    
    $expire = ($save_pass == '1') ? time() + 31536000 : 0;
    pun_setcookie($user_id, $form_password_hash, $expire);
    // end punBB login
Viewing 4 replies - 31 through 34 (of 34 total)