Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by ace ace is offline
Developer Last Online: May 2002 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-12-2002 Last Update: Never Installs: 0
 
No support by the author.

Ok, I'm on a mission to expand my knowledge of PHP and MySQL. So as a project, i decided to try and integrate vB (Yes I am Licensed! Check my records ) with a news script written by a friend of mine. now this is my problem(s).

My friend's News script uses sessions (vB uses Sessions for admin and cookies for users) and only supports one news poster (the admin).

So I was thinking that if i could modify this enough, i could get it to work with vB. What I'm planning to do is use the usergroupid variable from vB and create a newsposter's group and then multiple people would be able to post news and not just the admin.

The problem i ran into was that when i tried to login, it would not accept my password. I think this has something to do with the MD5 encryption that vB uses on their passwords. How would I be able to do this?


adminlogin.php
PHP Code:
<?php
include("../config.php");
include(
"../global.php");
session_start();
if(!isset(
$uid)) {
?>
<html><head>
<title>X-Gate admin</title></head>
<body leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">
<br><br><br>
<table cellpadding="1" cellspacing="0" border="0" align="center" width="450" bgcolor="<?=$menucolor1?>">
<tr><td><table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr><td><font size='2'><b><font size="3" face="Arial" color="#000000">Please Log in:</font></b></font></td>
</tr><tr>
<td align="center" nowrap bgcolor="<?=$leftcontentmenu?>"> 
<p><font face="Arial" size="2" color="#000000">You are either not a valid administrator or have not logged in.<br>
</font>
<form method="post" action="<?=$PHP_SELF?>">
<table cellpadding="0" cellspacing="1" border="0">
<tr><td><input type="text" name="uid"></td>
<td><input type="password" name="pwd"></td>
<td><input type="submit" value="Log in"></td>
</tr><tr><td><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#000000">Username</font></td>
<td colspan="2"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#000000">Password</font></td>
</tr></table>
</form>
</td></tr></table>
</td></tr></table>
<p align="center"><font size="1" face="Verdana"><b>X-Gate v1.3 Administrator Control Panel</b></font></p>
</body></html>

<?php
exit;
}
session_register("uid");
session_register("pwd");

mysql_select_db("auspc_net");

$sql "SELECT * FROM user WHERE username = '$uid' AND password = '$pwd'";
$result mysql_query($sql);

if (
$number mysql_num_rows($result) == 0) {
session_unregister("uid");
session_unregister("pwd");
?>

<br>
<meta http-equiv ="Refresh" content = "0 ; URL=<?=$HTTP_REFERER?>">
<?php
exit;
}
$adminname mysql_result($result,0,"userid");
$adminemail mysql_result($result,0,"email");
$password mysql_result($result,0,"password");
?>

global.php
PHP Code:
<?php

mysql_connect
($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
mysql_select_db ($DBname);
    
    
$result mysql_db_query($DBname"SELECT * FROM newsoptions");
    
$row mysql_fetch_array($result);

    
$adminname $row["adminname"];
    
$adminemail $row["adminemail"];
    
$welcome_msg $row["welcomemsg"];
    
$boxxnet_site $row["xgate"];
    
$sitename5 $row["sitename"];
    
$backgroundcolor $row["color1"];
    
$menucolor1 $row["color2"];
    
$textcolor $row["textcolor"];
    
$leftcontentmenu $row["color3"];
    
$footer $row["footer"];
    
$logoimage $row["logoimage"];
    
$siteurl $row["siteurl"];
    
$titlecolor $row["titlecolor"];
    
$titlebgcolor $row["titlebgcolor"];
    
$version $row["version"];
    
$leftmwidth $row["leftmwidth"];
?>
Any help GREATLY appreciated.

Cheers

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-13-2002, 06:39 AM
ace ace is offline
 
Join Date: Dec 2001
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?
Reply With Quote
  #3  
Old 02-13-2002, 09:45 PM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not just use vb's session/permissions instead of using the ones in this script? Just look at the other files in vb to get an idea of what you need to do. You would also want to use vb's global.php and merge the data in the news scripts global php into the adminlogin.php. You could also go further and use vb's sql functions as well....just my 2 cents...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:25 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03775 seconds
  • Memory Usage 2,237KB
  • Queries Executed 18 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete