Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a few things #16

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5d4cc19
Added some updating functions for later.
gugahoi Jul 31, 2011
367df5e
Able to get the name of the folder now.
gugahoi Jul 31, 2011
ed52c1e
Updated ignored files
gugahoi Aug 3, 2011
4795e3c
Further improvements of update function.
gugahoi Aug 3, 2011
e915a87
More functions
gugahoi Aug 3, 2011
b7339c5
Update functions updated
gugahoi Aug 7, 2011
2e2575e
More updates
gugahoi Aug 7, 2011
f273b38
Moving to tmp directory
gugahoi Aug 7, 2011
98ace2e
Moving to tmp dir.
gugahoi Aug 7, 2011
3b0ec93
Rearranging
gugahoi Aug 7, 2011
e1df6e1
More updates
gugahoi Aug 7, 2011
2e06fa1
Updated Trakt widget to Ajax to speed up loading of page.
gugahoi Aug 10, 2011
fbd6e6e
Added some jquery toggling.
gugahoi Aug 10, 2011
eb4aaec
ignore
gugahoi Aug 10, 2011
3ea1294
not ignoring.
gugahoi Aug 10, 2011
7b1b71f
Added tmp, update folder.
gugahoi Aug 10, 2011
7e9f26a
Added some logic to updating.
gugahoi Aug 10, 2011
0bfd370
Typo
gugahoi Aug 10, 2011
c81046c
Ignoring again.
gugahoi Aug 10, 2011
dc9e3d8
Added jquery.
gugahoi Aug 10, 2011
46f68f3
More checks.
gugahoi Aug 10, 2011
432cdc7
More stuff.
gugahoi Aug 10, 2011
d4447f1
The typo is back?!?!
gugahoi Aug 10, 2011
7adbcd0
More clean ups.
gugahoi Aug 10, 2011
8e52e64
Updating commit numbers.
gugahoi Aug 10, 2011
c385445
Display none tables.
gugahoi Aug 10, 2011
46a2cbc
forgot ; on line 10
gugahoi Aug 10, 2011
2a1f7cb
Added html tags
gugahoi Aug 10, 2011
a23eaa4
Almost there!!!
gugahoi Aug 10, 2011
b31bd58
Hidding tables.
gugahoi Aug 10, 2011
320c51e
Added css
gugahoi Aug 11, 2011
033e6a7
Added widget body and title.
gugahoi Aug 11, 2011
d1f96c6
Added buttons
gugahoi Aug 11, 2011
76b9c23
Wrong way to label a button.
gugahoi Aug 11, 2011
5abb5c4
Some bug ironing in the page.
gugahoi Aug 11, 2011
9a7dc8f
Started converting individual actions to functions.
gugahoi Aug 11, 2011
0cbc5a9
Converted rrmdir return values.
gugahoi Aug 11, 2011
a33295a
Added main table
gugahoi Aug 11, 2011
78738b8
Added some javascript
gugahoi Aug 11, 2011
62eee42
more javascript. Downloading works.
gugahoi Aug 11, 2011
419a1f2
More javascript!
gugahoi Aug 11, 2011
cc8ccb7
update section.
gugahoi Aug 11, 2011
b00451d
FInished js?
gugahoi Aug 11, 2011
4eb48eb
Found an error....
gugahoi Aug 11, 2011
eae399e
Added some error feedback
gugahoi Aug 11, 2011
9c66718
Found the directory problem.
gugahoi Aug 11, 2011
938cd21
Less echoing.
gugahoi Aug 11, 2011
e62e8da
Still a lot of 1's?
gugahoi Aug 11, 2011
b7afeac
Moving new items
gugahoi Aug 11, 2011
199fc4b
Move update section.
gugahoi Aug 11, 2011
76b8c32
Clean up fix.
gugahoi Aug 11, 2011
915b3a7
Single returns.
gugahoi Aug 11, 2011
462e8cb
Forgot one condition.
gugahoi Aug 11, 2011
e0d7ab9
Ceaning tmp and update folder before the start of the updating proces…
gugahoi Aug 11, 2011
d86f244
Finally cleaning up...
gugahoi Aug 11, 2011
acb23fb
Forgot to comment out something silly.
gugahoi Aug 11, 2011
c2ce031
Updating commit number.
gugahoi Aug 11, 2011
4f47891
Updated settings page.
gugahoi Aug 11, 2011
328ead8
Forgot <td>'s
gugahoi Aug 11, 2011
551fbda
Oh man, another silly one. update.html -> update.php
gugahoi Aug 11, 2011
891ef77
Redirecting after successfull update.
gugahoi Aug 14, 2011
ca41d15
Skipping first run when config.ini already exists.
gugahoi Aug 14, 2011
b746830
Added first version of jDownloader widget.
gugahoi Aug 14, 2011
6211202
Fixed stop/start entire queue.
gugahoi Aug 14, 2011
944817d
Updated default-layout to add jDownloader and start with system and t…
gugahoi Aug 14, 2011
b489383
ComingEpisodes Lunias' Fix
gugahoi Aug 19, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ layout.php
config.ini
m/mobileconfig.php
sbpcache/*
update.zip
update/*
tmp/*
Empty file modified EXTRAS/Core.js
100644 → 100755
Empty file.
Empty file modified EXTRAS/MediaLibrary.js
100644 → 100755
Empty file.
Empty file modified EXTRAS/index.html
100644 → 100755
Empty file.
28 changes: 16 additions & 12 deletions default-layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@
"title" => "XBMC Library",
"display" => ""
),
"wControl" => array(
"title" => "Control",
"display" => ""
),
"wRecentTV" => array(
"title" => "Recent TV",
"display" => ""
),
"wRecentMovies" => array(
"title" => "Recent Movies",
"display" => ""
)
),
),
"section3" => array(
"wSearch" => array(
Expand All @@ -36,13 +32,13 @@
"wHardDrives" => array(
"title" => "Hard Drives",
"display" => ""
),
"wControl" => array(
"title" => "Control",
"display" => ""
)
),
"section4" => array(
"wNowPlaying" => array(
"title" => "Now Playing",
"display" => ""
),
"wTransmission" => array(
"title" => "Transmission",
"display" => ""
Expand All @@ -51,18 +47,26 @@
"title" => "Sabnzbd",
"display" => ""
),
"wjDownloader" => array(
"title" => "jDownloader",
"display" => ""
),
"wMessage" => array(
"title" => "XBMC Message",
"display" => ""
),
"wNowPlaying" => array(
"title" => "Now Playing",
"display" => ""
),
"wTrakt" => array(
"title" => "trakt.tv",
"display" => ""
"display" => "collapsed"
),
"wSystem" => array(
"title" => "System info",
"display" => ""
)
"display" => "collapsed"
),
)
);

Expand Down
Empty file modified firstrun.php
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
//Check for config file and curl
if (file_exists('firstrun.php')){header('Location: servercheck.php');exit;}
if (file_exists('firstrun.php') && !file_exists('config.ini')){header('Location: servercheck.php');exit;}
//Authentication check
require_once('config.php');
if ($authsecured && (!isset($_SESSION['loggedin']) || !$_SESSION['loggedin'])) {
Expand Down
Empty file modified js/parse_uri.js
100644 → 100755
Empty file.
73 changes: 73 additions & 0 deletions js/update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
var count = 0;
$(document).ready(function() {
ajaxRequest('download=true', 'dl');
});

function ajaxRequest(params, id){
//alert(params);
$.ajax({
type: 'GET',
url: "update.php?" + params,
success: function(data) { // successful request; do something with the data
if(data == 1){
$("img#"+id).attr('src','media/green-tick.png');
callNext(count);
count++;
} else {
$("img#"+id).attr('src','media/red-cross.png');
document.getElementById('result').innerHTML = '<font color="red"> An ERROR occurred </font>'+data;
}
},
error: function() { // failed request; give feedback to user
alert("Ajax error.");
},
});
//document.getElementById('result').innerHTML = JSON.stringify(result);
}

function callNext(i){
if(i == 0){
$("#zip").html('<img id="unzip" src="media/pwait.gif" height="15px" />');
ajaxRequest('unzip=true','unzip');
} else if(i == 1){
$("#backup").html('<img id="bp" src="media/pwait.gif" height="15px" />');
ajaxRequest('move=true&src=.&dst=tmp','bp');
} else if(i == 2){
$("#update").html('<img id="up" src="media/pwait.gif" height="15px" />');
moveUpdate('moveupdate=true','up');
} else if(i == 3){
$("#clean-back").html('<img id="cb" src="media/pwait.gif" height="15px" />');
ajaxRequest('cleanup=true&dir=tmp','cb');
} else if(i == 4){
$("#clean-left").html('<img id="cu" src="media/pwait.gif" height="15px" />');
ajaxRequest('cleanup=true&dir=update','cu');
} else if(i == 5){
$("#commit").html('<img id="com" src="media/pwait.gif" height="15px" />');
ajaxRequest('update=true','com');
} else {
$("#result").html('<p>Update successfull</p> You will be redirected in a few seconds.');
window.location.href = window.top.location.reload();
}
}

function moveUpdate(params, id){
//alert(params);
$.ajax({
type: 'GET',
url: "tmp/update.php?" + params,
success: function(data) { // successful request; do something with the data
if(data == 1){
$("img#"+id).attr('src','media/green-tick.png');
callNext(count);
count++;
} else {
$("img#"+id).attr('src','media/red-cross.png');
document.getElementById('result').innerHTML = '<font color="red"> An ERROR occurred </font>'+data;
}
},
error: function() { // failed request; give feedback to user
alert("Ajax error.");
},
});
//document.getElementById('result').innerHTML = JSON.stringify(result);
}
7 changes: 7 additions & 0 deletions lib/class.github.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ function getCommits(){
return $this->request($this->URL.'repos/'.$this->USER.'/'.$this->REPO.'/commits');
}

function getDownload($id = ''){
if($id!==''){
$id = '/'.$id;
}
return $this->request($this->URL.'repos/'.$this->USER.'/'.$this->REPO.'/downloads'.$id);
}

//creates a cURL request to the API.
function request($url){
$ch = curl_init();
Expand Down
22 changes: 14 additions & 8 deletions settings.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,29 @@
<?php
$github = new GitHub('gugahoi','mediafrontpage');
$date = $github->getInfo();
echo $date['pushed_at'];
?>
$currentVersion = $config->get('version','ADVANCED');
$updateddate = str_replace(array("T","Z"), " ", $date['pushed_at']);
echo "<a href='https://github.com/gugahoi/mediafrontpage/commit/".$currentVersion."' target='_blank'>Time: ".substr($updateddate,11,20)." Date: ".substr($updateddate,0,10)."</a>"; ?>
</td>
</tr>
<tr align="left">
<td>
<td>Version</td>
<?php
$commit = $github->getCommits();
$commitNo = $commit['0']['sha'];
$currentVersion = $config->get('version','ADVANCED');
echo "Version </td><td><a href='https://github.com/gugahoi/mediafrontpage/commit/".$currentVersion."' target='_blank'>".$currentVersion.'</a>';
if($commitNo != $currentVersion){
echo "\t<a href='#' onclick='updateVersion();' title='".$commitNo." - Description: ".$commit['0']['commit']['message']."'>***UPDATE Available***</a>";
}
echo "<td><a href='https://github.com/gugahoi/mediafrontpage/commit/".$currentVersion."' target='_blank' Title='Description: ".$commit['0']['commit']['message']."'>".$currentVersion."</a>";
?>
</td>
</tr>
<tr>
<td colspan="2">
<?php
if($commitNo != $currentVersion){
echo "<input type='button' value='Update Available' Title='Click To Update' onclick=\"location.href='update.php'\" />";
}
?>
</td>
</tr>
</table>
</div>
<div id="GLOBAL" class="panel"><br><br>
Expand Down
Empty file added tmp/placeholder
Empty file.
Loading