Version: , by (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 09-17-2000
Last Update: Never
Installs: 0
No support by the author.
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
This modification may not be copied, reproduced or published elsewhere without author's permission.
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" ) . "\");" );
?>
Now when the user accesses the page, if they are logged in they see the contents of the "usercomments" template. If they arent logged in they are prompted to enter a username and password
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.
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
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!
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.