|
12 | 12 |
|
13 | 13 | } |
14 | 14 |
|
15 | | -function githubVersion (){ |
| 15 | +$html = "https://github.com/causefx/iDashboard-PHP/releases/latest"; |
16 | 16 |
|
17 | | - $html = "https://github.com/causefx/iDashboard-PHP/releases/latest"; |
18 | | - |
19 | | - $doc = new DOMDocument(); |
20 | | - |
21 | | - $doc->loadHTMLFile($html); |
22 | | - |
23 | | - $xpath = new DomXpath($doc); |
| 17 | +$doc = new DOMDocument(); |
24 | 18 |
|
25 | | - $version = $xpath->query('//span[@class="css-truncate-target"]')->item(0)->nodeValue; |
26 | | - |
27 | | - if(!isset($version)){ |
| 19 | +$doc->loadHTMLFile($html); |
| 20 | + |
| 21 | +$xpath = new DomXpath($doc); |
| 22 | + |
| 23 | +$githubChanges = $xpath->query('//div[@class="markdown-body"]//p')->item(0)->nodeValue; |
| 24 | + |
| 25 | +$githubVersion = $xpath->query('//span[@class="css-truncate-target"]')->item(0)->nodeValue; |
| 26 | + |
| 27 | +if(!isset($githubVersion)){ |
| 28 | + |
| 29 | + $githubVersion = "null"; |
28 | 30 |
|
29 | | - $version = "null"; |
30 | | - } |
31 | | - |
32 | | - return $version; |
33 | | - |
34 | 31 | } |
35 | 32 |
|
36 | | -$githubVersion = githubVersion(); |
| 33 | +if(!isset($githubChanges)){ |
37 | 34 |
|
38 | | -$currentVersion = "1.07"; |
| 35 | + $githubChanges = "null"; |
| 36 | + |
| 37 | +} |
| 38 | + |
| 39 | +$currentVersion = "1.08"; |
39 | 40 |
|
40 | 41 | foreach ($config as $keyname => $section) { |
41 | 42 |
|
@@ -63,7 +64,7 @@ function githubVersion (){ |
63 | 64 |
|
64 | 65 | }elseif($currentVersion < $githubVersion){ |
65 | 66 |
|
66 | | - $versionText = "New Version is out <a href=\"https://github.com/causefx/iDashboard-PHP/archive/master.zip\"> Download Here</a>"; |
| 67 | + $versionText = "New Version is out <a class=\"btn btn-success btn-sm\" href=\"https://github.com/causefx/iDashboard-PHP/archive/master.zip\" role=\"button\">Download Now</a> <button type=\"button\" class=\"btn btn-success btn-sm\" data-toggle=\"modal\" data-target=\"#changes\">View Changes</button>"; |
67 | 68 | $versionIcon = "times"; |
68 | 69 | $versionColor = "#d9534f"; |
69 | 70 |
|
@@ -514,6 +515,43 @@ function write_ini_file($content, $path) { |
514 | 515 | </div> |
515 | 516 |
|
516 | 517 | </form> |
| 518 | + |
| 519 | + <div class="modal fade" id="changes" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;"> |
| 520 | + |
| 521 | + <div class="modal-dialog" role="document"> |
| 522 | + |
| 523 | + <div class="modal-content"> |
| 524 | + |
| 525 | + <div class="modal-header"> |
| 526 | + |
| 527 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| 528 | + |
| 529 | + <span aria-hidden="true">×</span> |
| 530 | + |
| 531 | + </button> |
| 532 | + |
| 533 | + <h4 class="modal-title" id="myModalLabel">New Changes/Fixes</h4> |
| 534 | + |
| 535 | + </div> |
| 536 | + |
| 537 | + <div class="modal-body"> |
| 538 | + |
| 539 | + <?=$githubChanges;?> |
| 540 | + |
| 541 | + </div> |
| 542 | + |
| 543 | + <div class="modal-footer"> |
| 544 | + |
| 545 | + <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
| 546 | + |
| 547 | + |
| 548 | + </div> |
| 549 | + |
| 550 | + </div> |
| 551 | + |
| 552 | + </div> |
| 553 | + |
| 554 | + </div> |
517 | 555 |
|
518 | 556 | <script type="text/javascript" src="https://code.jquery.com/jquery-1.4.3.min.js"></script> |
519 | 557 |
|
|
0 commit comments