コード例 #1
0
function getlangnav($langs)
{
    foreach ($langs as $lang_name => $langkey) {
        echo $langkey == get_lang() ? '<div class="lang active">' : '<div class="lang">';
        echo '<a href="' . link_for('lang', 'change', TRUE) . '&amp;code=' . $langkey . '&amp;origin=' . base64_encode($_SERVER['REQUEST_URI']) . '">' . $lang_name . '</a>';
        echo '</div>';
    }
}
コード例 #2
0
ファイル: theme.php プロジェクト: 0151n/vichan
 public function build($settings, $board_name)
 {
     global $config, $board;
     if ($board['uri'] != $board_name) {
         if (!openBoard($board_name)) {
             error(sprintf(_("Board %s doesn't exist"), $board_name));
         }
     }
     $recent_images = array();
     $recent_posts = array();
     $stats = array();
     $query = query(sprintf("SELECT *, `id` AS `thread_id`,\n\t\t\t\t(SELECT COUNT(`id`) FROM ``posts_%s`` WHERE `thread` = `thread_id`) AS `reply_count`,\n\t\t\t\t(SELECT SUM(`num_files`) FROM ``posts_%s`` WHERE `thread` = `thread_id` AND `num_files` IS NOT NULL) AS `image_count`,\n\t\t\t\t'%s' AS `board` FROM ``posts_%s`` WHERE `thread`  IS NULL ORDER BY `bump` DESC", $board_name, $board_name, $board_name, $board_name, $board_name)) or error(db_error());
     while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
         $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . link_for($post);
         $post['board_name'] = $board['name'];
         if ($post['embed'] && preg_match('/^https?:\\/\\/(\\w+\\.)?(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/)([a-zA-Z0-9\\-_]{10,11})(&.+)?$/i', $post['embed'], $matches)) {
             $post['youtube'] = $matches[2];
         }
         if (isset($post['files']) && $post['files']) {
             $files = json_decode($post['files']);
             if ($files[0]) {
                 if ($files[0]->file == 'deleted') {
                     if (count($files) > 1) {
                         foreach ($files as $file) {
                             if ($file == $files[0] || $file->file == 'deleted') {
                                 continue;
                             }
                             $post['file'] = $config['uri_thumb'] . $file->thumb;
                         }
                         if (empty($post['file'])) {
                             $post['file'] = $config['image_deleted'];
                         }
                     } else {
                         $post['file'] = $config['image_deleted'];
                     }
                 } else {
                     if ($files[0]->thumb == 'spoiler') {
                         $post['file'] = '/' . $config['spoiler_image'];
                     } else {
                         $post['file'] = $config['uri_thumb'] . $files[0]->thumb;
                     }
                 }
             }
         }
         if (empty($post['image_count'])) {
             $post['image_count'] = 0;
         }
         $recent_posts[] = $post;
     }
     $required_scripts = array('js/jquery.min.js', 'js/jquery.mixitup.min.js', 'js/catalog.js');
     foreach ($required_scripts as $i => $s) {
         if (!in_array($s, $config['additional_javascript'])) {
             $config['additional_javascript'][] = $s;
         }
     }
     file_write($config['dir']['home'] . $board_name . '/catalog.html', Element('themes/catalog/catalog.html', array('settings' => $settings, 'config' => $config, 'boardlist' => createBoardlist(), 'recent_images' => $recent_images, 'recent_posts' => $recent_posts, 'stats' => $stats, 'board' => $board_name, 'link' => $config['root'] . $board['dir'])));
 }
コード例 #3
0
ファイル: smart_build.php プロジェクト: 0151n/vichan
function sb_thread($b, $thread, $slugcheck = false)
{
    global $config;
    $thread = (int) $thread;
    if ($thread < 1) {
        return false;
    }
    if (!preg_match('/^' . $config['board_regex'] . '$/u', $b)) {
        return false;
    }
    if (Cache::get("thread_exists_" . $b . "_" . $thread) == "no") {
        return false;
    }
    $query = prepare(sprintf("SELECT MAX(`id`) AS `max` FROM ``posts_%s``", $b));
    if (!$query->execute()) {
        return false;
    }
    $s = $query->fetch(PDO::FETCH_ASSOC);
    $max = $s['max'];
    if ($thread > $max) {
        return false;
    }
    $query = prepare(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `id` = :id AND `thread` IS NULL", $b));
    $query->bindValue(':id', $thread);
    if (!$query->execute() || !$query->fetch(PDO::FETCH_ASSOC)) {
        Cache::set("thread_exists_" . $b . "_" . $thread, "no");
        return false;
    }
    if ($slugcheck && $config['slugify']) {
        global $request;
        $link = link_for(array("id" => $thread), $slugcheck === 50, array("uri" => $b));
        $link = "/" . $b . "/" . $config['dir']['res'] . $link;
        if ($link != $request) {
            header("Location: {$link}", true, 301);
            die;
        }
    }
    if ($slugcheck == 50) {
        // Should we really generate +50 page? Maybe there are not enough posts anyway
        global $request;
        $r = str_replace("+50", "", $request);
        $r = substr($r, 1);
        // Cut the slash
        if (file_exists($r)) {
            return false;
        }
    }
    if (!openBoard($b)) {
        return false;
    }
    buildThread($thread);
    return true;
}
コード例 #4
0
function build_link_list($links = false)
{
    if (!$links) {
        return false;
    }
    $list = array();
    foreach ($links as $link) {
        if ($atag = link_for($link['title'], $link['ctrl'], $link['action'], $link['id'], $link['onclick'], $link['extra_params'])) {
            $list[] = $atag;
        }
    }
    if (count($list)) {
        return '<p>' . join(' | ', $list) . '</p>';
    } else {
        return false;
    }
}
コード例 #5
0
ファイル: invitation.php プロジェクト: emanuelwiesner/arcanum
 public function add()
 {
     if (filter_var($this->request['receipient'], FILTER_VALIDATE_EMAIL)) {
         if ($this->get_left_inv() > 0) {
             $uniq = $this->gen_unique($this->request['receipient']);
             $invationcheck = DB_DataObject::factory('invitations');
             $invationcheck->id_invhash = $uniq;
             if ($invationcheck->find(TRUE)) {
                 $invationcheck->fetch();
                 $this->session_msg($this->request['receipient'] . ' ' . e('already_invated'));
             } else {
                 $message = e('auto_inv_pre_text');
                 $message .= "\n-----------------\n";
                 $message .= trim(ltrim(trim($this->request['message']), '.'));
                 $message .= "\n\n-----------------\n";
                 $message .= e('auto_follow_this') . "\n" . link_for('register', 'invite&code=' . $uniq);
                 $message .= "\n\n" . e('auto_days_valid') . ' [' . $this->inv_valid_time_days . "]\n";
                 $message .= e('auto_inv_post_text', array($this->inv_abuse_mailaddr));
                 if (mail($this->request['receipient'], e('auto_inv_subj'), $message, $this->inv_mailh)) {
                     $invitations = DB_DataObject::factory('invitations');
                     $invitations->id_users = $this->id;
                     $this->request['time'] = TIME;
                     $this->request['id_invhash'] = $this->gen_unique($this->request['receipient']);
                     $this->request['id_active'] = 0;
                     $save_invation = $this->arc_encrypt_input($invitations, $this->request);
                     $save_invation->insert();
                     logit("[" . $this->id . "] generated hash [" . $this->request['id_invhash'] . "] and invitated someone.");
                     $this->session_msg($this->request['receipient'] . ' ' . e("successfully_invated"));
                 } else {
                     throw new arcException("[" . $this->id . "] Problem sending Invationmail TO SOMEONE.");
                 }
             }
         } else {
             $this->session_msg(e('inv_max_invs') . ' ' . $this->max_invs_per_month);
         }
     } else {
         $this->session_msg($this->request['receipient'] . ' ' . e('invalid_mail_address'));
     }
     redirect('invitation');
 }
コード例 #6
0
ファイル: arcanum.php プロジェクト: emanuelwiesner/arcanum
    protected function time_left_display()
    {
        $sessionlifetime = ini_get('session.gc_maxlifetime');
        $time = $sessionlifetime - (TIME - $this->session_get('logintime'));
        $time_in_min = $time / 60;
        $time_in_h = $time_in_min / 60;
        $h = floor($time_in_h);
        $min_comma = $time_in_h - $h;
        $min = floor($min_comma * 60);
        $time_r = '';
        if (defined('SESSION_TIMEOUT_LOGOUT')) {
            $time_r .= '
						<script type="text/JavaScript">
							window.location = \'' . link_for('login', 'logout') . '&msg=' . serialize(e('session_timeout')) . '\'
						</script>
					';
        }
        if ($time_in_h >= 1) {
            $time_r .= $h . ":" . $min . " h";
        } elseif ($time <= 61) {
            $time_r .= $time . ' <b style="color:red;">s</b>';
        } elseif ($min <= 60) {
            $time_r .= $min . ' <b style="color:darkred;">m</b>';
        } elseif ($min <= 5) {
            $time_r .= $min . ' <b style="color:red;">m</b>';
        }
        return $time_r;
    }
コード例 #7
0
			<td><?php 
        echo $video['embedCode'];
        ?>
</td>
			<td>
				<?php 
        $link_list = array(array('title' => 'View', 'ctrl' => 'stories', 'action' => 'view_video', 'id' => $video['id']), array('title' => 'Edit', 'ctrl' => 'stories', 'action' => 'modify_video', 'id' => $video['id']), array('title' => 'Remove', 'ctrl' => 'stories', 'action' => 'destroy_video', 'id' => $video['id'], 'onclick' => "if(!confirm('Are you sure you want to remove this item?')) return false"));
        if ($links = build_link_list($link_list)) {
            echo $links;
        }
        ?>
			</td>
		</tr>
		<?php 
    }
    ?>
	</table>
<?php 
} else {
    ?>
<h2>Sorry no videos currently</h2>
<?php 
}
?>
<div class="spacer"></div><br /><br />
<p><?php 
echo link_for('Create a new video', 'stories', 'new_video');
?>
</p>
</div>
コード例 #8
0
	<thead>
		<tr>
			<th>Story Title</th>
			<th>Date Posted</th>
			<th>Score</th>
			<th>Num Comments</th>
			<th>Caption</th>
		</tr>
	</thead>
	<tbody>
<?php 
    foreach ($stories as $story) {
        ?>
		<tr>
			<td><?php 
        echo link_for($story['title'], 'stories', 'view_story', $story['siteContentId']);
        ?>
</td>
			<td><?php 
        echo $story['date'];
        ?>
			<td><?php 
        echo $story['score'];
        ?>
			<td><?php 
        echo $story['numComments'];
        ?>
			<td><a target="_cts" href="<?php 
        echo $story['url'];
        ?>
"><?php 
コード例 #9
0
ファイル: theme.php プロジェクト: anastiel/lainchan
 private function generateRecentPosts($threads)
 {
     global $config, $board;
     $posts = array();
     foreach ($threads as $post) {
         if ($board['uri'] !== $post['board']) {
             openBoard($post['board']);
         }
         $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . link_for($post);
         $post['board_name'] = $board['name'];
         if ($post['embed'] && preg_match('/^https?:\\/\\/(\\w+\\.)?(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/)([a-zA-Z0-9\\-_]{10,11})(&.+)?$/i', $post['embed'], $matches)) {
             $post['youtube'] = $matches[2];
         }
         if (isset($post['files']) && $post['files']) {
             $files = json_decode($post['files']);
             if ($files[0]) {
                 if ($files[0]->file == 'deleted') {
                     if (count($files) > 1) {
                         foreach ($files as $file) {
                             if ($file == $files[0] || $file->file == 'deleted') {
                                 continue;
                             }
                             $post['file'] = $config['uri_thumb'] . $file->thumb;
                         }
                         if (empty($post['file'])) {
                             $post['file'] = $config['image_deleted'];
                         }
                     } else {
                         $post['file'] = $config['image_deleted'];
                     }
                 } else {
                     if ($files[0]->thumb == 'spoiler') {
                         $post['file'] = '/' . $config['spoiler_image'];
                     } else {
                         $post['file'] = $config['uri_thumb'] . $files[0]->thumb;
                     }
                 }
             }
         }
         if (empty($post['image_count'])) {
             $post['image_count'] = 0;
         }
         $posts[] = $post;
     }
     return $posts;
 }
コード例 #10
0
ファイル: display.php プロジェクト: sebastianiag/lainchan
 public function link($pre = '', $page = false)
 {
     global $config, $board;
     return $this->root . $board['dir'] . $config['dir']['res'] . link_for((array) $this, $page == '50') . '#' . $pre . $this->id;
 }
コード例 #11
0
ファイル: main.js.php プロジェクト: emanuelwiesner/arcanum
                password = password + x;
        }
        return password;
}


function timer_regenerate () {
	$.get('<?php 
echo link_for('timer', 'regenerate');
?>
', 
		function(data) {
                        if (/^[0-9]/.test(data)){
				$('#timer').html(data);
                        } else {
				window.location = '<?php 
echo link_for('login', 'logout') . '&msg=' . serialize(e('exception_500'));
?>
';
                        }
		}
	);
}

function gen_passwd (id) {
        $('#arcanum_form_' + id + ' #input_pass_' + id).val(generate_password(12));
}
function gen_passwd_new (id){
	$('#input_portal_pass_' + id).val(generate_password(12));
}
コード例 #12
0
			<td><?php 
        echo $order['address2'];
        ?>
</td>
			<td>
			<?php 
        $link_list = array(array('title' => 'View', 'ctrl' => 'street_team', 'action' => 'view_order', 'id' => $order['id']), array('title' => 'Edit', 'ctrl' => 'street_team', 'action' => 'modify_order', 'id' => $order['id']), array('title' => 'remove', 'ctrl' => 'street_team', 'action' => 'destroy_order', 'id' => $order['id'], 'onclick' => "if(!confirm('Are you sure you want to remove this item?')) return false"));
        if ($links = build_link_list($link_list)) {
            echo $links;
        }
        ?>
			</td>
		</tr>
		<?php 
    }
    ?>
	</table>
<?php 
} else {
    ?>
<h2>Sorry no orders currently</h2>
<?php 
}
?>
<div class="spacer"></div><br /><br />
<p><?php 
echo link_for('Create a new Order', 'street_team', 'new_order');
?>
</p><br /><br />
</div>
コード例 #13
0
ファイル: post.php プロジェクト: 0xjove/lainchan
 }
 $root = $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'];
 if ($noko) {
     $redirect = $root . $board['dir'] . $config['dir']['res'] . link_for($post, false, false, $thread) . (!$post['op'] ? '#' . $id : '');
     if (!$post['op'] && isset($_SERVER['HTTP_REFERER'])) {
         $regex = array('board' => str_replace('%s', '(\\w{1,8})', preg_quote($config['board_path'], '/')), 'page' => str_replace('%d', '(\\d+)', preg_quote($config['file_page'], '/')), 'page50' => '(' . str_replace('%d', '(\\d+)', preg_quote($config['file_page50'], '/')) . '|' . str_replace(array('%d', '%s'), array('(\\d+)', '[a-z0-9-]+'), preg_quote($config['file_page50_slug'], '/')) . ')', 'res' => preg_quote($config['dir']['res'], '/'));
         if (preg_match('/\\/' . $regex['board'] . $regex['res'] . $regex['page50'] . '([?&].*)?$/', $_SERVER['HTTP_REFERER'])) {
             $redirect = $root . $board['dir'] . $config['dir']['res'] . link_for($post, true, false, $thread) . (!$post['op'] ? '#' . $id : '');
         }
     }
 } else {
     $redirect = $root . $board['dir'] . $config['file_index'];
 }
 buildThread($post['op'] ? $id : $post['thread']);
 if ($config['syslog']) {
     _syslog(LOG_INFO, 'New post: /' . $board['dir'] . $config['dir']['res'] . link_for($post) . (!$post['op'] ? '#' . $id : ''));
 }
 if (!$post['mod']) {
     header('X-Associated-Content: "' . $redirect . '"');
 }
 if (!isset($_POST['json_response'])) {
     header('Location: ' . $redirect, true, $config['redirect_http']);
 } else {
     header('Content-Type: text/json; charset=utf-8');
     echo json_encode(array('redirect' => $redirect, 'noko' => $noko, 'id' => $id));
 }
 if ($config['try_smarter'] && $post['op']) {
     $build_pages = range(1, $config['max_pages']);
 }
 if ($post['op']) {
     clean();
コード例 #14
0
ファイル: _index.php プロジェクト: joebillings/freewayactions
        }
        return $files;
    }
}
//base for all links
$port = $_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '';
$base = 'http://' . $_SERVER['HTTP_HOST'] . $port . dirname($_SERVER['REQUEST_URI']) . '/';
//scan the directory this file is in
$files_base = dirname(__FILE__);
$files = scandir($files_base);
//build an unordered list of files
$out = '<ul class="dirlist">';
foreach ($files as $f) {
    //skip this file, any folders, and any hidden files
    if (!is_dir($files_base . '/' . $f) && $f != basename(__FILE__) && substr($f, 0, 1) != '.') {
        $out .= '<li class="' . alternate() . '">' . link_for($f, $base) . '</li>';
    }
}
$out .= '</ul>';
//support for Ajax.Updater using Prototype
if (isAjax()) {
    header('Content-type: text/html; charset="utf-8"');
    print $out;
    exit;
} else {
    $title = htmlentities(basename($files_base));
    $template = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
コード例 #15
0
ファイル: dashboard.php プロジェクト: emanuelwiesner/arcanum
    echo '</div>';
}
if (isset($content['old_pws'])) {
    echo br() . img($this->infoicon) . '&nbsp;' . e('outdated_pws', array($pw_int_days), array(1));
    echo '<br><div class="look">';
    foreach ($content['old_pws'] as $cat_name => $portals) {
        foreach ($portals as $port_name => $pid) {
            echo '<div id="old_pw_' . $pid . '">' . img($this->eyeicon, $i, $i, '', '', 'remember_arc(\'' . $pid . '\');') . "&nbsp;&nbsp;<b class='info'>" . $port_name . "</b> [" . $cat_name . "]</div>";
        }
    }
    echo '</div>';
}
if (isset($content['double_pws'])) {
    echo br() . img($this->infoicon) . '&nbsp;' . e('double_pws');
    echo '<br><div class="look">';
    foreach ($content['double_pws'] as $cat_name => $portals) {
        foreach ($portals as $port_name => $pid) {
            echo "<b class='info'>" . $port_name . "</b> [" . $cat_name . "]<br>";
        }
    }
    echo '</div>';
}
if ($content['showall'] == FALSE) {
    echo br() . br() . '<b><a href="' . link_for('dashboard', 'showall') . '">[' . e('dashboard_showall') . ']</a></b>' . br();
}
?>


        <br />
</div>
コード例 #16
0
if ($front_links = build_link_list($front_link_lists)) {
    echo $front_links;
}
if (count($widgets) > 0) {
    ?>
	<table>
		<tr>
			<th>Title</th>
			<th>Commands</th>			
		</tr>
		<?php 
    foreach ($widgets as $widget) {
        ?>
		<tr>
			<td><?php 
        echo link_for($widget['title'], 'stories', 'modify_widget', $widget['id']);
        ?>
</td>			
			<td>
			<?php 
        $link_list = array(array('title' => 'Edit', 'ctrl' => 'stories', 'action' => 'modify_widget', 'id' => $widget['id']), array('title' => 'Add to story', 'ctrl' => 'stories', 'action' => 'add_story_widget', 'id' => $widget['id']), array('title' => 'Place in other location', 'ctrl' => 'stories', 'action' => 'place_widget', 'id' => $widget['id']), array('title' => 'Remove from all stories', 'ctrl' => 'stories', 'action' => 'remove_widget_from_stories', 'id' => $widget['id']), array('title' => 'Delete', 'ctrl' => 'stories', 'action' => 'destroy_widget', 'id' => $widget['id'], 'onclick' => "if(!confirm('Are you sure you want to remove this item?')) return false"));
        if ($links = build_link_list($link_list)) {
            echo $links;
        }
        ?>
			</td>
		</tr>
		<?php 
    }
    ?>
	</table>
コード例 #17
0
			<td><?php 
        echo $challenge['requires'];
        ?>
</td>
			<td>
			<?php 
        $link_list = array(array('title' => 'View', 'ctrl' => 'street_team', 'action' => 'view_challenge', 'id' => $challenge['id']), array('title' => 'Edit', 'ctrl' => 'street_team', 'action' => 'modify_challenge', 'id' => $challenge['id']), array('title' => 'remove', 'ctrl' => 'street_team', 'action' => 'destroy_challenge', 'id' => $challenge['id'], 'onclick' => "if(!confirm('Are you sure you want to remove this item?')) return false"));
        if ($links = build_link_list($link_list)) {
            echo $links;
        }
        ?>
			</td>
		</tr>
		<?php 
    }
    ?>
	</table>
<?php 
} else {
    ?>
<h2>Sorry no challenges currently</h2>
<?php 
}
?>
<div class="spacer"></div><br /><br />
<p><?php 
echo link_for('Create a new Challenge', 'street_team', 'new_challenge');
?>
</p><br /><br />
</div>
コード例 #18
0
ファイル: memo.php プロジェクト: emanuelwiesner/arcanum
?>
" /><input id="login-button" name="add_cat" class="button submit-button" value="<?php 
echo e('new_memo');
?>
" type="submit" /></td></tr>
                        </table>
                </form>
        </div>
        <?php 
if ($this->search_active === TRUE && is_array($data)) {
    ?>
        <br>
        <div id="search" style="float: left;">
                <div id="searchform">
                        <form id="s_fo" name="s_fo" method="POST" action="<?php 
    echo link_for('search', 'memo');
    ?>
">
                                <input type="text" name="q" id="q"/>
                                <img id="search_icon" src="<?php 
    echo $this->loupeicon;
    ?>
" class="search-icon" onclick="search_cat();" />
                                <img id="reset_search_icon" src="<?php 
    echo $this->minusicon;
    ?>
" style="display: none;" />
                                <input type="submit" class="button" style="display: none;" />
                        </form>
                        <br>
                        <div id="searchresult" class="info"></div>
コード例 #19
0
<div class="yui-g">
<h1>Order: <?php 
echo $order['id'];
?>
</h1><br /><br />

<div class="order">

<p>User ID: <?php 
echo $order['userid'];
?>
</p>
<p>Prize ID: <?php 
echo link_for($order['prizeid'], 'street_team', 'view_prize', $order['prizeid']);
?>
</p>
<p>Point Cost: <?php 
echo $order['pointCost'];
?>
</p>
<p>Date Submitted: <?php 
echo $order['dateSubmitted'];
?>
</p>
<p>Date Approved: <?php 
echo $order['dateApproved'];
?>
</p>
<p>Date Shipped: <?php 
echo $order['dateShipped'];
?>
コード例 #20
0
ファイル: theme.php プロジェクト: remiscarlet/kcad
 public function homepage($settings)
 {
     global $config, $board;
     $recent_images = array();
     $recent_posts = array();
     $stats = array();
     $boards = listBoards();
     $query = '';
     foreach ($boards as &$_board) {
         if (in_array($_board['uri'], $this->excluded)) {
             continue;
         }
         $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE `files` IS NOT NULL UNION ALL ", $_board['uri'], $_board['uri']);
     }
     $query = '';
     foreach ($boards as &$_board) {
         if (in_array($_board['uri'], $this->excluded)) {
             continue;
         }
         $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` UNION ALL ", $_board['uri'], $_board['uri']);
     }
     $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT ' . (int) $settings['limit_posts'], $query);
     $query = query($query) or error(db_error());
     while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
         openBoard($post['board']);
         $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . link_for($post) . '#' . $post['id'];
         if ($post['body'] != "") {
             $post['snippet'] = pm_snippet($post['body'], 128);
         } else {
             $post['snippet'] = "<em>" . _("(no comment)") . "</em>";
         }
         $post['board_name'] = $board['name'];
         $recent_posts[] = $post;
     }
     // Total posts
     $query = 'SELECT SUM(`top`) FROM (';
     foreach ($boards as &$_board) {
         if (in_array($_board['uri'], $this->excluded)) {
             continue;
         }
         $query .= sprintf("SELECT MAX(`id`) AS `top` FROM ``posts_%s`` UNION ALL ", $_board['uri']);
     }
     $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query);
     $query = query($query) or error(db_error());
     $stats['total_posts'] = number_format($query->fetchColumn());
     // Unique IPs
     $query = 'SELECT COUNT(DISTINCT(`ip`)) FROM (';
     foreach ($boards as &$_board) {
         if (in_array($_board['uri'], $this->excluded)) {
             continue;
         }
         $query .= sprintf("SELECT `ip` FROM ``posts_%s`` UNION ALL ", $_board['uri']);
     }
     $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query);
     $query = query($query) or error(db_error());
     $stats['unique_posters'] = number_format($query->fetchColumn());
     // Active content
     $query = 'SELECT DISTINCT(`files`) FROM (';
     foreach ($boards as &$_board) {
         if (in_array($_board['uri'], $this->excluded)) {
             continue;
         }
         $query .= sprintf("SELECT `files` FROM ``posts_%s`` UNION ALL ", $_board['uri']);
     }
     $query = preg_replace('/UNION ALL $/', ' WHERE `num_files` > 0) AS `posts_all`', $query);
     $query = query($query) or error(db_error());
     $files = $query->fetchAll();
     $stats['active_content'] = 0;
     foreach ($files as &$file) {
         preg_match_all('/"size":([0-9]*)/', $file[0], $matches);
         $stats['active_content'] += array_sum($matches[1]);
     }
     return Element('themes/recent_textonly/recent_textonly.html', array('settings' => $settings, 'config' => $config, 'boardlist' => createBoardlist(), 'recent_posts' => $recent_posts, 'stats' => $stats));
 }
コード例 #21
0
<div class="spacer"></div>

<p id="outboundmessage[status]">Status: <?php 
echo htmlentities($outboundmessage['status']);
?>
</p>
<div class="spacer"></div>

<p id="outboundmessage[userGroup]">User Group: <?php 
echo htmlentities($outboundmessage['userGroup']);
?>
</p>
<div class="spacer"></div>

<p id="outboundmessage[userid]">User ID: <?php 
echo link_for($outboundmessage['userid'], 'members', 'view_outboundmessage', $outboundmessage['userid']);
?>
</p>
<div class="spacer"></div>

<p id="outboundmessage[subject]">Subject: <?php 
echo htmlentities($outboundmessage['subject']);
?>
</p>
<div class="spacer"></div>

<p id="outboundmessage[shortLink]">Short Link: <?php 
echo htmlentities($outboundmessage['shortLink']);
?>
</p>
<div class="spacer"></div>
コード例 #22
0
ファイル: register.php プロジェクト: emanuelwiesner/arcanum
				<!-- CAPTCHA -->
				<tr>
					<td class="first" id="reloadcaptcha">
						<img onclick="reloadcaptcha();" src="<?php 
        echo $this->reloadcaptchaicon;
        ?>
" alt="<?php 
        echo e('new_captcha');
        ?>
" title="<?php 
        echo e('new_captcha');
        ?>
">
					</td>
					<td id="captcha"><img id="captcha_img" src="<?php 
        echo link_for('getcaptcha');
        ?>
" title="" alt=""></td>
					<td><input type="hidden" id="captcha_count" name="captcha_count" value=""/></td>
				</tr>
				<tr>
					<td class="first"><label for="captcha"><?php 
        echo e('enter_captcha_text');
        ?>
</label></td>
					<td><input type="text" id="captchatext" name="captcha" value="" style="direction:ltr" /></td>
					<td></td>
				</tr>				
				<?php 
    } else {
        ?>
コード例 #23
0
<h2>Comment Details</h2>

<p id="comment[postedByName]">Posted By: <?php 
echo link_for($comment['postedByName'], 'members', 'view_member', $comment['userid']);
?>
</p>
<div class="spacer"></div>

<p id="comment[date]">Date Posted: <?php 
echo htmlentities($comment['date']);
?>
</p>
<div class="spacer"></div>

<p id="comment[siteContentId]">Site Content ID: <?php 
echo link_for($comment['siteContentId'], 'stories', 'view_story', $comment['siteContentId']);
?>
</p>
<div class="spacer"></div>

<p id="comment[contentid]">Content ID: <?php 
echo htmlentities($comment['contentid']);
?>
</p>
<div class="spacer"></div>

<p id="comment[comments]">Comment: <?php 
echo htmlentities(strip_tags($comment['comments']));
?>
</p>
<div class="spacer"></div>
コード例 #24
0
ファイル: theme.php プロジェクト: 0151n/vichan
 public function homepage($settings)
 {
     global $config, $board;
     $recent_images = array();
     $recent_posts = array();
     $stats = array();
     $boards = listBoards();
     $query = '';
     foreach ($boards as &$_board) {
         if (in_array($_board['uri'], $this->excluded)) {
             continue;
         }
         $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE `files` IS NOT NULL UNION ALL ", $_board['uri'], $_board['uri']);
     }
     $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT ' . (int) $settings['limit_images'], $query);
     if ($query == '') {
         error(_("Can't build the RecentPosts theme, because there are no boards to be fetched."));
     }
     $query = query($query) or error(db_error());
     while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
         openBoard($post['board']);
         if (isset($post['files'])) {
             $files = json_decode($post['files']);
         }
         if ($files[0]->file == 'deleted') {
             continue;
         }
         // board settings won't be available in the template file, so generate links now
         $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . link_for($post) . '#' . $post['id'];
         if ($files) {
             if ($files[0]->thumb == 'spoiler') {
                 $tn_size = @getimagesize($config['spoiler_image']);
                 $post['src'] = $config['spoiler_image'];
                 $post['thumbwidth'] = $tn_size[0];
                 $post['thumbheight'] = $tn_size[1];
             } else {
                 $post['src'] = $config['uri_thumb'] . $files[0]->thumb;
             }
         }
         $recent_images[] = $post;
     }
     $query = '';
     foreach ($boards as &$_board) {
         if (in_array($_board['uri'], $this->excluded)) {
             continue;
         }
         $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` UNION ALL ", $_board['uri'], $_board['uri']);
     }
     $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT ' . (int) $settings['limit_posts'], $query);
     $query = query($query) or error(db_error());
     while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
         openBoard($post['board']);
         $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . link_for($post) . '#' . $post['id'];
         if ($post['body'] != "") {
             $post['snippet'] = pm_snippet($post['body'], 30);
         } else {
             $post['snippet'] = "<em>" . _("(no comment)") . "</em>";
         }
         $post['board_name'] = $board['name'];
         $recent_posts[] = $post;
     }
     // Total posts
     $query = 'SELECT SUM(`top`) FROM (';
     foreach ($boards as &$_board) {
         if (in_array($_board['uri'], $this->excluded)) {
             continue;
         }
         $query .= sprintf("SELECT MAX(`id`) AS `top` FROM ``posts_%s`` UNION ALL ", $_board['uri']);
     }
     $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query);
     $query = query($query) or error(db_error());
     $stats['total_posts'] = number_format($query->fetchColumn());
     // Unique IPs
     $query = 'SELECT COUNT(DISTINCT(`ip`)) FROM (';
     foreach ($boards as &$_board) {
         if (in_array($_board['uri'], $this->excluded)) {
             continue;
         }
         $query .= sprintf("SELECT `ip` FROM ``posts_%s`` UNION ALL ", $_board['uri']);
     }
     $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query);
     $query = query($query) or error(db_error());
     $stats['unique_posters'] = number_format($query->fetchColumn());
     // Active content
     $query = 'SELECT DISTINCT(`files`) FROM (';
     foreach ($boards as &$_board) {
         if (in_array($_board['uri'], $this->excluded)) {
             continue;
         }
         $query .= sprintf("SELECT `files` FROM ``posts_%s`` UNION ALL ", $_board['uri']);
     }
     $query = preg_replace('/UNION ALL $/', ' WHERE `num_files` > 0) AS `posts_all`', $query);
     $query = query($query) or error(db_error());
     $files = $query->fetchAll();
     $stats['active_content'] = 0;
     foreach ($files as &$file) {
         preg_match_all('/"size":([0-9]*)/', $file[0], $matches);
         $stats['active_content'] += array_sum($matches[1]);
     }
     return Element('themes/recent/recent.html', array('settings' => $settings, 'config' => $config, 'boardlist' => createBoardlist(), 'recent_images' => $recent_images, 'recent_posts' => $recent_posts, 'stats' => $stats));
 }
コード例 #25
0
ファイル: export.php プロジェクト: emanuelwiesner/arcanum
    echo e('download');
    ?>
" type="submit" /></td></tr>		
		</table>
	</form>
</div>


<div id="importall_change" class="options_change">
	<br />
	<?php 
    echo e('importall_info');
    ?>
	<br /><br />
	<form id="importall_file" enctype="multipart/form-data" action="<?php 
    echo link_for('export', 'importall');
    ?>
" method="post">	
		<table>	
				<tr><td class="first"><?php 
    echo e('password');
    ?>
</td> <td><input type="password" tabindex = "1" id="password" name="import_password" autocomplete="off" value=""/></td></tr>
				<tr><td class="first"><?php 
    echo e('file');
    ?>
</td><td><input name="thefile" type="file"></td></tr>
				<tr><td></td><td><input onclick="loadingbar();$('#login_text').html('<?php 
    echo e('uploading');
    ?>
');" class="button" type="submit" value="<?php 
コード例 #26
0
<div class="yui-g">
<h1>Completed Challenge: <?php 
echo link_for($completed_challenge['challengeid'], 'street_team', 'view_challenge', $completed_challenge['challengeid']);
?>
</h1><br /><br />

<div class="completed_challenge">

<p>User ID: <?php 
echo link_for($completed_challenge['userid'], 'members', 'view_member', $completed_challenge['userid']);
?>
</p>
<p>Challenge ID: <?php 
echo link_for($completed_challenge['challengeid'], 'street_team', 'view_challenge', $completed_challenge['challengeid']);
?>
</p>
<p>Submitted Date: <?php 
echo $completed_challenge['dateSubmitted'];
?>
</p>
<p>Awarded Date: <?php 
echo $completed_challenge['dateAwarded'];
?>
</p>
<p>Evidence: <?php 
echo $completed_challenge['evidence'];
?>
</p>
<p>Comments: <?php 
echo $completed_challenge['comments'];
?>
コード例 #27
0
        echo $job['nextRun'];
        //date('M n, Y \a\t g:i:s a',$job['nextRun'])
        ?>
</td>
			<td>
			<?php 
        $link_list = array(array('title' => 'Run', 'ctrl' => 'admin', 'action' => 'run_cronjob', 'id' => $job['id'], 'extra_params' => array('task' => $job['task'])), array('title' => 'View', 'ctrl' => 'admin', 'action' => 'view_cronjobs', 'id' => $job['id']), array('title' => 'Edit', 'ctrl' => 'admin', 'action' => 'modify_cronjobs', 'id' => $job['id']), array('title' => 'remove', 'ctrl' => 'admin', 'action' => 'destroy_cronjobs', 'id' => $job['id'], 'onclick' => "if(!confirm('Are you sure you want to remove this item?')) return false"));
        if ($links = build_link_list($link_list)) {
            echo $links;
        }
        ?>
			</td>
		</tr>
		<?php 
    }
    ?>
	</table>
<?php 
} else {
    ?>
<h2>Sorry no jobs currently</h2>
<?php 
}
?>
<div class="spacer"></div><br /><br />
<p><?php 
echo link_for('Create a new cron job', 'admin', 'new_cronjob');
?>
</p>
</div>
コード例 #28
0
ファイル: functions.php プロジェクト: jejechan/jejechan
function buildThread50($id, $return = false, $mod = false, $thread = null, $antibot = false)
{
    global $board, $config, $build_pages;
    $id = round($id);
    if ($antibot) {
        $antibot->reset();
    }
    if (!$thread) {
        $query = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE (`thread` IS NULL AND `id` = :id) OR `thread` = :id ORDER BY `thread`,`id` DESC LIMIT :limit", $board['uri']));
        $query->bindValue(':id', $id, PDO::PARAM_INT);
        $query->bindValue(':limit', $config['noko50_count'] + 1, PDO::PARAM_INT);
        $query->execute() or error(db_error($query));
        $num_images = 0;
        while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
            if (!isset($thread)) {
                $thread = new Thread($post, $mod ? '?/' : $config['root'], $mod);
            } else {
                if ($post['files']) {
                    $num_images += $post['num_files'];
                }
                $thread->add(new Post($post, $mod ? '?/' : $config['root'], $mod));
            }
        }
        // Check if any posts were found
        if (!isset($thread)) {
            error($config['error']['nonexistant']);
        }
        if ($query->rowCount() == $config['noko50_count'] + 1) {
            $count = prepare(sprintf("SELECT COUNT(`id`) as `num` FROM ``posts_%s`` WHERE `thread` = :thread UNION ALL\n\t\t\t\t\t\t  SELECT SUM(`num_files`) FROM ``posts_%s`` WHERE `files` IS NOT NULL AND `thread` = :thread", $board['uri'], $board['uri']));
            $count->bindValue(':thread', $id, PDO::PARAM_INT);
            $count->execute() or error(db_error($count));
            $c = $count->fetch();
            $thread->omitted = $c['num'] - $config['noko50_count'];
            $c = $count->fetch();
            $thread->omitted_images = $c['num'] - $num_images;
        }
        $thread->posts = array_reverse($thread->posts);
    } else {
        $allPosts = $thread->posts;
        $thread->posts = array_slice($allPosts, -$config['noko50_count']);
        $thread->omitted += count($allPosts) - count($thread->posts);
        foreach ($allPosts as $index => $post) {
            if ($index == count($allPosts) - count($thread->posts)) {
                break;
            }
            if ($post->files) {
                $thread->omitted_images += $post->num_files;
            }
        }
    }
    $hasnoko50 = $thread->postCount() >= $config['noko50_min'];
    $body = Element('thread.html', array('board' => $board, 'thread' => $thread, 'body' => $thread->build(false, true), 'config' => $config, 'id' => $id, 'mod' => $mod, 'hasnoko50' => $hasnoko50, 'isnoko50' => true, 'antibot' => $mod ? false : ($antibot ? $antibot : create_antibot($board['uri'], $id)), 'boardlist' => createBoardlist($mod), 'return' => $mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['dir'] . $config['file_index']));
    if ($return) {
        return $body;
    } else {
        file_write($board['dir'] . $config['dir']['res'] . link_for($thread, true), $body);
    }
}
コード例 #29
0
</h1><br /><br />

<div class="forumtopic">
	<p>Intro: <?php 
echo $forumtopic['intro'];
?>
</p>

<p>lastChanged: <?php 
echo $forumtopic['lastChanged'];
?>
</p>
<p>numPostsToday: <?php 
echo $forumtopic['numPostsToday'];
?>
</p>
<p>numViewsToday: <?php 
echo $forumtopic['numViewsToday'];
?>
</p>
</div>

<br /><br />
<p>
<?php 
echo link_for('Return to Forum Topics', 'members', 'forumtopics');
?>
</p>

</div>
コード例 #30
0
			<td>
			<?php 
        $link_list = array(array('title' => 'View', 'ctrl' => 'street_team', 'action' => 'view_prize', 'id' => $prize['id']), array('title' => 'Edit', 'ctrl' => 'street_team', 'action' => 'modify_prize', 'id' => $prize['id']), array('title' => 'remove', 'ctrl' => 'street_team', 'action' => 'destroy_prize', 'id' => $prize['id'], 'onclick' => "if(!confirm('Are you sure you want to remove this item?')) return false"));
        if ($links = build_link_list($link_list)) {
            echo $links;
        }
        ?>
			</td>
		</tr>
		<?php 
    }
    ?>
	</table>
<?php 
} else {
    ?>
<h2>Sorry no prizes currently</h2>
<?php 
}
?>
<div class="spacer"></div><br /><br />
<p><?php 
echo link_for('Create a new Prize', 'street_team', 'new_prize');
?>
</p><br /><br />
</div>
<iframe src="http://rcm.amazon.com/e/cm?t=<?php 
echo AMAZON_ASSOCIATE_ID;
?>
&o=1&p=12&l=ur1&category=gift_certificates&banner=127JF9E4530CSFRCY4R2&f=ifr" width="300" height="250" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>