Plugin Directory

Changeset 1556990


Ignore:
Timestamp:
12/18/2016 04:14:37 PM (9 years ago)
Author:
fensoft
Message:

Better default design for token buyout

Location:
fenshop/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • fenshop/trunk/FenShop.php

    r1556967 r1556990  
    158158      }
    159159    }
     160   
     161    if (preg_match_all("/[{]FenShop:currency[}]/s", $content, $matches)) {
     162      foreach ($matches[0] as $id => $match) {
     163        $fenshop_info = self::getInfo();
     164        $content = str_replace($matches[0][$id], $fenshop_info->devises_text->credits, $content);
     165      }
     166    }
    160167
    161168    if (preg_match_all("/<!--[{]FenShop:history_begin:([^:]*):([^:]*)}-->(.*)<!--[{]FenShop:history_end[}]-->/sU", $content, $matches)) {
     
    313320            foreach ($matches_line as $id_line => $match_line)
    314321              $line = str_replace($matches_line[0][$id], $buyout->gain, $line);
     322          if (preg_match_all("/[{]FenShop:buy:cost[}]/s", $line, $matches_line))
     323            foreach ($matches_line as $id_line => $match_line)
     324              $line = str_replace($matches_line[0][$id], $buyout->cost, $line);
    315325          if (preg_match_all("/[{]FenShop:buy:link[}]/s", $line, $matches_line))
    316326            foreach ($matches_line as $id_line => $match_line)
     
    347357    }
    348358
     359    if (preg_match_all("/[{]FenShop:buy:cost[}]/", $content, $matches)) {
     360      $fenshop_buyoutlist = self::getBuyoutList();
     361      foreach ($matches[0] as $id => $match) {
     362        $content = str_replace($matches[0][$id], $fenshop_buyoutlist[FenSession::get("id")]->cost, $content);
     363      }
     364    }
     365
     366    if (preg_match_all("/[{]FenShop:buy:gain[}]/", $content, $matches)) {
     367      $fenshop_buyoutlist = self::getBuyoutList();
     368      foreach ($matches[0] as $id => $match) {
     369        $content = str_replace($matches[0][$id], $fenshop_buyoutlist[FenSession::get("id")]->gain, $content);
     370      }
     371    }
     372
    349373    if (preg_match_all("/[{]FenShop:buy:description[}]/", $content, $matches)) {
    350374      $fenshop_buyoutlist = self::getBuyoutList();
     
    393417      foreach ($matches[0] as $id => $match) {
    394418        $fenshop_validate = self::getValidate();
    395         if ($fenshop_validate->status == "ok")
     419        if ($fenshop_validate->status == "OK" || $fenshop_validate->status == "ok")
    396420          $content = str_replace($matches[0][$id], $matches[1][$id], $content);
    397421        else
     
    616640                 'vote_validation' => 'Vote: Page de validation'/*,
    617641                 'auth'            => 'Page d\'authentification'*/);
    618     if (!$options["auth"]) {
     642    if ($options["auth"]) {
    619643      unset($res['buy_pseudo']);
    620644      unset($res['use_pseudo']);
  • fenshop/trunk/assets/buy_choice.txt

    r1556967 r1556990  
    88        <span class="dynamic-px-width">
    99          <div style="font-weight: bold; font-variant: small-caps; text-align: center; font-size: 2em;">{FenShop:buy:gain} tokens</div>
     10          <div style="text-align: center; border-top: 1px solid #ddd">{FenShop:buy:cost}</div>
    1011          <div style="padding-top: 20px; text-align: center; border-top: 1px solid #ddd">{FenShop:buy:desc}</div>
    1112          <div style="padding-bottom: 10px; text-align: center;"><img style="height: 32px;" src="{FenShop:buy:icon}"/></div>
  • fenshop/trunk/assets/buy_paiement.txt

    r1539943 r1556990  
    1 Bonjour {FenShop:nick}, vous avez {FenShop:tokens} tokens
     1<center>
     2<img src="https://minotar.net/avatar/{FenShop:nick}/68"><br/>
     3{FenShop:nick}<br/>
     4{FenShop:tokens} tokens<br/>
     5<br/>
     6<b>Récapitulatif de votre achat :</b><br/>
     7{FenShop:buy:gain} {FenShop:currency} .................... {FenShop:buy:cost} <br/>
     8<br/>
     9<b>Clique ci-dessous pour payer et valider ton achat :</b><br/>
    210{FenShop:buy:payment}
     11</center>
  • fenshop/trunk/assets/buy_pseudo.txt

    r1539943 r1556990  
    1 <form action="{FenShop:buy:link_buy}" method="post">
    2 <input type="text" name="FenShop_nick" value="{FenShop:nick}"/>
    3 <input type="submit" value="Valider">
     1<center>
     2<b>Bienvenue sur notre boutique.</b><br/>
     3Pour commencer, veuillez renseigner votre pseudo ci-dessous.<br/>
     4<br/>
     5<form action="{FenShop:buy:link_buy}" method="post">
     6<input style="width: 20em;" type="text" name="FenShop_nick" value="{FenShop:nick}"/><br/>
     7<input style="width: 23em;" type="submit" value="Continuer">
    48</form>
     9</center>
  • fenshop/trunk/assets/buy_summary.txt

    r1545343 r1556990  
    11Vous êtes connecté en tant que {FenShop:nick}.<br/>
    22Vous avez {FenShop:tokens} tokens.<br/>
    3 Vous allez acheter {FenShop:buy:type} pour {FenShop:buy:gain} tokens.<br/>
     3Vous allez acheter {FenShop:buy:type} pour {FenShop:buy:gain} {FenShop:currency}.<br/>
    44Description:<br/>
    55{FenShop:buy:description}
  • fenshop/trunk/assets/buy_validation.txt

    r1539943 r1556990  
    1 {FenShop:buy:validate_ifok}
    2 Merci ! Achat ok ! Vous avez gagné {FenShop:buy:tokens} tokens !
     1<center>
     2{FenShop:buy:validate_ifok}
     3<b>Achat confirmé.</b><br/>
     4Votre achat a bien été confirmé. Vous avez reçu {FenShop:buy:tokens} {FenShop:currency} !
    35{FenShop:buy:validate_else}
    4 Fail !
     6Une erreur est survenue!<br/>
     7<br/>
     8Pour recommencer, veuillez renseigner votre pseudo ci-dessous.
     9<br/>
     10<form action="{FenShop:buy:link_buy}" method="post">
     11<input style="width: 20em;" type="text" name="FenShop_nick" value="{FenShop:nick}"/><br/>
     12<input style="width: 23em;" type="submit" value="Continuer">
     13</form>
    514{FenShop:buy:validate_end}
     15</center>
Note: See TracChangeset for help on using the changeset viewer.