PDA

View Full Version : Problem with PHP, Server & vB3.0 (trying to get pluhnews to work)


Mithan
02-13-2004, 09:27 PM
Hi.
I have moddified PluhNews to work with vb3.0 and the results can been seen here.
www.mithan.com

Basically the code works, except there is a small problem with Global.php not loading, which means that the text isn't parsing.

The problem is, I can not get the global.php file to work, as it wont "require" properly, meaning that I cant use the following parse command:
$bericht=bbcodeparse2($pagetext,"","","1","1","1");
in the Pluh News script.

With version 2.3.4 of vBulletin, global.php was working ok (and thus pluhnews). Now it wont work with 3.0...


The original code I had was this:

chdir("/home/virtual/site22/fst/var/www/html/forum/");
require("./global.php");
require("./PluhConfig.php");
require("./admin/config.php");


Now, that same code will not work, and I have tried the following:
chdir("/home/virtual/site22/fst/var/www/html/forum/");
require("/home/virtual/site22/fst/var/www/html/forum/global.php");
require("./PluhConfig.php");
require("./includes/config.php");

and a LOT of other variations.

PS:
chdir switches properly as tested with echo(getcwd());

I even followed through the vB3.0 code and added some absolute URL's into global.php, config.php, db_mysql.php and init.php to get it to keep passing through its commands. It kind of worked, but eventually ended up just causing nothing to load anyways...



Is there an issue with my Server and its settings possibly?
I am hosted by www.Dot5Hosting.com and I am wondering if they have some security settings preventing this.

I just don't get it, since vb2.3.4 was working correctly.

Alternativly:
Is there anyway I can get this code to work without calling Global.php?
$bericht=bbcodeparse2($pagetext,"","","1","1","1");


Ideally, I would like to find out why I can not call up global.php and get it to work properly.

I had this same trouble a year ago as well. I managed to get PluhNews working, but I couldn't add a remote vBulletin login on the front page of the site. It worked on westhost.com but wouldn't work when I moved to dot5hosting.com.

Again, thanks to anybody who can help me out.

Andreas
02-13-2004, 09:37 PM
Did your functions_bbcodeparse.php?
Did you try parse_bbcode($pagetext, 'nonforum') ?

I think it might be a problem with cookies being set when the vB backend loads up ...

Mithan
02-13-2004, 09:46 PM
Kirby, thanks for the reply.

I did not try that. How would I exactly?
Im not a PHP Expert by any means...

Right now Im using this:
$bericht=$pagetext;

then outputing:
$bericht

Which gives you the unparsed code on the front of my site.

Mithan
02-13-2004, 10:04 PM
I got this working by adding:

chdir("/home/virtual/site22/fst/var/www/html/forum/");

require("/home/virtual/site22/fst/var/www/html/forum/global.php");
chdir("/home/virtual/site22/fst/var/www/html/");

To my main index.php file.

My site is broken into pieces, and I had tried that a year ago and it didn't work.

Now it did...

Weird.

Mithan
02-13-2004, 11:14 PM
Turns out my fix didn't entirely work:

Turns out my fix didn't work :(

I get the following SQL Errors:
Warning: mysql_query(): 6 is not a valid MySQL-Link resource in /home/virtual/site22/fst/var/www/html/forum/includes/db_mysql.php on line 205

Warning: mysql_error(): 6 is not a valid MySQL-Link resource in /home/virtual/site22/fst/var/www/html/forum/includes/db_mysql.php on line 350

Warning: mysql_errno(): 6 is not a valid MySQL-Link resource in /home/virtual/site22/fst/var/www/html/forum/includes/db_mysql.php on line 351

Warning: mysql_query(): 6 is not a valid MySQL-Link resource in /home/virtual/site22/fst/var/www/html/forum/includes/db_mysql.php on line 205

Warning: mysql_error(): 6 is not a valid MySQL-Link resource in /home/virtual/site22/fst/var/www/html/forum/includes/db_mysql.php on line 350

Warning: mysql_errno(): 6 is not a valid MySQL-Link resource in /home/virtual/site22/fst/var/www/html/forum/includes/db_mysql.php on line 351






BTW, I added (in addition to moving the global.php require to index), this code:

require_once('./includes/functions_bbcodeparse.php');
$bericht=parse_bbcode2($pagetext,"1","1","1","1","1");



Any ideas?

Martyn
04-30-2004, 04:52 PM
I've been having the same problem with some of my custom scripts, they all worked fine before upgrading to v3.

Can anyone shed any light?

Cheers

Zachery
04-30-2004, 04:55 PM
I've been having the same problem with some of my custom scripts, they all worked fine before upgrading to v3.

Can anyone shed any light?

Cheers
Try my sig, vB3 works alot differntly :)

Martyn
04-30-2004, 05:48 PM
Thanks, i've just taken a look and i've made the changes advised and I still appear to be receiving php/mysql errors.

For example...

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/virtual/site3/fst/var/www/html/forums/setups/mysqltest.php on line 11

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/virtual/site3/fst/var/www/html/forums/setups/mysqltest.php on line 13


<?php require_once('Connections/seatcupra.php'); ?>
<?php
chdir("../");
error_reporting(E_ALL & ~E_NOTICE);
require_once("global.php");

$colname_rs_test = "1";
if (isset($HTTP_GET_VARS['userid'])) {
$colname_rs_test = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['userid'] : addslashes($HTTP_GET_VARS['userid']);
}
mysql_select_db($database_seatcupra, $seatcupra);
$query_rs_test = sprintf("SELECT * FROM setup_photos WHERE userid = %s", $colname_rs_test);
$rs_test = mysql_query($query_rs_test, $seatcupra) or die(mysql_error());
$row_rs_test = mysql_fetch_assoc($rs_test);
$totalRows_rs_test = mysql_num_rows($rs_test);
?>
<html>
<head>
<title>MySQL/VB Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php echo $row_rs_test['photo_id']; ?>,<?php echo $row_rs_test['filename']; ?>,<?php echo $row_rs_test['caption']; ?>,<?php echo $row_rs_test['userid']; ?>,<?php echo $row_rs_test['username']; ?>
</body>
</html>
<?php
mysql_free_result($rs_test);
?>

Any ideas?

Martyn
05-12-2004, 09:50 PM
Anyone?

Jujimufu
05-22-2004, 04:41 AM
I would be interested in this as well, I have the same problem.

lierduh
05-22-2004, 06:52 AM
What is the error in the web server error log?

Have you tried require global.php before other requires? I see you have something before global.php.

Martyn
05-22-2004, 08:36 AM
If I move the require to the top the recordset is empty

<?php
chdir("./../forums/");
require_once("./global.php");
require_once('Connections/seatcupra.php');
error_reporting(E_ALL & ~E_NOTICE);

$colname_rs_test = "1";
if (isset($HTTP_GET_VARS['userid'])) {
$colname_rs_test = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['userid'] : addslashes($HTTP_GET_VARS['userid']);
}
mysql_select_db($database_seatcupra, $seatcupra);
$query_rs_test = sprintf("SELECT * FROM setup_photos WHERE userid = %s", $colname_rs_test);
$rs_test = mysql_query($query_rs_test, $seatcupra) or die(mysql_error());
$row_rs_test = mysql_fetch_assoc($rs_test);
$totalRows_rs_test = mysql_num_rows($rs_test);
?>
<html>
<head>
<title>MySQL/VB Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php echo $row_rs_test['photo_id']; ?>,<?php echo $row_rs_test['filename']; ?>,<?php echo $row_rs_test['caption']; ?>,<?php echo $row_rs_test['userid']; ?>,<?php echo $row_rs_test['username']; ?>
</body>
</html>
<?php
mysql_free_result($rs_test);
?>

dstruct2k
05-26-2004, 06:42 PM
As far as I know, the function is "parse_bbcode()" in vb3, and it's not contained in global.php.


Include/require "./includes/functions_bbcodeparse.php" and then use parse_bbcode(). :)