예제 #1
0
function showHTML($message, $heading = "", $title = "", $footer = "", $endExec = true)
{
    global $loggedIn, $adminloggedIn, $adminOptions, $lang, $warn;
    if (empty($adminOptions)) {
        //Need to set default options for initial install, as readSettings is not executed yet
        $adminOptions['theme'] = 'modern';
        $lang['Script Title'] = 'Facebook Multi Page/Group Poster';
        $adminOptions['scriptFooter'] = '';
        $lang['Usage Help'] = 'Usage Help';
        $lang['Home'] = 'Home';
        $adminOptions['scriptLogo'] = 'img/logo.png';
        $adminOptions['modernMBGC'] = '#FFFFFF';
        $adminOptions['modernCBGC'] = '#FFFFFF';
        $adminOptions['modernHBGC'] = '#081E42';
        $lang['DIR'] = 'LTR';
        $adminOptions['lang'] = 'en';
    }
    if ($heading == "") {
        $heading = $lang['Heading'];
    }
    if ($title == "") {
        $title = $lang['Script Title'];
    }
    if ($footer == "") {
        $footer = $adminOptions['scriptFooter'];
    }
    $footer .= " | FBMPGP v.2.2";
    $langs = glob("lang/*.php");
    foreach ($langs as $file) {
        $filename = substr($file, 5, -9);
        if (isset($_COOKIE['FBMPGPLang']) && $_COOKIE['FBMPGPLang'] == $filename || !isset($_COOKIE['FBMPGPLang']) && $adminOptions['lang'] == $filename) {
            $footer .= " | " . strtoupper($filename);
        } else {
            $footer .= " | <a class=noul href='?lang=" . $filename . "'>" . strtoupper($filename) . "</a>";
        }
    }
    $footer .= " |";
    if ($loggedIn) {
        $menu = '<li><a href="?logout">' . $lang['Logout'] . '</a></li>
                 <li><a href="?usershowhelp">' . $lang['Usage Help'] . '</a></li>';
        if ($adminOptions['useCron']) {
            $menu .= '<li><a href="?crons">' . $lang['My Crons'] . '</a></li>';
        }
        $menu .= '<li><a href="?ucp">' . $lang['User CP'] . '</a></li>
                 <li><a href=".">' . $lang['Home'] . '</a></li>';
    } elseif ($adminloggedIn) {
        $menu = '<li><a href="?logout">' . $lang['Logout'] . '</a></li>';
        if ($adminOptions['useCron']) {
            $menu .= '<li><a href="?crons">' . $lang['View Crons'] . '</a></li>';
        }
        $menu .= '<li><a href="?users">' . $lang['Users List'] . '</a></li>
                 <li><a href=".">' . $lang['Admin Panel'] . '</a></li>';
    } else {
        $menu = '<li><a href="?showhelp">' . $lang['Usage Help'] . '</a></li>
                 <li><a href=".">' . $lang['Home'] . '</a></li>';
    }
    $template = sanitizeOutput(file_get_contents('themes/' . $adminOptions['theme'] . '.html'));
    if ($adminOptions['theme'] != 'fbmpgp') {
        $head = "<style>\n            body, .nojqui { background-color: " . $adminOptions['modernMBGC'] . " !important; }\n            .main { background-color: " . $adminOptions['modernCBGC'] . " !important; }\n            .container-full { background-color: " . $adminOptions['modernHBGC'] . " !important; }\n            .ui-state-active,.ui-widget-content .ui-state-hover,ui-state-default .ui-state-hover,.ui-widget-header { background-color: " . $adminOptions['modernHBGC'] . " !important;\n background-image: none; !important;\n opacity: 1 !important; }\n            .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { background-image: none !important;\n background-color: " . $adminOptions['modernHBGC'] . " !important;\n opacity: 0.7;\n color: white; }\n        </style>";
    } else {
        $head = "";
    }
    if ($lang['DIR'] == 'RTL') {
        $head .= "<style>body { direction: rtl !important; } .list-inline { direction: ltr !important; } a.visit {float: left !important; }</style>";
    }
    if (isset($warn)) {
        $footer .= "<script>\$.notify('Error: {$warn}', {globalPosition: 'bottom right', className: 'error'});</script>";
    }
    if (isset($_GET['notify'])) {
        $footer .= "<script>\$.notify('" . $_GET['notify'] . "', {globalPosition: 'top right', className: 'notify'});</script>";
    }
    $template = str_replace(array("%%title%%", "%%head%%", "%%logo%%", "%%menu%%", "%%h1%%", "%%p%%", "%%footer%%"), array($title, $head, $adminOptions['scriptLogo'], $menu, $heading, $message, $footer), $template);
    echo $template;
    if ($endExec) {
        die(0);
    }
}
예제 #2
0
}
// Is this a logged in user show help/documentation request?
if (isset($_GET['usershowhelp'])) {
    showHelp();
} elseif (isset($_GET['ucp'])) {
    //User Control Panel request?
    require_once 'includes/usercp.php';
} elseif (isset($_GET['crons'])) {
    require_once 'includes/showcrons.php';
}
if ($userOptions['userDisabled']) {
    showHTML($userOptions['disableReason'] . "<br />" . $lang['Manual approval'], $lang['Welcome'] . " {$userName}");
}
// Now we have all the data as user is logged into us
$pages = explode("\n", urldecode($pageData));
$groups = explode("\n", urldecode($groupData));
$isGroupPost = false;
if (isset($_POST['pageid'])) {
    // This is a post submission. Time to actually post this submission to selected account.
    require_once 'includes/post.php';
} else {
    // No pageid means not a post request, just show the fields and forms to fill-up
    require_once 'includes/mainform.php';
    require_once 'includes/class.JavaScriptPacker.php';
    $message = sanitizeOutput($message);
    $packer = new JavaScriptPacker($script, 10, true, false);
    $script = $packer->pack();
    // We encrypt the javascript output to make copying difficult on public sites
    $message .= $script . '</script> ';
    showHTML($message, "<img src='http://graph.facebook.com/v2.3/{$userId}/picture?redirect=1&height=64&type=normal&width=64' width=64 height=65 style='vertical-align:middle;'>&nbsp;" . $lang['Welcome'] . " {$fullname}");
}