Skip to content

Instantly share code, notes, and snippets.

View korenevskiy's full-sized avatar

Сергей korenevskiy

  • Ukraine, Nizhin
View GitHub Profile
@korenevskiy
korenevskiy / Registry.php
Created January 21, 2024 15:22
Class Reg heir Registry (Joomla CMS framework). This class has magic methods for use simple properties
<?php
if(class_exists('Reg') == false){
/**
* Class Reg heir Registry
* This class has magic methods for simple use properties
* Example: $reg->prop1; $reg->prop2 = 123;
*/
class Reg extends \Joomla\Registry\Registry{
function __get($nameProperty) {
@korenevskiy
korenevskiy / AddArticleInJoomla.sql
Last active January 19, 2024 21:58
Add content in MySQL in Joomla CMS
-- Query to add articles to the database
INSERT INTO `joom_content`(`asset_id`, `state`,`created_by`,`created_by_alias`,`access`,`version`,`featured`,`publish_up`,`language`, `created`,`modified`, `images`,`urls`,`attribs`,`metadata`,
`catid`, `alias`, `title`, `introtext`, `fulltext`, `note`, `ordering`, `metadesc`) VALUES
(0,1, 1,"",1,1,0, 0,'*', NOW(),NOW(), '{}','{}','{}','{}',
2, '__alias__', 'Title!', 'Intro!', '<p>Full Text</p>', 'Note', 0, 'metadesc');
-- Mandatory Query to add the process of articles required for the work
-- It runs 1 time for all articles after adding articles.
INSERT INTO joom_workflow_associations (item_id, stage_id, extension)