Skip to content

Commit

Permalink
Fixes v0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
joepdooper committed Apr 2, 2024
1 parent d6318af commit f2dcc99
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 12 deletions.
8 changes: 5 additions & 3 deletions core/classes/Ivy/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ public function delete()

public static function position($position, $items) {

return array_filter($items, function($item) use ($position) {
return property_exists($item, 'position') && $item->position === $position;
});
if($items) {
return array_filter($items, function($item) use ($position) {
return property_exists($item, 'position') && $item->position === $position;
});
}

}

Expand Down
2 changes: 1 addition & 1 deletion core/classes/Ivy/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Template extends Model {
public static string $url = "";
public static ?string $file;
public static array $positions = array();
public static mixed $content;
public static mixed $content = null;

public static function file($file, $content = null, $position = null): bool|string
{
Expand Down
53 changes: 45 additions & 8 deletions ivy.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CREATE TABLE `article` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`subtitle` varchar(255) NOT NULL,
`subject` int(11) NOT NULL,
`subject` json NOT NULL,
`image` varchar(255) DEFAULT NULL,
`token` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
Expand Down Expand Up @@ -120,6 +120,20 @@ VALUES
UNLOCK TABLES;


# Export von Tabelle item_tag
# ------------------------------------------------------------

DROP TABLE IF EXISTS `item_tag`;

CREATE TABLE `item_tag` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`item_id` int(11) NOT NULL,
`tag_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Export von Tabelle item_template
# ------------------------------------------------------------

Expand Down Expand Up @@ -168,7 +182,8 @@ CREATE TABLE `items` (
`token` int(11) DEFAULT NULL,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`sort` int(11) DEFAULT NULL,
`class` varchar(255) DEFAULT NULL,
`style` varchar(255) DEFAULT NULL,
`position_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `postid` (`table_id`),
KEY `userid` (`user_id`)
Expand Down Expand Up @@ -201,7 +216,6 @@ VALUES
(24,'Dark mode','DarkMode','1.0.0','Dark mode','template',1,0),
(25,'Text','Text','1.0.0','Text item','item',1,0),
(26,'Image','Image','1.0.0','Image item','item',1,0),
(27,'Tag','Tag','1.0.0','Create tags for items','filter',1,1),
(28,'Audio','Audio','1.0.0','Audio item','item',1,0),
(29,'Macy','macy','1.0.0','Macy.js - lightweight, dependency-free, 4kb masonry layout library, designed for a hassle-free configuration','javascript',1,0),
(33,'Sort item','SortItem','1.0.0','Sort items by drag and drop','template',1,0),
Expand All @@ -211,12 +225,35 @@ VALUES
(40,'Vimeo','Vimeo','1.0.0','Vimeo SDK','item',1,0),
(41,'Youtube','Youtube','1.0.0','Youtube player','item',1,0),
(44,'IframeManager','iframemanager','1.0.0','IframeManager from Orest Bida','utility',1,0),
(45,'Vanilla cookie consent','VanillaCookieConsent','1.0.0','Cookie consent from Orest Bida','utility',1,0);
(45,'Vanilla cookie consent','VanillaCookieConsent','1.0.0','Cookie consent from Orest Bida','utility',1,0),
(46,'Tag','Tag','1.0.0','Create tags for items','filter',1,1);

/*!40000 ALTER TABLE `plugin` ENABLE KEYS */;
UNLOCK TABLES;


# Export von Tabelle position
# ------------------------------------------------------------

DROP TABLE IF EXISTS `position`;

CREATE TABLE `position` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

LOCK TABLES `position` WRITE;
/*!40000 ALTER TABLE `position` DISABLE KEYS */;

INSERT INTO `position` (`id`, `value`)
VALUES
(1,'intro');

/*!40000 ALTER TABLE `position` ENABLE KEYS */;
UNLOCK TABLES;


# Export von Tabelle profiles
# ------------------------------------------------------------

Expand All @@ -235,7 +272,8 @@ LOCK TABLES `profiles` WRITE;

INSERT INTO `profiles` (`id`, `user_id`, `users_image`, `last_activity`)
VALUES
(1,1,NULL,'2024-02-26 19:39:26');
(1,1,'eff9fd259e5e07108658404eefb32d0e.jpg','2024-03-16 18:12:17'),
(2,2,NULL,'2024-02-28 19:29:41');

/*!40000 ALTER TABLE `profiles` ENABLE KEYS */;
UNLOCK TABLES;
Expand Down Expand Up @@ -297,7 +335,7 @@ INSERT INTO `tag` (`id`, `value`)
VALUES
(8,'Article'),
(9,'Documentation'),
(11,'Gig');
(10,'Gig');

/*!40000 ALTER TABLE `tag` ENABLE KEYS */;
UNLOCK TABLES;
Expand Down Expand Up @@ -367,8 +405,7 @@ LOCK TABLES `users` WRITE;

INSERT INTO `users` (`id`, `email`, `password`, `username`, `status`, `verified`, `resettable`, `roles_mask`, `registered`, `last_login`, `force_logout`)
VALUES
(1,'[email protected]','$2y$10$MPCNqwvXNzBK.Ip5PYhgGOkdzY.NrWgnvk.oz9RrEg0UmLKGnlpfu','ivy',0,1,1,263169,1701517536,1701537675,0);

(1,'[email protected]','$2y$10$MPCNqwvXNzBK.Ip5PYhgGOkdzY.NrWgnvk.oz9RrEg0UmLKGnlpfu','ivy',0,1,1,263169,1701517536,1701537675,0);

/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
Expand Down

0 comments on commit f2dcc99

Please sign in to comment.