The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
Hi,
I've got a little user-comment system where people registered with my copy of vBulletin can post little SlashDot-style comments after a news story...it works fine and all, but I was wondernig if I could check to see if they were "logged in" with their cookie info and, if so, have their username and password already in the fields? I just need the command to grab the cookie info really - is it possible? Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
Bump.
|
|
#3
|
|||
|
|||
|
Just do something like this:
Assuming your current html page is "usercomments.html" Make a new template called "usercomments" and dump all of "usercomments.html" into it. The make a file called "usercomments.php" with the following code: Code:
<?
require("global.php");
if ($bbuserid == 0)
{
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_nopermission")."\");");
exit;
}
if ($bbusername == "" || (isset($bbusername))==0)
{
$getusername=$DB_site->query_first("SELECT username FROM user WHERE userid=$bbuserid");
$username=$getusername[username];
$bbusername = $username;
}
else
{
$username = $bbusername;
}
eval( "echo dovars(\"" . gettemplate( "usercomments" ) . "\");" );
?>
HTH ~Chris |
|
#4
|
|||
|
|||
|
Unfortunatly that won't work...what I have is news articles that I want ANYONE to be able to view...not just people logged in. So something like this would restrict it so that only registered members could view them...
Isn't there a way to simply grab the username and password? If I can get those into some variables, I can easily have them populate the two form fields.
|
|
#5
|
|||
|
|||
|
If you want everyone to be able to see them, I dont see the point of having a login form.
Either way the values are already available by calling $bbpassword and $bbuserid. To get the username you will have to query the usertable against the value of $bbuserid HTH ~Chris |
|
#6
|
|||
|
|||
|
I don't think you follow.
:I have movie news on this site...stories on casting, new movies being made, release dates, etc. I want this to be public to all of course...not a good idea to make people register just to view the news... Anyway, at the END of every movie news article, there is a little form where you can leave your comments/thoughts on the article with your username and password if you're registered with our copy of vBulletin... Hope that clears things up - thanks for the help...I'll give it a try!
|
|
#7
|
|||
|
|||
|
Got it to work! Thanks!
|
|
#8
|
|||
|
|||
|
Could you let me know how you got it to work? Thanks in advance.
|
|
#9
|
|||
|
|||
|
if (isset($bbuserid))
{ do stuff } Instead of "do stuff" you'll want to use a MySQL query to grab the username and password from the table "user." based on the $bbuserid variable. I then simply used something like this: <b>Username: </b><input type="text" name="user" value="<?php echo("$theusername");?>"><br> If the variable is empty, then it isn't filled in...if it is - then its filled in. It's all part of this system I've got integrated with vBulletin - when it's all done and officially launched I'll post it here for all to see...it's quite cool. |
|
#10
|
|||
|
|||
|
Thanks...
|
![]() |
|
|