To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 64601e43 authored by vermeul's avatar vermeul
Browse files

README updated

parent fcaabdef
.DS_Store
.*.*
*.swp
*~
......@@ -135,6 +135,7 @@ The result is a sortable table containing the following data:
Because Pages can be long, the link contains an anchor (bookmark) and thus the result will appear immediately at the top of the page.
To achieve this, all annotations automatically get a bookmark generated which will result in a unique `id` within that page.
<<<<<<< Updated upstream
## Annotation Categories
......@@ -207,4 +208,3 @@ To delete a category, add this to any Wiki Page:
It will delete the category from the database. Annotations will still be there, but no longer assigned to a category.
If this category was a parent- or child-category, then this connection will break and you might not receive the same
results as before when searching for annotations. Therefore: be careful!
......@@ -11,12 +11,10 @@ CREATE TABLE /*_*/yata_category (
id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(255),
description blob,
parent_id int unsigned,
path varchar(1000)
parent_id int unsigned
) ;
CREATE INDEX /*i*/yata_category_name ON /*_*/yata_category (name);
CREATE INDEX /*i*/yata_category_parent ON /*_*/yata_category (parent_id);
CREATE INDEX /*i*/yata_category_path ON /*_*/yata_category (path);
COMMIT;
......@@ -22,19 +22,45 @@ this is THE END
EOT;
$where = array();
if ($where) {
die("bla");
}
else {
die("blu");
}
$blas = array("one", "two", "threee");
$where = array_merge($where, $blas);
#$where[] = $blas;
var_dump($where);
die;
# match either {{#annot: or {{#annotend:
# fetch all options too
# ignore whitespace, except at the beginning
$data = "slkfjsdkf";
$annots_found = preg_match_all('/(?P<annotation>{{#annot(?P<end>end)?\s*:\s*(?P<opts>.*?)\s*}})/s', $data, $reg_params, PREG_OFFSET_CAPTURE);
function create_id() {
$id = str_pad(dechex(mt_rand(0, 0xFFFFFF)), 6, '0', STR_PAD_LEFT);
$id = substr(
str_shuffle(
str_repeat(
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
mt_rand(1,10)
)
),
1,4);
#$id = substr(md5(rand()), 0, 4);
#$id = substr(str_shuffle(MD5(microtime())), 0, 6);
#$id = str_pad(dechex(mt_rand(0, 0xFFFFFF)), 6, '0', STR_PAD_LEFT);
return $id;
}
$starts = array();
$ends = array();
$annotations_with_id = array();
$new_annotations = array();
$new_data = "";
......@@ -49,14 +75,14 @@ $new_data = "";
$starts = array();
$start_loc = 0;
$end_loc = 0;
if ($annots_found) {
#if ($annots_found) {
foreach($reg_params["annotation"] as $index => $value) {
# $value[1] contains the location where the current tag has been found
$end_loc = $value[1];
$new_data = $new_data . substr($data, $start_loc, $end_loc-$start_loc);
print("end = $end_loc, start = $start_loc\n");
print substr($data, $start_loc, $end_loc-$start_loc);
print "\n------------------------------------\n";
#print("end = $end_loc, start = $start_loc\n");
#print substr($data, $start_loc, $end_loc-$start_loc);
#print "\n------------------------------------\n";
$start_loc = $value[1] + strlen($value[0]);
# we encountered an annotation start
if ($reg_params["end"][$index][0] === "") {
......@@ -118,10 +144,11 @@ if ($annots_found) {
}
}
}
}
else {
$new_data = $data;
}
$new_data = $new_data . substr($data, $start_loc, strlen($data)-$start_loc);
#}
#else {
# $new_data = $data;
#}
print $new_data;
#var_dump($reg_params["annotation"]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment