Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 09-04-2006, 10:54 AM
Paul_Hollibone Paul_Hollibone is offline
 
Join Date: Apr 2005
Location: Australia
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help with vb Login Script on non VB page

Hey guys.

I am having a problem with my login script which was partly coded by myself, which I use on my normal website.

It all works fine, except for one error at the bottom of the page which I believe is related to my cookie grabber.

Anyway, here is the code I am using.

PHP Code:
<? 

// Edit the lines below to show path to your forums
$forumpath = "http://www.thrillhistory.com/forums/";

// Set the maximum display size for the avatar
$maxw = 100; // Max thumbnail width
$maxh = 100; // Max thumbnail height


if ($vbulletin->userinfo['userid']!=0) { 
$username=$vbulletin->userinfo['username']; 

// ++++++++++++++++++++++++++++++++++
// display avatar - resize if too big
// ++++++++++++++++++++++++++++++++++

$userid=$vbulletin->userinfo['userid'];
$file = $forumpath."image.php?u=$userid";
list($width, $height, $type) = getimagesize($file);

if ( $width <= $maxw AND $height <= $maxh )// check width and height
   {// if width and height under size display unchanged
       echo "<img src=\"$file.$type\" align=\"center\" border=\"0\">";
   }
   else 
   {  
    if ($width > $maxw)//check if width is too wide
        { // if it is, resize
        $ratio = $width / $maxw; //work out resize ratio
        $newwidth = $maxw; // new width
        $newheight = ($height / $ratio); // new height at this resize
        }
        else
        {
        $newheight = $height; // if width is ok, set this cos we need it later
        $newwidth = $width; // if width was ok, set this cos we ned it later
        }
    If ($newheight <= $maxh )        
        {
        // if current height is ok, were done.
        } 
        
        else // either origional or resized height is too big
            if( $newheight >= $maxh )
            { // if resized height is still too big we resize it
            $ratio2 = $newheight / $maxh; //work out resize ratio
            $newheight = $maxh; // give $newheight a new value
            $newwidth = ($newwidth / $ratio2); // new width at this resize
            } // the value of $newwidth has just been changed
            else
            {// if were here then origional height is too big so we resize it
            $ratio2 = $newheight / $maxh; //work out resize ratio
            $newheight = $maxh; // give $newheight a new value
            $newwidth = ($newwidth / $ratio2); // new width at this resize
            }

        // now we can finally display resized pic
        echo "<img src=\"$file.$type\" border=\"0\" width = \"$newwidth\" height = \"$newheight\" align=\"center\">"; // display resized pic
   }
// +++++++++++++++++++++++  
// end avatar display code
// +++++++++++++++++++++++ 
   
print("<br><align='center'><span class='sectionheader'>Welcome back, $username!<p>");
 
 // Display PM Details and generate link to PM box
echo "<strong><center><a href=\"".$forumpath."private.php?$session[sessionurl] \">Private Messages:</a>  $vbphrase[unread_x_nav_compiled] $vbphrase[total_x_nav_compiled]</strong></center>";
echo "<p>";

// As were logged in display logout link
echo "<strong><center><a href=\"".$forumpath."login.php?$session[sessionurl]do=logout&amp;logouthash=$logouthash";
echo $vbulletin->userinfo['logouthash'];
echo "\">";
echo "<font size=\"1\" face=\"verdana\">Log Out of ThrillHistory.com</font></a><br></strong></center>";?>
  <? 

} else { 
  


?>
  </span></p>
<form action='/forums/login.php' method='post' class="style1" onsubmit='md5hash(vb_login_password,vb_login_md5password)'>
  <p align="center" class="inbottom style75">
    
    <script type='text/javascript' src='/forums/clientscript/vbulletin_md5.js'></script>
    <strong>Username:</strong>
    <input type='text' class='button' name='vb_login_username' id='navbar_username' size='15' accesskey='u' tabindex='1' value='' onfocus='if (this.value == 'username="username"') this.value = ''; />
      <br />
      <strong>Password:</strong>
    <input type='password' class='button' name='vb_login_password' size='15' accesskey='p' tabindex='2' />
      <br />
      <input type='checkbox' name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' />
      <strong>Remember Me</strong><br />
      <input name="submit" type='submit' class='button' accesskey='s' tabindex='4' title='Log In' value='Log In' />
      <input type='hidden' name='do' value='login' />
      <input type='hidden' name='forceredirect' value='1' />
      <input type='hidden' name='vb_login_md5password' />
    </p>
</form>
<div align="left" class="style1">
  <div align="center">
    <p><span class="inbottom"><a href="/forums/register.php?">Would you like to comment on some of the things being said below? Join ThrillHistory.com Now, it's FREE! </a> </span>
      <? 



?>
Here's the cookie grabber code.

PHP Code:
<?php
chdir
("/home/thrillhi/public_html/forums/"); 
require(
'/home/thrillhi/public_html/forums/global.php');   
chdir("../");
?>
And finally, here is the error I am recieving.

PHP Code:
Fatal errorCall to a member function unlock_tables() on a non-object in /home/thrillhi/public_html/forums/includes/functions.php on line 4419 
Guys I hope you can help me. I normally wouldn't be so fussy, however it just makes me look so unprofessional, and it could possibly be leaving my site open to hackers.

So, if anyone out there would be able to help me, I would be greatly appreciative.

Thanks.

Regards
Paul
Reply With Quote
  #2  
Old 09-15-2006, 04:17 AM
Paul_Hollibone Paul_Hollibone is offline
 
Join Date: Apr 2005
Location: Australia
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Guys, is anyone able to help me?

I really need some help from some serious coders.
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:31 PM.


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.04694 seconds
  • Memory Usage 2,182KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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