Ejemplo n.º 1
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
//Required configuration files
require dirname(__FILE__) . '/../../configuration.php';
require_once dirname(__FILE__) . '/../../core/abre_verification.php';
require_once dirname(__FILE__) . '/../../core/abre_functions.php';
require_once dirname(__FILE__) . '/../../core/abre_dbconnect.php';
require_once dirname(__FILE__) . '/../../core/abre_functions.php';
//Get User Settings
$query = "SELECT * FROM profiles where email='" . $_SESSION['useremail'] . "'";
$gafecards = databasequery($query);
foreach ($gafecards as $value) {
    $setting_card_mail = htmlspecialchars($value['card_mail'], ENT_QUOTES);
    $setting_card_drive = htmlspecialchars($value['card_drive'], ENT_QUOTES);
    $setting_card_calendar = htmlspecialchars($value['card_calendar'], ENT_QUOTES);
    $setting_card_classroom = htmlspecialchars($value['card_classroom'], ENT_QUOTES);
    $setting_card_apps = htmlspecialchars($value['card_apps'], ENT_QUOTES);
}
//Display the Likes
echo "<div id='streamlikes'></div>";
?>

<script>
	
	//Load Streams
	function loadLikes()
Ejemplo n.º 2
0
//Required configuration files
require dirname(__FILE__) . '/../../configuration.php';
require_once dirname(__FILE__) . '/../../core/abre_verification.php';
require_once dirname(__FILE__) . '/../../core/abre_functions.php';
require_once dirname(__FILE__) . '/../../core/abre_dbconnect.php';
$streamUrl = $_REQUEST['url'];
$streamTitle = $_REQUEST['title'];
$streamImage = $_REQUEST['image'];
$streamUrldecoded = base64_decode($streamUrl);
$streamTitledecoded = addslashes(base64_decode($streamTitle));
$streamImagedecoded = base64_decode($streamImage);
$portal_root_path = $portal_root . '/';
$trimmedimageurl = str_replace($portal_root_path, '', $streamImagedecoded);
$userposter = $_SESSION['useremail'];
if ($streamUrldecoded != "" && $streamTitledecoded != "") {
    //Check to see if like already exists for this user
    $query = "SELECT * FROM streams_comments where url='{$streamUrldecoded}' and liked='1' and user='******'useremail'] . "'";
    $dbreturn = databasequery($query);
    $num_rows_like_count = count($dbreturn);
    if ($num_rows_like_count == 0) {
        //Insert comment into database
        $sql = "INSERT INTO streams_comments (url, title, image, user, liked) VALUES ('{$streamUrldecoded}', '{$streamTitledecoded}', '{$trimmedimageurl}', '{$userposter}', '1');";
        $dbreturn = databaseexecute($sql);
    } else {
        //Remove commment from database
        $sql = "DELETE FROM streams_comments WHERE url='{$streamUrldecoded}' and liked='1' and user='******'useremail'] . "'";
        $dbreturn = databaseexecute($sql);
    }
}
$streamUrldecoded = base64_encode($streamUrldecoded);
echo $streamUrldecoded;
Ejemplo n.º 3
0
 $Comment = nl2br(strip_tags(html_entity_decode($Comment)));
 $Comment = linkify($Comment);
 $articletitle = html_entity_decode($row["title"]);
 $CommentID = htmlspecialchars($row["id"], ENT_QUOTES);
 $CommentCreationTime = htmlspecialchars($row["creationtime"], ENT_QUOTES);
 //Display comment creation in correct format
 if (strtotime($CommentCreationTime) < strtotime('-7 days')) {
     $CommentCreationTime = date("F j", strtotime($CommentCreationTime)) . " at " . date("g:i A", strtotime($CommentCreationTime));
 } else {
     $CommentCreationTime = date("l", strtotime($CommentCreationTime)) . " at " . date("g:i A", strtotime($CommentCreationTime));
 }
 //Look up name given email from directory
 $User2 = encrypt($User, "");
 $picture = "";
 $sql = "SELECT firstname, lastname, picture FROM directory where email='{$User2}'";
 $dbreturn = databasequery($sql);
 foreach ($dbreturn as $row) {
     $firstname = htmlspecialchars($row["firstname"], ENT_QUOTES);
     $firstname = stripslashes(htmlspecialchars(decrypt($firstname, ""), ENT_QUOTES));
     $lastname = htmlspecialchars($row["lastname"], ENT_QUOTES);
     $lastname = stripslashes(htmlspecialchars(decrypt($lastname, ""), ENT_QUOTES));
     $picture = htmlspecialchars($row["picture"], ENT_QUOTES);
 }
 echo "<tr class='commentwrapper'>";
 if (empty($picture)) {
     $picture = $portal_root . "/modules/directory/images/user.png";
 } else {
     $fileExtension = strrchr($picture, ".");
     $picture = $portal_root . "/modules/directory/serveimage.php?file={$picture}&ext={$fileExtension}";
 }
 echo "<td width='60px' style='vertical-align: top;'><img src='{$picture}' class='profile-avatar-small'></td>";
Ejemplo n.º 4
0
$counter = 0;
foreach ($dbreturn as $value) {
    $title = htmlspecialchars($value['title'], ENT_QUOTES);
    $titleencoded = base64_encode($title);
    $image = htmlspecialchars($value['image'], ENT_QUOTES);
    $imagebase = base64_encode($image);
    $link = htmlspecialchars($value['url'], ENT_QUOTES);
    $linkbase = base64_encode($link);
    $counter++;
    //Comment count
    $query = "SELECT * FROM streams_comments where url='{$link}' and comment!=''";
    $dbreturn = databasequery($query);
    $num_rows_comment = count($dbreturn);
    //Like count
    $query2 = "SELECT * FROM streams_comments where url='{$link}' and comment='' and liked='1'";
    $dbreturn2 = databasequery($query2);
    $num_rows_like = count($dbreturn2);
    echo "<div class='likes_{$counter}'>";
    $imagepath = $portal_root . "/" . $image;
    echo "<div class='col l3 m4 s6 nopaddingmarginsmall' style='margin-bottom:20px;'>";
    echo "<div class='mdl-card mdl-card__media mdl-shadow--2dp waves-effect waves-light' style='background-image: url({$imagepath}); background-color:#999; width:100%; height:100%;'>";
    echo "<div class='mdl-color-text--white center-align likedpost' data='{$link}' style='position:absolute; bottom:0; top: 0; left: 0; right: 0; padding:20px; background-color: rgba(0, 0, 0, 0.7);'>";
    echo "<span style='font-size:16px; line-height:22px;'>{$title}</span>";
    echo "</div>";
    echo "<a class='material-icons mdl-color-text--red likeicon' style='position:absolute; bottom:10px; right:100px;' data-title='{$titleencoded}' data-url='{$linkbase}' data-image='{$imagebase}' data-page='likes' data-resultcounter='likes_{$counter}' href='#'>favorite</a> <span class='mdl-color-text--white truncate' style='position:absolute; bottom:12px; right:10px; font-size:12px; font-weight:600; width:90px; padding-left:5px; text-align: left;'>{$num_rows_like}</span>";
    echo "<a class='material-icons modal-addstreamcomment commenticon' style='position:absolute; bottom:10px; right:40px; color: " . sitesettings("sitecolor") . "' data-title='{$titleencoded}' data-url='{$linkbase}' title='Add a comment' href='#addstreamcomment'>insert_comment</a> <span class='mdl-color-text--white' style='position:absolute; bottom:12px; right:10px; font-size:12px; font-weight:600; width:30px; padding-left:5px; text-align: left;'>{$num_rows_comment}</span>";
    echo "</div>";
    echo "</div>";
    echo "</div>";
}
if ($counter == 0) {