Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 24.26 KB | None | 0 0
  1. <?php
  2. include "Base/header.php";
  3. if(!$loggedIn)
  4.    header("Location:login.php");
  5.  
  6. $fields = array("old", "text", "tags", "name", "subject");
  7. $full = true;
  8. $errors = [];
  9. foreach($fields as $f){
  10.    if(!isset($_POST[$f])){
  11.        $full = false;
  12.    }
  13. }
  14. if($full){
  15.    $name = $_POST['name'];
  16.    $old = $_POST['old'];
  17.    $subject = $_POST['subject'];
  18.    $content = $_POST['text'];
  19.    $keys = $_POST['tags'];
  20.  
  21.    if($name == $old)
  22.        $name = "";
  23.  
  24.    $sql = "SELECT * FROM pages WHERE name='$name'";
  25.    $result = mysqli_query($conn, $sql);
  26.  
  27.    if ($rrow = mysqli_fetch_assoc($result)) {
  28.        array_push($errors, "<strong>Error:</strong> A page with that name does already exist!");
  29.     }else{
  30.         if($name == "")
  31.             $name = $old;
  32.         $sql = "UPDATE pages SET name='".mysqli_real_escape_string($conn, $name)."', subject='".mysqli_real_escape_string($conn, $subject)."',',content='".mysqli_real_escape_string($conn, $content)."',keywords='".mysqli_real_escape_string($conn, $keys)."' WHERE name='".mysqli_real_escape_string($conn, $old)."'";
  33.         mysqli_query($conn, $sql);
  34.         $sql = "SELECT * FROM pages WHERE name='$name'";
  35.         $result = mysqli_query($conn, $sql);
  36.         $roww = mysqli_fetch_assoc($result);
  37.         $id = $roww['id'];
  38.          header("Location: view.php?i=".$id);
  39.     }
  40. }
  41. $exist = true;
  42.     if(isset($_GET['i'])){
  43.         $id = mysqli_real_escape_string($conn, $_GET['i']);
  44.         $sql = "select * FROM `pages` WHERE id=\"".$id."\"";
  45.         $result = mysqli_query($conn, $sql);
  46.         if(mysqli_num_rows($result) == 0){
  47.             $exist = false;
  48.  
  49.         }else{
  50.             $resRow = mysqli_fetch_assoc($result);
  51.         }
  52.  
  53. }
  54. ?>
  55.     <style>
  56.         .bbedit{
  57.             min-height:100px;
  58.             width:100%;
  59.         }
  60.         .bbsymbs{
  61.             width:100%;
  62.             padding: 2.5px;
  63.         }
  64.         .bb-symbol {
  65.             display: inline-block;
  66.             width: 32px;
  67.             height: 32px;
  68.             padding: 8px;
  69.             color: transparent !important;
  70.         }
  71.         .bb-class{
  72.             background-color: #f5f5f5;
  73.             border-radius: 5px;
  74.         }
  75.         .bb-symbol:hover:active{
  76.             color: transparent !important;
  77.         }
  78.         .bb-img{
  79.             height:16px;
  80.             width: 16px;
  81.         }
  82.         .bb-a{
  83.             display: inline-block;
  84.             height: 32px;
  85.             width: 32px;
  86.             z-index: 4;
  87.             cursor: pointer;
  88.         }
  89.         .bb-a:hover, .bb-active{
  90.             background-color: #e1e1e1;
  91.             border-radius: 4px;
  92.         }
  93.         .bb-group{
  94.             z-index: 3;
  95.             height: 32px;
  96.             background-color: #ebebeb;
  97.             border-radius: 5px;
  98.             display: inline-block;
  99.             width: auto;
  100.         }
  101.         .bb-ifr{
  102.             border:none;
  103.             height: 100%;
  104.             width: 100%;
  105.         }
  106.         .list-group-item{
  107.             padding: 0px;
  108.             margin: 0px;
  109.         }
  110.         .bb-color-option{
  111.             height: 30px;
  112.             width: auto;
  113.         }
  114.         .bb-bold{
  115.             background-image: url('Base/icons.png');
  116.             background-repeat: no-repeat;
  117.             background-position: 0 -624px;
  118.         }
  119.         .bb-italic{
  120.             background-image: url('Base/icons.png');
  121.             background-repeat: no-repeat;
  122.             background-position: 0 -384px;
  123.         }
  124.         .bb-underline{
  125.             background-image: url('Base/icons.png');
  126.             background-repeat: no-repeat;
  127.             background-position: 0 -48px;
  128.         }
  129.         .bb-strikethrough{
  130.             background-image: url('Base/icons.png');
  131.             background-repeat: no-repeat;
  132.             background-position: 0 -128px;
  133.         }
  134.         .bb-subscript{
  135.             background-image: url('Base/icons.png');
  136.             background-repeat: no-repeat;
  137.             background-position: 0 -112px;
  138.         }
  139.         .bb-superscript{
  140.             background-image: url('Base/icons.png');
  141.             background-repeat: no-repeat;
  142.             background-position: 0 -96px;
  143.         }
  144.         .bb-left{
  145.             background-image: url('Base/icons.png');
  146.             background-repeat: no-repeat;
  147.             background-position: 0 -352px;
  148.         }
  149.         .bb-center{
  150.             background-image: url('Base/icons.png');
  151.             background-repeat: no-repeat;
  152.             background-position: 0 -592px;
  153.         }
  154.         .bb-right{
  155.             background-image: url('Base/icons.png');
  156.             background-repeat: no-repeat;
  157.             background-position: 0 -192px;
  158.         }
  159.         .bb-size{
  160.             background-image: url('Base/icons.png');
  161.             background-repeat: no-repeat;
  162.             background-position: 0 -160px;
  163.         }
  164.         .bb-font{
  165.             background-image: url('Base/icons.png');
  166.             background-repeat: no-repeat;
  167.             background-position: 0 -464px;
  168.         }
  169.         .bb-color{
  170.             background-image: url('Base/icons.png');
  171.             background-repeat: no-repeat;
  172.             background-position: 0 -560px;
  173.         }
  174.         .bb-hr{
  175.             background-image: url('Base/icons.png');
  176.             background-repeat: no-repeat;
  177.             background-position: 0 -432px;
  178.         }
  179.         .bg-img-div{
  180.             resize: both;
  181.             overflow: auto;
  182.             height:max-content;
  183.             width:max-content;
  184.         }
  185.         .bb-img{
  186.             height:100%;
  187.             width:100%;
  188.         }
  189.     </style>
  190. <div class="container">
  191.     <?php
  192.    if(!isset($_GET['i']) || !$exist){
  193.         echo "  <div class=\"alert alert-danger alert-dismissable fade in text-center\">
  194.       <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>
  195.       <strong>Error!</strong> ID not found!</div>";}
  196.     ?>
  197.     <div class="page-header">
  198.         <h1>Edit</h1>
  199.     </div>
  200.     <?php
  201.        if(!isset($_GET['i']) || !$exist){
  202.        include "Base/footer.php";
  203.        return;
  204.    }
  205.    ?>
  206.     <div id="errors"></div>
  207.  
  208.     <form method="POST" class="required" id="createform" name="createform" onsubmit="return validateForm()">
  209.         <div class="form-group">
  210.             <ul class="list-group">
  211.                 <li class="list-group-item">
  212.                     <div class="bb-class">
  213.                         <div class="bbsymbs">
  214.                             <div class="bb-group">
  215.                                 <a class="bb-a" data-bb-value="bold" onclick="h(this)" title="Bold">
  216.                                     <div class="bb-symbol">
  217.                                         <div class="bb-img bb-bold"></div>
  218.                                     </div></a> <a class="bb-a" data-bb-value="italic" onclick="h(this)">
  219.                                     <div class="bb-symbol">
  220.                                         <div class="bb-img bb-italic"></div>
  221.                                     </div></a> <a class="bb-a" data-bb-value="underline" onclick="h(this)">
  222.                                     <div class="bb-symbol">
  223.                                         <div class="bb-img bb-underline"></div>
  224.                                     </div></a> <a class="bb-a" data-bb-value="strikethrough" onclick="h(this)">
  225.                                     <div class="bb-symbol">
  226.                                         <div class="bb-img bb-strikethrough"></div>
  227.                                     </div></a> <a class="bb-a" data-bb-value="subscript" onclick="h(this)">
  228.                                     <div class="bb-symbol">
  229.                                         <div class="bb-img bb-subscript"></div>
  230.                                     </div></a> <a class="bb-a" data-bb-value="superscript" onclick="h(this)">
  231.                                     <div class="bb-symbol">
  232.                                         <div class="bb-img bb-superscript"></div>
  233.                                     </div></a>
  234.                             </div>
  235.                             <div class="bb-group">
  236.                                 <a class="bb-a bb-just" data-bb-value="justifyLeft" onclick="h(this)">
  237.                                     <div class="bb-symbol">
  238.                                         <div class="bb-img bb-left"></div>
  239.                                     </div></a> <a class="bb-a bb-just" data-bb-value="justifyCenter" onclick="h(this)">
  240.                                     <div class="bb-symbol">
  241.                                         <div class="bb-img bb-center"></div>
  242.                                     </div></a> <a class="bb-a bb-just" data-bb-value="justifyRight" onclick="h(this)">
  243.                                     <div class="bb-symbol">
  244.                                         <div class="bb-img bb-right"></div>
  245.                                     </div></a>
  246.                             </div>
  247.                             <div class="bb-group">
  248.                                 <a class="bb-a" data-bb-value="fontName" id="bb-font-parent" onclick="font(this)" title="Font">
  249.                                     <div class="bb-symbol">
  250.                                         <div class="bb-img bb-font"></div>
  251.                                     </div></a> <a class="bb-a" data-bb-value="fontSize" id="bb-size-parent" onclick="size(this)" title="Bold">
  252.                                     <div class="bb-symbol">
  253.                                         <div class="bb-img bb-size"></div>
  254.                                     </div></a> <a class="bb-a" data-bb-value="foreColor" id="bb-color-parent" onclick="color(this)" title="Color">
  255.                                     <div class="bb-symbol">
  256.                                         <div class="bb-img bb-color"></div>
  257.                                     </div></a>
  258.                             </div>
  259.                             <div class="bb-group">
  260.                                 <a class="bb-a" data-bb-value="insertHorizontalRule" onclick="h(this)">
  261.                                     <div class="bb-symbol">
  262.                                         <div class="bb-img bb-hr"></div>
  263.                                     </div></a>
  264.                             </div>
  265.                         </div>
  266.                     </div><iframe class="bb-ifr" id="bb-frame" name="bb-frame" style="resize: vertical;"></iframe>
  267.                 </li>
  268.             </ul>
  269.             <label for="ntag" class="required">
  270.                 Tags:
  271.             </label>
  272.             <br>
  273.             <ul class="pagination" id="tagsul">
  274.                 <li class="remtag">
  275.                     <a href="#">Add tags in the box below</a>
  276.                 </li>
  277.                 <li class="remtag">
  278.                     <a href="#">Click a tag to remove it</a>
  279.                 </li>
  280.             </ul><br>
  281.             <input class="form-control" id="ntag" maxlength="64" placeholder="Add a tag" style="display: inline; width: 74%;" type="text"> <input class="btn btn-success" onclick="addTag()" style="display: inline;width:24%" type="button" value="Add tag">
  282.         </div><br>
  283.         <label for="name" class="required">
  284.             Name:
  285.         </label>
  286.         <input id="name" class="form-control" maxlength="64" name="name" placeholder="Name" type="text"><br>
  287.         <label for="subject" class="required">
  288.             Subject:
  289.         </label>
  290.         <select id="subject" class="form-control" name="subject"><br>
  291.             <option id="ss" disabled style="display: none;" selected>Select subject</option>
  292.             <option>Literatue</option>
  293.             <option>Geography</option>
  294.             <option>History</option>
  295.             <option>Biology</option>
  296.             <option>Chemistry</option>
  297.             <option>Physics</option>
  298.             <option>Mathmatics</option>
  299.         </select><br>
  300.         <button class="btn btn-default" type="submit">Submit</button>
  301.         <div id="hids"></div>
  302.         <input type="hidden" name="old" value="<?php echo $resRow['name'];?>">
  303.     </form>
  304. </div>
  305. <script>
  306.     $("#bg-img-div").addClass("bg-img-div");
  307.     $("#bb-img").addClass("bb-img");
  308. </script>
  309. <div id="bb-size" style="background-color: white; border-radius: 4px; border: 1px solid black; padding: 3px; width:100px;">
  310.     <ul class="list-group" style="margin: 0px; cursor: pointer;">
  311.         <li class="list-group-item bb-size-option" data-size="1"><font size="1">1</font></li>
  312.         <li class="list-group-item bb-size-option" data-size="2"><font size="2">2</font></li>
  313.         <li class="list-group-item bb-size-option" data-size="3"><font size="3">3</font></li>
  314.         <li class="list-group-item bb-size-option" data-size="4"><font size="4">4</font></li>
  315.         <li class="list-group-item bb-size-option" data-size="5"><font size="5">5</font></li>
  316.         <li class="list-group-item bb-size-option" data-size="6"><font size="6">6</font></li>
  317.         <li class="list-group-item bb-size-option" data-size="7"><font size="7">7</font></li>
  318.     </ul>
  319. </div>
  320. <div id="bb-font" style="background-color: white; border-radius: 4px; border: 1px solid black; padding: 3px; width:100px;">
  321.     <ul class="list-group" style="margin: 0px; cursor: pointer;">
  322.         <li class="list-group-item bb-font-option" data-font="Arial"><font face="Arial">Arial</font></li>
  323.         <li class="list-group-item bb-font-option" data-font="Comic Sans MS"><font face="Comic Sans MS">Comic Sans MS</font></li>
  324.         <li class="list-group-item bb-font-option" data-font="Consolas"><font face="Consolas">Consolas</font></li>
  325.         <li class="list-group-item bb-font-option" data-font="Courier New"><font face="Courier New">Courier New</font></li>
  326.         <li class="list-group-item bb-font-option" data-font="Verdana"><font face="Verdana">Verdana</font></li>
  327.     </ul>
  328. </div>
  329. <div id="bb-color" style="background-color: white; border-radius: 4px; border: 1px solid black; padding: 3px; width:100px; cursor: pointer; width: 100px">
  330.     <div class="bb-color-option" data-color="#001f3f" style=""></div>
  331.     <div class="bb-color-option" data-color="#0074D9" style=""></div>
  332.     <div class="bb-color-option" data-color="#39CCCC" style=""></div>
  333.     <div class="bb-color-option" data-color="#3D9970" style=""></div>
  334.     <div class="bb-color-option" data-color="#2ECC40" style=""></div>
  335.     <div class="bb-color-option" data-color="#01FF70" style=""></div>
  336.     <div class="bb-color-option" data-color="#FFDC00" style=""></div>
  337.     <div class="bb-color-option" data-color="#FF851B" style=""></div>
  338.     <div class="bb-color-option" data-color="#FF4136" style=""></div>
  339.     <div class="bb-color-option" data-color="#85144b" style=""></div>
  340.     <div class="bb-color-option" data-color="#F012BE" style=""></div>
  341.     <div class="bb-color-option" data-color="#111111" style=""></div>
  342.     <div class="bb-color-option" data-color="#AAAAAA" style=""></div>
  343.     <div class="bb-color-option" data-color="#FFFFFF" style="border: 1px solid"></div>
  344. </div>
  345. <script>
  346.     var iframe = document.getElementById("bb-frame");
  347.     var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
  348.  
  349.     var actives = [];
  350.     var iftxt;
  351.     var tags = [];
  352.     var sizeAct = false;
  353.     var fontAct = false;
  354.     var colorAct = false;
  355.  
  356.  
  357.     function error(text, id){
  358.         var e = "<div id=\"" + id + "\" class=\"alert alert-danger alert-dismissable fade text-center\"> <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>" + text + "</div>";
  359.         document.getElementById("errors").innerHTML+=e;
  360.         window.setTimeout(function () {
  361.             $("#" + id).addClass("in");
  362.         }, 15);
  363.     }
  364.     function validateForm() {
  365.         addTag();
  366.         var taglist = "";
  367.         for (var t in tags) {
  368.             taglist = taglist + tags[t] + ",";
  369.         }
  370.         taglist = taglist.slice(0, -1);
  371.         document.getElementById("hids").innerHTML="";
  372.         document.getElementById("hids").innerHTML += "<input type=\"hidden\" name=\"tags\" value=\"" + taglist + "\">";
  373.         document.getElementById("hids").innerHTML += "<input type=\"hidden\" name=\"text\" value=\"" + escape(iframeDocument.body.innerHTML) + "\">";
  374.  
  375.         var r = true;
  376.         document.getElementById("errors").innerHTML="";
  377.         var tagsel = document.getElementsByName("tags")[0];
  378.         var text = document.getElementsByName("text")[0];
  379.         var name = document.getElementsByName("name")[0];
  380.         var subject = document.getElementsByName("subject")[0];
  381.         if(text.value==""){
  382.             error("<strong>Error!</strong> Please enter text!", "errtext");
  383.             r = false;
  384.         }
  385.         if(tagsel.value==""){
  386.             error("<strong>Error!</strong> Please enter tags!", "errtags");
  387.             r = false;
  388.         }
  389.         if(name.value==""){
  390.             error("<strong>Error!</strong> Please enter a valid name!", "errname");
  391.             r = false;
  392.         }
  393.         if(subject.value==$("#ss")[0].innerHTML.toLowerCase()){
  394.             error("<strong>Error!</strong> Please enter a valid subject!", "errsubject");
  395.             r = false;
  396.         }
  397.         if(!r){
  398.             window.scrollTo(100,0);
  399.         }
  400.         document.getElementById("hids").innerHTML="";
  401.         if(!r)
  402.             return r;
  403.         document.getElementById("hids").innerHTML += "<input type=\"hidden\" name=\"tags\" value=\"" + taglist + "\">";
  404.         document.getElementById("hids").innerHTML += "<input type=\"hidden\" name=\"text\" value=\"" + escape(iframeDocument.body.innerHTML) + "\">";
  405.         return r;
  406.     }
  407.     function h(d) {
  408.         if (d.classList.contains("bb-just"))
  409.             $(".bb-just").removeClass("bb-active");
  410.         if (d.classList.contains("bb-active")) {
  411.             d.classList.remove("bb-active");
  412.         } else {
  413.             d.classList.add("bb-active");
  414.         }
  415.         /*
  416.         Yes, it works, classes are changed first
  417.          */
  418.         iframeDocument.body.focus();
  419.     }
  420.     function addTag() {
  421.         var tag = $("#ntag").val();
  422.         if (tag == "" || tag == " ")
  423.             return;
  424.         /*
  425.         Tag valid!
  426.          */
  427.         $("#tagsul")[0].innerHTML = "";
  428.         tags.push(tag);
  429.         for (var s in tags) {
  430.             $("#tagsul")[0].innerHTML += "<li class=\"remtag\" data-tag=\"" + tag + "\"><a href=\"#\">" + tags[s] + "<\/a><\/li>";
  431.         }
  432.         $("#ntag").val("");
  433.         $("#ntag").focus();
  434.         $(".remtag").click(function () {
  435.             deleteTag($(this));
  436.         });
  437.     }
  438.     function addTagWT(tag) {
  439.         if (tag == "" || tag == " ")
  440.             return;
  441.         /*
  442.         Tag valid!
  443.          */
  444.         $("#tagsul")[0].innerHTML = "";
  445.         tags.push(tag);
  446.         for (var s in tags) {
  447.             $("#tagsul")[0].innerHTML += "<li class=\"remtag\" data-tag=\"" + tag + "\"><a href=\"#\">" + tags[s] + "<\/a><\/li>";
  448.         }
  449.         $("#ntag").val("");
  450.         $("#ntag").focus();
  451.         $(".remtag").click(function () {
  452.             deleteTag($(this));
  453.         });
  454.     }
  455.  
  456.     function deleteTag(tagel) {
  457.         tagel.css("display", "none");
  458.         tags.pop(tagel.data("tag"));
  459.     }
  460.     function size(d) {
  461.         h(d);
  462.         if (!sizeAct) {
  463.             $("#bb-size").show();
  464.             $("#bb-size").css('top', $("#bb-size-parent").offset()["top"] + $("#bb-size-parent").height() + 5);
  465.             $("#bb-size").css('left', $("#bb-size-parent").offset()["left"]);
  466.             $("#bb-size").css('position', 'fixed');
  467.             sizeAct = true;
  468.         } else {
  469.             $("#bb-size").hide();
  470.             sizeAct = false;
  471.         }
  472.     }
  473.     function font(d) {
  474.         h(d);
  475.         if (!fontAct) {
  476.             $("#bb-font").show();
  477.             $("#bb-font").css('top', $("#bb-font-parent").offset()["top"] + $("#bb-font-parent").height() + 5);
  478.             $("#bb-font").css('left', $("#bb-color-parent").offset()["left"]);
  479.             $("#bb-font").css('position', 'fixed');
  480.             fontAct = true;
  481.         } else {
  482.             $("#bb-font").hide();
  483.             fontAct = false;
  484.         }
  485.     }
  486.  
  487.  
  488.  
  489.     function color(d) {
  490.         h(d);
  491.         if (!colorAct) {
  492.             $("#bb-color").show();
  493.             $("#bb-color").css('top', $("#bb-color-parent").offset()["top"] + $("#bb-color-parent").height() + 5);
  494.             $("#bb-color").css('left', $("#bb-color-parent").offset()["left"]);
  495.             $("#bb-color").css('position', 'fixed');
  496.             colorAct = true;
  497.         } else {
  498.             $("#bb-color").hide();
  499.             colorAct = false;
  500.         }
  501.     }
  502.     $(document).keypress(function (event) {
  503.         if (event.keyCode == 13 && $("#ntag").is(':focus')) {
  504.            var tag = $("#ntag").val();
  505.             addTag();
  506.             event.preventDefault();
  507.         }
  508.     });
  509.  
  510.  
  511.     $(document).ready(function () {
  512.         iframe = document.getElementById("bb-frame");
  513.         iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
  514.         iframeDocument.body.contentEditable = "true";
  515.         $(".bb-font-option").click(function () {
  516.             var d = $("#bb-font-parent")[0];
  517.             font(d);
  518.             iframeDocument.execCommand($("#bb-font-parent").data('bb-value'), false, $(this).data("font"));
  519.         });
  520.         $("option").each(function () {
  521.             $(this)[0].value = $(this)[0].innerHTML.toLocaleLowerCase();
  522.             <?php
  523.            if(isset($resRow['subject'])){
  524.                echo "if(\"".strtolower($resRow['subject'])."\" == $(this)[0].innerHTML.toLocaleLowerCase())
  525.                    $(this)[0].selected = \"selected\";";
  526.            }
  527.            ?>
  528.         });
  529.  
  530.         $(".remtag").click(function () {
  531.             deleteTag($(this));
  532.         });
  533.  
  534.  
  535.         <?php
  536.        if(isset($resRow['name'])){
  537.            echo "$(\"#name\")[0].value=\"".$resRow['name']."\";";
  538.        }
  539.        ?>
  540.         <?php
  541.        if(isset($resRow['content'])){
  542.            echo "iframeDocument.body.innerHTML=unescape(\"".html_entity_decode($resRow['content'])."\");";
  543.        }
  544.        ?>
  545.  
  546.  
  547.  
  548.         iframeDocument.addEventListener("keyup", function () {
  549.             $("#bb-frame").contents().find("body").find("img").each(function () {
  550.                 if (!$(this).hasClass("bb-img")) {
  551.                     $(this).wrap("<div class=\"bb-img-div\" ><\/div>");
  552.                     $(this).parent().css("background-color", "white");
  553.                     $(this).parent().css("height", $(this).height());
  554.                     $(this).parent().css("width", $(this).width());
  555.                     $(this).parent().css("resize", "both");
  556.                     $(this).parent().css("overflow", "auto");
  557.                     $(this).css("height", "100%");
  558.                     $(this).css("width", "100%");
  559.                     $(this).addClass("bb-img");
  560.                 }
  561.             });
  562.             if ($("#bb-frame").height() < $("#bb-frame").height() + 100 + $(this).height())
  563.                $("#bb-frame").height = $("#bb-frame").height() + 100 + $(this).height();
  564.  
  565.        });
  566.        $("#bb-size").hide();
  567.        $("#bb-font").hide();
  568.        $("#bb-color").hide();
  569.        $(".bb-a").click(function (e) {
  570.  
  571.            var command = $(this).data('bb-value');
  572.  
  573.            iframeDocument.execCommand($(this).data('bb-value'), false, null);
  574.  
  575.        });
  576.  
  577.  
  578.        $(".bb-size-option").click(function () {
  579.            var d = $("#bb-size-parent")[0];
  580.            size(d);
  581.            iframeDocument.execCommand($("#bb-size-parent").data('bb-value'), false, $(this).data("size"));
  582.        });
  583.  
  584.  
  585.  
  586.        $(".bb-color-option").each(function () {
  587.            $(this).css("background-color", "" + $(this).data("color"));
  588.        });
  589.  
  590.        $(".bb-color-option").click(function () {
  591.            var d = $("#bb-color-parent")[0];
  592.            color(d);
  593.            iframeDocument.execCommand($("#bb-color-parent").data('bb-value'), false, $(this).data("color"));
  594.        });
  595.        <?php
  596.  
  597.        if(isset($resRow['keywords'])){
  598.            $tags = explode(",", $resRow['keywords']);
  599.            foreach ($tags as $t){
  600.                echo "addTagWT(\"".html_entity_decode(urldecode($t))."\");";
  601.            }
  602.        }
  603.  
  604.        ?>
  605.  
  606.     });
  607. </script>
  608. <?php
  609. if(!empty($errors)){
  610.    $i = 0;
  611.    foreach ($errors as $e){
  612.        echo "<script>error(\"".$e."\",".$i.");</script>";
  613.         $i++;
  614.     }
  615. }
  616. ?>
  617. <?php
  618. include "Base/footer.php";
  619. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement