Author Topic: XeDit / Website Editor  (Read 5129 times)

Ameer

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
    • Ameer Dawood
Re: XeDit / Website Editor
« Reply #80 on: September 17, 2010, 05:38:43 PM »
Dex,
How about the below? Just an idea! Far from completion.
Code: [Select]
<table class="module">
<tr>
<td align="center" width="300">

<?php
$data directorytoarray();
sort($data);
$count count($data);
?>


<h3 style="margin:0px 0px 5px 0px;"><?php echo $xedit['Phrase']['11']; ?> (<?php echo $count?> <?php echo $xedit['Phrase']['12']; ?>)</h3>

<script type="text/javascript">
function switchMethod(show, hide) {
document.getElementById(show).style.display='inline';
document.getElementById(hide).style.display='none';
}
</script>
<input type="radio" name="omethod" checked onclick="switchMethod('filelist', 'manual');" /><?php echo $xedit['Phrase']['13']; ?><br />
<input type="radio" name="omethod" onclick="switchMethod('manual', 'filelist');" /><?php echo $xedit['Phrase']['14']; ?><br />

<form id="filelist" method="post" action="" onSubmit="return dropdown(this.gourl)" style="display: inline;">
<select name="gourl">
<option value=""><?php echo $xedit['Phrase']['13']; ?></option>

<?php
foreach (
$data as $key => $read) {
$read str_replace("<###>./""""<###>" $read);
echo '<option value="' $_SERVER['PHP_SELF'] . "?action=open&file=" $read '">' $read "</option>";
}
?>


</select>
<div><input style="margin:0px 0px 0px 0px;" type="submit" value="<?php echo $xedit['Phrase']['11']; ?>"></div>
</form>

<form id="manual" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" style="display: none;">
<input name="action" type="hidden" value="open">
<input name="file" type="text" value="<?php echo $_REQUEST['file']; ?>">
<div><input style="margin:0px 0px 0px 0px;" type="submit" value="<?php echo $xedit['Phrase']['14']; ?>"></div>
</form>

</td>
</tr>
</table>
Also, you missed yet another </option> in the first option element, which has $xedit['Phrase']['13']
Follow the standards, not IE.
- I have decided that I would no longer be developing for "any" of the browsers. I would rather follow the standards and live happily ever after.

D3xt3r

  • Full Member
  • ***
  • Posts: 125
    • View Profile
    • XegmentDelta
Re: XeDit / Website Editor
« Reply #81 on: September 18, 2010, 02:48:34 AM »
Thanks for the work Human 1.0 and Ameer.

I have been busy the past week or so. Sorry about that. I'll have to get into the code, and check out your additional coding there.

Thanks for the support guys.

Joey

  • Hero Member
  • *****
  • Posts: 725
  • Unreason
    • View Profile
Re: XeDit / Website Editor
« Reply #82 on: September 18, 2010, 05:25:41 AM »
No problem D3x, real life goes first  :D
Please correct any grammatical error I may make; I wish to improve on my English as much as possible!

Ameer

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
    • Ameer Dawood
Re: XeDit / Website Editor
« Reply #83 on: September 19, 2010, 06:21:46 PM »
Okay Dex! I am waiting... for the next version...  ;)
Follow the standards, not IE.
- I have decided that I would no longer be developing for "any" of the browsers. I would rather follow the standards and live happily ever after.

Joey

  • Hero Member
  • *****
  • Posts: 725
  • Unreason
    • View Profile
Re: XeDit / Website Editor
« Reply #84 on: September 24, 2010, 04:46:21 PM »
some minor changes available at http://t2b.110mb.com/xedit.txt again

I included the changes in this post (http://www.thehosthelpers.com/xedit-website-editor-t855.0.html;msg9962#msg9962):
The changes I made since the last post have stars***. to recap, since your last release, this changed:

    ROOT FOLDER:
    • Added a setting (settings page) to change the directory listing root. When one is set, the manual file open entry field will start with this folder, to save typing. Automatic directory listing will only list this folder. (awesome if your root has huge amounts of files)
    • Editing files at the real root is still possible using the manual open field. NO ./ or ../ are required. Just remove the root directory from the field and enter any other filename.
    • **If the directory specified to be set as root does not exist, XeDit will abort with a warning**

      MINOR STUFF
      • **File type list missed dots for "jpeg" and "midi". I made them ".jpeg", ".midi". I fixed the extension detection to work with any length extensions.**
      • Fixed missing references to the French language in code's comments.
      • **New theme 'Ruby Red'**

      For the not allowed list, every extension will now work. Even if it is shorter or longer than three letters. Your code was taking the last four letters of a filename and assuming it would be the extension. That was why you had "jpeg" and "midi" without dots, right?

      I changed
      Code: [Select]
      if (!in_array(substr($file, -4), $xedit['not_allowed'])) into
      Code: [Select]
      if (!in_array("." . end(explode(".", $file)), $xedit['not_allowed'])) which will explode the string at dots, automatically go to the last variable in an array if there are multiple dots (the end() function) so that it will always get the right extension.

      For the new functions, I created new language phrases where needed.

      EDIT: what is with SMF randomly adding list tags everywhere?
      « Last Edit: September 26, 2010, 06:34:08 AM by Human 1.0 »
      Please correct any grammatical error I may make; I wish to improve on my English as much as possible!

      Ameer

      • Jr. Member
      • **
      • Posts: 83
        • View Profile
        • Ameer Dawood
      Re: XeDit / Website Editor
      « Reply #85 on: September 24, 2010, 09:59:05 PM »
      Great additions, I would say.
      Follow the standards, not IE.
      - I have decided that I would no longer be developing for "any" of the browsers. I would rather follow the standards and live happily ever after.

      Joey

      • Hero Member
      • *****
      • Posts: 725
      • Unreason
        • View Profile
      Re: XeDit / Website Editor
      « Reply #86 on: September 25, 2010, 02:26:22 PM »
      thank you =) Let's wait for d3xt3r to return here and see what he thinks =)
      Please correct any grammatical error I may make; I wish to improve on my English as much as possible!

      D3xt3r

      • Full Member
      • ***
      • Posts: 125
        • View Profile
        • XegmentDelta
      Re: XeDit / Website Editor
      « Reply #87 on: September 27, 2010, 11:28:12 PM »
      Sorry that I haven't tested out the additions. I will have to do that very very soon. Right now I am trying to catch up on forum info. But thanks for all the interest and support, very glad XeDit is of use to people. :)

      Joey

      • Hero Member
      • *****
      • Posts: 725
      • Unreason
        • View Profile
      Re: XeDit / Website Editor
      « Reply #88 on: September 28, 2010, 10:05:15 AM »
      I had some more ideas (to get to edit the extension list in the settings page for example)
      but it's mroe than average work so I thought to aks you what to do first.

      Here is what I had:
      Add some random thing that is not an extension (so it will not get blocked) into the array. Somethin glike "LASTLISTENTRY"

      Then, on the settings page, do a foreach() on the array of not-allowed list, and filter out the last one.

      Make a delete buttion per word, and do a replace  function-ish to remove it from the array.
      If one wants to add a word, replace , "LASTLISTENTRY") with ,".NEWEXT", "LASTLiSTENTRY")

      that way it might be possible, but to me it seems too much work for something that can be editied by simply opening up xedit.php anyway..
      Please correct any grammatical error I may make; I wish to improve on my English as much as possible!

      Joey

      • Hero Member
      • *****
      • Posts: 725
      • Unreason
        • View Profile
      Re: XeDit / Website Editor
      « Reply #89 on: October 08, 2010, 05:34:14 PM »
      I ran into a problem where changing the authentication would re-md5 the alreayd md5'd password even when it wasn't changed. I changed this:
      Code: [Select]
      ###########################################
      ### Modify Authentication
      if ($xedit["logged_in"] && isset($_REQUEST['action']) && $_REQUEST['action'] == "authentication") {

      $contents = file_get_contents(basename(__FILE__));

      $contents = str_replace("xedit[\"username\"] = \"" . $xedit["username"], "xedit[\"username\"] = \"" . $_REQUEST['name'], $contents);

      $contents = str_replace("xedit[\"password\"] = \"" . $xedit["password"], "xedit[\"password\"] = \"" . md5($_REQUEST['pass']), $contents);

      $contents = str_replace("xedit[\"encrypt_key\"] = \"" . $xedit["encrypt_key"], "xedit[\"encrypt_key\"] = \"" . $_REQUEST['encrypt_key'], $contents);

      @file_put_contents(basename(__FILE__), $contents) or xedit_display_quick('<div class="h2">' . $xedit['Phrase']['46'] . '</div><br><div>' . $xedit['Phrase']['37'] . '</div>');

      xedit_display_quick('<div class="h2">' . $xedit['Phrase']['47'] . '</div>');

      }
      ###########################################

      into
      Code: [Select]
      ###########################################
      ### Modify Authentication
      if ($xedit["logged_in"] && isset($_REQUEST['action']) && $_REQUEST['action'] == "authentication") {

      $contents = file_get_contents(basename(__FILE__));

      $contents = str_replace("xedit[\"username\"] = \"" . $xedit["username"], "xedit[\"username\"] = \"" . $_REQUEST['name'], $contents);

      if ($_REQUEST['pass'] != $xedit["password"]){
      $contents = str_replace("xedit[\"password\"] = \"" . $xedit["password"], "xedit[\"password\"] = \"" . md5($_REQUEST['pass']), $contents);
      }

      $contents = str_replace("xedit[\"encrypt_key\"] = \"" . $xedit["encrypt_key"], "xedit[\"encrypt_key\"] = \"" . $_REQUEST['encrypt_key'], $contents);

      @file_put_contents(basename(__FILE__), $contents) or xedit_display_quick('<div class="h2">' . $xedit['Phrase']['46'] . '</div><br><div>' . $xedit['Phrase']['37'] . '</div>');

      xedit_display_quick('<div class="h2">' . $xedit['Phrase']['47'] . '</div>');

      }
      ###########################################

      So that it only changes the password when a new password has actually been entered.
      http://t2b.110mb.com/xedit.txt as usual
      Please correct any grammatical error I may make; I wish to improve on my English as much as possible!

      paulwratt

      • Lurker
      • *
      • Posts: 2
        • View Profile
      Re: XeDit / On Host Text File Editor
      « Reply #90 on: January 12, 2011, 08:52:48 PM »
      @Mop

      I have thought about adding more code interface features. But truthfully, in the end, it's a very basic editor interface. With the exception of some additions that make it a little more user friendly, I'm trying to keep it as simple as possible in the editor interface.

      I would like to add some features for one-click adding of IMG HREF META tag fields.


      I have not got through all the posts in this thread yet, so I dont know if you have any "one-click" code yet. If not check below url for some experiments I was doing for eoCMS a couple of years ago (hey Confuser). It is quite flexible and should still be very compatible between browsers:
      http://paulwratt.110mb.com/bbcode/

      ---

      Also I have some custom code to do Goto Line, and Search (& Replace). Those are the 2 main things I require in an editor. I think I also have css mod to show line numbers in textarea (but I dont use these atm, not needed with Goto)

      Paul
      PS cheers for the continued credit for edit area realestate fix :)
      « Last Edit: January 12, 2011, 09:04:46 PM by paulwratt »