Jump to content

Deprecated: Function eregi() Etc


TheWelshOne

Recommended Posts

Hi Guys, 

 

Firstly I would like state that I do not have a clue about PHP coding, I have merely signed up to gain some help with the following errors I have with my site I have recently setup with a PHP sports application.

 

I downloaded the application from the following website http://phpmysport.sourceforge.net/ and as far as I know the software is opensource and no longer supported by its developer.

 

The following http://www.proevoeliteleagues.esy.es/  is my website which displays the error messages.

 

Please see following code the files in question: 

 

menu.php

<?php
/*
* phpMySport : website for team sport clubs and leagues
*
* Copyright (C) 2006-2009 Jerome PLACE. All rights reserved.
*
* Email           : djayp [at] users.sourceforge.net
* Website         : http://phpmysport.sourceforge.net
* Version         : 1.4
* Last update     : 4 march 2009
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
*/


/****************************/
/* MENUS                    */
/****************************/
$file=ROOT."/menu.csv"; # file containing the website menu

# list of default pages
$default_pages=array(
array('level'=>'parent','title'=>$lang['general']['home'],'url'=>'index.php','class'=>'menu_home'),
array('level'=>'parent','title'=>$lang['general']['news'],'url'=>'index.php?r='.$lang['general']['idurl_news'].'&v1=news_list','class'=>''),
array('level'=>'parent','title'=>$lang['general']['information'],'url'=>'index.php?r='.$lang['general']['idurl_information'],'class'=>''),
array('level'=>'parent','title'=>$lang['general']['team_list'],'url'=>'index.php?r='.$lang['general']['idurl_team'].'&v1=team_list','class'=>''),
array('level'=>'parent','title'=>$lang['general']['member_list'],'url'=>'index.php?r='.$lang['general']['idurl_member'].'&v1=member_list','class'=>''),
array('level'=>'child','title'=>$lang['general']['member_list'],'url'=>'index.php?r='.$lang['general']['idurl_member'].'&v1=member_list','class'=>''),
array('level'=>'child','title'=>$lang['general']['player_list'],'url'=>'index.php?r='.$lang['general']['idurl_team'].'&v1=player_list','class'=>''),
array('level'=>'child','title'=>$lang['general']['manager_list'],'url'=>'index.php?r='.$lang['general']['idurl_member'].'&v1=manager_list','class'=>''),
array('level'=>'child','title'=>$lang['general']['coach_list'],'url'=>'index.php?r='.$lang['general']['idurl_team'].'&v1=coach_list','class'=>''),
array('level'=>'child','title'=>$lang['general']['referee_list'],'url'=>'index.php?r='.$lang['general']['idurl_member'].'&v1=referee_list','class'=>''),
array('level'=>'parent','title'=>$lang['general']['match_list'],'url'=>'index.php?r='.$lang['general']['idurl_match'],'class'=>''),
array('level'=>'child','title'=>$lang['general']['match_list'],'url'=>'index.php?r='.$lang['general']['idurl_match'].'&v1=match_list','class'=>''),
array('level'=>'child','title'=>$lang['general']['standings'],'url'=>'index.php?r='.$lang['general']['idurl_match'].'&v1=standings','class'=>''),
array('level'=>'child','title'=>$lang['general']['stats_player'],'url'=>'index.php?r='.$lang['general']['idurl_match'].'&v1=stats_player','class'=>''),
array('level'=>'parent','title'=>$lang['general']['competition_list'],'url'=>'index.php?r='.$lang['general']['idurl_competition'].'&v1=competition_list','class'=>''),
//array('order'=>'6.1','title'=>$lang['general']['statistics'],'url'=>'index.php?r='.$lang['general']['idurl_match'].'&v1=statistics','class'=>''),
//array('order'=>'8.0','title'=>$lang['general']['search_member'],'url'=>'index.php?r='.$lang['general']['idurl_member'].'&v1=search_member','class'=>''),
array('level'=>'parent','title'=>$lang['general']['club_list'],'url'=>'index.php?r='.$lang['general']['idurl_club'],'class'=>''),
array('level'=>'parent','title'=>$lang['general']['field_list'],'url'=>'index.php?r='.$lang['general']['idurl_field'],'class'=>''),
array('level'=>'parent','title'=>$lang['general']['forum_list'],'url'=>'index.php?r='.$lang['general']['idurl_forum'],'class'=>'')
);

$website_menu=array();

# we load the menu 
if(file_exists($file) AND $fp=fopen($file, "r") AND filesize($file)!=0) {
	$i=0;
	while (($data = fgetcsv($fp, 1000, ";")) !== FALSE) {
		$website_menu[$i]['level']=$data[0];
		$website_menu[$i]['title']=$data[1];
		$website_menu[$i]['url']=$data[2];
		$website_menu[$i]['class']=$data[3];
		$website_menu[$i]['target']=$data[4];
		$i++;
	}
	fclose($fp);
}
else {
	$website_menu=$default_pages;
}


$k=0;
$i=-1;
foreach($website_menu AS $value) {
	if(!isset($value['target'])) $value['target']='';

	if(!eregi("http",$value['url'])) {
		$value['url']=convert_url($value['url']);
	}
	
	if($value['level']=='parent') {
		$i++;	
		$j=0;
		$index['menu'][$i]=$value;
		$index['menu'][$i]['i']=$k;
		$index['menu'][$i]['submenu']=array();
	}
	else {
		$index['menu'][$i]['submenu'][$j]=$value;
		$index['menu'][$i]['submenu'][$j]['i']=$k;
		$j++;
	}
	$k++;
}




/*
# team of the club
$index['team']=array();
if(CLUB!=0) {
 if(!isset($_SESSION['menu_team'])) {
  $var['condition']="";
  $var['limit']="";
  $var['order']=" ORDER BY e.sex_id, ne.team_name_name ASC";
  $included=1;
  include_once(create_path("team/sql_team.php"));
  include_once(create_path("team/tpl_team.php"));
  include_once(create_path("team/lg_team_".LANG.".php"));
  include(create_path("team/team_list.php"));
  unset($included);
  $_SESSION['menu_team']=$page['team'];
 }
 $index['team']=$_SESSION['menu_team'];
}

#  information pages list
$index['information']=array();
if(!isset($_SESSION['menu_information'])) {
  $var['condition']="";
  $var['limit']="";
  $var['order']="";
  $included=1;
  include_once(create_path("information/sql_information.php"));
  include_once(create_path("information/tpl_information.php"));
  include_once(create_path("information/lg_information_".LANG.".php"));
  include(create_path("information/page_list.php"));
  unset($included);
  $_SESSION['menu_information']=$page['page'];
}
$index['information']=$_SESSION['menu_information'];

# forums list
$index['forum']=array();
if(!isset($_SESSION['menu_forum'])) {
  $var['condition']="";
  $var['limit']="";
  $var['order']="";
  $included=1;
  include_once(create_path("forum/sql_forum.php"));
  include_once(create_path("forum/tpl_forum.php"));
  include_once(create_path("forum/lg_forum_".LANG.".php"));
  include(create_path("forum/forum_list.php"));
  unset($included);
  $_SESSION['menu_forum']=$page['forum'];
}
$index['forum']=$_SESSION['menu_forum'];

# competition list
$index['competition']=array();
if(!isset($_SESSION['menu_competition'])) {
  $var['condition']="";
  $var['limit']="";
  $var['order']="";
  $included=1;
  include_once(create_path("competition/sql_competition.php"));
  include_once(create_path("competition/tpl_competition.php"));
  include_once(create_path("competition/lg_competition_".LANG.".php"));
  include(create_path("competition/competition_list.php"));
  unset($included);
  $_SESSION['menu_competition']=$page['competition'];
}
$index['competition']=$_SESSION['menu_competition'];



# plugins
$index['plugin']=array();
$nb_plugin=sizeof($plugin);
$j=0;
for($i=0; $i< $nb_plugin; $i++)
{
 if($plugin[$i]['active']==1) { 
  $index['plugin'][$j]['name']=$plugin[$i]['name'];
  $index['plugin'][$j]['link']=$plugin[$i]['link'];
  $index['plugin'][$j]['class']=$plugin[$i]['class'];
  $j++;
 }
}

#text
$index['L_home']=$lang['general']['home'];
$index['L_news']=$lang['general']['news'];
$index['L_information']=$lang['general']['information'];
$index['L_member']=$lang['general']['member'];
$index['L_member_list']=$lang['general']['member_list'];
$index['L_player_list']=$lang['general']['player_list'];
$index['L_manager_list']=$lang['general']['manager_list'];
$index['L_coach_list']=$lang['general']['coach_list'];
$index['L_referee_list']=$lang['general']['referee_list'];
$index['L_match']=$lang['general']['match'];
$index['L_match_list']=$lang['general']['match_list'];
$index['L_standings']=$lang['general']['standings'];
$index['L_stats_player']=$lang['general']['stats_player'];
$index['L_competition_list']=$lang['general']['competition_list'];
$index['L_team_list']=$lang['general']['team_list'];
$index['L_statistics']=$lang['general']['statistics'];
$index['L_search_member']=$lang['general']['search_member'];
$index['L_club_list']=$lang['general']['club_list'];
$index['L_view_club']=$lang['general']['view_club'];
$index['L_field_list']=$lang['general']['field_list'];
$index['L_forum_list']=$lang['general']['forum_list'];

*/

# mode club
$index['link_view_club']="";
$index['class_view_club']="";

if(CLUB!=0){
 $index['link_view_club']=convert_url("index.php?r=".$lang['general']['idurl_club']."&v1=view&v2=".CLUB);
 $index['L_club_list']=$lang['general']['club_opponent_list'];  
 $index['L_information']=$lang['general']['the_club'];
 
 if(isset($_GET['r']) AND $_GET['r']==$lang['general']['idurl_club'] AND isset($_GET['v2']) AND $_GET['v2']==CLUB) 
 { 
  $index['class_information']="on";
  $index['class_club']="";
 }
}
?>

fonctions.php


<?php
/*
* phpMySport : website for team sport clubs and leagues
*
* Copyright (C) 2006-2009 Jerome PLACE. All rights reserved.
*
* Email           : djayp [at] users.sourceforge.net
* Website         : http://phpmysport.sourceforge.net
* Version         : 1.4
* Last update     : 4 march 2009
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
*/


/* En récursif */
function parse_template($tpl,$var)
{
 if(!file_exists($tpl))
 {
  # we try with defaut folder
$tpl_defaut=eregi_replace(TPL_URL,ROOT.'/template/defaut/',$tpl);
if(TPL_DOSSIER!='defaut' AND file_exists($tpl_defaut)) {
$tpl=$tpl_defaut;
}
else {
die("Le fichier \"".$tpl."\"n'existe pas - création du template impossible");
}  
 }
 $ligne=file($tpl);


 return parse_html($ligne,$var);
}


function parse_html($code,$var)
{
 $bloc=array();
 $boucle=false;
 $option=false;
 $name_bloc="";
 $name="";
 $name_option="";
 $name_op=array();
 $nb_option=0;
 $html="";
 $affichage=true;


 $size_code=sizeof($code);


 for($i="0";$i<$size_code;$i++)
 {
  $affichage=true;
  // remplacement du path des images 
  if(preg_match("`=\"(\.\.\/)*tpl_image/([-_a-zA-Z0-9\/\{\}]+).([a-zA-Z]{2,3})\"`",$code[$i],$catch)) {   
 if(TPL_DOSSIER!='defaut' AND file_exists(ROOT."/template/".TPL_DOSSIER."/tpl_image/".$catch[2].".".$catch[3])) {   
$code[$i]=eregi_replace("=\"(\.\.\/)*tpl_image/","=\"".ROOT_URL."/template/".TPL_DOSSIER."/tpl_image/",$code[$i]);
 }
 else {
$code[$i]=eregi_replace("=\"(\.\.\/)*tpl_image/","=\"".ROOT_URL."/template/defaut/tpl_image/",$code[$i]);
 }  
  }


  // si on trouve une boucle
  if($boucle==false AND preg_match("<!-- LOOP (\w+) -->",$code[$i],$name_bloc))
  {
    $name=$name_bloc['1'];
    $boucle=true;
    $nb=sizeof($var[$name]);
    $i++;
  }


   // on arrive à la end de la boucle
  if($boucle==true AND preg_match("<!-- END LOOP ".$name." -->",$code[$i]))
  {
    for($j="0";$j<$nb;$j++) // defini le number de bloc a afficher
    {
     $html.=parse_html($bloc[$name],$var[$name][$j]); // recursif
    }
    $boucle=false;
    $bloc=array();
    $affichage=false;
    $code[$i]="";
  }


  /* si on trouve du text optionnel */
  if(preg_match("<!-- OPTION (\w+) -->",$code[$i],$name_option))
  {
   if(isset($var[$name_option['1']]) AND (empty($var[$name_option['1']]) OR $var[$name_option['1']]==NULL))
   {
    array_push($name_op,$name_option['1']);
    $option=true;
$nb_option++; 
   }
   $affichage=false;
  }


  if($option==true)
  {
   if(preg_match("<!-- END OPTION ".$name_op[$nb_option-1]." -->",$code[$i]))
   {
    $code[$i]="";   
array_pop($name_op);
$nb_option--;
if($nb_option==0) { $option=false; }
   }
   $affichage=false;
  }


  // si on est dans une boucle, on enregistre le code dans un bloc
  if($boucle==true)
  {
   $bloc[$name][]=$code[$i];
   $affichage=false;
  }


  if($affichage==true)
  {
   $html.=preg_replace('/\{(\w+)\}/e','\$var[\'\\1\']',$code[$i]);
  }
 }
 return $html;
}


?>

index.php

 


<?php


/*
* phpMySport : website for team sport clubs and leagues
*
* Copyright (C) 2006-2009 Jerome PLACE. All rights reserved.
*
* Email           : djayp [at] users.sourceforge.net
* Website         : http://phpmysport.sourceforge.net
* Version         : 1.4
* Last update     : 4 march 2009
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
*/


if(file_exists("my_code/index.php") AND !isset($included_index)) {
$included_index=1;
include("my_code/index.php");
exit();
}


/****************/
/* PHP SESSIONS */
/****************/
session_start();


/***************************/
/* VARIABLES et CONSTANTES */
/***************************/
define("VERSION_SITE","1.4"); # script version
$page=array();
$index=array();
/***************************/


# create the path of a file
if(!function_exists('create_path')) {
function create_path($file) {
# we check if a customize file exists 
if(file_exists(ROOT."/my_code/".$file)) {
return ROOT."/my_code/".$file;
}
else {
return ROOT."/".$file;
} 
}
}


/*******************/
/* REQUIRED FILES  */
/*******************/
@include_once("include/conf.php");


if(!defined("SITE_OPEN")) define("SITE_OPEN","1");
if(!defined("SITE_TITLE")) define("SITE_TITLE","");
if(!defined("ROOT")) define("ROOT",".");
if(!defined("ROOT_URL")) define("ROOT_URL",".");


if(!defined("CONF_INCLUDED")) { header("location:installation/"); exit(); }
#elseif(SITE_OPEN==0) { $var=""; }
elseif(VERSION_SITE==VERSION && file_exists(ROOT."/installation/index.php"))
{
 header("location:".ROOT_URL."/installation/index.php?lg=".LANG."&r=message"); 
 exit();
}
elseif(VERSION_SITE!=VERSION)
{
 header("location:".ROOT_URL."/installation/index.php?lg=".LANG."&r=update"); 
 exit();
}


require_once(create_path("include/form.php"));
require_once(create_path("include/sgbd.php"));
include_once(create_path("include/fonction.php"));


/* fichiers communs */
/*
require_once(create_path("image/sql_image.php"));
include_once(create_path("include/image.php"));
include_once(create_path("include/search.php"));
*/


/***************************/


/************************/
/* LANGUAGE MANAGEMENT  */
/************************/
if(!@include_once(create_path("include/lg_general_".LANG.".php")))
{
 echo "ERREUR : Language not supported/Langue non supportée";
 exit();
}


setlocale(LC_ALL, $lang['general']['setlocale_parameters']); # define local language
/*************************/




/*************************/
/* TEMPLATES MANAGEMENT  */
/*************************/
include(create_path("include/template.php"));
/*************************/


require_once(create_path("member/sql_member.php"));
require_once(create_path("member/lg_member_".LANG.".php"));


if(isset($_SESSION['session_member_id'])) { define("MEMBER","1",1); define("MEMBER_ID",$_SESSION['session_member_id'],1); }
else { define("MEMBER","0",1); define("MEMBER_ID","0",1); }
/* END SESSIONS */




/* AUTO CONNEXION
si il y a un cookie valid, que le member n'est pas
deja connecte et qu'on est pas deja sur la page de connection,
on redirige vers la page de connection
*/
/*
if(isset($_COOKIE['auto_connection']) AND $_COOKIE['auto_connection']==1
AND (!isset($_SESSION['session_member_id']) OR $_SESSION['session_member_id']==0)
AND (!isset($_GET['v1']) OR $_GET['v1']!="login"))
{
 $url_redirection=convert_url("index.php?lg=".LANG."&s=".SECTION."&r=".$lang['general']['idurl_member']."&v1=login");
 header("location:".$url_redirection);
 exit();
}
*/


/********************************/
/* PLUGIN MANAGEMENT   */
/********************************/
include_once(create_path("plugin/plugin_list.php"));


/********************************/
/* USER RIGHTS AND PERMISSIONS */
/********************************/
include_once(create_path("member/group_right.php"));


/***************************/
/* SIGN IN FORM            */
/***************************/
$index['menu_member']="";
$index['form_connection']="";


if(!isset($_SESSION['session_login']))
{
 include_once(create_path("member/form_connection.php"));
 $index['form_connection']="1";
} 
else
{
 include_once(create_path("member/menu_member.php"));
 $index['menu_member']="1";
}


/****************************/
/* MINI STANDINGS           */
/****************************/
$index['mini_standings']="";
if(!isset($_SESSION['session_mini_standings']) OR empty($_SESSION['session_mini_standings'])) {
if(MS_SHOW!='none') {
include_once(ROOT.'/match/sql_match.php');
include_once(ROOT.'/match/tpl_match.php');
include_once(ROOT.'/match/lg_match_'.LANG.'.php');
$included_mini_standings=1;
include(ROOT.'/match/mini_standings.php');
unset($included_mini_standings);
//$_SESSION['session_mini_standings']=parse_template(TPL_URL.$page['template'],$page);
} 
}


if(MS_SHOW=='all') {
$index['mini_standings']=$_SESSION['session_mini_standings'];
}




/****************************/
/* MENUS                    */
/****************************/
include_once(create_path("menu.php"));


// menu admin
$index['menu_admin']="";


if($right_user['home'] OR $right_user['admin'] OR $right_user['configuration']) {
 include_once(create_path("administration/menu_admin.php"));
 $index['menu_admin']="1";
}


// we check if the site is open
if(SITE_OPEN!=1 AND (!isset($_GET['v1']) OR $_GET['v1']!="login") AND (!isset($_SESSION['session_status']) OR $_SESSION['session_status']<"2"))
{
 $page['L_title']=$lang['general']['site_construction'];
 $affichage=0;
 $page['template']=$tpl['general']['message'];
 $page['L_message']=$lang['general']['site_construction_text'];
 $page['erreur']=array();
}


/********************************/
/* PAGE TO INCLUDE MANAGEMENT   */
/********************************/
/*
Important : l'url de la page est de type : index.php?lg=XX&r=xxxxxx&v1=xxxxx
selon l'url, on regarde dans quelle rubrique on est (variable $_GET['r'])
puis eventuellement dans quelle sous-rubrique  $_GET['v1']
*/


$index['class_home']="";
$index['class_news']="";
$index['class_information']="";
$index['class_club']="";
$index['class_match']="";
$index['class_member']="";
$index['class_image']="";
$index['class_team']="";
$index['class_forum']="";
$index['class_competition']="";
$index['class_field']="";
$index['class_forum']="";


$in_plugin=0;


/* if the page can be included */
if($affichage==1)
{
/* we look at the section (rubrique) */
 if(isset($_GET['r']) AND $_GET['r']!="")
 {
 /* rubrique administration */
 switch($_GET['r']) {
  case $lang['general']['idurl_admin'] : require_once(create_path("administration/include.php")); $index['class_home']='on'; break;
  case $lang['general']['idurl_news'] : require_once(create_path("news/include.php")); $index['class_news']='on'; break;
  case $lang['general']['idurl_information'] : require_once(create_path("information/include.php")); $index['class_information']='on'; break;
  case $lang['general']['idurl_club'] : require_once(create_path("club/include.php")); $index['class_club']='on'; break;
  case $lang['general']['idurl_match'] : require_once(create_path("match/include.php")); $index['class_match']='on'; break;
  case $lang['general']['idurl_member'] : require_once(create_path("member/include.php")); $index['class_member']='on'; break;
  case $lang['general']['idurl_file'] : require_once(create_path("file/include.php")); $index['class_file']=''; break;
  case $lang['general']['idurl_team'] : require_once(create_path("team/include.php")); $index['class_team']='on'; break;
  case $lang['general']['idurl_forum'] : require_once(create_path("forum/include.php")); $index['class_forum']='on'; break;
  case $lang['general']['idurl_competition'] : require_once(create_path("competition/include.php")); $index['class_competition']='on'; break;
  case $lang['general']['idurl_field'] : require_once(create_path("field/include.php")); $index['class_field']='on'; break;
  case $lang['general']['idurl_forum'] : require_once(create_path("forum/include.php")); $index['class_forum']='on'; break;
  case $lang['general']['idurl_file'] : require_once(create_path("file/include.php"));  break;   
  default : 
   # if plugin
   if(in_array($_GET['r'],$plugin_list))
   {
    $key=array_search($_GET['r'], $plugin_list); # we search for the key corresponding to the value 
$plugin[$key]['class']='on';
require_once($plugin[$key]['root']."/include.php");
$in_plugin=1;
   }
   else { require_once(create_path("home.php")); $index['class_home']='on'; }
  }
 }
 else
 {
  require_once(create_path("home.php")); $index['class_home']='on';
 }


 if(CLUB!=0){


  if(isset($_GET['r']) AND $_GET['r']==$lang['general']['idurl_club'] AND isset($_GET['v2']) AND $_GET['v2']==CLUB) 
  { 
   $index['class_information']='on';
   $index['class_club']="";
  }
 }
}
/***************************/






/**********************/
/* Text elements   */
/**********************/
$index['L_realisation']=$lang['general']['realisation'];
$index['L_confirmation']=$lang['general']['confirmation_suppression'];
$index['link_choose_file']=convert_url("index.php?r=".$lang['general']['idurl_file']."&v1=image_manager&fen=pop",0);




/******************************************/
/* META : TITLE, DESCRIPTION AND KEYWORDS */
/******************************************/
/*
we look if there is a title, a description and keywword if the included page.
If there is not, we add the default information 
*/


$index['meta_lang']=LANG;
$index['meta_charset']=$lang['general']['charset'];


/* title */
if(isset($page['meta_title']) AND $page['meta_title']!="") { $index['meta_title']=SITE_TITLE." > ".$page['meta_title']; }
else { $index['meta_title']=SITE_TITLE; }


/* description */
if(isset($page['meta_description']) AND $page['meta_description']!="") { $index['meta_description']=$page['meta_description']; }
else { $index['meta_description']=$lang['general']['meta_description']; }


/* mots cles */
if(isset($page['meta_keyword']) AND $page['meta_keyword']!="") { $index['meta_keyword']=$page['meta_keyword']; }
else { $index['meta_keyword']=$lang['general']['meta_keyword']; }


/* url */
$index['meta_url']=ROOT_URL;
$index['page_url']=ROOT_URL;
if(isset($_SERVER['QUERY_STRING']) AND $_SERVER['QUERY_STRING']!="")
{ $index['page_url']=convert_url("index.php?".$_SERVER['QUERY_STRING']); }


/*****************************************/




/**********************/
/* PAGE MAIN CONTENT  */
/**********************/
/* on cherche si le contenu a un template declare */
/* si ce n'est pas le cas, erreur, sinon on charge le contenu */
if(!isset($page['template']))
{
 $page['template']=$tpl['general']['message'];
 $page['L_message']="Template non trouvé";
 $page['erreur']=array();
}


if($in_plugin==1) { $index['contenu']=parse_template(ROOT."/plugin/".$page['template'],$page); }
else { $index['contenu']=parse_template(TPL_URL.$page['template'],$page); }
/**********************/




/***********************/
/* PAGE CREATION       */
/***********************/
/*
 choix du template principal :
 page normale (par defaut), pop-up ou page pour impression
*/
if(eregi("fen_pop",$_SERVER['QUERY_STRING'])) $page['fen']="pop";
if(eregi("fen_impression",$_SERVER['QUERY_STRING'])) $page['fen']="impression";


if(isset($page['fen']) AND $page['fen']=="pop")
{
 $template=$tpl['general']['pop']; 
 $html_code=parse_template(TPL_URL.$template,$index);
}
elseif(isset($_GET['fen']) AND $_GET['fen']=="pop")
{
 $template=$tpl['general']['pop'];
 $html_code=parse_template(TPL_URL.$template,$index);
}
elseif(isset($page['fen']) AND $page['fen']=="ajax")
{
 $html_code=$index['contenu'];
}
elseif(isset($page['fen']) AND $page['fen']=="impression")
{
 $template=$tpl['general']['imprime'];
 $html_code=parse_template(TPL_URL.$template,$index);
}
else
{
 $template=$tpl['general']['index'];
 $html_code=parse_template(TPL_URL.$template,$index);
}


echo $html_code;


/***********************/
?>

I appreciate your help.

 

Many Thanks, 

TheWelshOne

Edited by TheWelshOne
Link to comment
Share on other sites

the point of programming help forums are to help those who are trying to program. we are not here to read through, find, and fix problems in 700+ lines of code that someone else wrote and isn't supporting. if that's what you need, post in the job offers/freelancing forum section.

 

to get help in the forum section you have posted in, you need to narrow down the problem to just the relevant lines of code where the issue is at, make an attempt at solving the problem, then post your attempt along with any symptoms or errors you got from that attempt. supplying a sample of the input data being use by the specific section of code would be helpful as well.

 

edit: for each of the deprecated errors you are getting, the php.net documentation for those functions provides information about the functions that replace the deprecated ones. 

Link to comment
Share on other sites

To be honest I would advise you to not use that script at all. The last official release was 5 years ago. There are alot of known vulnerabilities for that script which will allow an attacker to easily hack your site, that is reason alone not to use this script.

 

I would advise you to either find a replacement script or to pay a developer to create the site for you.

 

We are not going to go through an abandoned project and fix it for you. 

Link to comment
Share on other sites

Thanks for your replies and your help.

 

By the way I wasn't expecting anybody to re-write me the script or to look through the 700 odd lines of code.

 

I have supplied the website which clearly displays the files and lines at fault and also supplied the files in question.

 

I have stated I do not know PHP and was merely expecting some kind if idea where to start.

 

Thank you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.