Author |
Message |
SoulflyZ
New Member


Joined: May 02, 2004
Posts: 8
|
Posted:
Sun May 02, 2004 10:50 am |
|
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. |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Sun May 02, 2004 11:25 am |
|
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. |
|
|
|
 |
SoulflyZ

|
Posted:
Mon May 03, 2004 2:38 pm |
|
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

|
Posted:
Thu May 06, 2004 5:41 pm |
|
Does anyone know why I don't have the functions? |
|
|
|
 |
upennballer
New Member


Joined: Jun 10, 2004
Posts: 16
|
Posted:
Wed Jul 14, 2004 12:27 am |
|
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... |
|
|
|
 |
Raven

|
Posted:
Wed Jul 14, 2004 7:02 am |
|
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

|
Posted:
Wed Jul 14, 2004 11:12 am |
|
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

|
Posted:
Wed Jul 14, 2004 11:43 am |
|
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 . Thanks. |
|
|
|
 |
upennballer

|
Posted:
Wed Jul 14, 2004 12:17 pm |
|
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

|
Posted:
Thu Jul 15, 2004 8:34 am |
|
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

|
Posted:
Thu Jul 15, 2004 8:43 am |
|
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

|
Posted:
Fri Jul 16, 2004 2:22 pm |
|
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

|
Posted:
Fri Jul 16, 2004 3:03 pm |
|
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

|
Posted:
Sat Jul 17, 2004 8:45 am |
|
You tried the code as I have it?  |
|
|
|
 |
Raven

|
Posted:
Sat Jul 17, 2004 8:49 am |
|
No. What I am telling you is that if you have passed a valid username to the kissq scriptCode:// 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

|
Posted:
Sat Jul 17, 2004 11:58 am |
|
Then I'm out of ideas.
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

|
Posted:
Sat Jul 17, 2004 12:22 pm |
|
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

|
Posted:
Sat Jul 17, 2004 5:20 pm |
|
$isStd = TRUE
The value of $username is correct, it shows up on the page twice now. |
|
|
|
 |
upennballer

|
Posted:
Tue Jul 27, 2004 1:06 pm |
|
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. |
|
|
|
 |
|