/**
  * Tests whether timeline() returns the correct value.
  *
  * @uses timeline()
  **/
 public function testTimelineValue()
 {
     $timeline = $this->_createTimeline();
     $this->dispatch('neatline-time/timelines/show/1');
     // Timeline Title
     $this->assertEquals('Timeline Title', timeline('title'));
     // Timeline Description
     $this->assertEquals('Timeline description.', timeline('description'));
 }
示例#2
0
function showtimeline($offset, $name)
{
    $tmstart = rticktime();
    $tmljsn = timeline($offset, $name);
    $tmtime = number_format(rticktime() - $tmstart, 3);
    $starttime = rticktime();
    if (strpos($tmljsn, '"err"') !== false) {
        print "Sorry, this feed unavailable";
        exit;
    }
    header("HTTP/1.0 200 Ok");
    $tml = json_decode($tmljsn);
    // -- make groups list
    $ga = $tml->subscribers;
    $ga_cnt = sizeof($ga);
    $ga_out = array();
    for ($i = 0; $i < $ga_cnt; $i++) {
        if ($ga[$i]->type == "group") {
            $ga_out[$ga[$i]->id] = $ga[$i]->username;
        }
    }
    $gb = $tml->subscriptions;
    $gb_cnt = sizeof($gb);
    $groups = array();
    for ($i = 0; $i < $gb_cnt; $i++) {
        if (isset($ga_out[$gb[$i]->user])) {
            $groups[$gb[$i]->id] = $ga_out[$gb[$i]->user];
        }
    }
    // end make groups list
    $postarr = $tml->posts;
    $postcnt = sizeof($postarr);
    $commarr = $tml->comments;
    // all timeline comments
    $carrcnt = sizeof($commarr);
    $commidx = array();
    //comments index
    for ($k = 0; $k < $carrcnt; $k++) {
        $commidx[$commarr[$k]->id] = $k;
    }
    //$usrarr=$tml->subscribers; //users
    $usrarr = $tml->users;
    //users
    $usrcnt = sizeof($usrarr);
    $usridx = array();
    $usracs = array();
    for ($k = 0; $k < $usrcnt; $k++) {
        $usridx[$usrarr[$k]->id] = $usrarr[$k]->username;
        $usracs[$usrarr[$k]->id] = $usrarr[$k]->isPrivate;
    }
    //start html
    print "<!DOCTYPE html><html><head><title>frf: " . htmlspecialchars($name) . " / offset " . htmlspecialchars($offset) . "</title></head><body bgcolor=\"#FFFFFF\">";
    $attindex = array();
    $cattacharr = array();
    if (isset($tml->attachments)) {
        $cattacharr = $tml->attachments;
    }
    $cattcnt = sizeof($cattacharr);
    for ($ci = 0; $ci < $cattcnt; $ci++) {
        $attindex[$cattacharr[$ci]->id] = $ci;
    }
    //print_r ($usridx);
    if ($postcnt == 0) {
        print "Ой, всё";
        exit;
    }
    for ($i = 0; $i < $postcnt; $i++) {
        if ($postarr[$i]->isHidden) {
            continue;
        }
        // check groups
        print "<b>";
        $ps_cnt = sizeof($postarr[$i]->postedTo);
        if ($ps_cnt > 1) {
            print "+";
        }
        for ($j = 0; $j < $ps_cnt; $j++) {
            $xz = $postarr[$i]->postedTo[$j];
            if (isset($groups[$xz])) {
                print htmlspecialchars($groups[$xz]) . ":";
            }
        }
        print "</b>";
        // post author
        $ausr = $usridx[$postarr[$i]->createdBy];
        print "<b>" . htmlspecialchars($ausr) . "</b><br>";
        //post body
        print htmlspecialchars($postarr[$i]->body);
        print "<br>";
        $time = $postarr[$i]->createdAt;
        $time_html = date("d.m.y H:i", ($time + 0) / 1000) . "\n";
        print "<a href=\"/" . htmlspecialchars($name . "/" . $postarr[$i]->id) . "\">" . htmlspecialchars($time_html) . "</a><br>";
        //	print $postarr[$i]->omittedComments."<br>";
        //likes
        $likearr = $postarr[$i]->likes;
        $likecnt = sizeof($likearr);
        if ($likecnt != 0) {
            print "Likes: ";
        }
        for ($z = 0; $z < $likecnt; $z++) {
            print htmlspecialchars($usridx[$likearr[$z]]) . ", ";
        }
        if ($postarr[$i]->omittedLikes != "0") {
            print "... [" . htmlspecialchars($postarr[$i]->omittedLikes) . "]";
        }
        if ($likecnt != 0) {
            print "<br>";
        }
        //attachments
        $attach_html = '';
        if (isset($postarr[$i]->attachments)) {
            $attacharr = $postarr[$i]->attachments;
        } else {
            $attacharr = array();
        }
        $attachasize = sizeof($attacharr);
        //	   print_r($attacharr);
        if ($attachasize != 0) {
            for ($ai = 0; $ai < $attachasize; $ai++) {
                $citm = $cattacharr[$attindex[$attacharr[$ai]]];
                if ($citm->mediaType != "image") {
                    $attach_html .= "<a href=\"" . htmlspecialchars($citm->url) . "\">" . htmlspecialchars($citm->fileName) . "</a><br>\n";
                } else {
                    $attach_html .= "<img src=\"" . htmlspecialchars($citm->thumbnailUrl) . "\"><br>\n";
                }
            }
        }
        print $attach_html;
        //comments
        $commlist = $postarr[$i]->comments;
        $commcnt = sizeof($commlist);
        if ($commcnt > 0) {
            print "<ul>\n";
        }
        $cmtdiv = $postarr[$i]->omittedComments;
        for ($j = 0; $j < $commcnt; $j++) {
            print "<li>";
            $cid = $commlist[$j];
            $cx = $commidx[$cid];
            //		print $cid.":".$cx.":";
            print htmlspecialchars($commarr[$cx]->body);
            print " - <i>" . htmlspecialchars($usridx[$commarr[$cx]->createdBy]) . "</i>";
            print "</li>";
            if ($j == 0 && $cmtdiv != "0") {
                print " ...[ " . htmlspecialchars($cmtdiv) . " ]...<br>";
            }
            //		print $commarr[$commidx[$commlist[$j]]]->id;
        }
        if ($commcnt > 0) {
            print "</ul>\n";
        }
        print "<hr><p>";
    }
    $gentime = number_format(rticktime() - $starttime, 3);
    if ($offset > 29) {
        print "<a href=/" . htmlspecialchars($name) . "/offset/" . ($offset - 30) . ">Prev</a> | ";
    }
    print "<a href=/" . htmlspecialchars($name) . "/offset/" . ($offset + 30) . ">Next</a> | ";
    print "<p>\n" . htmlspecialchars($tmtime . "/" . $gentime);
    print "</body></html>";
}
示例#3
0
<?php

/**
 * The edit view for the Timelines administrative panel.
 */
$timelineTitle = timeline('title') ? strip_formatting(timeline('title')) : '[Untitled]';
$title = __('Neatline Time | Edit "%s" Metadata', $timelineTitle);
$head = array('bodyclass' => 'timelines primary', 'title' => html_escape($title));
echo head($head);
echo $form;
echo foot();
示例#4
0
                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1>
                        <?php 
if (isset($titre)) {
    echo $titre;
}
?>
                    </h1>
                </section>

                <!-- Main content -->
                <section class="content">
                    <!-- Main row -->
                    <?php 
echo timeline();
?>

                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->

        <!-- add new calendar event modal -->


        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
        <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js" type="text/javascript"></script>
        <script src="//code.jquery.com/ui/1.11.1/jquery-ui.min.js" type="text/javascript"></script>
        <!-- Morris.js charts -->
        <script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
        <script src="./AdminLTE/js/plugins/morris/morris.min.js" type="text/javascript"></script>
示例#5
0
                payBonus();
                break;
            case 'pingTask':
                pingTask();
                break;
            case 'userReview':
                userReview();
                break;
            case 'visitQuery':
                echo json_encode(VisitQueryTools::visitQuery((int) $_GET['jobid']));
                break;
            case 'wdFee':
                wdFee();
                break;
            case 'timeline':
                timeline();
                break;
            case 'newUserNotification':
                Utils::validateAPIKey();
                sendNewUserNotification();
                break;
            case 'sendJobReport':
                Utils::validateAPIKey();
                sendJobReport();
                break;
            default:
                die("Invalid action.");
        }
    }
}
function validateAction()
示例#6
0
       <div class="span7">
		<table>
<tr>
<td valign='top'>
<br>
<div class="slidingDiv" id="slidingDiv" style='padding-left:10px;padding-right:10px;padding-top:10px;-moz-box-shadow:1px 1px 2px 3px #ccc;-webkit-box-shadow: 1px 1px 2px 3px #ccc;box-shadow:1px 1px 2px 3px #ccc;'>
<?php 
heat($categories);
?>
 
</div>
</td>
<td>
  <div class="timeline">
  <?php 
timeline($months, $categories);
?>
  </div>
  <br>
  <div class="weapon" style='margin-top:-30px;'>
<?php 
weapon($weapons);
?>
 
  </div>
</td>
</tr>
</table>
      </div>
	 
/**
 * Displays random featured timelines
 *
 * @param int Maximum number of random featured timelines to display.
 * @return string HTML
 */
function neatlinetime_display_random_featured_timelines($num = 1)
{
    $html = '';
    $timelines = get_db()->getTable('NeatlineTimeTimeline')->findBy(array('random' => 1, 'featured' => 1), $num);
    if ($timelines) {
        foreach ($timelines as $timeline) {
            $html .= '<h3>' . link_to_timeline(null, array(), 'show', $timeline) . '</h3>' . '<div class="description timeline-description">' . timeline('description', array('snippet' => 150), $timeline) . '</div>';
        }
        return $html;
    }
}
示例#8
0
}
?>

</div>

<div class="three columns omega">
<div id="edit" class="panel">
<?php 
if (is_allowed($neatline_time_timeline, 'edit')) {
    ?>
    <?php 
    echo link_to($neatline_time_timeline, 'edit', __('Edit Metadata'), array('class' => 'big green button'));
    ?>
    <?php 
    echo link_to($neatline_time_timeline, 'query', __('Edit Items Query'), array('class' => 'big green button'));
}
?>
<a href="<?php 
echo html_escape(public_url('neatline-time/timelines/show/' . timeline('id')));
?>
" class="big blue button"><?php 
echo __('View Public Page');
?>
</a>
<?php 
echo link_to($neatline_time_timeline, 'delete-confirm', __('Delete'), array('class' => 'delete-confirm big red button'));
?>
</div>
</div>
<?php 
foot();