Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-07-2017, 07:02 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Errors in server log

Seeing many of these.. running php 5.6.30


[Thu Mar 02 23:24:31.397570 2017] [proxy_fcgi:error] [pid 4188:tid 139985248311040] [client ###########] AH01071: Got error 'PHP message: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/vhosts/#########.com/httpdocs/global.php(29) : eval()'d code on line 274\nPHP message: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/vhosts/#######.com/httpdocs/global.php(29) : eval()'d code on line 336\n', referer: https://#########.com/showthread.php?t=236793&page=11

i know it is a plug in but I could use help tracking it down..

Thanks:up:
Reply With Quote
  #2  
Old 03-07-2017, 07:51 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check for a "global_start" hook.
Looks like the hook you're looking for has a couple hundred lines of code in it.
Reply With Quote
  #3  
Old 03-07-2017, 08:00 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, That makes sense Dave.

It has to be one of the following plug ins then. Any thoughts?
Attached Images
File Type: jpg Plugin_&_Products_System_-_Mus2017-03-07_16-59-01.jpg (22.9 KB, 0 views)
Reply With Quote
  #4  
Old 03-07-2017, 08:12 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hard to tell, open each of them and see which one contains the function "mysql_connect".
Reply With Quote
  #5  
Old 03-07-2017, 08:33 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Dave,

I believe it is Photopost.. Still looking though.

Anything wrong with this?

$dblink = mysql_connect ("$vbhost", "$vbuser", "$vbpass") or die('I cannot connect to the database.');
mysql_select_db ("$dbname2")or die("Could not select forum database");
Reply With Quote
  #6  
Old 03-07-2017, 08:35 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, that's what makes use of the mysql_* functions which is deprecated in your PHP version.
You can fairly easy change it to make use of the mysqli_* functions though: https://www.phpclasses.org/blog/pack...to-MySQLi.html
Reply With Quote
  #7  
Old 03-07-2017, 08:39 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh yeah, I see what you mean now...

Like this..

$connection = mysqli_connect( 'host', 'username', 'password'); or die('I cannot connect to the database.');

ok, I got you. Thanks Dave

##The full replacement would be:

$connection = mysqli_connect( 'host', 'username', 'password'); or die('I cannot connect to the database.');

mysqli_select_db( $link, $database) or die("Could not select forum database");
}
Reply With Quote
  #8  
Old 03-07-2017, 09:37 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can change it to
PHP Code:
$connection mysqli_connect'host''username''password''database'); 
to make it easier.

I assume that it also makes use of other mysql_* functions, I would double check that.
To port a mysql_query to mysqli_query, you need to specify the connection variable as the first argument and the second argument will be the actual query.
Reply With Quote
  #9  
Old 03-07-2017, 10:26 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!

The only other ones are $vbhost, $vbuser, $vbpass, $dbname and they should not hard to convert.
Reply With Quote
  #10  
Old 03-08-2017, 05:13 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A product or plugin should never be using native MySQL or MySQLi functions to connect to the database (or for subsequent commands), it should be using the vbulletin database object.
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 08:42 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08735 seconds
  • Memory Usage 2,269KB
  • Queries Executed 14 (?)
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
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete