PDA

View Full Version : php5 incompatability ?


majorj0nny
01-15-2010, 09:19 PM
hi all - we use a staffpage mod for vbadvanced on our 3.8.4 vb forum, and have done for some years, ive used the basic mod to create other similar pages - ie for tagged members and clans ect..

last night our hosting apparently did some kind of a server upgrade , since then everything still works except any pages using a module that uses on of these 3 php files..

php file example -



<?php
//////////////////////////////////////////////////////////////////////////////////
// staffpage.php version 1.6
// A dynamic staffpage for vBadvanced CMPS
// Installation Instructions
//////////////////////////////////////////////////////////////////////////////////
// staffpage.php /////////////////////////////////////////////////////////////////
// 1.6 Added support for filesystem and database
// 1.5 Added support for vBulletin 3.5
// 1.4a Added display of staff without a profile pic
// 1.4 Added support for updated profile images
// 1.3 Added support for secondary usergroups
// 1.2 Added display of line breaks
// Seperated titles to allow for spaces
// Added links to member profiles from name and picture
// Fixed width display for non uniform profile pics.
// 1.1 Reverted to use all three usergroups.
// 1.0 Initial code
//////////////////////////////////////////////////////////////////////////////////
// ? 2005 Written by Alexander "Kesomir" Worton
// You are not permitted to remove the link to Online Gamers or distribute this code
// http://www.onlinegamers.org.uk <- UK based PC Gaming enthusiasts community
//////////////////////////////////////////////////////////////////////////////////
// Read the installation instructions. Support is only provided at Online Gamers
// enter the number of your biography field //////////////////////////////////////

$bionum = "5";

$picturewidth = "100";

///////////////////////// NO NEED TO EDIT BELOW THIS LINE ///////////////////////


$biofield = "field".$bionum;
// Grabbing that data
$result = $db->query_read("SELECT userfield.userid, user.userid, user.username, user.membergroupids, user.usergroupid, user.avatarrevision, user.profilepicrevision, customprofilepic.dateline, customprofilepic.filename, userfield.$biofield
FROM " . TABLE_PREFIX ."userfield AS userfield
INNER JOIN " . TABLE_PREFIX ."user AS user ON (userfield.userid=user.userid)
LEFT JOIN " . TABLE_PREFIX ."customprofilepic AS customprofilepic ON (customprofilepic.userid=user.userid)
WHERE FIND_IN_SET(5,user.membergroupids) OR FIND_IN_SET(6,user.membergroupids) OR FIND_IN_SET(67,user.membergroupids) OR FIND_IN_SET(9,user.membergroupids)OR FIND_IN_SET(7,user.membergroupids)OR FIND_IN_SET(54,user.membergroupids)
OR (user.usergroupid = 5) OR (user.usergroupid = 6) OR (user.usergroupid = 67) OR (user.usergroupid = 9)OR (user.usergroupid = 7)OR (user.usergroupid = 54)
ORDER BY userfield.userid ASC
");

//loop it baby yeah!
while($row = mysql_fetch_array($result))
{
$bio = stripslashes(nl2br($row[$biofield]));
$susername = $row['username'];
$susergroup = $row['usergroupid'];

if (in_array('9',explode(",", $row['membergroupids'])))
{
$susergroup = "9";
}

if (in_array('67',explode(",", $row['membergroupids'])))
{
$susergroup = "67";
}

if (in_array('54',explode(",", $row['membergroupids'])))
{
$susergroup = "54";
}

if (in_array('5',explode(",", $row['membergroupids'])))
{
$susergroup = "5";
}

if (in_array('6',explode(",", $row['membergroupids'])))
{
$susergroup = "6";
}

if (in_array('7',explode(",", $row['membergroupids'])))
{
$susergroup = "7";
}



switch ($susergroup)
{
case "7":
$staffrank = "VeteranModerator";
$staffname = "Veteran Moderator";
break;

case "6":
$staffrank = "Administrator";
$staffname = "Founder";
break;

case "54":
$staffrank = "Administrator";
$staffname = "Founder";
break;

case "9":
$staffrank = "ServerAdmin";
$staffname = "Server Admin";
break;

case "67":
$staffrank = "GServerAdmin";
$staffname = "Girly Server Admin";
break;


case "5":
$staffrank = "Moderator";
$staffname = "Moderator";
break;



}



// if ($row['userid'] != 1) uncomment these three lines to stop the default admin account from appearing. (Line 1)
// { //uncomment these three lines to stop the default admin account from appearing. (Line 2)
$$staffrank .= "<table class=\"tborder\" cellpadding=\"$stylevar[cellpadding]\" cellspacing=\"$stylevar[cellspacing]\" border=\"0\" width=\"100%\" align=\"center\">";
$$staffrank .= "<thead><tr align=\"left\" height=\"10\"><td class=\"tcat\">";
$$staffrank .= "<span class=\"smallfont\"><b>$vboptions[blockbullet] ".$staffname." <a href=\"$vboptions[bburl]/forum/member.php?u=".$row[userid]."\">".$susername."</a></b></td>";
$$staffrank .= "</tr></thead>";
$$staffrank .= "<tr class=\"alt2\">";
$$staffrank .= "<td class=\"alt1\" width=\"100%\">";
$$staffrank .= "<!-- avatar -->";
$$staffrank .= "<table align=\"left\" cellspacing=\"4\"><tr><td>";
$$staffrank .= "<a href=\"".$vbulletin->options[bburl]."/member.php?u=".$row[userid]."\">";
if ($vbulletin->options['usefileavatar'])
{
$$staffrank .= "<img src=\"".$vbulletin->options[bburl]."/customprofilepics/profilepic".$row[userid]."_".$row[profilepicrevision].".gif\" border=\"0\" width=\"$picturewidth\" /></a> </td></tr></table>";
}
else {
$$staffrank .= "<img src=\"".$vbulletin->options[bburl]."/image.php?u=".$row[userid]."&type=profile&dateline=".$row[dateline]."\" valign=\"top\" alt=\"".$row[username]."\" border=\"0\" width=\"$picturewidth\" /></a> </td></tr></table>";
}
$$staffrank .= "<!-- /avatar -->";
$$staffrank .= "<div align=\"left\">".$bio."</div>";
$$staffrank .= "</td>";
$$staffrank .= "</table> <br />";

// } //uncomment these three lines to stop the default admin account from appearing. (Line 3)

}



eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_staffmembers') . '";');
?>



nothing has changed with these files - but they just dont work anymore..

ive asked our hosting and they say it might be a php5 incompatability ?

Lynne
01-15-2010, 09:23 PM
What errors are you getting? I seem to recall having to change the syntax in a couple of my queries when upgrading. I don't remember what else but I would guess there are probably threads about it on here or on vb.com if you do a search.

BBR-APBT
01-15-2010, 09:27 PM
The following code is no longer used in vb4.0

eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_staffmembers') . '";');


Refer To: https://vborg.vbsupport.ru/showthread.php?t=228078

majorj0nny
01-16-2010, 07:20 AM
The following code is no longer used in vb4.0

eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_staffmembers') . '";');


Refer To: https://vborg.vbsupport.ru/showthread.php?t=228078

Im running vb 3.8.4 currently and this error cropped up when the hosting company did some updates (outside of VB) to the server ... the actual version of VB im using aint changed from the one that was using these php scripts just fine a day before the update.

--------------- Added 1263633744 at 1263633744 ---------------

What errors are you getting? I seem to recall having to change the syntax in a couple of my queries when upgrading. I don't remember what else but I would guess there are probably threads about it on here or on vb.com if you do a search.

it just shows a blank browser page saying

"Internet Explorer cannot display the webpage"

if I remove the modules connection to the problem php file the page displays just fine (minus the module content I need obviously).

its nothing wrong with vbadvanced as other pages that dont use these staffpage phps work just fine ..

Paul M
01-16-2010, 08:56 AM
Have you got error reporting turned on in php ?

BTW, you posted this in the vb4 section, from reading this it should be in vb3, moved

Lynne
01-16-2010, 03:40 PM
As Paul suggested, take a look at your error_logs. I know when I did the upgrade, the errors showed up in there.