コード例 #1
0
ファイル: functions.php プロジェクト: danialbehzadi/tehlug
function getNextSession()
{
    $last = current(getEntries('Session', 1));
    if ($last->timestamp >= time()) {
        return $last;
    }
}
コード例 #2
0
ファイル: index.php プロジェクト: ragi79/Textcube
function GoogleMap_LocationLogView($target)
{
    $ctx = Model_Context::getInstance();
    $blogId = $ctx->getProperty('blog.id');
    $blogURL = $ctx->getProperty('uri.blog');
    $serviceURL = $ctx->getProperty('uri.service');
    global $pluginURL, $configVal;
    $ctx->setProperty('is_used', true);
    $config = Setting::fetchConfigVal($configVal);
    $locatives = getEntries($blogId, 'id, title, slogan, location, longitude, latitude', '(length(location)>1 AND category > -1) OR (`longitude` IS NOT NULL AND `latitude` IS NOT NULL)', 'location');
    $width = Misc::getContentWidth();
    $height = intval($width * 1.2);
    $default_type = isset($config['locative_maptype']) ? _GMap_convertLegacyMapType($config['locative_maptype']) : 'ROADMAP';
    $id = 'LocationMap';
    $lat = $config['latitude'];
    $lng = $config['longitude'];
    $zoom = 10;
    ob_start();
    ?>
	<div style="text-align:center;">
		<div id="<?php 
    echo $id;
    ?>
" style="margin:0 auto;"></div>
	</div>
	<script type="text/javascript">
	//<![CDATA[
	var process_count = 0;
	var polling_interval = 100; // ms
	var query_interval = 500; // ms
	var query_interval_handle = null;
	var progress = null;
	var boundary = null;
	var locationMap = null;
	function locationFetch(tofind) {
		if (tofind.length == 0) {
			window.clearInterval(query_interval_handle);
			return;
		}
		GMap_addLocationMark.apply(this, tofind.pop());
	}
	function locationFetchPoller(target_count) {
		if (process_count != target_count) {
			progress.setProgress(process_count / target_count);
			window.setTimeout('locationFetchPoller('+target_count+');', polling_interval);
			return;
		}
		progress.setProgress(1.0);
		window.setTimeout(function() {progress.remove();}, 200); // eyecandy
		locationMap.fitBounds(boundary);
	}
	GMapOnLoadCallbacks.push(function() {
		var c = document.getElementById('<?php 
    echo $id;
    ?>
');
		c.style.width = "<?php 
    echo $width;
    ?>
px"
		c.style.height = "<?php 
    echo $height;
    ?>
px";
		locationMap = new google.maps.Map(c, {
			'center': new google.maps.LatLng(<?php 
    echo $lat;
    ?>
, <?php 
    echo $lng;
    ?>
),
			'zoom': <?php 
    echo $zoom;
    ?>
,
			'mapTypeId': google.maps.MapTypeId.<?php 
    echo $default_type;
    ?>
,
			'mapTypeControl': true,
			'navigationControl': true,
			'scaleControl': true
		});
		progress = new GProgressControl(locationMap);
		google.maps.event.addListenerOnce(locationMap, 'idle', function() {
			boundary = locationMap.getBounds();
			var locations = new Array();
			var tofind = new Array();
<?php 
    $count = 0;
    $countRemoteQuery = 0;
    $dbPrefix = $ctx->getProperty('database.prefix');
    foreach ($locatives as $locative) {
        //if ($count == 10) break; // for testing purpose
        $locative['link'] = "{$blogURL}/" . ($ctx->getProperty('blog.useSloganOnPost') ? 'entry/' . URL::encode($locative['slogan'], $ctx->getProperty('service.useEncodedURL')) : $locative['id']);
        $found = false;
        if ($locative['longitude'] != NULL && $locative['latitude'] != NULL) {
            $found = true;
            $lat = $locative['latitude'];
            $lng = $locative['longitude'];
            $locative['location'] = _t("위도") . " : " . $lat . ", " . _t("경도") . " : " . $lng;
        } else {
            $row = POD::queryRow("SELECT * FROM {$dbPrefix}GMapLocations WHERE blogid = {$blogId} AND original_address = '" . POD::escapeString($locative['location']) . "'");
            if ($row == null || empty($row)) {
                $found = false;
            } else {
                $lat = $row['latitude'];
                $lng = $row['longitude'];
                $found = true;
            }
        }
        if ($found) {
            // found, just output
            echo "\t\t\tGMap_addLocationMarkDirect(locationMap, {address:plugin.gmap.normalizeAddress('{$locative['location']}'), path:'{$locative['location']}', original_path:'{$locative['location']}'}, '" . str_replace("'", "\\'", $locative['title']) . "', encodeURI('" . str_replace("'", "\\'", $locative['link']) . "'), new google.maps.LatLng({$lat}, {$lng}), boundary, locations, false);\n";
        } else {
            // try to find in the client
            echo "\t\t\ttofind.push([locationMap, '{$locative['location']}', '" . str_replace("'", "\\'", $locative['title']) . "', encodeURI('" . str_replace("'", "\\'", $locative['link']) . "'), boundary, locations]);\n";
        }
        $count++;
    }
    ?>
			progress.setLabel('Loading locations...');
			query_interval_handle = window.setInterval(function() {locationFetch(tofind);}, query_interval);
			window.setTimeout(function() {locationFetchPoller(<?php 
    echo $count;
    ?>
);}, polling_interval);
		});
	});
	//]]>
	</script>
<?php 
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
コード例 #3
0
        $streamId = $entry->getStreamRemoteId();
        $entry->setStreamName($entry->getId() . '_%i@' . $streamId);
        $entry->setPrimaryBroadcastingUrl('rtmp://p.ep' . $streamId . '.i.akamaientrypoint.net/EntryPoint');
        $entry->setSecondaryBroadcastingUrl('rtmp://b.ep' . $streamId . '.i.akamaientrypoint.net/EntryPoint');
        if (!$dryRun) {
            KalturaLog::log('Saving new entry with the following parameters: ' . PHP_EOL);
            KalturaLog::log('Stream name = ' . $entry->getStreamName() . PHP_EOL);
            KalturaLog::log('Primary broadcasting URL = ' . $entry->getPrimaryBroadcastingUrl() . PHP_EOL);
            KalturaLog::log('Secondary broadcasting URL =  ' . $entry->getSecondaryBroadcastingUrl() . PHP_EOL);
            $entry->save();
        } else {
            KalturaLog::log('DRY RUN - entry is not being saved with the following new parameters: ' . PHP_EOL);
            KalturaLog::log('Stream name = ' . $entry->getStreamName() . PHP_EOL);
            KalturaLog::log('Primary broadcasting URL = ' . $entry->getPrimaryBroadcastingUrl() . PHP_EOL);
            KalturaLog::log('Secondary broadcasting URL =  ' . $entry->getSecondaryBroadcastingUrl() . PHP_EOL);
        }
        file_put_contents($lastEntryFile, $lastEntry);
    }
    entryPeer::clearInstancePool();
    $entries = getEntries($con, $lastEntry, $entryLimitEachLoop);
}
KalturaLog::log('Done');
function getEntries($con, $lastEntry, $entryLimitEachLoop)
{
    $c = new Criteria();
    $c->add(entryPeer::INT_ID, $lastEntry, Criteria::GREATER_THAN);
    $c->addAnd(entryPeer::TYPE, entryType::LIVE_STREAM);
    $c->addAscendingOrderByColumn(entryPeer::INT_ID);
    $c->setLimit($entryLimitEachLoop);
    return entryPeer::doSelect($c, $con);
}
function entryLookup($atts)
{
    $attributes = shortcode_atts(array('formid' => ''), $atts);
    if ($attributes[formid] != '') {
        $entires = getEntries($attributes['formid']);
        /* Turn on buffering */
        ob_start();
        ?>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
  <script>
    angular.module('entries', []).controller('controller',  function ($scope, $filter) {
        $scope.members = <?php 
        echo json_encode($entires);
        ?>
;

        $scope.ME = $filter('filter')($scope.members, function(m){return m.events.indexOf('ME') != -1;});
        $scope.MF = $filter('filter')($scope.members, function(m){return m.events.indexOf('MF') != -1;});
        $scope.MS = $filter('filter')($scope.members, function(m){return m.events.indexOf('MS') != -1;});
        $scope.WE = $filter('filter')($scope.members, function(m){return m.events.indexOf('WE') != -1;});
        $scope.WF = $filter('filter')($scope.members, function(m){return m.events.indexOf('WF') != -1;});
        $scope.WS = $filter('filter')($scope.members, function(m){return m.events.indexOf('WS') != -1;});


        $scope.events = [
          {
            title : "Men's Epee",
            entrants: $scope.ME 
          },
           {
            title : "Men's Foil",
            entrants: $scope.MF 
          },
           {
            title : "Men's Sabre",
             entrants: $scope.MS 

          },
            {
            title : "Women's Epee",
             entrants: $scope.WE 
          },
           {
            title : "Women's Foil",
             entrants: $scope.WF 
          },
           {
            title : "Women's Sabre",
             entrants: $scope.WS 
          }
        ];
    });    
  </script>
  

  <div ng-app="entries" ng-controller="controller">

  <div ng-repeat="event in events">
   <h3 style="float:left">{{event.title}}</h3>  <span style="float:right">{{event.entrants.length}} entered</span>
   <table class="table table-bordered table-striped">
     <tr>      
       <td>Name</td>
       <td>Club</td>       
       <td>Nationality</td>       
     </tr>
      <tr ng-repeat="m in event.entrants">      
       <td>{{m.firstName}} {{m.lastName}}</td>
       <td>{{m.club}}</td> 
       <td>{{m.nationality}}</td>          
     </tr>
   </table> 
   </div>
  </div>
  
  <?php 
        /* Get the buffered content into a var */
        $sc = ob_get_contents();
        /* Clean buffer */
        ob_end_clean();
        /* Return the content as usual */
        return $sc;
    } else {
        return new WP_Error("Error", __("FormID wasn't specified", "IFF_Lookup_Plugin"));
    }
}
コード例 #5
0
ファイル: sessions.php プロジェクト: danialbehzadi/tehlug
<?php

$sessions = getEntries('Session');
?>

<ul id="sessions" class="results">
	<?php 
foreach ($sessions as $session) {
    ?>
		<li class="entry">
			<div class="title">
				<a href="index.php?page=entries/<?php 
    echo $session->id;
    ?>
">
					<?php 
    echo $session->title;
    ?>
				</a>
			</div>

			<div class="date">
				<?php 
    echo toPersian($session->date);
    ?>
			</div>

			<div class="clear"></div>

			<div class="num">
				<?php 
コード例 #6
0
            $output .= file_get_contents("templates/add-remove-users.html");
        }
        $output .= "<form name='leave-group' method='post' action=''><label>Set new group admin:</label><input type='text' name='newowner'><input type='submit' value='Leave Group' name='setowner'></form>";
    } else {
        if (getGroupMember($username, $group)) {
            //Everyone else then sees...
            $output .= "<form name='leave-group' method='post' action=''><input type='submit' text='Leave Group'></form>";
        }
    }
    //Group is private?
    if (checkGroupPrivate($group) && $_SESSION['admin'] == false) {
        header("Location: {$host}/403");
        //No permission to view this
    } else {
        //Getting, prettifying and printing entries WITHOUT edit functionality. User currently must do that via landing page.
        $output .= encaseResults(getEntries($group, true));
    }
} else {
    //TODO - List all of the groups the user is a member of.
    if ($_SESSION['admin']) {
        //spit("Admin List");
        //Get ALL groups
        $sql = "SELECT DISTINCT owner, groupid FROM Groups INNER JOIN GroupMembers";
    } else {
        //spit("Normal List");
        //Searched based on usename
        $sql = "SELECT DISTINCT * FROM GroupMembers INNER JOIN Groups WHERE userid='{$username}' AND groupid=name";
        //Select everything from groups where userid in GroupMember is paired with that groupid.
    }
    $result = mysqli_query($conn, $sql);
    if ($result === FALSE) {
コード例 #7
0
ファイル: news.php プロジェクト: danialbehzadi/tehlug
<?php

$news = getEntries('News');
?>

<ul id="news" class="results">
	<?php 
foreach ($news as $item) {
    ?>
		<li class="entry">
			<div class="title">
				<a href="index.php?page=entries/<?php 
    echo $item->id;
    ?>
">
					<?php 
    echo $item->title;
    ?>
				</a>
			</div>

			<div class="date">
				<?php 
    echo toPersian($item->date);
    ?>
			</div>

			<div class="clear"></div>

			<div class="body">
				<?php 
コード例 #8
0
ファイル: rss.php プロジェクト: danialbehzadi/tehlug
<?php

echo '<?xml version="1.0" encoding="UTF-8" ?>';
include_once 'functions.php';
$entries = getEntries(Null, 20);
$baseUrl = 'http://' . str_replace('rss.php', Null, $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
?>
<rss version="2.0">
<channel>
	<title>گروه کاربران لینوکس تهران</title>
	<description>برد خبری و آخرین جلسات گروه کاربران لینوکس تهران</description>
	<link>http://tehlug.org</link>
	<lastBuildDate><?php 
echo date('r', filectime(end($entries)->path));
?>
</lastBuildDate>
	<pubDate><?php 
echo date('r', filectime(end($entries)->path));
?>
</pubDate>

	<?php 
foreach ($entries as $entry) {
    ?>
		<item>
			<title><?php 
    echo $entry->title;
    ?>
</title>
			<description>
				<![CDATA[
コード例 #9
0
ファイル: locative.php プロジェクト: webhacking/Textcube
function getLocatives($blogid)
{
    return getEntries($blogid, 'id, userid, title, slogan, location', array(array('length(location)', '>', 1), 'AND', array('category', '>', -1)), array('location', 'desc'));
}
コード例 #10
0
ファイル: blog.locative.php プロジェクト: hinablue/TextCube
function getLocatives($blogid)
{
    return getEntries($blogid, 'id, userid, title, slogan, location', 'length(location) > 1 AND category > -1', 'location');
}
コード例 #11
0
    //To update the group, we want to delete anything with this id from the relationship table
    //then IF it's not being posted to the user, insert a new relationship into the table.
    //Thus, delete relationships first
    $sql = "DELETE FROM groupposts WHERE postid='{$id}'";
    $query = mysqli_query($conn, $sql);
    echo mysqli_error($conn);
    if ($group != $username) {
        //Then add to the relationship table
        $sql = "INSERT INTO groupposts (postid, groupid) VALUES ('{$id}', '{$group}')";
        $query = mysqli_query($conn, $sql);
        echo mysqli_error($conn);
    }
}
//User deleted link
if (isset($_POST['delete'])) {
    $id = $_POST['id'];
    $title = mysqli_real_escape_string($conn, $_POST['title']);
    $url = mysqli_real_escape_string($conn, $_POST['url']);
    $group = $_POST['postTo'];
    //delete post with corresponding id
    $sql = "DELETE FROM posts WHERE postid='{$id}'";
    $query = mysqli_query($conn, $sql);
    echo mysqli_error($conn);
    //Then skim through the group/post relationship table to delete any references to that id
    $sql = "DELETE FROM groupposts WHERE postid='{$id}'";
    $query = mysqli_query($conn, $sql);
    echo mysqli_error($conn);
}
//Printing entries, WITH edit buttons on landing page.
$output .= encaseResults(getEntries($username, true), true);
コード例 #12
0
ファイル: front.php プロジェクト: na3r/tehlug
</div>


<div class="dialog" style="float: left;">
	<div class="orange box">
		تابلوی اخبار و جلسات

		<a href="rss.php">
			<img src="images/rss.png" alt="RSS Feed" title="RSS Feed" style="float: left;" />
		</a>
	</div>

	<ul class="entries">
		<?php 
$next = getNextSession();
foreach (getEntries(Null, 6) as $entry) {
    echo '<li class="entry">';
    if ($entry == $next) {
        echo 'جلسه بعدی:';
    }
    echo '<a href="' . $entry->url . '">';
    echo $entry->title;
    echo '</a>';
    if ($entry->date) {
        echo "<div class='date'>" . toPersian($entry->date) . "</div>";
    }
    echo '</li>';
}
?>
	</ul>
</div>