• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UserSpice 5 Folder Structure
#1
Folders Structure

Now we have only two root folders - users and usersc. The first is core, and the second is users customized. If we want to change something we need to copy files from core to custom folder and change it. I think, such solution looks rough. We need to implement MVC pattern.

In well-coded systems developer doesn't need to change core files. He using existing functions on front-end to generate static content and hooks to change something in admin panel. That's why I think, that WordPress folders structure is perfect (wp-admin and wp-includes is a core folders that never edit because it always updates, and wp-content - for a user's themes, plugins and content).

How I see UserSpice folders structure:
▣ core - CMS core files (api, cron, helpers ...).
admin - back-end files needed for displaying admin panel.
plugins - folder for plugins (dbman, demo, fileman ...).
▣ themes - main site templates (bs4, default, light ...).
uploads - folder for user's content (avatars, images and others).

This structure is approximate, but it best description of separation core files from user edit content. If new update exist, it rewrite core folder, but don't touch for example user's template or plugin.

With such folders structure we able to create own folders, for example pages and get links like mysite.com/pages/myfile.php. The file content may look like this:

PHP Code:
<?php theme_include('header'); ?>

    <section class="content wrap">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <h1><?php echo page_title(); ?></h1>
                    <?php echo page_content(); ?>
                </div>
            </div>
        </div>
        </section>

<?php theme_include('footer'); ?>

We just include header and footer from theme, and main code is between this includes (code in example taken from Anchor CMS page.php file).

If someone has ideas about how folders structure must look, please comment.
  Reply
#2
I think you may have missed the point of UserSpice. UserSpice, at its core, (from the perspective of the person using it to develop an application) is essentially 2 lines of code.

1. It's a call to an init file that sets everything up.
2. It's a call to a securePage function that enforces permissions and security.

UserSpice takes a "take it or leave it approach beyond that.

Don't like our DB class? Use meekro...write your own...do whatever you want. UserSpice doesn't care?

Want to make a login form with zero security? Write an input that literally just matches the input with the username in the db...no password, and say the person enters "admin" and you set $_SESSION['user']=1; and as far as UserSpice is concerned, you're logged in.

I can definitely appreciate MVC and all the other user management systems out there, but the reason that UserSpice has over 1.5 million downloads by people in every nation on earth is because it is so flexible. If your page has the 2 lines mentioned above...nothing else matters. You're welcome to use as much or as little of the UserSpice code as you want.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)