/** * bookmarking($document_url,$document_title) * used in thumbnail.php */ function bookmarking($document_url, $document_title) { global $settings; $ypid = check_set('SET_ADDTHIS') ? '#pubid=' . $settings['SET_ADDTHIS'] : ''; $text = '<div class="addthis"> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style " addthis:url="' . $document_url . '" addthis:title="' . $document_title . '"> <a class="addthis_button_preferred_1"></a> <a class="addthis_button_preferred_2"></a> <a class="addthis_button_email"></a> <a class="addthis_button_pinterest_share" title="Send to Pinterest"></a> <a class="addthis_button_preferred_4"></a> <a class="addthis_button_preferred_5"></a> <a class="addthis_button_preferred_6"></a> <a class="addthis_button_preferred_7"></a> <a class="addthis_button_preferred_8"></a> <a class="addthis_button_compact"></a> <a class="addthis_counter addthis_bubble_style"></a> </div> <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js' . $ypid . '"></script> <!-- AddThis Button END --> </div>'; return $text; }
require './inc/cfih.php'; // check for ajax call if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') { header('Location: ' . $settings['SET_SITEURL'] . 'index.php?err=404'); exit; } //////////////////////////////////////////////// // Image Widgit if (isset($_POST['widgit']) && check_set('SET_IMAGE_WIDGIT')) { $widgetHtml = ImageWidget(theme_setting('widgit_row', 4), false); echo $widgetHtml; exit; } //////////////////////////////////////////////// // Image report if (isset($_POST['report']) && check_set('SET_ALLOW_REPORT')) { if (!report_img(cl($_POST['report']))) { echo json_encode(array('status' => 0, 'error' => show_feedback(false))); exit; } echo json_encode(array('status' => 1, 'suc' => show_feedback(false))); exit; } //////////////////////////////////////////////// // admin only code below // check if user is loged in as admin if (!checklogin()) { header('Location: index.php'); exit; } ////////////////////////////////////////////////
$result = $database->CachedQuery("REVOKE ALL PRIVILEGES, GRANT OPTION FROM :Username", array(':Username' => $sUser->sUsername), 1); } $sInitialSetupContent = Templater::AdvancedParse('/blue_default/setup', $locale->strings, array('PanelTitle' => $sPanelTitle->sValue, 'ErrorMessage' => "", 'Username' => $sUser->sUsername, 'InitialSetup' => $sUser->sInitialSetup)); } else { $sInitialSetupContent = ""; } $sUsedMemory = $database->CachedQuery("SELECT * FROM stats WHERE type='used_memory' ORDER BY id DESC LIMIT 60", array(), 1); foreach ($sUsedMemory->data as $key => $value) { $sUsed[] = $value["result"]; } $sTotalMemory = $database->CachedQuery("SELECT * FROM stats WHERE type='total_memory' ORDER BY id DESC LIMIT 60", array(), 1); foreach ($sTotalMemory->data as $key => $value) { $sTotal[] = $value["result"]; } $sRAMUsage[] = array("name" => "60", "used" => round($sUsed[59] / 1024), "total" => round($sTotal[59] / 1024)); $sRAMUsage[] = array("name" => "30", "used" => round($sUsed[29] / 1024), "total" => round($sTotal[29] / 1024)); $sRAMUsage[] = array("name" => "15", "used" => round($sUsed[14] / 1024), "total" => round($sTotal[14] / 1024)); $sRAMUsage[] = array("name" => "5", "used" => round($sUsed[4] / 1024), "total" => round($sTotal[4] / 1024)); $sRAMUsage[] = array("name" => "1", "used" => round($sUsed[0] / 1024), "total" => round($sTotal[0] / 1024)); $sLoadAverage = $database->CachedQuery("SELECT * FROM stats WHERE type='load' ORDER BY id DESC LIMIT 60", array(), 1); foreach ($sLoadAverage->data as $key => $value) { $sLoads[] = $value["result"]; } $sLoad[] = array("name" => 60, "AVG" => check_set($sLoads[59])); $sLoad[] = array("name" => 30, "AVG" => check_set($sLoads[29])); $sLoad[] = array("name" => 15, "AVG" => check_set($sLoads[14])); $sLoad[] = array("name" => 5, "AVG" => check_set($sLoads[4])); $sLoad[] = array("name" => 1, "AVG" => $sLoads[0]); $sContent = Templater::AdvancedParse('/blue_default/main', $locale->strings, array('ErrorMessage' => "", 'InitialSetup' => $sUser->sInitialSetup, 'WelcomeClosed' => $sUser->sWelcomeClosed, 'InitialSetupContent' => $sInitialSetupContent, 'Load' => $sLoad, 'RAM' => $sRAMUsage)); echo Templater::AdvancedParse('/blue_default/master', $locale->strings, array('PageTitle' => "Main Dashboard", 'PageName' => "main", 'ErrorMessage' => "", 'Content' => $sContent)); }