Topic: xml structure
How can I create this structure in xml ?
1 1 60a19eb042 otoño otoño en mallorca galeria content 3/3/2013 ´ This =========================1 one one text one date ========================== 2 two two text two date
You are not logged in. Please login or register.
Monstra → Development → xml structure
How can I create this structure in xml ?
1 1 60a19eb042 otoño otoño en mallorca galeria content 3/3/2013 ´ This =========================1 one one text one date ========================== 2 two two text two date
http://monstra.org/documentation/xmldb-api
You must create two tables.
1) Table "galleries" with fields: name, title, content, date
2) Table "photos" with filelds: title, content, date, gallery_id
As is normal MySQL Database
But for better perfomance in Monstra: create new "photos" table for each "gallery" table
1) Table "galleries" with fields: name, title, content, date
2) Table "photos_{gallery_id}" with filelds: title, content, date
1. first question
in install I put this:
Table::create('galeria', array('name','title','content','date'));
Table::create('photos',array('title','content','tags'));And now in plugin.admin.php
$galeria = new Table('galeria');
$photos = new Table('photos');as I do this photos_{gallery_id}
2.question
how to do a foreach with 2 tables (array_combine?)
understand me
Plugin Installation:
Create Table galleries
Table::create('galleries', array('name','title','content','date'));Create new gallery (and create photos table too)
$galleries = new Table('galleries');
$galleries->insert('Gallery name', 'Gallery title', 'Gallery content', time());
Table::create('galleries_photos_'.$galleries->lastId(), array('name','title','content','date'));This is just an Idea) Next you must write php logic for working with that tables. Actually it's part of backend development for backend developers )
I think it's deja vu, already discussed this somewhere here...
I have this code:
to delete the photo:
if (Request::get('del_photo')) {
if (Security::check(Request::get('token'))) {
$id = Request::post('id');
$galeria->deleteWhere($id);
Request::redirect('index.php?id=sandbox');
} else { die('csrf detected!'); }
}to view photos:
Why delete first image on click in other image?
I've solved thanks.
Monstra → Development → xml structure