News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

the best way to integrate my custom user system?

Started by A2xA, August 30, 2008, 12:53:12 PM

Previous topic - Next topic

A2xA

I have used SMF before and I loved it.  I was thinking of not using it on this project, but I couldn't stay away from it haha.

I have read the stickys, used ssi before, and everything, but I am stumped so that's why I posted a topic.

Anyways.. I have searched around and experimented and couldn't figure out how to do it, so I came here.

Here's some of the code I'm using

<?php
ob_start
(); 
// Disable browser caching
header('Cache-Control: no-cache, must-revalidate, no-store');
header('Cache-Control: post-check=0, pre-check=0'false);
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' gmdate('D, d M Y H:i:s') . ' GMT');
header('Pragma: no-cache');

// Begin session, initiate database connection, etc.
require_once('includes/config.php');
require_once(
'includes/start.php');

// Store necessary variables
$user $_SESSION['userUser'];
$pass $_SESSION['userPass'];

// Begin authentication process
if(!empty($_POST['user'])){
$user strip_tags($_POST['user']);
}

if(!empty(
$_POST['pass'])){
$pass md5(strip_tags($_POST['pass']));
}



// User is trying to log in or is logged in
else{

// Display header
require("./templates/$template/header.php");

// Authenticate user
$query 'SELECT userID, userName, userUser, userPass from users WHERE userUser = "' $user '" AND userPass = "' $pass '"';
$result mysql_query($query$link);
$rows mysql_num_rows($result);

// If user has successfully authenticated
if($rows == 1){
$row mysql_fetch_row($result);
$_SESSION['userID'] = $row[0];
$_SESSION['userName'] = $row[1];
$_SESSION['userUser'] = $row[2];
$_SESSION['userPass'] = $row[3];

// Add post to database, if there is one
if(!empty($_POST['post'])){
$query 'INSERT INTO posts (postUserID, postTime, postPost) VALUES ("' $_SESSION['userID'] . '", NOW(), "' addslashes(trim(strip_tags($_POST['post']))) . '")';
mysql_query($query$link);
$success_post 1;
}


// Add link to database, if there is one
if(!empty($_POST['link'])){
$query 'INSERT INTO links (linksUserID, linksTime, linksLink, linksPost) VALUES ("' $_SESSION['userID'] . '", NOW(), "' addslashes(trim(strip_tags($_POST['link']))) . '", "' addslashes(trim(strip_tags($_POST['link_post']))) . ' ")';
mysql_query($query$link);
$success_post 1;
}


?>


If someone could give a look at the code and give me some advice or get me started I would greatly appreciate it.  Also this database is seperate from my smf database.

Thanks!


Online Video Game Battles Community that Supports Xbox 360, Wii, And PS3

Rumbaar

From the look of that you're not using SMF functions or making any writes to a SMF db.  So I'm unsure of the SMF nature of your question.

Though the use of SSI.php you can make, I'm sure, direct access to SMF function and db.  The SMF API should offer some options as well.  But I'm unsure of it's level of compatibility at the moment.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

A2xA

I'm sorry I've got this integrated already You can lock this topic.

I just used SSI and bridged both user systems for anyone wondering.


Online Video Game Battles Community that Supports Xbox 360, Wii, And PS3

Rumbaar

"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: