public static function _socialImage($cid)
{
- file_get_contents('https://workshop.fluidbook.com/services/facebook_thumbnail?cid=' . $cid . '&j=' . TIME);
+ $ctx = stream_context_create(array('http' =>
+ array(
+ 'timeout' => 1, //1200 Seconds is 20 Minutes
+ )
+ ));
+ file_get_contents('https://workshop.fluidbook.com/services/facebook_thumbnail?cid=' . $cid . '&j=' . TIME, $ctx);
}
public static function mergeLangs()
public static function bookParams()
{
$parent = new wsBook();
- $t = new wsBookParametres($parent,'export');
+ $t = new wsBookParametres($parent, 'export');
$t->generateV3Form(false);
}
shuffle($pages);
- echo wsDocument::isFarmUser()?'farm':'not farm'."\n";
+ echo wsDocument::isFarmUser() ? 'farm' : 'not farm' . "\n";
foreach ($pages as $page) {
foreach ($files as $file) {
$count = $book->parametres->pages;
$allPages = range(1, $count);
- $coef=wsDocument::isFarmUser()?2:0.25;
+ $coef = wsDocument::isFarmUser() ? 2 : 0.25;
$it = round($coef * max(4, min(12, ceil($count / 20))));
shuffle($allPages);
$portions = array_chunk($allPages, ceil($count / $it));
foreach ($portions as $p) {
- $url = 'https://workshop.fluidbook.com/maintenance/processPage/' . $book_id . '/' . implode(',', $p) . '/' . ($force ? '1' : '0').'?PHPSESSID=' . session_id();
+ $url = 'https://workshop.fluidbook.com/maintenance/processPage/' . $book_id . '/' . implode(',', $p) . '/' . ($force ? '1' : '0') . '?PHPSESSID=' . session_id();
echo $url . "\n";
self::timeoutRequest($url, 1);
}
*/
public function facebook_thumbnail()
{
+ CubeIT_Util_PHP::neverStop(true);
$this->outputXML = false;
$dao = new wsDAOBook($this->con);
$daoTheme = new wsDAOTheme($this->con);
}
// Endpoint for the CFOC Fluidbooks (custom cart)
- public function CFOC() {
+ public function CFOC()
+ {
$this->outputXML = false;
if (empty($_POST['cart_items'])) {
$current_row++;
// Look up the value by the column keys to ensure the correct order of values
- foreach(array_keys($column_headings) as $column_index => $column_key) {
+ foreach (array_keys($column_headings) as $column_index => $column_key) {
$sheet->setCellValueByColumnAndRow($column_index, $current_row, $cart_item[$column_key]);
$current_cell_style = $sheet->getStyleByColumnAndRow($column_index, $current_row);
continue;
}
$tk = 'download_' . $k;
- if (!$book->parametres->{$tk} && $k !== 'scorm') {
+ if ($k !== 'online' && !$book->parametres->{$tk} && $k !== 'scorm') {
if ($core->user->rs == 'Kadreo' || $core->user->rs == 'STUDIOFRANCE') {
$disabled = ' class="disabled"';
} else {
session_write_close();
$nointerface = isset($_GET['nointerface']);
+ $shortLoading = isset($_GET['shortLoading']);
$args = cubePage::getArgs($args);
$q = '?' . $q;
}
$limit = time() - 60;
- if (count($e) <= 2 || ($e[2] < $limit && !$nointerface)) {
+ if (count($e) <= 2 || ($e[2] < $limit && !$nointerface && !$shortLoading)) {
$e[2] = $time;
$daoTheme = new wsDAOTheme($core->con);
if (is_array($forceTheme)) {
}
$CrawlerDetect = new Jaybizzle\CrawlerDetect\CrawlerDetect();
- if (!isset($_GET['force']) && !$nointerface && !$CrawlerDetect->isCrawler()) {
- if ($fbv !== 'scorm') {
- $book->parametres->scorm_enable = false;
- }
-
- $dao->compile($book_id, $fbv, false, false, false, $book, false, $forceTheme);
+ if ($fbv !== 'scorm') {
+ $book->parametres->scorm_enable = false;
+ }
+ $dao->compile($book_id, $fbv, false, false, false, $book, false, $forceTheme);
+ if (!isset($_GET['force']) && !$nointerface && !$shortLoading && !$CrawlerDetect->isCrawler()) {
wsMaintenance::_socialImage($book->cid);
}
$res = '<!DOCTYPE html><html>';
$res .= '<head>';
- $res .= '<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">';
- $res .= '<style>
+ $res .= '<script type="text/javascript">function load(){
+ var url=\'' . $url . '\'+window.location.hash;
+ window.location=url;
+};
+</script>';
+ if (!isset($_GET['shortLoading']) || !$_GET['shortLoading']) {
+ $res .= '<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">';
+
+ $res .= '<style>
@keyframes loader-spin {
0% {
transform: rotate(0deg);
}
*{margin:0;padding:0;}
html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-color:' . $bgcolor . ';}';
- $res .= 'h2,h3{text-align:center;color:' . $tcolor . ';font-weight:400;position:relative;top:55%;}';
- $res .= 'h2{font-size:16px;}';
- $res .= 'h3{font-size:10px;}';
- $res .= 'svg{position:absolute;top:calc(50% - 24px);left:calc(50% - 24px);
+ $res .= 'h2,h3{text-align:center;color:' . $tcolor . ';font-weight:400;position:relative;top:55%;}';
+ $res .= 'h2{font-size:16px;}';
+ $res .= 'h3{font-size:10px;}';
+ $res .= 'svg{position:absolute;top:calc(50% - 24px);left:calc(50% - 24px);
animation-name: loader-spin;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-timing-function: linear;}';
- $res .= '</style>';
- $res .= '<script type="text/javascript">function load(){
- var url=\'' . $url . '\'+window.location.hash;
- window.location=url;
-}</script>';
- $res .= '<title>' . $book->parametres->title . '</title>';
- $res .= '</head>';
- $res .= '<body onload="load();">';
- $res .= '<svg width="48" height="48" id="interface-loader" viewBox="0 0 48 48">
+ $res .= '</style>';
+ $res .= '<title>' . $book->parametres->title . '</title>';
+ $res .= '</head>';
+ $res .= '<body onload="load();">';
+ $res .= '<svg width="48" height="48" id="interface-loader" viewBox="0 0 48 48">
<circle cx="24" cy="24" r="23" fill="' . $lcolor . '"></circle>
<circle class="animate" cx="24" cy="24" fill="none" stroke="' . $scolor . '" stroke-width="3" r="16"
stroke-dasharray="80 80"
transform="rotate(0 24 24)">
</circle>
</svg>';
- $res .= '<h2>' . __('Compilation du fluidbook en cours') . '...</h2>';
- $res .= '<h3>' . __('Cette étape ne sera pas nécessaire lorsque le fluidbook sera installé sur son emplacement définitif') . '</h3>';
+
+ $res .= '<h2>' . __('Compilation du fluidbook en cours') . '...</h2>';
+ $res .= '<h3>' . __('Cette étape ne sera pas nécessaire lorsque le fluidbook sera installé sur son emplacement définitif') . '</h3>';
+ } else {
+ $res .= '<script>load();</script>';
+ $res .= '</head>';
+ $res .= '<body>';
+ }
+
$res .= '</body>';
$res .= '</html>';
echo $res;