[RESOLU] sondage

Eléphant du PHP | 172 Messages

28 nov. 2012, 00:10

Bonjour :D

voilà mon problème lorsque je valide un sondage tout ce passe comme si s'était ok, mais celui-ci n'apparait pas dans la discussion ?

Par avance merci à celui qui pourra m'aiguiller
/*** Ici debute le bloc Sondage ***/
	$fog_smarty->assign('incsondage',$fog_parent['incsondage']);
	if($fog_parent['incsondage']){
		$fog_sondage = $fog_parent['poll'];
		unset($fog_parent['poll']);
		$fog_sondage['valeurs'] = empty($fog_sondage['valeurs'])?array():explode('|',$fog_sondage['valeurs']);
		//Vote
		if($fog_user->valide && ($fog_res & $fog_resbin['POST']) && !FOGIsIn($fog_user->row['id'],$fog_sondage['ontvote'])){
			$fog_sondage_action = 1;
			$fog_smarty->assign('user_can_vote',1);
			if(isset($_GET['fog_sondage_action']) && $_GET['fog_sondage_action'] == 1){
				$fog_sondage['ontvote'] = FOGAddIn($fog_user->row['id'],$fog_sondage['ontvote']);
				if(isset($_POST['fog_sondage_choix'])){
					$fog_sondage['valeurs'][$_POST['fog_sondage_choix']]++;
					$fog_tmp = is_array($fog_sondage['valeurs'])?implode('|',$fog_sondage['valeurs']):$fog_sondage['valeurs'];
					if ($fog_db->query('UPDATE '.FOG_TABLES_PREF.'polls set nbvotants=nbvotants+1,ontvote=\''.$fog_sondage['ontvote'].'\',valeurs=\''.$fog_tmp.'\' where id='.$fog_parentid)){
						$fog_sondage = FOGGetElt($fog_parentid,'polls','nom,date,choix,valeurs,ontvote,nbvotants');
						$fog_sondage['valeurs'] = empty($fog_sondage['valeurs'])?array():explode('|',$fog_sondage['valeurs']);
						$fog_sondage_action = 0;
						$fog_smarty->assign('user_can_vote',0);
					}
					unset($fog_tmp);
				}
			}elseif(isset($_GET['fog_spr']))
				$fog_sondage_action = 0;
		}else $fog_sondage_action = 0;
		//resultats
		if($fog_sondage_action === 0){
			$fog_sondage['percent'] = array();
			for($fog_i=0,$fog_max=count($fog_sondage['valeurs']);$fog_i<$fog_max;$fog_i++)
				$fog_sondage['percent'][$fog_i] = ($fog_sondage['nbvotants'])?(round($fog_sondage['valeurs'][$fog_i]*10000/$fog_sondage['nbvotants'])/100):0;
		}
		$fog_rowtmp = explode('|||',$fog_sondage['choix']);
			$fog_sondage['choix'] = array();
		for($fog_i = 0, $fog_max=(count($fog_rowtmp)-1); $fog_i<$fog_max && $fog_i<$fog_config['maxs4posts'][0];$fog_i++)
			$fog_sondage['choix'][$fog_i] = $fog_rowtmp[$fog_i];
			
		$fog_smarty->assign('sondage_action',$fog_sondage_action);
		$fog_smarty->assign('sondage',$fog_sondage);
		unset($fog_sondage,$fog_sondage_action,$fog_rowtmp);
	}
	/*** Ici termine le bloc Sondage ***/

Eléphant du PHP | 172 Messages

28 nov. 2012, 15:49

Je rajoute que lorsque je veux le visualiser avant de valider, il n'apparait pas non plus :cry:

Eléphant du PHP | 172 Messages

28 nov. 2012, 16:03

Peut-être une piste, tout ce qui est en rapport avec sondage
earch "sondage" (36 hits in 8 files)
  C:\Site mon site\forum\libs\prefilter\show_poll.inc (13 hits)
	Line 3: 03	$this->_replace('poll_results_begin',array(),'{if $sondage_action == 0}',0);
	Line 5: 05	$this->_replace('poll_form_begin',array(),'{if $sondage_action == 1}',0);
	Line 7: 07	$this->_replace('poll_loop_begin',array(),'{section name=choix loop=$sondage.choix}',0);
	Line 11: 11	$this->_replace('$lang.poll_header',array(),'{get_date from=$sondage.date timezone=$fuseauused assign="sondagedate" date=$config.dateformat}{sprintf string=$lang.poll_header args="%sondagedate.date%,%sondage.nbvotants%"}',0);
	Line 11: 11	$this->_replace('$lang.poll_header',array(),'{get_date from=$sondage.date timezone=$fuseauused assign="sondagedate" date=$config.dateformat}{sprintf string=$lang.poll_header args="%sondagedate.date%,%sondage.nbvotants%"}',0);
	Line 11: 11	$this->_replace('$lang.poll_header',array(),'{get_date from=$sondage.date timezone=$fuseauused assign="sondagedate" date=$config.dateformat}{sprintf string=$lang.poll_header args="%sondagedate.date%,%sondage.nbvotants%"}',0);
	Line 11: 11	$this->_replace('$lang.poll_header',array(),'{get_date from=$sondage.date timezone=$fuseauused assign="sondagedate" date=$config.dateformat}{sprintf string=$lang.poll_header args="%sondagedate.date%,%sondage.nbvotants%"}',0);
	Line 12: 12	$this->_replace('$sondage.choix',array(),'<label for="fog_sondage_choix_{$smarty.section.choix.rownum}">{$sondage.choix[choix]}</label>',0);
	Line 12: 12	$this->_replace('$sondage.choix',array(),'<label for="fog_sondage_choix_{$smarty.section.choix.rownum}">{$sondage.choix[choix]}</label>',0);
	Line 12: 12	$this->_replace('$sondage.choix',array(),'<label for="fog_sondage_choix_{$smarty.section.choix.rownum}">{$sondage.choix[choix]}</label>',0);
	Line 33: 33	    array('action'=>'{$fog_url}fog_parentid={$parentid}&fog_s={$start}&fog_sondage_action=1','method'=>'post')
	Line 36: 36	    array('name'=>'fog_sondage_choix'),
	Line 37: 37	    array('value'=>'{math equation="a-b" a=$smarty.section.choix.rownum b=1}','id'=>'fog_sondage_choix_{$smarty.section.choix.rownum}')
  C:\Site mon site\forum\libs\required\lib.get_topics.inc (1 hits)
	Line 49: 			ON T.incsondage=1 AND P2.id = T.id';
  C:\Site mon site\forum\libs\prefilter\nav\posts.inc (1 hits)
	Line 14: $this->_replace('include_poll',array(),'{if $incsondage}{include file="poll.tpl"}{/if}',0);
  C:\Site mon site\forum\libs\prefilter\nav\topic_row.inc (1 hits)
	Line 41: 	'{if !empty($sujet.incsondage)}[{$lang.poll}] {/if}',
  C:\Site mon site\forum\libs\prefilter\edit.inc (3 hits)
	Line 29: $this->_replace('poll_exists_begin',array(),'{if $incsondage}',0);
	Line 63: $this->_replace('$incsondage_checked',array(),'{if $incsondage}checked{/if}',0);
	Line 63: $this->_replace('$incsondage_checked',array(),'{if $incsondage}checked{/if}',0);
  C:\Site mon site\forum\libs\prefilter\forms.inc (2 hits)
	Line 35: 			array('name'=>'fog_sondage_champs'),array(),
	Line 36: 			'{foreach from="$sondage_champs" item="poll_item"}{$poll_item}'."\n".'{/foreach}','',''
  C:\Site mon site\forum\libs\prefilter\post.inc (2 hits)
	Line 64: $this->_replace('$incsondage_checked',array(),'{if $incsondage}checked{/if}',0);
	Line 64: $this->_replace('$incsondage_checked',array(),'{if $incsondage}checked{/if}',0);
  C:\Site mon site\forum\libs\prefilter\XXXXshow_poll.inc (13 hits)
	Line 3: $this->_replace('poll_results_begin',array(),'{if $sondage_action == 0}',0);
	Line 5: $this->_replace('poll_form_begin',array(),'{if $sondage_action == 1}',0);
	Line 7: $this->_replace('poll_loop_begin',array(),'{section name=choix loop=$sondage.choix}',0);
	Line 11: $this->_replace('$lang.poll_header',array(),'{get_date from=$sondage.date timezone=$fuseauused assign="sondagedate" date=$config.dateformat}{sprintf string=$lang.poll_header args="%sondagedate.date%,%sondage.nbvotants%"}',0);
	Line 11: $this->_replace('$lang.poll_header',array(),'{get_date from=$sondage.date timezone=$fuseauused assign="sondagedate" date=$config.dateformat}{sprintf string=$lang.poll_header args="%sondagedate.date%,%sondage.nbvotants%"}',0);
	Line 11: $this->_replace('$lang.poll_header',array(),'{get_date from=$sondage.date timezone=$fuseauused assign="sondagedate" date=$config.dateformat}{sprintf string=$lang.poll_header args="%sondagedate.date%,%sondage.nbvotants%"}',0);
	Line 11: $this->_replace('$lang.poll_header',array(),'{get_date from=$sondage.date timezone=$fuseauused assign="sondagedate" date=$config.dateformat}{sprintf string=$lang.poll_header args="%sondagedate.date%,%sondage.nbvotants%"}',0);
	Line 12: $this->_replace('$sondage.choix',array(),'<label for="fog_sondage_choix_{$smarty.section.choix.rownum}">{$sondage.choix[choix]}</label>',0);
	Line 12: $this->_replace('$sondage.choix',array(),'<label for="fog_sondage_choix_{$smarty.section.choix.rownum}">{$sondage.choix[choix]}</label>',0);
	Line 12: $this->_replace('$sondage.choix',array(),'<label for="fog_sondage_choix_{$smarty.section.choix.rownum}">{$sondage.choix[choix]}</label>',0);
	Line 33: 	array('action'=>'{$fog_url}fog_parentid={$parentid}&fog_s={$start}&fog_sondage_action=1','method'=>'post')
	Line 36: 	array('name'=>'fog_sondage_choix'),
	Line 37: 	array('value'=>'{math equation="a-b" a=$smarty.section.choix.rownum b=1}','id'=>'fog_sondage_choix_{$smarty.section.choix.rownum}')
Search "vote" (10 hits in 3 files)
	Line 83: 	$result = $fog_db->query('SELECT T.lastpost as lastpost_date,T.lastpost_aut,T.lastpost_auth,T.lastpost_im,T.acces,T.options,T.nbviews,T.ispostit,T.moved,T.nbposts,T.id,T.incsondage,
  C:\Site mon site\forum\php\list\bookmarks.php (1 hits)
	Line 40:         $result = $fog_db->query('SELECT DISTINCT(PA.parentid) as dpa,T.lastpost as lastpost_date,T.lastpost_aut,T.lastpost_auth,T.lastpost_im,T.acces,T.forumid,T.options,T.nbviews,T.ispostit,T.moved,T.nbposts,T.id,T.incsondage,
  C:\Site mon site\forum\php\list\my_posts.php (1 hits)
	Line 47:         $result = $fog_db->query('SELECT T.lastpost as lastpost_date,T.lastpost_aut,T.lastpost_auth,T.lastpost_im,T.acces,T.forumid,T.options,T.nbviews,T.ispostit,T.moved,T.nbposts,T.id,T.incsondage,
  C:\Site mon site\forum\php\list\new_posts.php (1 hits)
	Line 40:         $result = $fog_db->query('SELECT T.lastpost as lastpost_date,T.lastpost_aut,T.lastpost_auth,T.lastpost_im,T.acces,T.forumid,T.options,T.nbviews,T.ispostit,T.moved,T.nbposts,T.id,T.incsondage,
  C:\Site mon site\forum\php\list\search.php (1 hits)
	Line 52:         $result = $fog_db->query('SELECT DISTINCT(PA.parentid) as dpa,T.lastpost as lastpost_date,T.lastpost_aut,T.lastpost_auth,T.lastpost_im,T.acces,T.forumid,T.options,T.nbviews,T.ispostit,T.moved,T.nbposts,T.id,T.incsondage,
  C:\Site mon site\forum\php\accueil.php (1 hits)
	Line 59: 		$fog_tfl = 'acces,conditions,suivipar,options,actif,lastpost,ispostit,forumid,nbposts,nbviews,date,incsondage';
  C:\Site mon site\forum\php\edit.php (50 hits)
	Line 45: 			$fog_parent = FOGGetSomeTopics('acces,conditions,options,actif,forumid,nbposts,incsondage,ispostit','',"where T.id='$fog_parentid'",1);
	Line 53:                 $fog_parent = FOGGetSomeTopics('acces,conditions,options,actif,forumid,nbposts,incsondage,ispostit','',"where T.id='$fog_parentid'",1);
	Line 204: 				$fog_sondage_champs = array();
	Line 205: 				$fog_incsondage = $fog_parent['incsondage'];
	Line 205: 				$fog_incsondage = $fog_parent['incsondage'];
	Line 206: 				if($fog_incsondage){
	Line 207: 				 	$fog_sondage = FOGGetElt($fog_parentid,"polls","nom,choix");
	Line 208: 					$fog_sondage_titre = $fog_sondage['nom'];
	Line 208: 					$fog_sondage_titre = $fog_sondage['nom'];
	Line 209: 					$fog_rowtmp = explode("|||",$fog_sondage['choix']);
	Line 211: 						$fog_sondage_champs[$fog_i] = $fog_rowtmp[$fog_i];
	Line 213: 				}else $fog_sondage_titre = '';
	Line 214: 				$fog_smarty->assign('incsondage',$fog_incsondage);
	Line 214: 				$fog_smarty->assign('incsondage',$fog_incsondage);
	Line 215: 				$fog_smarty->assign('sondage_titre',$fog_sondage_titre);
	Line 215: 				$fog_smarty->assign('sondage_titre',$fog_sondage_titre);
	Line 216: 				$fog_smarty->assign('sondage_champs',$fog_sondage_champs);
	Line 216: 				$fog_smarty->assign('sondage_champs',$fog_sondage_champs);
	Line 295: 					$fog_incsondage = isset($_POST['fog_incsondage'])?$_POST['fog_incsondage']:0;
	Line 295: 					$fog_incsondage = isset($_POST['fog_incsondage'])?$_POST['fog_incsondage']:0;
	Line 295: 					$fog_incsondage = isset($_POST['fog_incsondage'])?$_POST['fog_incsondage']:0;
	Line 296: 					if($fog_incsondage==1){
	Line 297: 						$fog_sondage_titre =trim(htmlentities($_POST['fog_sondage_titre']));
	Line 297: 						$fog_sondage_titre =trim(htmlentities($_POST['fog_sondage_titre']));
	Line 298: 						$fog_sondage_champs_string = preg_replace("`\r?\n`",'|||',htmlentities(trim($_POST['fog_sondage_champs']))).'|||';
	Line 298: 						$fog_sondage_champs_string = preg_replace("`\r?\n`",'|||',htmlentities(trim($_POST['fog_sondage_champs']))).'|||';
	Line 299: 						$fog_rowtmp = explode("|||",$fog_sondage_champs_string);
	Line 300: 						$fog_sondage_nb = 0;
	Line 301: 						for($fog_i = 0; $fog_i<(count($fog_rowtmp)-1) && $fog_sondage_nb<$fog_config['maxs4posts'][0];$fog_i++){
	Line 304: 								$fog_sondage_champs[$fog_i] = $fog_rowtmp[$fog_i];
	Line 305: 								$fog_sondage_valeurs.='|';
	Line 306: 								$fog_sondage_nb++;
	Line 309: 						if($fog_sondage_titre === '')
	Line 311: 						if($fog_sondage_nb<2)
	Line 313: 					}elseif($fog_incsondage == 2)
	Line 314:                                                 $fog_incsondage = 0;
	Line 315:                                         elseif(!$fog_incsondage){
	Line 316:                                                 $fog_incsondage = $fog_parent['incsondage'];
	Line 316:                                                 $fog_incsondage = $fog_parent['incsondage'];
	Line 347: 							if($fog_db->query("UPDATE ".FOG_TABLES_PREF."topics SET acces='$fog_acces',conditions='$fog_conditions',options='$fog_selected_lvls',ispostit='$fog_ispostit',incsondage='$fog_incsondage' where id='$fog_parentid'")){
	Line 347: 							if($fog_db->query("UPDATE ".FOG_TABLES_PREF."topics SET acces='$fog_acces',conditions='$fog_conditions',options='$fog_selected_lvls',ispostit='$fog_ispostit',incsondage='$fog_incsondage' where id='$fog_parentid'")){
	Line 359:                                                                                 if($fog_incsondage){
	Line 360:                                                                                         if($fog_parent['incsondage'])
	Line 361: 										                $fog_db->query("UPDATE ".FOG_TABLES_PREF."polls SET nom='$fog_sondage_titre',choix='$fog_sondage_champs_string',date='$fog_time',valeurs='$fog_sondage_valeurs',ontvote='',nbvotants='0' where id='$fog_parentid'");
	Line 361: 										                $fog_db->query("UPDATE ".FOG_TABLES_PREF."polls SET nom='$fog_sondage_titre',choix='$fog_sondage_champs_string',date='$fog_time',valeurs='$fog_sondage_valeurs',ontvote='',nbvotants='0' where id='$fog_parentid'");
	Line 361: 										                $fog_db->query("UPDATE ".FOG_TABLES_PREF."polls SET nom='$fog_sondage_titre',choix='$fog_sondage_champs_string',date='$fog_time',valeurs='$fog_sondage_valeurs',ontvote='',nbvotants='0' where id='$fog_parentid'");
	Line 363:                                                                                                 $fog_db->query("INSERT into ".FOG_TABLES_PREF."polls (nom,date,choix,valeurs,id) values ('$fog_sondage_titre','$fog_time','$fog_sondage_champs_string','$fog_sondage_valeurs','$fog_parentid')");
	Line 363:                                                                                                 $fog_db->query("INSERT into ".FOG_TABLES_PREF."polls (nom,date,choix,valeurs,id) values ('$fog_sondage_titre','$fog_time','$fog_sondage_champs_string','$fog_sondage_valeurs','$fog_parentid')");
	Line 363:                                                                                                 $fog_db->query("INSERT into ".FOG_TABLES_PREF."polls (nom,date,choix,valeurs,id) values ('$fog_sondage_titre','$fog_time','$fog_sondage_champs_string','$fog_sondage_valeurs','$fog_parentid')");
	Line 364:                                                                                 }elseif($fog_parent['incsondage'])
  C:\Site mon site\forum\php\delete.php (3 hits)
	Line 45: 			$fog_parent = FOGGetSomeTopics('acces,conditions,options,actif,forumid,nbposts,incsondage,ispostit','',"where T.id='$fog_parentid'",1);
	Line 53: 		$fog_parent = FOGGetSomeTopics('acces,conditions,options,actif,forumid,nbposts,incsondage,ispostit','',"where T.id='$fog_parentid'",1);
	Line 170: 						if($fog_parent['incsondage'])
  C:\Site mon site\forum\php\post.php (29 hits)
	Line 38:                 $fog_tfl = 'acces,conditions,suivipar,options,actif,lastpost,ispostit,forumid,nbposts,incsondage';
	Line 220:                                 $fog_smarty->assign_by_ref('incsondage',$fog_incsondage);
	Line 220:                                 $fog_smarty->assign_by_ref('incsondage',$fog_incsondage);
	Line 221:                                 $fog_smarty->assign_by_ref('sondage_titre',$fog_sondage_titre);
	Line 221:                                 $fog_smarty->assign_by_ref('sondage_titre',$fog_sondage_titre);
	Line 222:                                 $fog_smarty->assign_by_ref('sondage_champs',$fog_sondage_champs);
	Line 222:                                 $fog_smarty->assign_by_ref('sondage_champs',$fog_sondage_champs);
	Line 224:                                 $fog_sondage_champs = array();
	Line 358:                                         $fog_incsondage = isset($_POST['fog_incsondage'])?1:0;
	Line 358:                                         $fog_incsondage = isset($_POST['fog_incsondage'])?1:0;
	Line 359:                                         if($fog_incsondage){
	Line 360:                                                 $fog_sondage_titre =trim(htmlentities($_POST['fog_sondage_titre']));
	Line 360:                                                 $fog_sondage_titre =trim(htmlentities($_POST['fog_sondage_titre']));
	Line 361:                                                 $fog_sondage_champs_string = preg_replace("`\r?\n`",'|||',htmlentities($_POST['fog_sondage_champs'])).'|||';
	Line 361:                                                 $fog_sondage_champs_string = preg_replace("`\r?\n`",'|||',htmlentities($_POST['fog_sondage_champs'])).'|||';
	Line 362:                                                 $fog_rowtmp = explode("|||",$fog_sondage_champs_string);
	Line 363:                                                 $fog_sondage_nb = 0;
	Line 364:                                                 for($fog_i = 0; $fog_i<(count($fog_rowtmp)-1) && $fog_sondage_nb<$fog_config['maxs4posts'][0];$fog_i++){
	Line 367:                                                                 $fog_sondage_champs[$fog_i] = $fog_rowtmp[$fog_i];
	Line 368:                                                                 $fog_sondage_valeurs.='|';
	Line 369:                                                                 $fog_sondage_nb++;
	Line 372:                                                 if($fog_sondage_titre == "")
	Line 374:                                                 if($fog_sondage_nb < 2)
	Line 405:                                                         if($fog_db->query("INSERT into ".FOG_TABLES_PREF."topics (date,lastpost,acces,conditions,options,forumid,suivipar,ispostit,incsondage,id)  VALUES('$fog_time','$fog_time','$fog_acces','$fog_conditions','$fog_selected_lvls','$fog_forumid','$fog_suivre','$fog_ispostit','$fog_incsondage','0')")){
	Line 405:                                                         if($fog_db->query("INSERT into ".FOG_TABLES_PREF."topics (date,lastpost,acces,conditions,options,forumid,suivipar,ispostit,incsondage,id)  VALUES('$fog_time','$fog_time','$fog_acces','$fog_conditions','$fog_selected_lvls','$fog_forumid','$fog_suivre','$fog_ispostit','$fog_incsondage','0')")){
	Line 419:                                                                         if($fog_incsondage) $fog_db->query("INSERT into ".FOG_TABLES_PREF."polls (nom,date,choix,valeurs,id) values ('$fog_sondage_titre','$fog_time','$fog_sondage_champs_string','$fog_sondage_valeurs','$fog_insertid')");
	Line 419:                                                                         if($fog_incsondage) $fog_db->query("INSERT into ".FOG_TABLES_PREF."polls (nom,date,choix,valeurs,id) values ('$fog_sondage_titre','$fog_time','$fog_sondage_champs_string','$fog_sondage_valeurs','$fog_insertid')");
	Line 419:                                                                         if($fog_incsondage) $fog_db->query("INSERT into ".FOG_TABLES_PREF."polls (nom,date,choix,valeurs,id) values ('$fog_sondage_titre','$fog_time','$fog_sondage_champs_string','$fog_sondage_valeurs','$fog_insertid')");
	Line 419:                                                                         if($fog_incsondage) $fog_db->query("INSERT into ".FOG_TABLES_PREF."polls (nom,date,choix,valeurs,id) values ('$fog_sondage_titre','$fog_time','$fog_sondage_champs_string','$fog_sondage_valeurs','$fog_insertid')");
  C:\Site mon site\forum\lang\francais\admin.php (2 hits)
	Line 61: $fog_lang['max_poll_fields'] = 'Nombre maximum de choix par sondage';
	Line 62: $fog_lang['help']['max_poll_fields'] = '(La valeur 0 désactive les sondages)';
  C:\Site mon site\forum\lang\francais\edit.php (2 hits)
	Line 11: $fog_lang['polltitle_empty'] = 'Vous devez renseigner le titre du sondage<br />';
	Line 12: $fog_lang['poll_notenoughchoices'] = 'Le sondage doit comporter au moins deux choix<br />';
  C:\Site mon site\forum\lang\francais\global.php (6 hits)
	Line 146: $fog_lang['inc_poll'] = 'Inclure un sondage à votre message';
	Line 162: $fog_lang['poll'] = 'Sondage';
	Line 168: $fog_lang['poll_title'] = 'Sujet du sondage';
	Line 179: $fog_lang['about_poll'] = 'En ce qui concerne le sondage';
	Line 211: $fog_lang['avg']['poll'] = 'Par sondage';
	Line 253: $fog_lang['polls'] = 'Sondages';
  C:\Site mon site\forum\lang\francais\post.php (2 hits)
	Line 18: $fog_lang['polltitle_empty'] = 'Vous devez renseigner le titre du sondage<br />';
	Line 19: $fog_lang['poll_notenoughchoices'] = 'Le sondage doit comporter au moins deux choix<br />';

Avatar du membre
Mammouth du PHP | 1609 Messages

28 nov. 2012, 16:45

Y a rien qui me saute aux yeux en regardant viteuf. Il va falloir que tu cherches par tes propres moyens je crois.
Fait des echo dans les différentes alternatives de tes if pour vérifier que ça passe bien la où c'est sensé passer et utilise print_r et echo pour vérifier le contenu de tes variables au besoin.
En procédant ainsi tu devrais pouvoir debuguer ça.
Développeur web depuis + de 20 ans

Eléphant du PHP | 172 Messages

28 nov. 2012, 22:40

Bonjour saïan j'ai installé Easy PHP et interprêté le code de post.php

Code interprété par le serveur et envoyée au navigateur

Notice: Use of undefined constant FOG_DIR - assumed 'FOG_DIR' in C:\Program Files (x86)\EasyPHP-12.1\home\codesource.php on line 30

Warning: include(FOG_DIRlibs/required/lib.process_posts.inc): failed to open stream: No such file or directory in C:\Program Files (x86)\EasyPHP-12.1\home\codesource.php on line 30

Warning: include(): Failed opening 'FOG_DIRlibs/required/lib.process_posts.inc' for inclusion (include_path='.;C:\php\pear') in C:\Program Files (x86)\EasyPHP-12.1\home\codesource.php on line 30

Fatal error: Call to undefined function FOGChopeSmileys() in C:\Program Files (x86)\EasyPHP-12.1\home\codesource.php on line 33

les lignes en question :

///----ligne 30---///
 include FOG_DIR.'libs/required/lib.process_posts.inc';
///----ligne33----///
$fog_icons = FOGChopeSmileys('isicon',0);

Pour ce que tu me demande (utilise print_r et echo) , mon site est installé avec FileZilla sur mon hébergeur alors ?

Avatar du membre
Modérateur PHPfrance
Modérateur PHPfrance | 8758 Messages

28 nov. 2012, 22:58

salut,

c'est clair dans le message : la constante FOG_DIR n'existe pas, il doit te manquer une inclusion avant non ?


@+
Il en faut peu pour être heureux ......

Eléphant du PHP | 172 Messages

28 nov. 2012, 23:46

salut,

c'est clair dans le message : la constante FOG_DIR n'existe pas, il doit te manquer une inclusion avant non ?


@+

merci de ma répondre moogli, :D

je ne crois pas que l'erreur vient de là. Pour règler tous mes problèmes sur mon pc j'installe le forum avec EasyPHP et je n'arrive pas à installer des erreurs à l'install que je n'ai pas rencontré en hébergeant .

Notice: Only variable references should be returned by reference in C:\essai_forum\libs\db\db.mysql.inc on line 37
Les informations actuelles ne permettent pas de se connecter
return false;
Warning: mysql_error() expects parameter 1 to be resource, boolean given in C:\essai_forum\libs\db\db.mysql.inc on line 78
  return mysql_error($id);
J'ai voulu tester le code, mais peut-être que l'on ne peux pas tester une page php tant que l'ensemble du site ne soit installé?

Bonne fin de soirée

Avatar du membre
Modérateur PHPfrance
Modérateur PHPfrance | 8758 Messages

29 nov. 2012, 15:37

Sans le code on ne peux pas t'aider, mais ce type d'erreur le fait penser a :
- du code php4 exécuté avec php5
- une différence au niveau de l'affichage des erreurs

Pour vérifier affiche un phpinfo(); être garde la version ainsi que le paramètre error_reporting en local et en ligne.

Dans tous les cas il faut dvelopper avec error_reporting =E_ALL.
Et corriger les erreurs dans ce sens.

Le message d'erreur que tu indique dans ton dernier post indique la tentative d'un passage par référence foireux (utilisation de & sur une variable en paramètres ou quelque chose du genre. Ceci n'êtes plus utilisable depuis php 5 (passage par référence implicite).


@+
Il en faut peu pour être heureux ......

Eléphant du PHP | 172 Messages

05 déc. 2012, 16:16

Bonjour moogli,
Pour le code il est vrai qu'il n'est pas d'aujourd'hui , voir http://www.phpkode.com/folder/p/fog-for ... rd-engine/Mais comme j'ai installé ce forum et qu'il fonctionne hormis la fonction sondage que j'ai désactivé et quelques erreurs rapportés par le fichier log, j'essaie au mieux de règler les problèmes avec votre aide, car pas évident.


dernière erreur :

ERROR : PHP Warning : mysql_connect() [function.mysql-connect]: Connection timed out /htdocs/forum/libs/db/db.mysql.inc#34

 {
     //==34===//           $id = mysql_connect($srv,$login,$pass);
                if($id === false)return false;
                if (!mysql_select_db($bdd,$id))
                	return false;
                return $id;
        }


Avatar du membre
Modérateur PHPfrance
Modérateur PHPfrance | 8758 Messages

05 déc. 2012, 20:16

Connection timed out : le serveur mysql ne répond pas.

- l'url est bonne ?
- le port est bon ?


Pour ce qui est du code, n’existe-il pas simplement une version plus as jour ?

Le fait d'utiliser des méthodes de codes obsolètes c'est une chose, mais il y a aussi le fiat d'utiliser des fonctions obsolètes qui finissent par rendre ton code HS.

tu ne fait, ici, que des rustines et les rustines ça ne tiens qu'un temps ;)

par exemple il est préférable d'utiliser mysqli plutôt que mysql, les fonctions sont, globalement, toute les mêmes.


@+
Il en faut peu pour être heureux ......

Eléphant du PHP | 172 Messages

06 déc. 2012, 00:38

Bonjour moogli, car à l'heure ou je poste je pense que tu est couché :P

Pour te répondre oui l'URL est bonne ainsi que le port je ne vois pas pourquoi cette erreur est générée.

autre erreur

Code interprété par le serveur et envoyée au navigateur

Notice: Undefined variable: email in C:\Program Files (x86)\EasyPHP-12.1\home\codesource.php on line 2

Warning: preg_match(): Unknown modifier '_' in C:\Program Files (x86)\EasyPHP-12.1\home\codesource.php on line 2
return preg_match('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$',$email);

Eléphant du PHP | 172 Messages

07 déc. 2012, 15:08

Bonjour moogli, car à l'heure ou je poste je pense que tu est couché :P

Pour te répondre oui l'URL est bonne ainsi que le port je ne vois pas pourquoi cette erreur est générée.

autre erreur

Code interprété par le serveur et envoyée au navigateur

Notice: Undefined variable: email in C:\Program Files (x86)\EasyPHP-12.1\home\codesource.php on line 2

Warning: preg_match(): Unknown modifier '_' in C:\Program Files (x86)\EasyPHP-12.1\home\codesource.php on line 2
return preg_match('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$',$email);

erreur résolu en changeant le script:
function FOGIsEmailValid($var) // fonction qui verifie si le mail est correct et si le champs est vide
{
   $code_syntaxe='#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#'; // chargement de la syntaxe mail valide  
      if(preg_match($code_syntaxe,$var)){ // compare la syntaxe mail valide au mail saisie
        return $var;
      }   

Eléphant du PHP | 172 Messages

09 janv. 2013, 15:00

Bonjour et meilleurs Voeux :D .
J'ai finalement règlé ce problème en installant un nouveau forum sur mon PC, ensuite j'ai envoyé au serveur les templates_c de la nouvelle install et tout est OK

Merci