<?php

require_once PATH_CORE . '/classes/db.class.php';
$db = new cloudDatabase();
if (isset($_GET['story-1']) && preg_match('/^story_([0-9]+)$/', $_GET['story-1'], $id)) {
    $story_1_id = $id[1];
} else {
    $story_1_id = 0;
}
if (isset($_GET['story-2']) && preg_match('/^story_([0-9]+)$/', $_GET['story-2'], $id)) {
    $story_2_id = $id[1];
} else {
    $story_2_id = 0;
}
if (isset($_GET['story-3']) && preg_match('/^story_([0-9]+)$/', $_GET['story-3'], $id)) {
    $story_3_id = $id[1];
} else {
    $story_3_id = 0;
}
if (isset($_GET['story-4']) && preg_match('/^story_([0-9]+)$/', $_GET['story-4'], $id)) {
    $story_4_id = $id[1];
} else {
    $story_4_id = 0;
}
if (isset($_GET['story-5']) && preg_match('/^story_([0-9]+)$/', $_GET['story-5'], $id)) {
    $story_5_id = $id[1];
} else {
    $story_5_id = 0;
}
if (isset($_GET['story-6']) && preg_match('/^story_([0-9]+)$/', $_GET['story-6'], $id)) {
    $story_6_id = $id[1];
 }
 // fix x or y dimension
 if (isset($_GET['crop'])) {
     $crop = 'c';
 } else {
     $crop = '';
 }
 // crop the height
 $file_cache_path = PATH_CACHE . '/' . CACHE_PREFIX . '_imgSc_' . $imageid . '_' . $dx . '_' . $dy . '_' . $fixed . $crop . '.jpg';
 if (file_exists($file_cache_path)) {
     // try reading cached file
     header("Content-type: image/jpeg");
     readfile($file_cache_path);
 } else {
     require_once PATH_CORE . 'classes/db.class.php';
     $db = new cloudDatabase();
     $q = $db->queryC("SELECT url FROM ContentImages WHERE id={$imageid}");
     if (!$q) {
         die;
     }
     $data = $db->readQ($q);
     // else create a new scaled image
     $file_orig = $data->url;
     // old PATH_CACHE.'/story_'.$imageid.'.jpg';
     if ($file_orig == '') {
         $file_orig = PATH_SITE_IMAGES . 'watermark.jpg';
     }
     $imageType = getExtension($file_orig);
     switch ($imageType) {
         default:
             $srcImage = imagecreatefromjpeg($file_orig);
<?php

require_once PATH_CORE . '/classes/db.class.php';
$db = new cloudDatabase();
function cleanDirty($string)
{
    // Replace other special chars
    $specialCharacters = array('#' => '', '$' => '', '%' => '', '&' => '', '@' => '', '.' => '', '€' => '', '+' => '', '=' => '', '§' => '', '\\' => '', '/' => '');
    while (list($character, $replacement) = each($specialCharacters)) {
        $string = str_replace($character, '-' . $replacement . '-', $string);
    }
    $string = strtr($string, "ÀÁÂÃÄÅ� áâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ", "AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn");
    // Remove all remaining other unknown characters
    $string = preg_replace('/[^a-zA-Z0-9\\-]/', ' ', $string);
    $string = preg_replace('/^[\\-]+/', '', $string);
    $string = preg_replace('/[\\-]+$/', '', $string);
    $string = preg_replace('/[\\-]{2,}/', ' ', $string);
    return $string;
}
if (isset($_GET['id']) && preg_match('/^story_([0-9]+)$/i', $_GET['id'], $matches)) {
    $id = $matches[1];
} else {
    $id = '';
}
if (isset($_GET['dropElId'])) {
    $dropElId = $_GET['dropElId'];
} else {
    $dropElId = '';
}
$type = preg_replace('/.*?-image-(mini|blurb)$/', '\\1', $dropElId);
if ($id != '') {
 static function getRecentlyInvitedFriends($db, $userid, $inviteInterval)
 {
     if (is_null($db)) {
         require_once PATH_CORE . '/classes/db.class.php';
         $db = new cloudDatabase();
     }
     // get fbIds of everyone of their friends that they have invited inside the invite interval
     $idList = $db->buildIdList("\n\t\t\tSELECT friendFbId AS id \n\t\t\tFROM UserInvites WHERE userid={$userid} AND \n\t\t\t\tUNIX_TIMESTAMP(dateInvited) > (UNIX_TIMESTAMP(NOW())-{$inviteInterval});");
     // invited within the invite interval means we want to exclude them
     // convert id list to array
     $friends = explode(',', $idList);
     return $friends;
 }
<?php

require_once PATH_CORE . '/classes/db.class.php';
$db = new cloudDatabase();
$results = $db->query("SELECT SQL_CALC_FOUND_ROWS Content.*,ContentImages.url as imageUrl,UserInfo.fbId FROM Content LEFT JOIN UserInfo ON Content.postedById = UserInfo.userid LEFT JOIN ContentImages ON (Content.siteContentId=ContentImages.siteContentId) ORDER BY Content.date DESC LIMIT 20");
$stories = array();
$story_ids = array();
while ($row = mysql_fetch_assoc($results)) {
    $stories[] = $row;
}
?>
<div class="stories" style="border: 1px solid black;">
<?php 
foreach ($stories as $story) {
    ?>
	<?php 
    $story_id = "story_" . $story['siteContentId'];
    $story_ids[] = "'{$story_id}'";
    ?>
	<div class="story" id="<?php 
    echo $story_id;
    ?>
" style="border: 1px solid black; margin: 10px; padding: 10px;">
		<?php 
    if ($story['imageUrl'] != '') {
        ?>
			<img alt="story image" style="max-width:100px;max-height:100px;" src="<?php 
        echo $story['imageUrl'];
        ?>
"/>
		<?php 
    if (preg_match('/(num)?([A-Z][^A-Z]+)([A-Z][^A-Z]+)?/', $string, $match)) {
        $return = '';
        if ($match[1] != '') {
            $return .= 'Number of ';
        }
        if ($match[2] != '') {
            $return .= $match[2];
        }
        if ($match[3] != '') {
            $return .= " {$match[3]}";
        }
    }
    return $return;
}
require_once PATH_CORE . '/classes/db.class.php';
$db = new cloudDatabase();
$times = array('day', 'week', 'month', 'all');
$types = array('members', 'actions', 'sessions');
$timeslabels = array('day' => 'Daily (' . date('l jS \\of F Y', time()) . ')', 'week' => 'Week of ', 'month' => 'Month of ' . date('F Y', time()), 'all' => 'All time');
$typeslabels = array('members' => 'Members Statistics', 'actions' => 'Site Actions Statistics', 'sessions' => 'Active Session Statistics');
if (isset($_GET['type'])) {
    $type = $_GET['type'];
}
//if (isset($_GET['time']))
//$time = $_GET['time'];
$time = $_GET['time'] ? $_GET['time'] : 'day';
if (!in_array($type, $types)) {
    $type = 'actions';
}
//$type = 'members';
if (!in_array($time, $times)) {
예제 #7
0
fb_sig_time=>1230754526.8214
fb_sig=>576c85dc673f91553231de8e9dc47880
*/
/* Process incoming variable requests */
if (isset($_GET['m'])) {
    $method = $_GET['m'];
} else {
    $method = 'remove';
}
if (isset($_GET['referid'])) {
    $referid = $_GET['referid'];
} else {
    $referid = 0;
}
require_once PATH_CORE . '/classes/db.class.php';
$db = new cloudDatabase();
//	$db->log('===');
//	$db->log('method:'.$method);
//	foreach ($_POST as $key=>$item)
//		$db->log($key.'=>'.$item);
if (isset($_POST['fb_sig_user']) or isset($_GET['force'])) {
    $fbId = $_POST['fb_sig_user'];
} else {
    exit;
}
if (isset($_GET['force'])) {
    $fbId = $_GET['fbId'];
}
require_once PATH_CORE . '/classes/user.class.php';
$userTable = new UserTable($db);
$user = $userTable->getRowObject();