Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.95 KB | None | 0 0
  1. <!-- TinyMCE -->
  2. <script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
  3. <script type="text/javascript">
  4. tinyMCE.init({
  5. // General options
  6. mode : "textareas",
  7. theme : "advanced",
  8. plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
  9.  
  10. // Theme options
  11. theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
  12. theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
  13. theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
  14. theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
  15. theme_advanced_toolbar_location : "top",
  16. theme_advanced_toolbar_align : "left",
  17. theme_advanced_statusbar_location : "bottom",
  18. theme_advanced_resizing : true,
  19.  
  20. // Example content CSS (should be your site CSS)
  21. content_css : "css/content.css",
  22.  
  23. // Drop lists for link/image/media/template dialogs
  24. template_external_list_url : "lists/template_list.js",
  25. external_link_list_url : "lists/link_list.js",
  26. external_image_list_url : "lists/image_list.js",
  27. media_external_list_url : "lists/media_list.js",
  28.  
  29. // Style formats
  30. style_formats : [
  31. {title : 'Bold text', inline : 'b'},
  32. {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
  33. {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
  34. {title : 'Example 1', inline : 'span', classes : 'example1'},
  35. {title : 'Example 2', inline : 'span', classes : 'example2'},
  36. {title : 'Table styles'},
  37. {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
  38. ],
  39.  
  40. // Replace values for the template plugin
  41. template_replace_values : {
  42. username : "Some User",
  43. staffid : "991234"
  44. }
  45. });
  46. </script>
  47. <!-- /TinyMCE -->
  48. <?php
  49. session_start();
  50.  
  51. if(isset($_GET['logout']))
  52. {
  53. session_destroy();
  54. session_start();
  55. }
  56.  
  57. if (isset($_POST['submitUpdate'])) {
  58. if (get_magic_quotes_gpc()) {
  59. $_POST = array_map('stripslashes',$_POST);
  60. }
  61. $fc = file_get_contents($_POST['file']);
  62. // truncate file
  63. $fw = fopen($_POST['file'], 'w+');
  64. $text = explode("<!-- EDITABLE -->",$fc);
  65. $newText = $text[0]."<!-- EDITABLE -->".htmlentities($_POST['content'])."<!--EDITABLE ->".$text[2];
  66. if (fwrite($fw, $newText)===FALSE) {
  67. die("Cannot write to file.");
  68. }
  69. fclose($fw);
  70. exit("<div><span class='redText'>The file has been updated. Click <a href=\"admin.php\">here</a> to go back to admin page.</div>");
  71. }
  72.  
  73. if (isset($_POST['Submit'])) {
  74. if (($_POST['username'] == 'admin') && ($_POST['passwd'] == 'x638cdk')) {
  75. $_SESSION['username'] = 'login';
  76. }
  77. else {
  78. echo "<b>Your login details are not correct. Please try again</b>";
  79. }
  80. }
  81.  
  82. if ($_SESSION['username']=='login') {
  83. if (isset($_REQUEST['file'])) {
  84. $fc = file_get_contents($_REQUEST['file']);
  85. $text = explode("<!– EDITABLE –>",$fc);
  86. echo "<form method='post' action=''><textarea id=\"elm1\" name=\"elm1\" rows=\"15\" cols=\"80\" style=\"width: 80%\">$text[1]</textarea>";
  87. echo "</div>
  88.  
  89. <!-- Some integration calls -->
  90. <a href=\"javascript:;\" onclick=\"tinyMCE.get('elm1').show();return false;\">[Show]</a>
  91. <a href=\"javascript:;\" onclick=\"tinyMCE.get('elm1').hide();return false;\">[Hide]</a>
  92. <a href=\"javascript:;\" onclick=\"tinyMCE.get('elm1').execCommand('Bold');return false;\">[Bold]</a>
  93. <a href=\"javascript:;\" onclick=\"alert(tinyMCE.get('elm1').getContent());return false;\">[Get contents]</a>
  94. <a href=\"javascript:;\" onclick=\"alert(tinyMCE.get('elm1').selection.getContent());return false;\">[Get selected HTML]</a>
  95. <a href=\"javascript:;\" onclick=\"alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));return false;\">[Get selected text]</a>
  96. <a href=\"javascript:;\" onclick=\"alert(tinyMCE.get('elm1').selection.getNode().nodeName);return false;\">[Get selected element]</a>
  97. <a href=\"javascript:;\" onclick=\"tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');return false;\">[Insert HTML]</a>
  98. <a href=\"javascript:;\" onclick=\"tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');return false;\">[Replace selection]</a>
  99.  
  100. <br />
  101. <input type=\"submit\" name=\"save\" value=\"Submit\" />
  102. <input type=\"reset\" name=\"reset\" value=\"Reset\" />
  103. </div>
  104. </form>";
  105. }
  106. else {
  107. // edit to link to your own static html files
  108. echo "
  109. <h1><a href=\"/\">View Site</a> | <a href=\"?logout\">Logout</a></h1>
  110. <em>Click on the links below to edit the files.</em><br/><br/>
  111. <p align='left'>
  112. <a href=\"?file=../home/pages/home.php\">Home Page</a><br/>
  113. <hr>
  114. <a href=\"?file=../home/pages/welcome/home.php\">Welcome Home</a><br/>
  115. <a href=\"?file=../home/pages/welcome/about.php\">About Ruach</a><br/>
  116. <a href=\"?file=../home/pages/welcome/declaration-of-faith.php\">Declaration of Faith</a><br/>
  117. <a href=\"?file=../home/pages/welcome/governance.php\">Governance</a><br/>
  118. <a href=\"?file=../home/pages/welcome/partnership.php\">Partnership</a><br/>
  119. <hr>
  120. <a href=\"?file=../home/pages/ministries/aol.php\">Academy of Learning</a><br/>
  121. <a href=\"?file=../home/pages/ministries/creative-arts.php\">Creative Arts</a><br/>
  122. <a href=\"?file=../home/pages/ministries/global.php\">Global Ministry</a><br/>
  123. <a href=\"?file=../home/pages/ministries/hospitality.php\">Hospitality Ministry</a><br/>
  124. <a href=\"?file=../home/pages/ministries/outreach.php\">Outreach Ministry</a><br/>
  125. <a href=\"?file=../home/pages/ministries/social-care.php\">Social Care Ministry</a><br/>
  126. <a href=\"?file=../home/pages/ministries/spiritual-mediation.php\">Spiritual Mediation</a><br/>
  127. <a href=\"?file=../home/pages/ministries/youth.php\">Youth Ministry</a><br/>
  128. <hr>
  129. <a href=\"?file=../home/pages/contact/home.php\">Contact Home</a><br/>
  130. <a href=\"?file=../home/pages/contact/directions.php\">Directions</a><br/>
  131. <hr>
  132. <a href=\"?file=/home/pages/missions/home.php\">Missions</a>
  133. </p>";
  134. }
  135. }
  136. if(!$_SESSION['username'])
  137. {
  138. ?>
  139. <div align="center"><img src="images/cms-title.png" border="0" alt=""></div>
  140. <form method="post" action="">
  141. <table width="400" border="0" align="center" cellpadding="2" cellspacing="2">
  142. <tr>
  143. <td width="73">Username: </td>
  144. <td width="313"><input type="text" name="username"></td>
  145. </tr>
  146. <tr>
  147. <td>Password: </td>
  148. <td><input type="password" name="passwd"></td>
  149. </tr>
  150. <tr>
  151. <td>&nbsp;</td>
  152. <td><input type="submit" name="Submit" class="btn" value="Submit">&nbsp;&nbsp; <input type="reset" name="reset" class="btn" value="Reset">
  153. </td>
  154. </tr>
  155. </table>
  156. </form>
  157. <?php
  158. }
  159. ?>
  160.  
  161. <style>
  162. body{
  163. font-family: Arial, Helvetica, sans-serif;
  164. font-size: 12px;
  165. color: #000000;
  166. margin-top: 20px;
  167. }
  168.  
  169. a{
  170. color: #639;
  171. text-decoration: underline;
  172. }
  173.  
  174. a:hover{
  175. text-decoration: none;
  176. }
  177.  
  178. h1{
  179. font-size: 16px;
  180. }
  181.  
  182. table{
  183. font-family: Arial, Helvetica, sans-serif;
  184. font-size: 12px;
  185. color: #000000;
  186. margin-top: 20px;
  187. }
  188.  
  189. input{
  190. width: 300px;
  191. height: 25px;
  192. background: #FFFFFF;
  193. border: 1px solid #999;
  194. padding: 5px;
  195. }
  196.  
  197. .btn{
  198. width: auto;
  199. background: #CCC;
  200. }
  201.  
  202. hr{
  203. color: #fff;
  204. background-color: #fff;
  205. height: 1px;
  206. border: 0;
  207. }
  208. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement