Пример #1
0
function view()
{
    if (isset($_GET['post'])) {
        $data['subtitle'] = $lang['post'];
        $data['content'] .= '<h1>' . (isset($_SESSION['admin']) ? '<a href = "add.php?post">[+]</a>' : '') . $data['subtitle'] . '</h1>';
        $page = array_chunk(array_reverse(listEntry('post/')), 4);
        if (!isset($page[$_GET['post'] - 1])) {
            $_GET['post'] = 1;
        }
        if ($page) {
            foreach ($page[$_GET['post'] - 1] as &$post) {
                $postEntry = readEntry('post', $post);
                $data['content'] .= '<div class = "well" style="margin-top: 20px;">
			<div class = "entryHeader"><h3>' . managePost($post) . $postEntry['title'] . '<h3></div>
			<div class = "entryMain">
			<p>' . summary($postEntry['content']) . '</p>
			<p><a class = "btn btn-primary" href = "view.php?post=' . $post . '"><span class="btn-label">' . $lang['readMore'] . '</span></a></p>
			</div>
			<div class = "entryFooter"><ul>';
                if (isset($postEntry['category'])) {
                    $categoryEntry = readEntry('category', $postEntry['category']);
                    $data['content'] .= '<label><strong rel="tooltip" data-placement="top" title="Категория&nbsp;"><i class="icon-folder-open"></i></strong></label> - <a href = "view.php?category=' . $postEntry['category'] . '">' . $categoryEntry['name'] . '</a> <br> ';
                }
                $data['content'] .= '<label><strong rel="tooltip" data-placement="top" title="Комментарии"><i class="icon-comment"></i></strong></label> - <small>' . count($postEntry['comment']) . '</small> <br>
			 <label><strong rel="tooltip" data-placement="left" title="Просмотры"><i class="icon-eye-open"></i></strong></label> - <small>' . $postEntry['view'] . '</small> <br>
			<label><strong rel="tooltip" data-placement="left" title="Дата"><i class="icon-calendar"></i></strong></label> - <small>' . date('Y-m-d H:i', strtotime($dateoutput)) . '</small>
			</ul></div>
			</div>';
            }
        } else {
            $data['content'] .= '<p>' . $lang['none'] . '</p>';
        }
        $data['content'] .= '<div id = "page"><ul>' . (isset($page[$_GET['post'] - 2]) ? '<li><a href = "index.php?post=' . ($_GET['post'] - 1) . '">< ' . $lang['prev'] . '</a></li>' : '') . '<li>' . $lang['page'] . ':' . $_GET['post'] . ' / ' . count($page) . '</li>' . (isset($page[$_GET['post']]) ? '<li><a href = "index.php?post=' . ($_GET['post'] + 1) . '">' . $lang['next'] . ' ></a></li>' : '') . '</ul></div>';
    }
}
 public function indexJson(Request $request, Group $group)
 {
     //dd($request);
     // load of actions between start and stop provided by calendar js
     if ($request->has('start') && $request->has('end')) {
         $actions = $group->actions()->where('start', '>', Carbon::parse($request->get('start')))->where('stop', '<', Carbon::parse($request->get('end')))->orderBy('start', 'asc')->get();
     } else {
         $actions = $group->actions()->orderBy('start', 'asc')->get();
     }
     $event = '';
     $events = '';
     foreach ($actions as $action) {
         $event['id'] = $action->id;
         $event['title'] = $action->name . ' (' . $group->name . ')';
         $event['description'] = $action->body . ' <br/> ' . $action->location;
         $event['body'] = $action->body;
         $event['summary'] = summary($action->body);
         $event['location'] = $action->location;
         $event['start'] = $action->start->toIso8601String();
         $event['end'] = $action->stop->toIso8601String();
         $event['url'] = action('ActionController@show', [$group->id, $action->id]);
         $event['color'] = $group->color();
         $events[] = $event;
     }
     return $events;
 }
Пример #3
0
 /**
  * Renders an ical file for a specific group
  */
 public function group(Group $group)
 {
     // 1. Create new calendar
     $vCalendar = new \Eluceo\iCal\Component\Calendar(config('app.url'));
     $vCalendar->setName(config('mobilizator.name') . ' : ' . $group->name);
     $vCalendar->setDescription(summary($group->body, 500));
     // returns actions started the last 60 days
     $actions = $group->actions()->where('start', '>=', Carbon::now()->subDays(60))->get();
     foreach ($actions as $action) {
         // 2. Create an event
         $vEvent = new \Eluceo\iCal\Component\Event();
         $vEvent->setDtStart($action->start);
         $vEvent->setDtEnd($action->stop);
         $vEvent->setSummary($action->name);
         $vEvent->setDescription(summary($action->body), 1000);
         $vEvent->setLocation($action->location);
         $vEvent->setUrl(action('ActionController@show', [$action->group->id, $action->id]));
         $vEvent->setUseUtc(false);
         //TODO fixme
         $vCalendar->addComponent($vEvent);
     }
     return response($vCalendar->render())->header('Content-Type', 'text/calendar; charset=utf-8')->header('Content-Disposition', 'attachment; filename="cal.ics"');
 }
Пример #4
0
    ?>
#comments"><?php 
    $this->commentsNum('没有评论', '1 条评论', '%d 条评论');
    ?>
</a>
							</dd>
							<dd	class="thumbnail"><img src="<?php 
    @thumbnail($this);
    ?>
" alt="<?php 
    $this->title();
    ?>
"></dd>
							<dd class="article_list_txt">
								<?php 
    @summary($this);
    ?>
							</dd>
						</dl>
					</article>
				<?php 
}
?>
				<?php 
$this->need('pagebar.php');
?>
			</div>
		<div class="col-md-4 bodyer_sider">
			<?php 
$this->need('sidebar.php');
?>
Пример #5
0
// Description : get data for pvsolar
if (defined('STDIN') && isset($_SERVER['QUERY_STRING'])) {
    parse_str($_SERVER['QUERY_STRING'], $_GET);
}
// command line debugging
require 'pv_config.php.inc';
// site specific data
date_default_timezone_set("UTC");
$credits = array('enabled' => false);
if (isset($_GET['pv'])) {
    if ($_GET['pv'] == 'day') {
        require INCPATH . '/' . 'pv_daydata.php.inc';
        $dataset = daydata();
    } elseif ($_GET['pv'] == 'sum') {
        require INCPATH . '/' . 'pv_summary.php.inc';
        $alldata = summary();
        $dataset = $alldata['items'];
        $series = $alldata['series'];
        $dataset['system'] = SYSTEM;
        $dataset['updelay'] = UPDELAY;
        $dataset['yrmax'] = YRMAX;
        $dataset['md_x'] = $series['days'];
        $dataset['md_y'] = $series['day_nrg'];
        $dataset['mo_x'] = $series['months'];
        $dataset['mo_y'] = $series['mo_nrg'];
        $dataset['yr_x'] = $series['years'];
        $dataset['yr_y'] = $series['yr_nrg'];
    } else {
        die("must specify correct data type: pvdata.php?pv=<data>\n");
    }
} else {
Пример #6
0
		<?php 
$SQL = "SELECT * FROM news WHERE status=1 ORDER BY date ASC LIMIT 5";
$var1 = mysql_query($SQL);
$count = 0;
while ($var2 = mysql_fetch_assoc($var1)) {
    $string = "";
    $active = '';
    $picture;
    $writings;
    preg_match_all('/<img[^>]+>/i', $var2['content'], $picture);
    preg_match_all('/(alt|title|src)=("[^"]*")/i', $picture[0][0], $picture);
    preg_replace("/<img[^>]+\\>/i", "", $var2['content']);
    if ($count == 0) {
        $active = ' active';
    }
    $string = '<div class="item' . $active . '"><a href="http://izumezun.tk/new.php?id=' . $var2['id'] . '" style="color:white;"><img ' . $picture[0][0] . ' alt="" style="width:100%;height:100%"><div class="carousel-caption"><h3>' . $var2['title'] . '</h3><p>' . summary($var2['content'], 20) . '...</p></a></div></div>';
    echo $string;
    $count++;
}
?>

	</div>

	<a class="left carousel-control" href="#carousel-example-captions" role="button" data-slide="prev">

		<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
		
		<span class="sr-only">Previous</span>

	</a>
    
Пример #7
0
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 or later of the GPL.
#
# $Id: summary.php,v 1.1 2003/11/21 12:55:59 helix Exp $
#
######################################################################
require "include/prepend.php3";
page_open(array("sess" => "SourceAgency_Session"));
if (isset($auth) && !empty($auth->auth["perm"])) {
    page_close();
    page_open(array("sess" => "SourceAgency_Session", "auth" => "SourceAgency_Auth", "perm" => "SourceAgency_Perm"));
}
require "include/header.inc";
$bx = new box("100%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
start_content();
$page = "summary";
if (check_proid($proid)) {
    top_bar($proid, $page);
    $db->query("SELECT * FROM description WHERE proid='{$proid}'");
    $db->next_record();
    htmlp_image("ic/a.png", 0, 48, 48, "Summary");
    print '<b>' . $t->translate('Project description') . ':</b> ';
    $db->p("description");
    print '<p>';
    //  step_information ($db->f("status"));
    summary($proid);
    lib_comment_it($proid, "General", "0", "0", "", $t->translate('General Comments'));
}
end_content();
require "include/footer.inc";
@page_close();
Пример #8
0
        ?>
#disqus_thread" style="pointer-events: none;" class="btn btn-default btn-xs"></a> | <a href="#" data-id="<?php 
        echo $p->id;
        ?>
" data-likes="<?php 
        echo $p->likes;
        ?>
" data-toggle="tooltip" title="Like this post" style="pointer-events: none;" class="btn btn-default btn-xs likes_button">
                      <i class="fa fa-thumbs-o-up"></i>&nbsp;<span class="likes_value"><?php 
        echo $p->likes;
        ?>
</span></a>
                    </small>
            <br /><br />
            <?php 
        echo summary($p->body);
        ?>
                    <a href="<?php 
        echo site_url() . 'post/' . $title;
        ?>
"><i class="fa fa-angle-double-right"></i> Continue reading</a>
                  </div>
                </div>
  <hr />
  </div>
   <?php 
    }
    ?>

<?php 
} else {
Пример #9
0
    $date = $HTTP_GET_VARS['daily_lookups'];
}
if (isset($HTTP_GET_VARS['user'])) {
    $action = 'user';
    $cookie = $HTTP_GET_VARS['user'];
}
if (isset($HTTP_GET_VARS['active_users'])) {
    $action = 'active_users';
}
$dict_db = new inoah_db(DBUSER, '', DBNAME, DBHOST);
if ($action == 'summary') {
    summary();
} elseif ($action == 'daily') {
    daily_stats($date);
} elseif ($action == 'daily_lookups') {
    daily_lookups_stats($date);
} elseif ($action == 'user') {
    user_stats($cookie);
} elseif ($action == 'active_users') {
    active_users_stats();
} else {
    # shouldnt happen
    summary();
}
?>


</body>
</html>

Пример #10
0
function char_summary($memID)
{
    global $context, $user_profile;
    if (!empty($_SESSION['merge_success'])) {
        $context['profile_updated'] = $_SESSION['merge_success'];
        unset($_SESSION['merge_success']);
    }
    $cur_profile = $user_profile[$memID];
    $main_char = $cur_profile['characters'][$cur_profile['main_char']];
    loadTemplate('Profile-Chars');
    summary($memID);
    $context['member']['signature'] = $main_char['sig_parsed'];
    $user_groups = [];
    if (!empty($main_char['main_char_group'])) {
        $user_groups[] = $main_char['main_char_group'];
    }
    if (!empty($cur_profile['id_group'])) {
        $user_groups[] = $cur_profile['id_group'];
    }
    if (!empty($cur_profile['additional_groups'])) {
        $user_groups = array_merge($user_groups, explode(',', $cur_profile['additional_groups']));
    }
    if (!empty($main_char['char_groups'])) {
        $user_groups = array_merge($user_groups, explode(',', $main_char['char_groups']));
    }
    $details = get_labels_and_badges($user_groups);
    $context['member']['group'] = $details['title'];
    $context['member']['badges'] = $details['badges'];
    foreach ($context['member']['characters'] as $id_char => $char) {
        if ($char['is_main']) {
            continue;
        }
        $user_groups = [];
        if (!empty($char['main_char_group'])) {
            $user_groups[] = $char['main_char_group'];
        }
        if (!empty($char['char_groups'])) {
            $user_groups = array_merge($user_groups, explode(',', $char['char_groups']));
        }
        $details = get_labels_and_badges($user_groups);
        $context['member']['display_group'] = $details['title'];
    }
}
Пример #11
0
<?php

function summary($intx, $inty)
{
    $sum = $intx + $inty;
    return $sum;
}
$x = 15;
$y = 20;
$z = summary($x, $y);
echo "variable x = {$x}, variable y = {$y} <br>";
echo "sum (x + y) = " . $z;
Пример #12
0
          <?php 
while ($event = mysql_fetch_array($allEvent)) {
    ?>
 <!-- Get all events -->
          
          <a href="event.php?id=<?php 
    echo $event['id'];
    ?>
" class="list-group-item">
            <h4 class="list-group-item-heading"><?php 
    echo $event['title'];
    ?>
</h4> <!-- Event's Title -->

            <p class="list-group-item-text"><?php 
    echo summary($event['description'], 30);
    ?>
</p> <!-- Event's Content -->
            <br>

            <p class="list-group-item-text" style="font-style: italic">
              <?php 
    @setlocale(LC_ALL, 'turkish');
    echo iconv('latin5', 'utf-8', strftime('%e %B %Y %A', strtotime($event['date'])));
    ?>
            </p> <!-- Event's Date -->
          </a>
          <?php 
}
?>
        </div>
Пример #13
0
        if (isToken($_GET)) {
            echo "<h1>Dear CAcert Inc. member!</h1>";
            echo "<p>Please give your vote until 2016-01-28 00:00 UTC.</p>";
            echo "<p>Should CAcert perform the Root Re-sign Procedure?</p>";
            echo "<p><form method='POST' action='?'><input type='hidden' name='token' value='{$_GET['token']}'>";
            echo "  <input class='btn btn-primary btn-lg' style='margin-right: 10px' role='button' type='submit' name='y' value='YES'>";
            echo "  <input type='submit' name='n' value='NO' class='btn btn-primary btn-lg'>";
            echo "</form></p>";
        } else {
            echo "<p>Token for voting not found or used!</p>";
        }
    }
} else {
    echo "<h1>Results:</h1>";
    summary("yes", "YES");
    summary("no", "NO");
}
?>
      </div>
    </div>

    <div class="container">
       <hr>

      <footer>
        <p>2016 CAcert, Inc.</p>
      </footer>
    </div> <!-- /container -->
  </body>
</html>
Пример #14
0
    if ($news[1] == 0) {
        echo "Taslak";
    } else {
        echo "Yayında";
    }
    ?>
                                    </td>

                                    <td>
                                        <?php 
    echo $news[2];
    ?>
                                    </td>
                                    <td>
                                        <?php 
    echo summary($news[3], 40);
    echo "...";
    ?>
                                    </td>

                                    <td>
                                       <?php 
    echo $news[4];
    ?>
                                    </td>
                                    <td>
                                        <a class="btn btn-info btn-lg btn-block" href="edit-news.php?id=<?php 
    echo $news[0];
    ?>
">Düzenle</a>
                                        <a class="btn btn-warning btn-lg btn-block" href="delete-news.php?id=<?php