The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 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


Messages In This Thread
UserSpice 5 Folder Structure - by Bogdan - 01-05-2019, 12:53 PM
RE: UserSpice 5 Folder Structure - by mudmin - 01-06-2019, 02:24 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)