Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 01-15-2010, 09:19 PM
majorj0nny majorj0nny is offline
 
Join Date: May 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default php5 incompatability ?

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 Code:

<?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 ?
Reply With Quote
  #2  
Old 01-15-2010, 09:23 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 01-15-2010, 09:27 PM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The following code is no longer used in vb4.0
Code:
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_staffmembers') . '";');
Refer To: https://vborg.vbsupport.ru/showthread.php?t=228078
Reply With Quote
  #4  
Old 01-16-2010, 07:20 AM
majorj0nny majorj0nny is offline
 
Join Date: May 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BBR-APBT View Post
The following code is no longer used in vb4.0
Code:
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 [DATE]1263633744[/DATE] at [TIME]1263633744[/TIME] ---------------

Quote:
Originally Posted by Lynne View Post
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 ..
Reply With Quote
  #5  
Old 01-16-2010, 08:56 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 01-16-2010, 03:40 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As Paul suggested, take a look at your error_logs. I know when I did the upgrade, the errors showed up in there.
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 09:43 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.03866 seconds
  • Memory Usage 2,267KB
  • 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
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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