Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FairCoin
fips
Commits
7d80fe33
Commit
7d80fe33
authored
Mar 18, 2019
by
Gampe Sebastian
Browse files
add roadmap
parent
8dff8663
Changes
2
Hide whitespace changes
Inline
Side-by-side
functions/roadmap.php
0 → 100644
View file @
7d80fe33
<?php
define
(
'ROADMAP'
,
'data/roadmap.json'
);
define
(
'FIPS_URL'
,
'https://git.fairkom.net/FairCoin/fips/blob/master/proposals/'
);
define
(
'FIPS_URL_RAW'
,
'https://git.fairkom.net/FairCoin/fips/raw/master/proposals/'
);
define
(
'FIPS'
,
Array
(
'fip-0001'
,
'fip-0002'
)
);
function
cURL
(
$url
){
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
$data
=
curl_exec
(
$ch
);
curl_close
(
$ch
);
return
$data
;
}
function
get_param
(
$text
,
$param
){
$A
=
preg_split
(
'/'
.
$param
.
'/'
,
$text
);
$B
=
preg_split
(
'/
/'
,
$A
[
1
]);
return
trim
(
$B
[
0
]
);
}
function
roadmap_create
(){
$FIPS
=
Array
();
foreach
(
FIPS
as
$fip
){
$f
=
cURL
(
FIPS_URL_RAW
.
$fip
.
'.md'
);
$F
=
preg_split
(
'/```/'
,
$f
)[
1
];
if
(
!
empty
(
$F
)
){
$files
=
get_param
(
$F
,
'Files:'
);
$files
=
preg_replace
(
'/\[/'
,
'["'
,
$files
);
$files
=
preg_replace
(
'/\]/'
,
'"]'
,
$files
);
$files
=
preg_replace
(
'/,/'
,
'","'
,
$files
);
array_push
(
$FIPS
,
Array
(
'URL'
=>
FIPS_URL
.
$fip
.
'.md'
,
'FIP'
=>
get_param
(
$F
,
'FIP:'
),
'Title'
=>
get_param
(
$F
,
'Title:'
),
'Author'
=>
get_param
(
$F
,
'Author:'
),
'Discussion-To'
=>
get_param
(
$F
,
'Discussion-To:'
),
'Comments-URI'
=>
get_param
(
$F
,
'Comments-URI:'
),
'Type'
=>
get_param
(
$F
,
'Type:'
),
'Status'
=>
get_param
(
$F
,
'Status:'
),
'Created'
=>
get_param
(
$F
,
'Created:'
),
'Updated'
=>
get_param
(
$F
,
'Updated:'
),
'Scheduled'
=>
get_param
(
$F
,
'Scheduled:'
),
'Requires'
=>
get_param
(
$F
,
'Requires:'
),
'Replaces'
=>
get_param
(
$F
,
'Replaces:'
),
'Superseded-By'
=>
get_param
(
$F
,
'Superseded-By:'
),
'Files'
=>
json_decode
(
$files
,
true
)
)
);
}
}
echo
json_encode
(
$FIPS
);
$fp
=
fopen
(
ROADMAP
,
'w+'
);
fwrite
(
$fp
,
json_encode
(
$FIPS
)
);
fclose
(
$fp
);
}
if
(
$_GET
[
'action'
]
==
'update'
){
roadmap_create
();
}
else
{
$fp
=
fopen
(
ROADMAP
,
'r'
);
$fips
=
fread
(
$fp
,
filesize
(
ROADMAP
));
fclose
(
$fp
);
$FIPS
=
json_decode
(
$fips
,
true
);
$tmp
=
'<tr><th>Created</th><th>Scheduled</th><th>FIP</th><th>Title</th><th>Type</th><th>Status</th></tr>'
;
foreach
(
$FIPS
as
$fip
){
$tmp
.
=
'<tr>'
;
$tmp
.
=
'<td>'
.
$fip
[
'Created'
]
.
'</td>'
;
$tmp
.
=
'<td>'
.
$fip
[
'Scheduled'
]
.
'</td>'
;
$tmp
.
=
'<td><a href="'
.
$fip
[
'URL'
]
.
'">'
.
$fip
[
'FIP'
]
.
'</a></td>'
;
$tmp
.
=
'<td>'
.
$fip
[
'Title'
]
.
'</td>'
;
$tmp
.
=
'<td>'
.
$fip
[
'Type'
]
.
'</td>'
;
$tmp
.
=
'<td>'
.
$fip
[
'Status'
]
.
'</td>'
;
$tmp
.
=
'</tr>'
;
}
echo
'<h2>FairCoin EcoSystem Roadmap</h2>'
;
echo
'<table class="table">'
.
$tmp
.
'</table>'
;
}
?>
roadmap.php
0 → 100644
View file @
7d80fe33
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
FairCoin FreeVision Price Ticker
</title>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"description"
content=
""
>
<meta
name=
"author"
content=
""
>
<meta
name=
"robots"
content=
"noindex, nofollow"
>
<link
href=
"assets/bootstrap/bootstrap.min.css"
rel=
"stylesheet"
>
</head>
<body>
<?php
include_once
(
'functions/roadmap.php'
);
?>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment