Jump to content
La fin ?! Elle est là ! ×
×
×
  • Create New...
  • 0

mcms starpass


alexis59103
 Share

Question

Bonjour,J'installe mcms dofus avec starpass j' ai changer les fichier shop.php et points.php quand je m' ai le code je tombe sur une page d'erreur j'ai suivie le conseil sur ce lienmodifier mCMS.php dans config changer les idd et idp, changer la ligne dans points.php et j'ai une erreur merci pour l'aide que vous pouvez m'apporter.

 Veuillez activer le Javascript de votre navigateur s'il vous plaît.
Micropaiement StarPass                                        

Link to comment
Share on other sites

  • Answers 6
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

6 answers to this question

Recommended Posts

  • 0

je poste le code de shop.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Shop extends CI_Controller 
{
private $_emulator;

public function __construct()
{
	parent::__construct();

	$this->load->config('mCMS');

	$this->load->library('session');
	$this->load->library('cache');

	$this->load->database('default');

	$this->load->helper('url');

	$this->_emulator = $this->load->library($this->config->item('emulator'));

	$this->_boutique = $this->load->library('Shop');

	$this->style = $this->config->item('style');
}

public function index()
{
	redirect('shop/menu');
}

public function menu()
{
	if($this->session->userdata('logged_in'))
	{
		$data = array(	'site_title'			=> $this->config->item('title'),
						'navigation_header'		=> $this->_emulator->GetNavigation('header'),
						'navigation_menu'		=> $this->_emulator->GetNavigation('menu'),
						'status'				=> $this->_emulator->GetStatusInfos());

		$this->parser->parse(''.$this->style.'/shop_menu', $data);
	}
	else
	{
		$this->common->_display();
	}
}

public function liste($categorie = NULL)
{
	if($this->session->userdata('logged_in'))
	{
		if($categorie == 'kamas')
		{
			$data = array(	'site_title'			=> $this->config->item('title'),
							'navigation_header'		=> $this->_emulator->GetNavigation('header'),
							'navigation_menu'		=> $this->_emulator->GetNavigation('menu'),
							'status'				=> $this->_emulator->GetStatusInfos());

			$this->parser->parse(''.$this->style.'/shop_kamas', $data);
		}
		elseif($categorie == 'titre')
		{
			$data = array(	'site_title'			=> $this->config->item('title'),
							'navigation_header'		=> $this->_emulator->GetNavigation('header'),
							'navigation_menu'		=> $this->_emulator->GetNavigation('menu'),
							'status'				=> $this->_emulator->GetStatusInfos());

			$this->parser->parse(''.$this->style.'/shop_title', $data);
		}
		elseif($categorie == 'armes')
		{
			$data = array(	'site_title'			=> $this->config->item('title'),
							'navigation_header'		=> $this->_emulator->GetNavigation('header'),
							'navigation_menu'		=> $this->_emulator->GetNavigation('menu'),
							'status'				=> $this->_emulator->GetStatusInfos());

			$this->parser->parse(''.$this->style.'/shop_menu_armes', $data);
		}
		else
		{
			$data = array(	'site_title'			=> $this->config->item('title'),
							'navigation_header'		=> $this->_emulator->GetNavigation('header'),
							'navigation_menu'		=> $this->_emulator->GetNavigation('menu'),
							'status'				=> $this->_emulator->GetStatusInfos(),
							'items_liste'			=> $this->_boutique->liste($categorie));

			$this->parser->parse(''.$this->style.'/shop_liste', $data);
		}
	}
	else
	{
		$this->common->_display();
	}
}

public function action($Obj)
{
	if($this->session->userdata('logged_in'))
	{
		if(isset($Obj) && $Obj != '')
		{
			if($this->input->post('player') != '' && $this->input->post('player') != 0 && is_numeric($this->input->post('player')))
			{
				$this->db->select('account');
				$this->db->where('guid', $this->input->post('player'));
				$Player = $this->db->get('personnages')->result_array();

				if($Player[0]['account'] == $this->session->userdata('id'))
				{
					$this->_boutique->AccountId = $this->session->userdata('id');
					$this->_boutique->PlayerId = $this->input->post('player');
					$this->_boutique->BuyObj($Obj);
				}
				else
				{
					$this->common->_display("Vous devez sélectionner l'un de vos personnages.");
				}
			}
			else
			{
				$this->common->_display("Aucun personnage séléctioné.");
			}
		}
		else
		{
			$this->common->_display("Aucun objet séléctioné.");
		}
	}
	else
	{
		$this->common->_display();
	}
}

public function selectPlayer($Obj)
{
	if($this->session->userdata('logged_in'))
	{
		$data = array(	'site_title'			=> $this->config->item('title'),
						'navigation_header'		=> $this->_emulator->GetNavigation('header'),
						'navigation_menu'		=> $this->_emulator->GetNavigation('menu'),
						'status'				=> $this->_emulator->GetStatusInfos(),
						'player'				=> $this->_emulator->GetAccountCharacters($this->session->userdata('id')),
						'objet'					=> $Obj);

		$this->parser->parse(''.$this->style.'/shop_select_player', $data);
	}
	else
	{
		$this->common->_display();
	}
}

public function points()
{
	if($this->session->userdata('logged_in'))
	{
		$data = array(	'site_title'			=> $this->config->item('title'),
						'starpass_idd'			=> $this->config->item('starpass_idd'),
						'points_achat'			=> $this->config->item('points_achat'),
						'navigation_header'		=> $this->_emulator->GetNavigation('header'),
						'navigation_menu'		=> $this->_emulator->GetNavigation('menu'),
						'status'				=> $this->_emulator->GetStatusInfos());

		$this->parser->parse(''.$this->style.'/points', $data);
	}
	else
	{
		$this->common->_display();
	}
}

public function points_check()
{
	if($this->session->userdata('logged_in'))
	{
		$ident=$idp=$ids=$idd=$codes=$code1=$code2=$code3=$code4=$code5=$datas='';
   		$idp = $this->config->item('starpass_idp');
		$idd = $this->config->item('starpass_idd');

           $ident=$idp.";".$ids.";".$idd;
           // On récupère le(s) code(s) sous la forme 'xxxxxxxx;xxxxxxxx'
           if(isset($_POST['code1'])) $code1 = $_POST['code1'];
           if(isset($_POST['code2'])) $code2 = ";".$_POST['code2'];
           if(isset($_POST['code3'])) $code3 = ";".$_POST['code3'];
           if(isset($_POST['code4'])) $code4 = ";".$_POST['code4'];
           if(isset($_POST['code5'])) $code5 = ";".$_POST['code5'];
           $codes=$code1.$code2.$code3.$code4.$code5;
           // On récupère le champ DATAS
           if(isset($_POST['DATAS'])) $datas = $_POST['DATAS'];
           // On encode les trois chaines en URL
           $ident=urlencode($ident);
           $codes=urlencode($codes);
           $datas=urlencode($datas);

           /* Envoi de la requête vers le serveur StarPass
           Dans la variable tab[0] on récupère la réponse du serveur
           Dans la variable tab[1] on récupère l'URL d'accès ou d'erreur suivant la réponse du serveur */
           [email protected]("http://script.starpass.fr/check_php.php?ident=$ident&codes=$codes&DATAS=$datas");

           if(!$get_f)
           {
               $this->common->_display("Le site n'a pas accès au serveur de Starpass, merci de réessayer ulterieurement.");
               return;
           }
           $tab = explode("|",$get_f[0]);

           if(!$tab[1]) $url = "http://script.starpass.fr/erreur.php";
           else $url = $tab[1];

           // dans $pays on a le pays de l'offre. exemple "fr"
           $pays = $tab[2];
           // dans $palier on a le palier de l'offre. exemple "Plus A"
           $palier = urldecode($tab[3]);
           // dans $id_palier on a l'identifiant de l'offre
           $id_palier = urldecode($tab[4]);
           // dans $type on a le type de l'offre. exemple "sms", "audiotel, "cb", etc.
           $type = urldecode($tab[5]);
           // vous pouvez à tout moment consulter la liste des paliers à l'adresse : http://script.starpass.fr/palier.php

           // Si $tab[0] ne répond pas "OUI" l'accès est refusé
           // On redirige sur l'URL d'erreur
           if(substr($tab[0],0,3) != "OUI")
           {
               header("Location: $url");
               exit;
           }
           else
           {
			$pays = $tab[2];
			$type = urldecode($tab[5]);
			$palier = urldecode($tab[3]);
			$palier_id = urldecode($tab[4]);

			$pointsNew = $this->session->userdata('points') + ($this->session->userdata('VIP') == 1 ? $this->config->item('points_vip_achat') : $this->config->item('points_achat'));

			$data = array(	'AccountId' 	=> $this->session->userdata('id'),
							'IP'			=> $this->input->ip_address(),
							'code' 			=> $codes,
							'pays' 			=> $pays,
							'type' 			=> $type,
							'palier' 		=> $palier,
							'palier_id' 	=> $palier_id,
							'pointsOld' 	=> $this->session->userdata('points'),
							'pointsNew' 	=> $pointsNew,
							'pointsRecv' 	=> ($this->session->userdata('VIP') == 1 ? $this->config->item('points_vip_achat') : $this->config->item('points_achat')));

			$this->db->insert('points', $data);

			$this->db->where('guid', $this->session->userdata('id'));
			$this->db->update('accounts', array('points' => $pointsNew));

			$this->session->set_userdata(array('points' => $pointsNew));

			$this->common->_display("Vous avez reçus vos ".($this->session->userdata('VIP') == 1 ? $this->config->item('points_vip_achat') : $this->config->item('points_achat'))." points -  Retour.", "Achat de points terminé", "succes");
           }
	}
	else
	{
		$this->common->_display();
	}
}

public function points_checkOLD()
{
	if($this->session->userdata('logged_in'))
	{
		$idp = $this->config->item('starpass_idp');
		$idd = $this->config->item('starpass_idd');

		$ident = $idp.";;".$idd;

		$codes = $this->input->post('code');

		if(isset($codes[1]) && $codes[1] != '')
		{
			$ident = urlencode($ident);
			$codes = urlencode($codes[1]);

			$file = @file("http://script.starpass.fr/check_php.php?ident=$ident&codes=$codes&DATAS=");

			if($file)
			{
				$exp = explode("|", $file[0]);

				if(substr($exp[0],0,3) == "OUI")
				{
					$pays = $exp[2];
					$type = urldecode($exp[5]);
					$palier = urldecode($exp[3]);
					$palier_id = urldecode($exp[4]);

					$pointsNew = $this->session->userdata('points') + ($this->session->userdata('VIP') == 1 ? $this->config->item('points_vip_achat') : $this->config->item('points_achat'));

					$data = array(	'AccountId' 	=> $this->session->userdata('id'),
									'IP'			=> $this->input->ip_address(),
									'code' 			=> $codes,
									'pays' 			=> $pays,
									'type' 			=> $type,
									'palier' 		=> $palier,
									'palier_id' 	=> $palier_id,
									'pointsOld' 	=> $this->session->userdata('points'),
									'pointsNew' 	=> $pointsNew,
									'pointsRecv' 	=> ($this->session->userdata('VIP') == 1 ? $this->config->item('points_vip_achat') : $this->config->item('points_achat')));

					$this->db->insert('points', $data);

					$this->db->where('guid', $this->session->userdata('id'));
					$this->db->update('accounts', array('points' => $pointsNew));

					$this->session->set_userdata(array('points' => $pointsNew));

					$this->common->_display("Vous avez reçus vos ".($this->session->userdata('VIP') == 1 ? $this->config->item('points_vip_achat') : $this->config->item('points_achat'))." points -  Retour.", "Achat de points terminé", "succes");
				}
				else
				{
					$this->common->_display("Le code indiqué n'est pas correcte.");
				}
			}
			else
			{
				$this->common->_display("Le site n'a pas accès au serveur de Starpass, merci de réessayer ulterieurement.");
			}
		}
		else
		{
			$this->common->_display("Aucun code n'est indiqué");
		}
	}
	else
	{
		$this->common->_display();
	}
}

public function vip()
{
	if($this->session->userdata('logged_in'))
	{
		$data = array(	'site_title'			=> $this->config->item('title'),
						'navigation_header'		=> $this->_emulator->GetNavigation('header'),
						'navigation_menu'		=> $this->_emulator->GetNavigation('menu'),
						'status'				=> $this->_emulator->GetStatusInfos());

		$this->parser->parse(''.$this->style.'/vip', $data);
	}
	else
	{
		$this->common->_display();
	}
}

public function get_vip()
{
	if($this->session->userdata('logged_in'))
	{
		if($this->session->userdata('VIP') == 0)
		{
			if($this->session->userdata('points') >= $this->config->item('cost_vip'))
			{
				$Solde = $this->session->userdata('points') - $this->config->item('cost_vip');

				$this->session->set_userdata(array('VIP' => 1, 'points' => $Solde));

				$this->db->where('guid', $this->session->userdata('id'));
				$this->db->update('accounts', array('vip' => 1, 'points' => $Solde));

				$data = array(	'AccountId'	=> $this->session->userdata('id'),
								'PlayerId' 	=> 0,
								'Type' 		=> 'vip',
								'Value' 	=> 1,
								'Cost' 		=> $this->config->item('cost_vip'),
								'IP' 		=> $this->input->ip_address());

				$this->db->insert('achats', $data);

				$this->common->_display("Vous êtes maintenant VIP.", "Achat terminé", "succes");
			}
			else
			{
				$this->common->_display("Vous n'avez pas assé de points.");
			}
		}
		else
		{
			$this->common->_display("Vous êtes déjà VIP", "Information", "infos");
		}
	}
	else
	{
		$this->common->_display();
	}
}

public function prestige()
{
	if($this->session->userdata('logged_in'))
	{
		$data = array(	'site_title'			=> $this->config->item('title'),
						'navigation_header'		=> $this->_emulator->GetNavigation('header'),
						'navigation_menu'		=> $this->_emulator->GetNavigation('menu'),
						'status'				=> $this->_emulator->GetStatusInfos(),
						'player'				=> $this->_emulator->GetAccountCharacters($this->session->userdata('id')));

		$this->parser->parse(''.$this->style.'/prestige', $data);
	}
	else
	{
		$this->common->_display();
	}
}

public function prestige_action()
{
	if($this->session->userdata('logged_in'))
	{
		if($this->input->post('player') != '' && $this->input->post('player') != 0 && is_numeric($this->input->post('player')))
		{
			$this->db->select('account, guid, level, prestige');
			$this->db->where('guid', $this->input->post('player'));
			$Player = $this->db->get('personnages')->result_array();

			if($Player[0]['account'] == $this->session->userdata('id'))
			{
				if($Player[0]['level'] >= 300)
				{
					if($Player[0]['prestige'] < 10)
					{
						if($this->session->userdata('points') >= $this->config->item('cost_prestige'))
						{
							$Solde = $this->session->userdata('points') - $this->config->item('cost_prestige');

							$this->_boutique->AccountId = $this->session->userdata('id');
							$this->_boutique->PlayerId = $this->input->post('player');

							$prestige = $Player[0]['prestige'] + 1;

							switch($prestige)
							{
								case 1:
									$title = 56;
									break;
								case 2:
									$title = 57;
									break;
								case 3:
									$title = 58;
									break;
								case 4:
									$title = 59;
									break;
								case 5:
									$title = 60;
									break;
								case 6:
									$title = 61;
									break;
								case 7:
									$title = 62;
									break;
								case 8:
									$title = 63;
									break;
								case 9:
									$title = 64;
									break;
								case 10:
									$title = 65;
									break;
								default:
									$title = 0;
									break;
							}

							if($this->_boutique->RecvTitle($title))
							{
								$this->db->where('guid', $Player[0]['guid']);
								$this->db->update('personnages', array('level' => 101, 'prestige' => $prestige, 'xp' => 99823000));

								$this->db->where('guid', $this->session->userdata('id'));
								$this->db->update('accounts', array('points' => $Solde));

								$this->session->set_userdata(array('VIP' => 1, 'points' => $Solde));

								$data = array(	'AccountId'	=> $this->session->userdata('id'),
												'PlayerId' 	=> 0,
												'Type' 		=> 'prestige',
												'Value' 	=> $prestige,
												'Cost' 		=> $this->config->item('cost_prestige'),
												'IP' 		=> $this->input->ip_address());

								$this->db->insert('achats', $data);

								$this->common->_display("Votre personnage est maintenant Prestige {$prestige}.", "Achat terminé", "succes");
							}
							else
							{
								$this->common->_display();
							}
						}
						else
						{
							$this->common->_display("Vous n'avez pas assé de points.");
						}
					}
					else
					{
						$this->common->_display("Votre personnage est déjà atteint le niveau Prestige maximum.");
					}
				}
				else
				{
					$this->common->_display("Votre personnage n'est pas niveau 300.");
				}
			}
			else
			{
				$this->common->_display("Vous devez sélectionner l'un de vos personnages.");
			}
		}
		else
		{
			$this->common->_display("Aucun personnage séléctioné.");
		}
	}
	else
	{
		$this->common->_display();
	}
}
}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



Important Information

Terms of Use / Privacy Policy / Guidelines / 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.