Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> KISSQ General Support
Author Message
SoulflyZ
New Member
New Member



Joined: May 02, 2004
Posts: 8

PostPosted: Sun May 02, 2004 10:50 am Reply with quote

Hi, I am running a PHPBB forum message board (non-nuke) and I am trying to implement this quote system. Is it possible to setup the login for the portfolio to correspond with the login for the forums? So that each registered user for the forums can be automatically logged into their portfolio.
If it can't be done this way could you please explain how to setup a login system for the portfolios? I didn't understand how to use the $username function mentioned in the comments.
Thank you.
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun May 02, 2004 11:25 am Reply with quote

Whatever login system you use, KISSQ [ultimately] uses the $username to identify a username that is logged in. So, just as it detects if it's standard, phpnuke, or postnuke, you will need to add code to detect phpbb. If you would like a quotation from me to do the work for you, let me know.
 
View user's profile Send private message
SoulflyZ







PostPosted: Mon May 03, 2004 2:38 pm Reply with quote

Thank you for your help.
I was able to figure out how to get it to reconize the correct username, but I don't have the Delete and update functions. Nor will it store values other than the stock name.
 
SoulflyZ







PostPosted: Thu May 06, 2004 5:41 pm Reply with quote

Does anyone know why I don't have the functions?
 
upennballer
New Member
New Member



Joined: Jun 10, 2004
Posts: 16

PostPosted: Wed Jul 14, 2004 12:27 am Reply with quote

Fix for standalone maybe.

I am not much of a coder. but i was trying to implement this standalone version and it wouldnt read the shares or price. I found that it isnt even searching for that when it goes to read the sql so i added

$uArray[] = $row->Symbol.':'.$row->pDate.':'.$row->nShares.':'.$row->pPrice.':'.$row->fees.':'.$row->uniqueid.":~";

after

$symbols[] = $row->Symbol;

Should now look like


elseif ($isStd) {
$dbi = mysql_connect($stdHost, $stdUser, $stdPasswd) or die($err_msg);
mysql_select_db($stdDB, $dbi);
$result = mysql_query($query, $dbi) or die($err_msg);;
if ($result && (mysql_num_rows($result) > 0)) {
while ($row=mysql_fetch_object($result,1)) {
if (empty($row->Symbol)) continue;
$symbols[] = $row->Symbol;
$uArray[] = $row->Symbol.':'.$row->pDate.':'.$row->nShares.':'.$row->pPrice.':'.$row->fees.':'.$row->uniqueid.":~";

}
}
}


or something like that...
 
View user's profile Send private message
Raven







PostPosted: Wed Jul 14, 2004 7:02 am Reply with quote

Embarassed You are exactly correct! It appears that not too many are using KISSQ as a standalone, membership, application, so this part had never been tested [thoroughly at least]. Thanks so much for the head's up and I will get an update out ASAP.
 
upennballer







PostPosted: Wed Jul 14, 2004 11:12 am Reply with quote

yeah pretty much no one could have been since it wouldnt work without that line. LOL. That is okay. It is a great script and i am going to try and change it around so that i can make it into a stock competition script. Where a person gets a certain amount of money to spend to purchase stocks and so forth. Dont know if you remember me trying to make a stock ticker. Well i figured it out! www.marketstir.com is the site that i am developing both of the ideas on. Ticker is going to be customized to read the portfolio symbols and all that jazz.

Just wanted to thank you because by messing around with your script it has allowed me to learn php and all its great uses.

Thanks!
 
Raven







PostPosted: Wed Jul 14, 2004 11:43 am Reply with quote

If you wouldn't mind me packaging your ticker code, I would love to add that in. Let me know if you're interested in fame and fortune Laughing. Thanks.
 
upennballer







PostPosted: Wed Jul 14, 2004 12:17 pm Reply with quote

Sure. I should finish it hopefully tonight. Then you can give me your thoughts and suggestions and i can improve it if need be.
 
SoulflyZ







PostPosted: Thu Jul 15, 2004 8:34 am Reply with quote

Thanks for your reply, I thought I was forgotten!
I implemented the change you suggest and the functions now appear when a stock in your portfolio is selected. BUT, I can not add shares,price,etc..
The update portfolio has no effect and the delete from portfolio function returns an error stating "ERROR while deleting record."

I have completely started over to insure I didn't change something accidentally, so it is barely changed and I still have the same problem. If you would like to check out the script I have it here: http://68.83.144.136/stock%20script.txt
Any suggestions?
 
Raven







PostPosted: Thu Jul 15, 2004 8:43 am Reply with quote

Have you implemented a User registration system and integrated it with kissq? As stated in the docs, you have to have a way to 'sign in' or the system doesn't know where to write to. That's why you can't add.
 
SoulflyZ







PostPosted: Fri Jul 16, 2004 2:22 pm Reply with quote

When a user logs in under the PHPBB forums and visits the "stock page" the message comes up that says "Your portfolio settings will be saved under your username of (Whatever user). The individual usernames and stocks are added to the kissq database, just not anything else.
 
Raven







PostPosted: Fri Jul 16, 2004 3:03 pm Reply with quote

As long as you have written a rountine to pass the username to $username in KISSQ, it should work. I have tested it here and it seems to work.
 
SoulflyZ







PostPosted: Sat Jul 17, 2004 8:45 am Reply with quote

You tried the code as I have it? Shocked
 
Raven







PostPosted: Sat Jul 17, 2004 8:49 am Reply with quote

No. What I am telling you is that if you have passed a valid username to the kissq script
Code:
// Determine username from the system

if (!$isStd) {
   cookiedecode($user);
   $username = $cookie[1];
}
if (!isset($username)) $username = "";
then it works. As you see here, it is expecting it in the form of a cookie. If you are passing it in any other way then you need to write your own code.
 
SoulflyZ







PostPosted: Sat Jul 17, 2004 11:58 am Reply with quote

Then I'm out of ideas. Confused
I just don't understand how it can recognize the username, save it to the database and still not be "logged in".
This is the code that i'm using to login:
$username = ($userdata['session_logged_in']) ? $userdata['username'] : '' ;
 
Raven







PostPosted: Sat Jul 17, 2004 12:22 pm Reply with quote

Make sure that $isStd = TRUE. Then, alter your statement to read
echo $username = ($userdata['session_logged_in']) ? $userdata['username'] : '' ;
to see what the value of $username is.
 
SoulflyZ







PostPosted: Sat Jul 17, 2004 5:20 pm Reply with quote

$isStd = TRUE
The value of $username is correct, it shows up on the page twice now.
 
upennballer







PostPosted: Tue Jul 27, 2004 1:06 pm Reply with quote

Dont know if this helps. I use this function:

function checkLogin(){
/* Check if user has been remembered */
if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookpass'])){
$_SESSION['username'] = $_COOKIE['cookname'];
$_SESSION['password'] = $_COOKIE['cookpass'];
}

/* Username and password have been set */
if(isset($_SESSION['username']) && isset($_SESSION['password'])){
/* Confirm that username and password are valid */
if(confirmUser($_SESSION['username'], $_SESSION['password']) != 0){
/* Variables are incorrect, user not logged in */
unset($_SESSION['username']);
unset($_SESSION['password']);
return false;
}
return true;
}
/* User not logged in */
else{
return false;
}
}


This is the cookie that i create when i have people login:
if(isset($_POST['remember'])){
setcookie("cookname", $_SESSION['username'], time()+60*60*24*100, "/");
setcookie("cookpass", $_SESSION['password'], time()+60*60*24*100, "/");
setcookie("cookemail", $_SESSION['email'], time()+60*60*24*100, "/");

}


So it reads the cookie and sets that as the session username which is then used by my portfolio and ticker scripts.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> KISSQ General Support

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©