Example #1
0
if (isset($_REQUEST['avatar'])) {
    $avtr = explode("::", $_REQUEST['avatar']);
    $_REQUEST['authorid'] = $avtr[1];
    $_REQUEST['method'] = $avtr[0];
} elseif (isset($_REQUEST['authorid'])) {
} elseif (isset($_SESSION['SESS_USER_ID'])) {
    $_REQUEST['authorid'] = $_SESSION['SESS_USER_ID'];
} else {
    printDefaultAvatar();
}
$method = "email";
if (isset($_REQUEST['method'])) {
    $method = $_REQUEST['method'];
}
if (!in_array($method, $avlMethods)) {
    printServiceErrorMsg("Method Not Supported");
    //printDefaultAvatar();
    exit;
}
//printArray($_REQUEST);exit($method);
if (isset($_REQUEST['action'])) {
    if ($_REQUEST['action'] == "src") {
        printServiceMsg($avlMethods);
    } else {
        printAvatarPhoto($method);
    }
} else {
    printAvatarPhoto($method);
}
function printAvatarPhoto($method)
{
Example #2
0
            checkServiceSession();
            if (isset($_POST['gid'])) {
                $sql = _db()->_updateQ("guides_tbl", array("status" => "published", "approved" => "false", "userid" => $_SESSION['SESS_USER_ID'], "dtoe" => date("Y-m-d H:i:s")), array("id" => $_POST['gid']));
                $res = _dbQuery($sql);
                if ($res) {
                    echo "success";
                } else {
                    echo "Sorry, couldn't publish your article, try again later.";
                }
            } else {
                printServiceErrorMsg(501, "GID Missing");
            }
            break;
        case "approve-guide":
            checkServiceSession();
            if (isset($_REQUEST['gid'])) {
                $sql = _db()->_updateQ("guides_tbl", array("approved" => "true", "approved_on" => date("Y-m-d H:i:s"), "approver" => $_SESSION['SESS_USER_ID'], "userid" => $_SESSION['SESS_USER_ID'], "dtoe" => date("Y-m-d H:i:s")), array("id" => $_POST['gid']));
                $res = _dbQuery($sql);
                if ($res) {
                    echo "success";
                } else {
                    echo "Sorry, couldn't approve your article, try again later.";
                }
            } else {
                printServiceErrorMsg(501, "GID Missing");
            }
            break;
    }
} else {
    printServiceErrorMsg("Sorry, Action Not Found");
}