Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function DisplayMyWikis(){
- include'functions/connect.php';
- if(isset($_SESSION['profilLevel'])){
- $userId = $_SESSION['userid'];
- $userLevel = $_SESSION['profilLevel'];
- } else {
- $userId = 0;
- $userLevel = 0;
- }
- $sqlDisplayTopics = ("SELECT * FROM tbsujet where authorId = $userId ");
- $sqlDisplayTopicsResult = mysqli_query($db_connexion, $sqlDisplayTopics);
- echo"<form method=post action=#>";
- echo "<table>
- <tr>
- <th>id du sujet</th>
- <th>id de l'auteur</th>
- <th>titre</th>
- <th>description</th>
- <th>date de création</th>
- <th>éditer sujet</th>
- <th>éditer page(s)</th>
- <th>afficher</th>
- <th>supprimer sujet</th>
- </tr>";
- while($row = mysqli_fetch_array($sqlDisplayTopicsResult)){
- if(empty($row['visibilityAdminChoice'])){
- $adminLevelChoice = "NULLL";
- } else {
- $adminLevelChoice = $row['visibilityAdminChoice'];
- }
- if(empty($row['visibilityModoChoice'])){
- $adminModoChoice = "NULLL";
- } else {
- $adminModoChoice = $row['visibilityModoChoice'];
- }
- if(empty($row['visibilityAuthorChoice'])){
- $adminAuthorChoice = "NULLL";
- } else {
- $adminAuthorChoice = $row['visibilityAuthorChoice'];
- }
- $topicLevel;
- if($adminLevelChoice == "NULLL"){
- if($adminModoChoice == "NULLL"){
- if($adminAuthorChoice == "NULLL"){
- $topicLevel = 0;
- } else {
- $topicLevel = $adminAuthorChoice;
- }
- } else {
- $topicLevel = $adminModoChoice;
- }
- } else {
- $topicLevel = $adminLevelChoice;
- }
- if($userLevel < $topicLevel){
- echo "
- <tr>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis, enregistrez vous</td>
- </tr>";
- } else {
- $sujetIdToEdit = $row['sujetId'];
- $authorSql = ("SELECT authorId from tbsujet where sujetId = $sujetIdToEdit");
- $authorSqlQuery = mysqli_query($db_connexion, $authorSql);
- $authorSqlFetch = mysqli_fetch_array($authorSqlQuery);
- $author = $authorSqlFetch['authorId'];
- echo "
- <tr>
- <td>" . $row['sujetId'] . "</td>
- <td>" . $row['authorId'] . "</td>
- <td>" . $row['sujetTitle'] . "</td>
- <td>" . $row['sujetDesc'] . "</td>
- <td>" . $row['sujetDateCrea'] . "</td>";
- if($userId != $author){
- echo"<td>seul l'auteur peut éditer</td>";
- }else if(($userId == $author) || ($userId = 1)){
- echo"<td><input type=submit name=IdToEdit value=$sujetIdToEdit id=inputSmall >éditer topic</input></td>";
- }
- if($userId != $author){
- echo"<td>seul l'auteur peut éditer</td>";
- }else if($userId == $author) {
- echo"<td><input type=submit name=sujetIdToEdit value=$sujetIdToEdit id=inputSmall >éditer page(s)</input></td>";
- }
- echo" <td><input type=submit name=displayTopic value=$sujetIdToEdit id=inputSmall >afficher</input></td>";
- if($sujetIdToEdit == 1){
- echo "<td>ce sujet ne peut pas être éffacé</td>";
- } else {
- echo"<td><input type=submit name=DeleteTopic value=$sujetIdToEdit id=inputSmall >Supprimer le sujet</input></td>";
- }
- echo "</tr>";
- }
- }
- echo "</table>";
- echo"</form>";
- if(isset($_POST['DeleteTopic'])){
- $topicToDelete = $_POST['DeleteTopic'];
- if(isset($_POST['deleteTheTopic'])){
- $deleteTheTopic = $_POST['deleteTheTopic'];
- $sqlDelete = (" DELETE FROM tbpage WHERE sujetId = $deleteTheTopic ");
- $sqlDeleteQuery = mysqli_query($db_connexion, $sqlDelete);
- if(mysqli_query($db_connexion, $sqlDelete)){
- echo "1/2 : les pages ont été correctement éffacées";
- } else {
- echo "erreur". mysqli_error($db_connexion);
- }
- $sqlDelete2 = (" DELETE FROM tbsujet WHERE sujetId = $deleteTheTopic ");
- $sqlDelete2Query = mysqli_query($db_connexion, $sqlDelete2);
- if(mysqli_query($db_connexion, $sqlDelete2)){
- echo "2/2 : les sujets ont été correctement éffacées";
- } else {
- echo "erreur". mysqli_error($db_connexion);
- }
- } else {
- ?>
- <h3>Suppresion du sujet</h3>
- <button onclick="myFunction()" id="button1">Continuer</button>
- <button onclick="myFunction2()" id="button2">Continuer quand même</button>
- <form action="index.php?page=wiki&subPage=espaceMembre&a=DisplayMyWikis" id="annuler1">
- <input type="submit" id="annuler" value="annuler">
- </form>
- <form action="#" method="post" id="deleteTheTopic">
- <input type="text" name="deleteTheTopic" value="<?php echo $topicToDelete ?>" readonly="true">
- <input type="hidden" name="DeleteTopic" value="<?php echo $topicToDelete ?>" readonly="true">
- <input type="submit" id="submit" value="effacer le sujet">
- </form>
- <script>
- window.onload=function(){
- document.getElementById("button1").style.display='block';
- document.getElementById("button2").style.display='none';
- document.getElementById("annuler").style.display='none';
- document.getElementById("annuler1").style.display='none';
- document.getElementById("deleteTheTopic").style.display='none';
- }
- function myFunction() {
- var txt;
- var r = confirm("Etes-vous sur de vouloir continuer?");
- if (r == true) {
- document.getElementById("button1").style.display='none';
- document.getElementById("button2").style.display='block';
- document.getElementById("annuler").style.display='none';
- document.getElementById("annuler1").style.display='none';
- } else {
- document.getElementById("button1").style.display='none';
- document.getElementById("button2").style.display='none';
- document.getElementById("annuler").style.display='block';
- }
- }
- function myFunction2() {
- var txt;
- var r = confirm("Attention, toutes les pages vont également être supprimées. Etes-vous sur de vouloir continuer?");
- if (r == true) {
- document.getElementById("button1").style.display='none';
- document.getElementById("button2").style.display='none';
- document.getElementById("deleteTheTopic").style.display='block';
- } else {
- document.getElementById("button1").style.display='none';
- document.getElementById("button2").style.display='none';
- document.getElementById("annuler").style.display='block';
- document.getElementById("annuler1").style.display='block';
- }
- }
- </script>
- </body>
- </html>
- <?php
- }
- }
- if(isset($_POST['sujetIdToEdit'])){
- $sujetIdToEdit = $_POST['sujetIdToEdit'];
- $sql = "SELECT pageId, pageKeyword FROM tbpage where sujetId= $sujetIdToEdit order by pageId ";
- if(isset($_POST['pageToEdit'])){
- $pageToEdit = $_POST['pageToEdit'];
- $sqlPageContent = ("SELECT * from tbpage where pageId = $pageToEdit");
- $sqlPageContentQuery = mysqli_query($db_connexion, $sqlPageContent);
- $fetchPageContent = mysqli_fetch_array($sqlPageContentQuery);
- $pageContent= $fetchPageContent['pageContent'];
- echo "
- <h3>Veuillez insérer le nouveau contenu</h3>
- <form method=post action=index.php?page=wiki&wikiAction=editPage>
- <label>Contenu:</br></label>
- <textarea name=pageContentNew id=pageContentNew value='$pageContent' cols=30 rows=30 required></textarea></br>
- <input type=hidden name=pageToEdit id=pageToEdit value='$pageToEdit' required</br>
- <input type=submit name=edit value='editer la page' />
- ";
- } else {
- echo'<hr class="fancy-line"></hr>';
- echo'<h3>Modificiation des pages pour le sujet selectionné</h3>';
- echo'<p>Choisisez la page à éditer:</p>';
- echo '<form action="#" method="POST">';
- echo '<select name=pageToEdit id=pageToEdit>Page</option>';
- foreach($db_connexion->query($sql) as $row)
- {
- echo '<option value="' . $row['pageId'] . '">' . $row['pageKeyword'] . '</option>';
- }
- echo "
- <input type=hidden name=sujetIdToEdit id=sujetIdToEdit value=$sujetIdToEdit required>
- <input type=submit name=edit value=editer id=inputSmall />
- </select>
- </form>";
- $toEdit = $row['pageId'];
- }
- }
- if(isset($_POST['displayTopic'])){
- $displayTopic = $_POST['displayTopic'];
- $sqlTopic = "SELECT * FROM tbsujet where sujetId= $displayTopic ";
- foreach($db_connexion->query($sqlTopic) as $row)
- {
- $authorId = $row['authorId'];
- $authorName = get_user_name_fromId($authorId);
- ?>
- <div style="background-color: #243464; color: #fff; padding: 10px 10px 10px 10px; margin-top: 20px;">
- <h1><?php echo $row['sujetTitle'] ?></h1>
- <h2><?php echo $row['sujetDesc'] ?></h2>
- <p><?php echo "auteur: " .$authorName . " | "; echo "date de création: " .$row['sujetDateCrea'];?></p></div>
- <?php
- $sqlPage = "SELECT * FROM tbpage where sujetId = $displayTopic";
- $i = 0;
- $y = 1;
- foreach($db_connexion->query($sqlPage) as $row){
- $pageId = $row['pageId'];
- $regexText = $row['pageContent'];
- $htmlText = regex_to_html_copy($regexText, $displayTopic);
- ?>
- <div style="background-color: #808080; padding: 10px 10px 10px 10px; margin-top: 20px;">
- <h3>Mot clé : <?php echo $row['pageKeyword'] ?> (page: <?php echo $i ?>)</h3><a href="index.php?page=pageSignal&pageSignalID=<?php echo $pageId?>&pageSignalTopicID=<?php echo $displayTopic?>">signaler la page</a></p>
- </div>
- <div style="background-color: #c9c9c9; padding: 10px 10px 10px 10px; margin-top: 20px;">
- <p>Contenu: </p><br>
- <p><?php echo $htmlText?></p>
- <hr>
- <p><?php echo "auteur: " .$authorName . " | "; echo "date de création: " .$row['pageDateCrea'];?></p>
- </div>
- <?php
- $i = $i + $y;
- }
- }
- }
- if(isset($_POST['IdToEdit'])){
- if(isset($_POST['editTopicValid'])){
- include'fx_visibility.php';
- $sujetTitleNew = $_POST['sujetTitleNew'];
- $sujetDescNew = $_POST['sujetDescNew'];
- $newVisi = $_POST['newVisi'];
- $IdToEdit = $_POST['IdToEdit'];
- $newVisi = get_vis_lev_fromChoice($newVisi);
- $sqlUpdate = ("UPDATE tbsujet SET sujetTitle = '$sujetTitleNew', sujetDesc = '$sujetDescNew', sujetDerModif = NOW(), visibilityAuthorChoice = '$newVisi' WHERE sujetId = '$IdToEdit' ");
- if(mysqli_query($db_connexion, $sqlUpdate)){
- echo "Le sujet a été correctement modifié";
- } else {
- echo "erreur lors de l'édition" . mysqli_error($db_connexion);
- }
- } else {
- $editTopicId = $_POST['IdToEdit'];
- $sqlTopic = "SELECT * FROM tbsujet where sujetId= $editTopicId ";
- foreach($db_connexion->query($sqlTopic) as $row)
- {
- $sujetTitleOld = $row['sujetTitle'];
- $sujetDescOld = $row['sujetDesc'];
- ?>
- <form action="" method="post">
- <label>Titre</label><br>
- <input type=text name=sujetTitleNew id=sujetTitleNew value=<?php echo "'$sujetTitleOld'" ?> required><br>
- <label>Description</label><br>
- <input type=text name=sujetDescNew id=sujetDescNew value=<?php echo "'$sujetDescOld'"?> required><br>
- <?php if($userLevel == 7) {
- echo "<label>Visibilité</label><br>
- <input list=visi name=newVisi required>
- <datalist id=visi>
- <option value=visiteur>
- <option value=normal>
- </datalist>";
- } else if($userLevel == 8){
- echo "<label>Visibilité</label><br>
- <input list=visi name=newVisi required>
- <datalist id=visi>
- <option value=visiteur>
- <option value=normal>
- <option value=modo>
- </datalist>";
- } else if($userLevel == 9){
- echo "<label>Visibilité</label><br>
- <input list=visi name=newVisi required>
- <datalist id=visi>
- <option value=visiteur>
- <option value=normal>
- <option value=modo>
- <option value=admin>
- </datalist>";
- }
- ?>
- <input type=hidden name=IdToEdit id=IdToEdit value=<?php echo "'$editTopicId'" ?> required><br>
- <input type=submit name=editTopicValid value="editer le sujet" />
- </form>
- <?php
- }
- }
- }
- mysqli_close($db_connexion);
- }
- function FindMyWikisTitle(){
- include'functions/connect.php';
- if (!isset($_POST['wikiToFind'])){
- echo'<form action="#" method="post">
- <div>
- <label for="wikiToFind">Trouver le wiki à partir de son titre*</label><br/>
- <input type="text" name="wikiToFind" id="wikiToFind" required/><br />
- </div>
- </form>';
- } else {
- if(isset($_SESSION['userid'])){
- $userId = $_SESSION['userid'];
- $userLevel = user_level_fromId($userId);
- } else {
- $userLevel = 0;
- $userId = 0;
- }
- $wikiToFind;
- $wikiToFind = $_POST['wikiToFind'];
- $sql = ("SELECT * from tbsujet
- WHERE sujetTitle like '%$wikiToFind%' AND authorId = '$userId' ");
- $result = mysqli_query($db_connexion, $sql) or die("Selection Query Failed !!!");
- if(mysqli_num_rows($result) > 0){
- echo "<table>
- <tr>
- <th>id du sujet</th>
- <th>id de l'auteur</th>
- <th>titre</th>
- <th>description</th>
- <th>date de création</th>
- <th>éditer sujet</th>
- <th>éditer page(s)</th>
- <th>afficher</th>
- </tr>";
- while($row = mysqli_fetch_array($result)){
- if(empty($row['visibilityAdminChoice'])){
- $adminLevelChoice = "NULLL";
- } else {
- $adminLevelChoice = $row['visibilityAdminChoice'];
- }
- if(empty($row['visibilityModoChoice'])){
- $adminModoChoice = "NULLL";
- } else {
- $adminModoChoice = $row['visibilityModoChoice'];
- }
- if(empty($row['visibilityAuthorChoice'])){
- $adminAuthorChoice = "NULLL";
- } else {
- $adminAuthorChoice = $row['visibilityAuthorChoice'];
- }
- $topicLevel;
- if($adminLevelChoice == "NULLL"){
- if($adminModoChoice == "NULLL"){
- if($adminAuthorChoice == "NULLL"){
- $topicLevel = 0;
- } else {
- $topicLevel = $adminAuthorChoice;
- }
- } else {
- $topicLevel = $adminModoChoice;
- }
- } else {
- $topicLevel = $adminLevelChoice;
- }
- if ($userLevel < $topicLevel){
- echo "
- <tr>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis, enregistrez vous</td>
- </tr>";
- } else {
- $sujetIdToEdit = $row['sujetId'];
- $authorSql = ("SELECT authorId from tbsujet where sujetId = $sujetIdToEdit");
- $authorSqlQuery = mysqli_query($db_connexion, $authorSql);
- $authorSqlFetch = mysqli_fetch_array($authorSqlQuery);
- $author = $authorSqlFetch['authorId'];
- echo "
- <tr>
- <td>" . $row['sujetId'] . "</td>
- <td>" . $row['authorId'] . "</td>
- <td>" . $row['sujetTitle'] . "</td>
- <td>" . $row['sujetDesc'] . "</td>
- <td>" . $row['sujetDateCrea'] . "</td>";
- if($userId != $author){
- echo"<td>seul l'auteur peut éditer</td>";
- }else if(($userId == $author) || ($userId = 1)){
- echo"<td><p>via la page 'Les sujets'</p></td>";
- }
- if($userId != $author){
- echo"<td>seul l'auteur peut éditer</td>";
- }else if($userId == $author) {
- echo"<td><p>via la page 'Les sujets'</p></td>";
- }
- echo" <td><p>via la page 'Les sujets'</p></td>
- </tr>";
- }
- }
- echo "</table>";
- echo "</form>";
- mysqli_close($db_connexion);
- } else {
- echo "<div id=notifications>Aucune correspondance trouvée dans les wikis pour : $wikiToFind</div>";
- }
- }
- }
- function FindMyWikisDesc(){
- include'functions/connect.php';
- if (!isset($_POST['wiki_description'])){
- echo'<form action="#" method="post">
- <div>
- <label for="wiki_description">Trouver le wiki à partir de sa description*</label><br/>
- <input type="text" name="wiki_description" id="wikiToFind" required/><br />
- </div>
- </form>';
- } else {
- if(isset($_SESSION['userid'])){
- $userId = $_SESSION['userid'];
- $userLevel = user_level_fromId($userId);
- } else {
- $userLevel = 0;
- $userId = 0;
- }
- $wiki_description;
- $wiki_description = $_POST['wiki_description'];
- $sqlDesc = ("SELECT * from tbsujet
- WHERE sujetDesc like '%$wiki_description%' AND authorId = '$userId' ");
- $result = mysqli_query($db_connexion, $sqlDesc) or die("Selection Query Failed !!!" . mysqli_error($db_connexion));
- if(mysqli_num_rows($result) > 0){
- echo "<table>
- <tr>
- <th>id du sujet</th>
- <th>id de l'auteur</th>
- <th>titre</th>
- <th>description</th>
- <th>date de création</th>
- <th>éditer sujet</th>
- <th>éditer page(s)</th>
- <th>afficher</th>
- </tr>";
- while($row = mysqli_fetch_array($result)){
- if(empty($row['visibilityAdminChoice'])){
- $adminLevelChoice = "NULLL";
- } else {
- $adminLevelChoice = $row['visibilityAdminChoice'];
- }
- if(empty($row['visibilityModoChoice'])){
- $adminModoChoice = "NULLL";
- } else {
- $adminModoChoice = $row['visibilityModoChoice'];
- }
- if(empty($row['visibilityAuthorChoice'])){
- $adminAuthorChoice = "NULLL";
- } else {
- $adminAuthorChoice = $row['visibilityAuthorChoice'];
- }
- $topicLevel;
- if($adminLevelChoice == "NULLL"){
- if($adminModoChoice == "NULLL"){
- if($adminAuthorChoice == "NULLL"){
- $topicLevel = 0;
- } else {
- $topicLevel = $adminAuthorChoice;
- }
- } else {
- $topicLevel = $adminModoChoice;
- }
- } else {
- $topicLevel = $adminLevelChoice;
- }
- if ($userLevel < $topicLevel){
- echo "
- <tr>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis</td>
- <td> vous n'avez pas les droit recquis, enregistrez vous</td>
- </tr>";
- } else {
- $sujetIdToEdit = $row['sujetId'];
- $authorSql = ("SELECT authorId from tbsujet where sujetId = $sujetIdToEdit");
- $authorSqlQuery = mysqli_query($db_connexion, $authorSql);
- $authorSqlFetch = mysqli_fetch_array($authorSqlQuery);
- $author = $authorSqlFetch['authorId'];
- echo "
- <tr>
- <td>" . $row['sujetId'] . "</td>
- <td>" . $row['authorId'] . "</td>
- <td>" . $row['sujetTitle'] . "</td>
- <td>" . $row['sujetDesc'] . "</td>
- <td>" . $row['sujetDateCrea'] . "</td>";
- if($userId != $author){
- echo"<td>seul l'auteur peut éditer</td>";
- }else if(($userId == $author) || ($userId = 1)){
- echo"<td><p>via la page 'Les sujets'</p></td>";
- }
- if($userId != $author){
- echo"<td>seul l'auteur peut éditer</td>";
- }else if($userId == $author) {
- echo"<td><p>via la page 'Les sujets'</p></td>";
- }
- echo" <td><p>via la page 'Les sujets'</p></td>
- </tr>";
- }
- }
- echo "</table>";
- echo"</form>";
- mysqli_close($db_connexion);
- } else {
- echo "<div id=notifications>Aucune correspondance trouvée dans les wikis pour : $wiki_description</div>";
- }
- }
- }
- function DisplayMyPages(){
- include'functions/connect.php';
- if(isset($_SESSION['profilLevel'])){
- $userId = $_SESSION['userid'];
- $userLevel = $_SESSION['profilLevel'];
- } else {
- $userId = 0;
- $userLevel = 0;
- }
- $PostSujetId = $_POST[''];
- $sqlDisplayTopics = ("SELECT * FROM tbpage where sujetId = $userId ");
- $sqlDisplayTopicsResult = mysqli_query($db_connexion, $sqlDisplayTopics);
- }
- ?>
- <?php
- function regex_to_html_copy($text, $topicId)
- {
- $text = trim($text);
- $text = htmlspecialchars($text);
- $text = nl2br($text);
- $text = stripslashes($text);
- $regexCode = array(
- "/\[\s*!\s*\|\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*1\s*\|\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*2\s*\|\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*3\s*\|\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*d\s*\|\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*n\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*h\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*i\s*\|\s*([^\]^\[^\|]*)\s*\]/si",
- "/\[\s*b\s*\|\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*s\s*\|\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*p\s*\|\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*u\s*\|\s*([^\]\[\|]*)\s*\]/si",
- "/\[\s*a\s*\|\s*([^\]\[\|]*)\s*\|([^\]\[\|]*)\s*\]/si",
- "/\[\s*img\s*\|\s*([^\]\[\|]*)\s*\|([^\]\[\|]*)\s*\]/si",
- "/\[\[\s*(.*?)\s*\]\]/",
- );
- $htmlCode = array(
- "<!--$1-->\n",
- "<h1>$1</h1>\n",
- "<h2>$1</h2>\n",
- "<h3>$1</h3>\n",
- "<div>$1</div>\n",
- "<br />\n$1",
- "<hr>\n$1",
- "<i>$1</i>",
- "<b>$1</b>",
- "<s>$1</s>",
- "<p>$1</p>\n",
- "<u>$1</u>",
- "<a href=\"$1\">$2</a>",
- "<img src=\"$1\" alt=\"$2\"/>",
- "<a href=index.php?page=wiki&wikiAction=pageKey&keyword=" .'$1'. "&topicId=$topicId style='color:blue'>$1</a>",
- );
- while (($isTreaded = preg_replace($regexCode, $htmlCode, $text)) != $text) {
- $text = $isTreaded;
- }
- return ($text);
- }
- function keyWord_get2($text)
- {
- $text = trim($text);
- $text = htmlspecialchars($text);
- $regexCodeKeyWord = array(
- "/\[\[\s*(.*?)\s*\]\]/",
- );
- $textCodeKeyWord = array(
- "<a href=index.php?page=wiki&keyword=" .'$1'. ">$1</a>",
- );
- $textCodeKeyWord2 = array(
- "$1",
- );
- while (($isTreaded = preg_replace($regexCodeKeyWord, $textCodeKeyWord, $text)) != $text) {
- $Word = preg_replace($regexCodeKeyWord, $textCodeKeyWord2, $text);
- $text = $isTreaded;
- }
- return ($text);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement