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

Reply
 
Thread Tools Display Modes
  #1  
Old 12-30-2015, 01:32 PM
r5mjh r5mjh is offline
 
Join Date: Dec 2015
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default why are my php custom files not working

hi there, im playing around with a upgrade of vb to maybe 4.2.3 and have found that it requires php 5.4, problem is if i change from 5.2.17 to 5.4 my custom php files wont work

is there a easy fix for this??
or do i need to go 4.2.2 as this is 5.2.17 friendly

any help appreciated thanx:up:
Reply With Quote
  #2  
Old 12-30-2015, 04:06 PM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

we would have to be able to see your custom files code to figure out what is wrong with them, but it sounds like you are using deprecated functions.

Without at least errors, we can only guess.
Reply With Quote
  #3  
Old 12-30-2015, 04:43 PM
r5mjh r5mjh is offline
 
Join Date: Dec 2015
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

basically the code controls many different php pages, also the custom software has to require 2 other modified files header.php,global.php

but if i change the php to 5.4 nothing works

4.2.3 requires 5.4 and 3.8.9 requires 5.3 or above we are currrently on 3.7.1

i can provide some code which is from the home.php file which works on 5.2.17 but not 5.4

PHP Code:
<?php

// number of news items to show on home page:
$news_items 5;

//########################

require_once("header.php");  // header calls /boards/global.php

$username=$vbulletin->userinfo['username'];
$userid=$vbulletin->userinfo['userid'];
$usergroupid=$vbulletin->userinfo['usergroupid'];
$totalposts=vb_number_format($vbulletin->userinfo['posts']);
$token=$vbulletin->userinfo['securitytoken'];

function 
is_member()
{
    
// are we a member ?
    
if($GLOBALS['usergroupid'] != "1" AND $GLOBALS['usergroupid'] != "2" AND $GLOBALS['usergroupid'] != "3") return TRUE; else return FALSE;
}

if(
is_member)
{
    
$chat_link "http://www/chat/login.php";
    
$shop_link "/shop/";
    
$class_link "/boards/forumdisplay.php?f=14";
    
$articles_link "/boards/forumdisplay.php?f=17";
    
$club_link "/club/";
} else
{
    
$chat_link "/guest.php";
    
$shop_link "/guest.php";
    
$class_link "/guest.php";
    
$articles_link "/guest.php";
    
$club_link "/guest.php";
}

$files_link "/files/";

// go html:
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>RTOC - Renault Turbo Owners Club</title>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name="generator" content="RTOC">
<meta name="keywords" content="rtoc,renault,turbo,owners,club,r5gtt,turbo,r9,r11,r21,forum">
<!-- CSS Stylesheet -->
<style type="text/css">
body
{
    background: #FFFFFF;
    color: #000000;;
    margin: 0px 0px 0px 0px;
    padding: 0px;
    font: 11px Verdana, Helvetica, sans-serif;
}
.rtoc_nav
{
    background: #6080c0;
    color: #FFFFFF;
    font: 10px Verdana, Helvetica, sans-serif;
}
.rtoc_nav a:link, .rtoc_nav_alink
{
    color: #ffffff;
    text-decoration: none;
}
.rtoc_nav a:visited, .rtoc_nav_avisited
{
    color: #ffffff;
    text-decoration: none;
}
.rtoc_nav a:hover, .rtoc_nav a:active, .rtoc_nav_ahover
{
    color: #FFFFFF;
    text-decoration: underline;
}
.home_nav a:link, .home_nav_alink
{
    color: #000000;
    text-decoration: none;
}
.home_nav a:visited, .home_nav_avisited
{
    color: #000000;
    text-decoration: none;
}
.home_nav a:hover, .home_nav a:active, .home_nav_ahover
{
    color: #000000;
    text-decoration: underline;
}
.box
{
    border: 1px #888888 solid;
}
</style>
<!-- / CSS Stylesheet -->
</head>
<body text="#000000" bgcolor="#FFFFFF">
<?

// show page header
show_page_header();

?>
<table border="0" cellspacing="2" cellpadding="0"><tr><td width="100%"></td></tr></table>
<!-- MAIN TABLE -->
<table width="100%" bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0">
<tr>
<!-- LEFT COLUMN -->
<td align="left" valign="top" width="180" bgcolor="#CCCCD2">
<?
show_left_nav();
?>
<table border="0" width="175" cellpadding="3" cellspacing="0"><tr>
<td align="left" width="175">
<?
// visitor counter removed, forever re-setting for some reason :-(  Scoff
//Visits: <?
// do counter:
//$fh = fopen('main_page_counter.dat', 'r') or die("Can't open counter file!");
//$line = fgets($fh);
//$data = explode("|",$line);
//fclose($fh);
//$data[1] ++;
//$fh = fopen('main_page_counter.dat', 'w') or die("Can't write to counter file!");
//fputs($fh,"|".$data[1]."|");
//fclose($fh);
//print $data[1];
?>
<br><br><br><br><br><br><br><br><br><br><br><br><br></td></tr></table>
<br><br>
</td>
<td width="2" bgcolor="#BBBBBB"></td>
<td width="10"></td>
<td valign="top">
<!-- CENTER COLUMN -->
<!-- MAIN TABLE -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top">
<? if($userid!="0"){ print "<b>Hi $username</b>, w";} else { print "W"; } ?>elcome to the internet home of the Renault Turbo owners club, the largest collection of Renault turbo enthusiasts on the internet. Catering for all types of Renault turbo including the 5 GT Turbo, 9 Turbo, 11 turbo, 21 Turbo, 25 V6 turbo, R5 Turbo 1 and 2's, Alpine, Gordini, Twingo turbo, Megane Sport Turbo and other one-off's and modern Renault Turbo variants too.
<br><br>
<img src="/images/a.gif"><img src="/images/a.gif">&nbsp;&nbsp;<img src="/images/latest-news.gif">
<br><br>
<!-- NEWS SCRIPT OUTPUT -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<?

// open news file:
$fh = fopen('news/news.txt', 'r') or die("Can't open news file!");

// loop to fetch top news items:
$count = 0;
while (($count < $news_items) AND !feof($fh))
{
    $data = fgets($fh);
    list($junk,$title,$image,$short,$long,$on_off,$img_on_off) = split('\|',$data);

    // are we showing this item ?
    if ($on_off=="ON")
    {
        // start TD:
        $count++;
        print "<!-- NEWS ITEM " . $count . "-->\n";
        print "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n";
        // are we showing an image ?
        if ($img_on_off=="ON")
        {
            print "<td align=\"left\" valign=\"top\" width=\"150\"><img src=\"$image\"></td><td width=\"8\"></td>\n";
        }

        print "<td align=\"left\" valign=\"top\">\n"; 
        print "<b><u>$title</u></b><br><br>\n";
        print $short . "\n</td>\n</tr>\n</table>\n<br>\n";
        print "<!--- / NEWS ITEM " . $count . "-->\n";
    }

}

// close the file:
fclose($fh);

?>
</td></tr></table>
</td>
</tr>
</table>
</td>
<td width="10"></td>
<td align="right" valign="top" width="202">
<!-- RIGHT COLUMN -->
<?

// show join-now to non-paid members:
if (($usergroupid == "1") OR ($usergroupid == "2"))
{
    ?>
<!-- JOIN NOW -->
<table border="0" cellpadding="5" cellspacing="0" width="200">
<tr>
<td align="left" valign="top" bgcolor="#EEEEF0" class="box">
<img src="/images/a.gif">&nbsp;<a href="/club/?show=join"><img src="/images/join-now.gif" border="0"></a>
<br>
<a href="/club/?show=join"><font color="#000000">Join RTOC today!</font></a>
</td>
</tr>
</table>
<br>
    <?
}
?>
<!-- BOARDS -->
<table border="0" cellpadding="5" cellspacing="0" width="200">
<tr>
<td align="left" valign="top" bgcolor="#EEEEF0" class="box">
<img src="/images/a.gif">&nbsp;<a href="/boards/"><img src="/images/boards.gif" border="0"></a>
<br>
The club message boards lets you chat with other members and send & receive private messages.
</td>
</tr>
</table>
<br>
<!-- EVENTS -->
<table border="0" cellpadding="5" cellspacing="0" width="200">
<tr>
<td align="left" valign="top" bgcolor="#EEEEF0" class="box">
<img src="/images/a.gif">&nbsp;<a href="/boards/events.php"><img src="/images/events.gif" border="0"></a>
<br>
Check out forthcoming events in our club calendar.
</td>
</tr>
</table>
<br>
<!-- ARTICLES -->
<table border="0" cellpadding="5" cellspacing="0" width="200">
<tr>
<td align="left" valign="top" bgcolor="#EEEEF0" class="box">
<img src="/images/a.gif">&nbsp;<a href="<? print $articles_link; ?>"><img src="/images/articles.gif" border="0"></a>
<br>
Technical advice, data and other interesting stuff.
</td>
</tr>
</table>
<br>
<!-- CLASSIFIEDS -->
<table border="0" cellpadding="5" cellspacing="0" width="200">
<tr>
<td align="left" valign="top" bgcolor="#EEEEF0" class="box">
<img src="/images/a.gif">&nbsp;<a href="<? print $class_link; ?>"><img src="/images/classifieds.gif" border="0"></a>
<br>
Renault turbo related classifieds<br>for sale and wanted.
</td>
</tr>
</table>
<br>
<!-- FILES -->
<table border="0" cellpadding="5" cellspacing="0" width="200">
<tr>
<td align="left" valign="top" bgcolor="#EEEEF0" class="box">
<img src="/images/a.gif">&nbsp;<a href="<? print $files_link; ?>"><img src="/images/files.gif" border="0"></a>
<br>
Files area - pictures, technical images, members files, etc.
</td>
</tr>
</table>
<br>
<!-- WIZARD -->
<table border="0" cellpadding="5" cellspacing="0" width="200">
<tr>
<td align="left" valign="top" bgcolor="#EEEEF0" class="box">
<img src="/images/a.gif">&nbsp;<a href="/wizard/"><img src="/images/wizard.gif" border="0"></a>
<br>
The Wizard - on hand to answer your technical questions.
</td>
</tr>
</table>
<br>
<!-- CONTACTS -->
<table border="0" cellpadding="5" cellspacing="0" width="200">
<tr>
<td align="left" valign="top" bgcolor="#EEEEF0" class="box">
<img src="/images/a.gif">&nbsp;<a href="/contacts/"><img src="/images/contacts.gif" border="0"></a>
<br>
Contact directory - see which companies offer you Discount!
</td>
</tr>
</table>
<br>
<!-- CONTACT -->
<table border="0" cellpadding="5" cellspacing="0" width="200">
<tr>
<td align="left" valign="top" bgcolor="#EEEEF0" class="box">
<img src="/images/a.gif">&nbsp;<a href="/contact.php"><img src="/images/contact.gif" border="0"></a>
<br>
Visit our contact page if you'd like to get in touch with the club.
</td>
</tr>
</table>

</td>
<td width="4"></td>
</tr>
</table>
</body>
</html>
Reply With Quote
  #4  
Old 12-30-2015, 05:11 PM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please enclose that PHP in the PHP bbcode, to make it more readable.
Also, whe you change to PHP v5.4 does it give any errors, or just nothing at all?

Also, try changing all the <? to <?php
Reply With Quote
  #5  
Old 12-30-2015, 06:48 PM
r5mjh r5mjh is offline
 
Join Date: Dec 2015
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok im not a total noob lol but im not up on the bbcode part, ive just duplicated on another part of the server using a different forum database all works correctly on 5.2.17 but as soon as i put it on 5.4 the custom php pages stop working not the vb itself

we have loads of custom tabs that all work with vb and none work with 5.4 php
Reply With Quote
  #6  
Old 12-30-2015, 09:05 PM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by r5mjh View Post
ok im not a total noob lol but im not up on the bbcode part, ive just duplicated on another part of the server using a different forum database all works correctly on 5.2.17 but as soon as i put it on 5.4 the custom php pages stop working not the vb itself

we have loads of custom tabs that all work with vb and none work with 5.4 php
No worries
Right, I understand that vBulletin works, but your custom pages do not. However, do they generate any errors, or just blank pages?

Also, in your PHP pages change <? to <?php some installs are strict requiring the full tag
Reply With Quote
Благодарность от:
MarkFL
  #7  
Old 12-31-2015, 09:26 AM
r5mjh r5mjh is offline
 
Join Date: Dec 2015
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dragonsys View Post
No worries
Right, I understand that vBulletin works, but your custom pages do not. However, do they generate any errors, or just blank pages?

Also, in your PHP pages change <? to <?php some installs are strict requiring the full tag
got ya matey yep it gives a server 500 error on 5.4 saying it not on the server or somrthing else

but is fine with 5.2.17 ill give that a try matey and report back

--------------- Added [DATE]1451570200[/DATE] at [TIME]1451570200[/TIME] ---------------

well done dragon that worked for php 5.4 but some pages dont work 5.2.17 now lol but if we are upgrading thats not a problem thanx for your help sir apprec

can these php custom pages be used in 4.2.3 still??
Reply With Quote
  #8  
Old 12-31-2015, 02:51 PM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by r5mjh View Post
well done dragon that worked for php 5.4 but some pages dont work 5.2.17 now lol but if we are upgrading thats not a problem thanx for your help sir apprec

can these php custom pages be used in 4.2.3 still??
Strange, that change shouldn't affect it in PHP 5.2
I'm not sure if they will still work on vb v4 since they were written for v3. I would copy your forums to a test site and try the upgrade see what errors you get, if any
Reply With Quote
  #9  
Old 01-01-2016, 03:17 PM
r5mjh r5mjh is offline
 
Join Date: Dec 2015
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanx matey ill do that next

1 more question, does vb only use 1 database even if you choose to put albumpictures to the database? ive got 2 they look linked
Reply With Quote
  #10  
Old 01-01-2016, 03:21 PM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by r5mjh View Post
thanx matey ill do that next

1 more question, does vb only use 1 database even if you choose to put albumpictures to the database? ive got 2 they look linked
Yes, vb only uses 1 DB, unless you have a custom mod which changes this
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 10:16 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.04638 seconds
  • Memory Usage 2,300KB
  • Queries Executed 11 (?)
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
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete