Posted in core
5666
11:33 pm, December 13, 2018
 

Core Class - Basic Core Structure

A Core class that can be used as a base for all content types and uses the extend classes to define the database variables. So basically you can set up core class and then create sub extend classes to define everything easily. I wanted something where i could just add items into an array and they would auto be created in a database taking away some of the pain of creating table structures and all that kind of thing.

For each core extend it creates a new database file in sqlite, so each extend is contained in its own file. Im not sure how this degrades the site performance, but it seems to work ok so far.

When the rows of each database exceed 100,000 it seems to slow a bit in text searching but i would guess that this would happen most data bases that have text searching so it wouldnt make too much of a difference. 

This is just the core class structure i will add each core function seperately and explain each bit or just add the code. 

PHP

class core {

    public $status = "";
    public $nice_name = "Core";
    public $nice_description = "The Main Core";
    public $title_url_length = 100;
    public $images_enabled = true; // enable or disable the use of image links in this class

    public $db; // was private static
    public $db_directory = "/../db/";
    public $db_table_name = "core";
    public $db_file_location = ""; // can set manually if do not want to use default name. 

    public $add_to_menu = false; // add this class to the main menu

    protected $core_version = "core 1.0.1";
    
    // default database variables + array
    public $id;
    public $uid;
    public $insdate;
    public $title;
    public $additional;
    public $category;
    
    public $load_array = [
    "id",
    "uid",
    "insdate",
    "title",
    "additional",
    "category",
    ]; 

}

View Statistics
This Week
115
This Month
508
This Year
904

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
In this case my anchor this week becomes driving almost 2hrs outside of Atlanta to one of my favorite hard core gyms in the world.. MetroFlex aka The Dungeon. The gym owners turn the heat way up so it becomes a fun sweat box and the gym members just watch from afar and leave me alone. I happily drive myself long distances to find MY ANCHOR. Our anchor allows us to have balance, focus and be as productive as possible. And if you're in the middle of a heavy set and your headphones start to fall off your head, like mine did here.. well.. f*ck the headphones. Let em break and fall. You can always get a new pair, but the iron ain't ever gonna lift itself.
Unknown
Random CSS Property

text-underline-position

The text-underline-position CSS property specifies the position of the underline which is set using the text-decoration property's underline value.
text-underline-position css reference