forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request WWBN#3 from WWBN/master
up2date
- Loading branch information
Showing
73 changed files
with
2,478 additions
and
1,511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
//streamer config | ||
require_once '../videos/configuration.php'; | ||
|
||
if(!isCommandLineInterface()){ | ||
return die('Command Line only'); | ||
} | ||
echo "Enter the username or press enter to skip:"; | ||
echo "\n"; | ||
ob_flush(); | ||
$userName = trim(readline("")); | ||
|
||
if(!empty($userName)){ | ||
$user = new User(0, $userName, false); | ||
if(!empty($user->getBdId())){ | ||
$sql = "UPDATE users SET isAdmin = 1, status = 'a' where id = ".$user->getBdId(); | ||
|
||
$insert_row = sqlDAL::writeSql($sql); | ||
if($insert_row){ | ||
echo "Your user {$userName} is admin now"; | ||
echo "\n"; | ||
die(); | ||
} | ||
}else{ | ||
echo "User ({$userName}) Not found"; | ||
echo "\n"; | ||
die(); | ||
} | ||
} | ||
echo "Bye"; | ||
echo "\n"; | ||
die(); | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
//streamer config | ||
require_once '../videos/configuration.php'; | ||
require_once $global['systemRootPath'] . 'objects/playlist.php'; | ||
|
||
if (!isCommandLineInterface()) { | ||
return die('Command Line only'); | ||
} | ||
|
||
$users_ids = array(); | ||
$sql = "SELECT distinct(users_id) as users_id FROM playlists "; | ||
$res = sqlDAL::readSql($sql); | ||
$fullData = sqlDAL::fetchAllAssoc($res); | ||
sqlDAL::close($res); | ||
$rows = array(); | ||
if ($res != false) { | ||
foreach ($fullData as $key => $row) { | ||
$users_ids[] = $row['users_id']; | ||
} | ||
} else { | ||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error); | ||
} | ||
|
||
|
||
foreach ($users_ids as $user_id) { | ||
echo "Process user_id = {$user_id}\n"; | ||
ob_flush(); | ||
$sql = "SELECT * FROM playlists WHERE users_id = {$user_id} AND status = 'favorite' ORDER BY created "; | ||
$res = sqlDAL::readSql($sql); | ||
$fullData = sqlDAL::fetchAllAssoc($res); | ||
sqlDAL::close($res); | ||
$rows = array(); | ||
if ($res != false) { | ||
foreach ($fullData as $key => $row) { | ||
if ($key === 0) { | ||
continue; | ||
} | ||
|
||
if(!empty(PlayList::getVideosIDFromPlaylistLight($row['id']))){ | ||
continue; | ||
} | ||
|
||
$sql = "DELETE FROM playlists "; | ||
$sql .= " WHERE id = ?"; | ||
|
||
echo $sql." = {$row['id']}\n"; | ||
ob_flush(); | ||
sqlDAL::writeSql($sql, "i", array($row['id'])); | ||
} | ||
} else { | ||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error); | ||
} | ||
|
||
|
||
$sql = "SELECT * FROM playlists WHERE users_id = {$user_id} AND status = 'watch_later' ORDER BY created "; | ||
$res = sqlDAL::readSql($sql); | ||
$fullData = sqlDAL::fetchAllAssoc($res); | ||
sqlDAL::close($res); | ||
$rows = array(); | ||
if ($res != false) { | ||
foreach ($fullData as $key => $row) { | ||
if ($key === 0) { | ||
continue; | ||
} | ||
$sql = "DELETE FROM playlists "; | ||
$sql .= " WHERE id = ?"; | ||
echo $sql." = {$row['id']}\n"; | ||
ob_flush(); | ||
sqlDAL::writeSql($sql, "i", array($row['id'])); | ||
} | ||
} else { | ||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.