The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
I just installed a new script that works as a yahoo style directory. In order for some one to add a site, they need to fill in a valid emal address and username which is then saved in a database. I would like them to have to be a member in order for them to post. How can I do this?
I would like the add part of the script to check to see if they are a member, and send their username and password from vbulletin to the database for the directory. That way they can simply use their site wide user name and password to add more sites or edit them in the future. Thanks, -JRW |
#2
|
||||
|
||||
that could be done but not without letting someone look at the source and tweaking it. i did that once before for a similar kind of script
|
#3
|
||||
|
||||
Ok, here is the code that I'm working with:
Code:
$error=0; if($submit){ // Validate the Site Name if(strlen(trim($SiteName)) < 10){ $error = 1; $error_html .= "Site Name is invalid, (should be at least 10 characters in length).<br><br>\n"; } if(strlen(trim($SiteName)) > 100){ $error = 1; $error_html .= "Site Name is invalid, (should be less than 100 characters in length).<br><br>\n"; } // Validate the Site URL if($auto_validate=="Y"){ if(!$get_url=@fopen($SiteURL,"r")){ $error = 1; $error_html .= "Site URL is invalid.<br><br>\n"; } } // Validate the Description if(strlen(trim($Description)) > 255){ $error = 1; $error_html .= "Description is invalid, (should be less than 255 characters in length).<br><br>\n"; } if(strlen(trim($Description)) < 25){ $error = 1; $error_html .= "Description is invalid, (should be at least 25 characters in length).<br><br>\n"; } // Validate the Category if(!$Category){ $error = 1; $error_html .= "Category selection is invalid.<br><br>\n"; } // Validate the User Name if(strlen(trim($UserName)) < 5){ $error = 1; $error_html .= "User Name is invalid, (should be at least 5 characters in length).<br><br>\n"; } if(strlen(trim($UserName)) > 50){ $error = 1; $error_html .= "User Name is invalid, (should be less than 50 characters in length).<br><br>\n"; } // Validate the Email Address if(!ereg("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$",$UserEmail)){ $error = 1; $error_html .= "Email Address is invalid.<br><br>\n"; } ?> <table cellpadding="5" cellspacing="0" border="0"> <tr> <td align="left" valign="top"><font size="<? echo $font_size;?>" face="<? echo $font_face;?>"> <? if($error=="1"){ echo "<br><font color=\"#FF0000\"><b>Your submission is incomplete for the following reasons:</b></font>"; echo "<blockquote>".$error_html."</blockquote>\n"; echo "Please <a href=\"javascript:history.go(-1)\">go back</a> and try again."; } else { $insert=mysql_query("insert into temp (SiteName,SiteURL,Description,Category,UserEmail,UserName) values ('$SiteName','$SiteURL','$Description','$Category','$UserEmail','$UserName')",$db); echo "<br>Submission Complete. You site awaits a pending review before final submission into the database.<br><br>"; echo "Here is the info you sent:"; $find_cat=mysql_query("select * from categories where ID='$Category'",$db); $find_row=mysql_fetch_array($find_cat); $found_cat=$find_row[Category]; echo "<blockquote><b>Site Name:</b> ".$SiteName."<br><br>\n<b>Site URL:</b> <a href=\"".$SiteURL."\" target=\"_blank\">".$SiteURL."</a><br><br>\n<b>Description:</b> ".$Description."<br><br>\n<b>Category:</b> ".eregi_replace("_"," ",$found_cat)."<br><br>\n<b>Email Address:</b> <a href=\"mailto:".$UserEmail."\">".$UserEmail."</a><br><br>\n<b>User Name:</b> ".$UserName."</blockquote>"; $subject = "Site needs validating..."; $content = "Site needs validating, go here: ".$base_url."/admin/"; mail($owner_email,$subject,$content,"From: $UserEmail"); } ?> </font></td> </tr> </table> <? } Thanks again, -JRW |
#4
|
||||
|
||||
hmm i'm not very good at mysql connections but i can do basic. if you wish to use different username and passwords from vBB and have the users store stuff in a different database you would need two connections in there, another database and you'd have to edit the other database. sorry i can't help further because this is out of my reach.
|
#5
|
||||
|
||||
I really want everyone to have the same username and password site wide, even if it is stored exactly the same way in a different database. I just need to know how to check the given username and password against the vb database and then I should be able to same it in the directory database for future use.
-JRW |
#6
|
||||
|
||||
Well, afaik you wouldn't need to access the database again for the username and password as they should already be validated and have a cookie. This means that you only need to include the cookie function (where and whatever that may be) to check they are logged in, otherwise display a link so they can do a vB login and get the cookie required?
Also I think you need to make sure that the cookie is available to the entire domain, and not just vB. Sorry i can't help more, but I think thats the approcahe you may need to take? Could someone confirm this or tell me I am wrong |
#7
|
||||
|
||||
Ok let me try to explain what I need a little clearer. This directory script uses its own database. It asks for a username and and email address. The site is then added into the directory after the admin has ok'ed it. The user can go back into the directory and edit the site listing by entering the username and email address.
What I want the script to ask for a username and password. Then it will check it against the vbulletin database. If the username and passwrod match, they can be entered into the directory database. Then the script will simply check its own database if the user wants to edit the site listing. I just need to know how to check a username and password against the vbulletin database before allowing the site into the directory. That way only registered users will be able to add to the directory. Thanks, -JRW |
#8
|
||||
|
||||
Anyone?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|