User Control Panel
Advertisements

HELP US, HELP YOU!

Site Management

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Bot Depot Forum Index -> Recycle Bin 2.0
View unanswered posts
Author Message
$username=Username;
Newbie
Newbie


Joined: 07 Oct 2005
Posts: 38

Reputation: 8.9Reputation: 8.9Reputation: 8.9Reputation: 8.9Reputation: 8.9Reputation: 8.9Reputation: 8.9Reputation: 8.9
votes: 1

PostPosted: Sun Nov 13, 2005 11:07 pm    Post subject: Site Management Reply with quote

Plenty of us have our own web site. I was just curious how you go about managing the site (Uploading Files, Renaming, Moving, Copying, Editing, etc). Do you do it right of your computer? Through an online File Managing script? Or not at all? If you use a script, could you please post the URL of the download, I am trying to find a better site management script.
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Sun Nov 13, 2005 11:10 pm    Post subject: Reply with quote

I used to just upload from my computer, as I found it to be the best way. Recently though (ie, today and yesterday Razz) I've started converting my pages to XML format, and then getting the content directly from there. I'm creating a mini-CMS to upload files to any folder on my server, and to edit the XML.

Sample XML: http://www.darkmonkey.org.uk/new/xml/home.xml
Sample Page: http://www.darkmonkey.org.uk/new/

I've heard that Mambo CMS is very good - you may want to give that a try Wink

_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Nov 14, 2005 1:07 am    Post subject: Reply with quote

All my site's pages are text files, the file is only responsible for the page's own unique content (i.e. main body of the page). Query string "display=" is converted to the filename, i.e. display=about gives you "about.txt", and if the page isn't found it gives a custom 404-style error page.

So the main site's layout can be changed easily and every page will be automatically updated since they were never responsible for how the final page should look. Smile

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
$username=Username;
Newbie
Newbie


Joined: 07 Oct 2005
Posts: 38

Reputation: 8.9Reputation: 8.9Reputation: 8.9Reputation: 8.9Reputation: 8.9Reputation: 8.9Reputation: 8.9Reputation: 8.9
votes: 1

PostPosted: Mon Nov 14, 2005 1:19 am    Post subject: Reply with quote

Yes, but how do you add the text files/edit them? Do you just double click it and edit it on your comp? Or do you have a script that lets you edit it from any computer?
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Nov 14, 2005 1:34 am    Post subject: Reply with quote

$username=Username; wrote:
Yes, but how do you add the text files/edit them? Do you just double click it and edit it on your comp? Or do you have a script that lets you edit it from any computer?


When I run my own server, yeah I just edit them right from my desktop. When it was on another server, I'd edit them on my computer and upload them (so if the server crashed, I'd still have all the updates on my computer because they were changed there first).

And for when I wasn't at home, I made a page for editing files through the site, and could make updates to pages through a page on the site and then save them, and download them when I got home just to have a backup copy.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Nov 14, 2005 1:53 am    Post subject: Reply with quote

$username wanted my file editor code. It's actually a page within my content-managed site, so it won't run as a standalone script.

Basically what you need to do, use the open function to get the page's content into a <textarea>, have a save function to put the data back into the file... it's not too hard to figure out.

Here's my code anyway, $cks->{content} = the page's final output, <perl> = indicator for evaluated code interpreted by the site engine, <nofilter></nofilter> marks part of the code to not be filtered through the site engine (things like <tab>, $self, etc.)

Code:
<perl>
   $cks->{content} = '';

   # Special overrides.
   my $override = 0;
   my $over = {
      'tiril' => {
         permissions => {
            edit => 1,
            save => 1,
         },
         files       => {
            './vfive/pages/spyware.txt' => 1,
         },
      },
      'vortexbot' => {
         permissions => {
            edit => 1,
            save => 1,
         },
         files       => {
            './vfive/pages/test.txt' => 1,
         },
      },
   };

   # See if the user is eligible to override.
   if ($cks->{logged_in} == 1) {
      if (exists $over->{$sn}) {
         # Check that they're within their limits.
         my $action = $query{action};
         my $file   = $query{file};
         if (exists $over->{$sn}->{permissions}->{$action} && exists $over->{$sn}->{files}->{$file}) {
            $override = 1;
         }
      }
   }

   # Leader ONLY!
   if ($cks->{logged_in} == 1 && (&isTop || $override == 1)) {
      # Actions?
      if ($query{action} eq 'edit') {
         my $file_data = '';

         # If the file exists...
         if (-e $query{file}) {
            open (FILE, "$query{file}");
            @data = <FILE>;
            close (FILE);
            chomp @data;
            $file_data = join ("\n",@data);
         }
         else {
            $query{file} = './New File.txt';
         }

         # The Page.
         $cks->{content} = "<b class=\"header\">:: File Editor</b><br><br>\n\n"
            . "Edit the file using the form below.<br><br>\n\n"
            . "<form name=\"editor\" action=\"$self\" method=\"post\">\n"
            . "<input type=\"hidden\" name=\"display\" value=\"leader.files\">\n"
            . "<input type=\"hidden\" name=\"action\" value=\"save\">\n"
            . "<input type=\"hidden\" name=\"c\" value=\"1\">\n\n"
            . "<b class=\"header\">:: File Path &amp; Name</b><br>\n"
            . "<input type=\"text\" size=\"100\" name=\"file\" class=\"text\" value=\"$query{file}\">"
            . "<br><br>\n\n"
            . "<b class=\"header\">:: Options</b><br>\n"
            . "<input type=\"submit\" value=\"Save File\" class=\"bttn\">\n"
            . "<input type=\"reset\" value=\"Revert Changes\" class=\"bttn\">"
            . "<input type=\"button\" value=\"Exit Editor\" class=\"bttn\" "
            . "onClick=\"self.location=\'$self?display=leader.files&[cks]\';\"><br><br>\n\n"
            . "<b class=\"header\">:: File Data</b><br>\n"
            . "<nofilter>"
            . "<textarea cols=\"100\" rows=\"20\" class=\"text\" name=\"data\" "
            . "wrap=\"off\">$file_data</text" . "area></nofilter>\n"
            . "</form>";
      }
      elsif ($query{action} eq 'save') {
         # Save the data.
         open (FILE, ">$query{file}");
         print FILE $query{data};
         close (FILE);

         # Log this.
         open (LOG, ">>$cks->{path}->{logs}/file_edit.txt");
         print LOG localtime(time) . " :: $cks->{users}->{$sn}->{username} <$ENV{REMOTE_ADDR}> has edited file: $query{file}\n\n";
         close (LOG);

         $cks->{content} = "<b class=\"header\">:: Save Successful!</b><br><br>\n\n"
            . "The file <b>$query{file}</b> has been saved.<br><br>\n\n"
            . "¤ <a href=\"$self?display=leader.files&action=edit&file=$query{file}&[cks]\">"
            . "Back to Editing File</a><br>\n"
            . "¤ <a href=\"$self?display=leader.files&[cks]\">"
            . "Back to File Manager</a>";
      }
      else {
         # Main List Page.
         $cks->{content} = "<b class=\"header\">:: File Manager</b><br><br>\n\n"
            . "All your site's files can be found here for editing. Also, "
            . "the text field below can be used to access any other file on "
            . "your server.<br><br>\n\n"
            . "<form name=\"editfile\" action=\"$self\" method=\"post\">\n"
            . "<input type=\"hidden\" name=\"display\" value=\"leader.files\">\n"
            . "<input type=\"hidden\" name=\"action\" value=\"edit\">\n"
            . "<input type=\"hidden\" name=\"c\" value=\"1\">\n"
            . "<b class=\"header\">:: Quick Jump</b><br>\n"
            . "If you know the exact path to the file you want, enter it below.<br>\n"
            . "<input type=\"text\" size=\"50\" name=\"file\" class=\"text\">"
            . "<input type=\"submit\" value=\"OK!\" class=\"bttn\">\n"
            . "</form><br><br>\n\n"
            . "<b class=\"header\">:: All Files List</b><br><br>\n\n"
            . "<table width=\"500\" border=\"1\" bordercolor=\"#AAAAAA\" "
            . "cellspacing=\"0\" cellpadding=\"0\">\n";

         # Open directories.
         my $switch = 1;

         # Paths to show.
         my @paths = (
            'sources',
            'global',
            'pages',
            'stats',
            'users',
            'bans',
            'news',
            'hits',
            'tag',
            'online',
            'poll',
            'notes',
            'pm',
            'logs',
         );

         foreach my $dir (@paths) {
            my @filez = ();
            opendir (DIR, "$cks->{path}->{$dir}");
            foreach my $file (sort(grep(!/^\./, readdir(DIR)))) {
               push (@filez, $file);
            }
            closedir (DIR);

            # Prepare the table.
            if ($switch == 1) {
               $switch = 2;

               $cks->{content} .= "<tr>\n"
                  . "<td width=\"250\" height=\"300\" align=\"left\" valign=\"top\">\n"
                  . "<div width=\"250\" height=\"300\" style=\"width: 250px; height: 300px; "
                  . "overflow: auto\">\n"
                  . "<font face=\"Verdana,Arial\" size=\"2\" color=\"#000000\" class=\"font\">\n"
                  . "<b class=\"header\">&lt;\$dir ($cks->{path}->{$dir})&gt;</b>"
                  . "<br><br>\n";
               foreach my $item (@filez) {
                  $cks->{content} .= "¤ "
                     . "<a href=\"$self?display=leader.files&"
                     . "action=edit&file=$cks->{path}->{$dir}/$item&[cks]\">"
                     . "$item</a><br>\n";
               }
               $cks->{content} .= "</font>\n"
                  . "</div>\n"
                  . "</td>\n";
            }
            else {
               $switch = 1;

               $cks->{content} .= "<td width=\"250\" height=\"300\" align=\"left\" valign=\"top\">"
                  . "<div width=\"250\" height=\"300\" style=\"width: 250px; height: 300px; "
                  . "overflow: auto\">\n"
                  . "<font face=\"Verdana,Arial\" size=\"2\" color=\"#000000\" class=\"font\">\n"
                  . "<b class=\"header\">&lt;\$dir ($cks->{path}->{$dir})&gt;</b>"
                  . "<br><br>\n";
               foreach my $item (@filez) {
                  $cks->{content} .= "¤ "
                     . "<a href=\"$self?display=leader.files&"
                     . "action=edit&file=$cks->{path}->{$dir}/$item&[cks]\">"
                     . "$item</a><br>\n";
               }
               $cks->{content} .= "</font>\n"
                  . "</div>\n"
                  . "</td>\n"
                  . "</tr>\n";
            }
         }
         $cks->{content} .= "</table>\n";
      }
   }
   else {
      $cks->{content} .= "<b class=\"header\">:: Authentication Error!</b><br><br>\n\n"
         . "Only the site LEADER may access this page!";
   }
</perl>

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Bot Depot Forum Index -> Recycle Bin 2.0 All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group