Пример #1
0
 *
 */
if (!defined("SHOW_PROFILE_MAIN")) {
    exit;
}
include_once $prevFolder . "plugins/twitter/twitter.php";
$twitterObj = new Twitter($mysqli);
if ($twitterObj->hasTwitter($memberInfo['member_id'])) {
    $twitterObj->oauthToken = $twitterObj->get_info("oauth_token");
    $twitterObj->oauthTokenSecret = $twitterObj->get_info("oauth_tokensecret");
    $twitterObj->reloadCacheInfo();
    $twitterInfo = $twitterObj->get_info();
    if ($twitterInfo['infocard'] + $twitterInfo['embedtweet'] + $twitterInfo['showfeed'] > 0) {
        echo "\n\t\t\t\t<div class='formTitle' style='position: relative; text-align: center; margin-top: 20px'>Twitter</div>\n\t\t\t\t\n\t\t\t\t<table class='profileTable' style='border-top-width: 0px'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='main' align='center'>\n\t\t\t\t\t\t\t";
        if ($twitterInfo['infocard'] == 1) {
            echo "<div class='shadedBox' style='margin: 20px auto; width: 70%; overflow: auto'>" . $twitterObj->dispCard() . "</div>";
        }
        if ($twitterInfo['embedtweet']) {
            echo "<div style='position: relative; margin-left: auto; margin-right: auto; margin-top: 20px'>";
            echo $twitterInfo['lasttweet_html'];
            echo "</div>";
        }
        if ($twitterInfo['showfeed']) {
            echo "\n\t\t\t\t\t<div style='position: relative; margin: 20px auto; width: 70%'>\n\t\t\t\t\t\t<a class=\"twitter-timeline\"  href=\"https://twitter.com/" . $twitterInfo['username'] . "\"  data-widget-id=\"" . $twitterObj->widgetID . "\">Tweets by @" . $twitterInfo['username'] . "</a>\n\t\t\t\t\t\t<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"//platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\n\t\t\t\t\t</div>\n\t\t\t\t";
        }
        echo "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\t\t\n\t\t\t";
    }
}
?>

Пример #2
0
    } else {
        echo "\n\t\t\t\n\t\t\t<div class='shadedBox' style='margin-left: auto; margin-right: auto; width: 50%'>\n\t\t\t\t<p class='main' align='center'>\n\t\t\t\t\tUnable to connect account!  Please Try Again.<br><br>\n\t\t\t\t\t<a href='" . $MAIN_ROOT . "members/console.php?cID=" . $_GET['cID'] . "'>Retry</a>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\n\t\t";
    }
} elseif ($twitterObj->hasTwitter($memberInfo['member_id'])) {
    $dispSuccess = false;
    if ($_POST['submit']) {
        $setShowFeed = $_POST['showfeed'] == 1 ? 1 : 0;
        $setEmbedTweet = $_POST['embedlasttweet'] == 1 ? 1 : 0;
        $setInfoCard = $_POST['showinfo'] == 1 ? 1 : 0;
        $setAllowLogin = $_POST['allowlogin'] == 1 ? 1 : 0;
        $arrColumns = array("showfeed", "embedtweet", "infocard", "allowlogin");
        $arrValues = array($setShowFeed, $setEmbedTweet, $setInfoCard, $setAllowLogin);
        $twitterObj->update($arrColumns, $arrValues);
        $dispSuccess = true;
    }
    // MEMBER ALREADY HAS TWITTER CONNECTED
    $twitterObj->oauthToken = $twitterObj->get_info("oauth_token");
    $twitterObj->oauthTokenSecret = $twitterObj->get_info("oauth_tokensecret");
    $twitterObj->reloadCacheInfo();
    $twitterInfo = $twitterObj->get_info_filtered();
    $checkShowFeed = $twitterInfo['showfeed'] == 1 ? " checked" : "";
    $checkEmbedTweet = $twitterInfo['embedtweet'] == 1 ? " checked" : "";
    $checkInfoCard = $twitterInfo['infocard'] == 1 ? " checked" : "";
    $checkAllowLogin = $twitterInfo['allowlogin'] == 1 ? " checked" : "";
    echo "\n\t\n\t\t<div id='connectedDiv'>\n\t\t\t<form action='" . $MAIN_ROOT . "members/console.php?cID=" . $_GET['cID'] . "' method='post'>\n\t\t\t\t<div class='formDiv'>\n\t\t\t\t\t<table class='formTable'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\t\t\t\t<div class='main dottedLine' style='margin-bottom: 20px; padding-bottom: 3px'>\n\t\t\t\t\t\t\t\t\t<b>Connected:</b>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\n\t\t\t\t\t\t\t\t<div class='shadedBox' style='margin-left: auto; margin-right: auto; width: 50%; overflow: auto'>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t" . $twitterObj->dispCard() . "\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div style='font-style: italic; text-align: center; margin-top: 3px; margin-left: auto; margin-right: auto; position: relative' class='main'>\n\t\t\t\t\t\t\t\t\tLast updated " . getPreciseTime($twitterInfo['lastupdate']) . "\n\t\t\t\t\t\t\t\t\t<p class='largeFont' style='font-style: normal; font-weight: bold' align='center'>\n\t\t\t\t\t\t\t\t\t\t<a style='cursor: pointer' id='btnDisconnect'>DISCONNECT ACCOUNT</a>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan='2'><br><br>\n\t\t\t\t\t\t\t\t<div class='main dottedLine' style='margin-bottom: 2px; padding-bottom: 3px'>\n\t\t\t\t\t\t\t\t\t<b>Profile Display Options:</b>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div style='padding-left: 3px; margin-bottom: 15px'>\n\t\t\t\t\t\t\t\t\tUse the form below to set which items from Twitter will show in your profile.\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class='formLabel'>Show Feed:</td>\n\t\t\t\t\t\t\t<td class='main'><input type='checkbox' name='showfeed' value='1'" . $checkShowFeed . "></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class='formLabel'>Embed Last Tweet:</td>\n\t\t\t\t\t\t\t<td class='main'><input type='checkbox' name='embedlasttweet' value='1'" . $checkEmbedTweet . "></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class='formLabel'>Show Info Card: <a href='javascript:void(0)' onmouseover=\"showToolTip('An example of the Info Card is shown in the &quot;Connected&quot; section above.')\" onmouseout='hideToolTip()'>(?)</a></td>\n\t\t\t\t\t\t\t<td class='main'><input type='checkbox' name='showinfo' value='1'" . $checkInfoCard . "></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan='2'><br>\n\t\t\t\t\t\t\t\t<div class='main dottedLine' style='margin-bottom: 2px; padding-bottom: 3px'>\n\t\t\t\t\t\t\t\t\t<b>Log In Options:</b>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div style='padding-left: 3px; margin-bottom: 15px'>\n\t\t\t\t\t\t\t\t\tCheck the box below to allow logging into this website through Twitter.\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class='formLabel'>Allow Log In:</td>\n\t\t\t\t\t\t\t<td class='main'><input type='checkbox' name='allowlogin' value='1'" . $checkAllowLogin . "></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class='main' colspan='2' align='center'><br>\n\t\t\t\t\t\t\t\t<input type='submit' name='submit' value='Save' class='submitButton'>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t<br>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</div>\n\t\t\n\t\t<div id='disconnectDiv' style='display: none'>\n\t\t\t<p class='main' align='center'>\n\t\t\t\tAre you sure you want to disconnect your Twitter account?\n\t\t\t</p>\n\t\t</div>\n\t\t\n\t\t<script type='text/javascript'>\n\t\t\n\t\t\t\$(document).ready(function() {\n\t\t\t\n\t\t\t\t\$('#btnDisconnect').click(function() {\n\t\t\t\t\t\n\t\t\t\t\t\$('#disconnectDiv').dialog({\n\t\t\t\t\t\ttitle: 'Disconnect Twitter',\n\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t'Yes': function() {\n\t\t\t\t\t\t\t\t\$('#connectedDiv').fadeOut(250);\n\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "plugins/twitter/disconnect.php', { }, function(data) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$('#connectedDiv').html(data);\n\t\t\t\t\t\t\t\t\t\$('#connectedDiv').fadeIn(250);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t'Cancel': function() {\n\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\$('.ui-dialog :button').blur();\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t});\n\t\t\n\t\t</script>\n\t";
    if ($dispSuccess) {
        echo "\n\t\t\t<div id='successDiv' style='display: none'>\n\t\t\t\t<p align='center' class='main'>\n\t\t\t\t\tTwitter Connect Settings Saved!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<script type='text/javascript'>\n\t\t\t\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\n\t\t\t\t\t\$('#successDiv').dialog({\n\t\t\t\t\t\ttitle: 'Twitter Connect',\n\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t'Ok': function() {\n\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\$('.ui-dialog :button').blur();\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t</script>\n\t\t\n\t\t\n\t\t";
    }
} else {
    echo "\n\t\n\t\t<script type='text/javascript'>\n\t\t\t\n\t\t\twindow.location = '" . $MAIN_ROOT . "members';\n\t\t\n\t\t</script>\n\t\n\t";
}