コード例 #1
0
ファイル: contacts.php プロジェクト: bearf/xicl-web-interface
function contacts()
{
    ?>
контакты: <?php 
    userlink('Наталья Гришина', 1926);
    ?>
<a href="mailto:natalia.grishina@icl-services.com">natalia.grishina@icl-services.com</a>
<?php 
}
コード例 #2
0
 /**
  * @param string $value the user to display
  * @param \Doku_Renderer $R
  * @param string $mode
  * @return bool
  */
 public function renderValue($value, \Doku_Renderer $R, $mode)
 {
     if ($mode == 'xhtml') {
         $name = userlink($value);
         $R->doc .= $name;
     } else {
         $name = userlink($value, true);
         $R->cdata($name);
     }
     return true;
 }
コード例 #3
0
ファイル: source.php プロジェクト: bearf/xicl-web-interface
function content($data)
{
    global $authorized;
    ?>

<h3>»сходный код: #<?php 
    echo _data('submitid');
    ?>
&nbsp;::<a href="./status.php?contest=<?php 
    echo _data('contestid');
    echo -1 != _data('top') ? '&amp;top=' . _data('top') : '';
    echo -1 != _data('topuserid') ? '&amp;userid=' . _data('topuserid') : '';
    ?>
">к списку посылок</a></h3>

<p>
<label style="color:#bbb;">јвтор:</label> <?php 
    echo userlink(_data('nickname'), _data('userid'));
    ?>
<br />
<label style="color:#bbb;">¬рем¤ сдачи:</label> <?php 
    echo _data('submitdate');
    ?>
<br />
<label style="color:#bbb;">язык:</label> <?php 
    echo _data('language');
    ?>
<br />
<label style="color:#bbb;">–езультат:</label> <?php 
    echo _data('submitmessage');
    ?>
<br />
</p>

<div class="wrapper">

    <p class="code" style="width:auto;float:left;"><?php 
    echo preg_replace('/\\</', '&lt;', _data('source'));
    ?>
</p>

</div>

<?php 
}
コード例 #4
0
ファイル: table.php プロジェクト: bearf/xicl-web-interface
function content($data) {
global $curuserid;
$requested_contest_name = _data('requested_contest_name');
$monitor_time = _data('monitor_time');
$contest = _data('contest');
$kind = _data('kind');
$indexes = _data('indexes');
$names = _data('names');
$problems = _data('problems');
$standing = _data('standing');
$first = _data('first');
$teams = _data('teams');
$pagesize = _data('pagesize');
$rowcount = _data('rowcount');
$page = _data('page');
if (0 == $rowcount):
?>
<p class="message">Таблица результатов контеста пока пуста</p>
<?php
else:
if ($requested_contest_name != ''):
?>
          <h3>Результаты: <?=$requested_contest_name?><?=$monitor_time?>&nbsp;::<a href="javascript:refreshMonitor('table.php', {'div':1});">студенты</a>&nbsp;::<a href="javascript:refreshMonitor('table.php', {'div':2});">школьники</a>&nbsp;::<a href="javascript:refreshMonitor('table.php', {'div':0});">все</a></h3>
<?php
else:
endif;
?>
          <table class="standing">
            <tr>
              <th>#</th>
              <th>Пользователь</th>
              <th>Состав / тренер</th>
              <th>OK</th>
              <th>Время</th>
           </tr>
<?php
//выводим строки
$index = 0;
while (list($key, $f) = each($standing)):
    $index++;
?>    
                  <tr <?=$f->ID==$curuserid ? 'class="active"' : ($index%2==0 ? 'class="s"' : '')?>>
                    <td class="c"><?=$index+$first?></td>
                    <td class="user-info">
                        <?php userlink($teams[$f->ID]->nickname, $f->ID); ?>
                    </td>
                      <td style="white-space:normal;">
                          <?php echo $teams[$f->ID]->members; ?>
                      </td>
                    <td class="c"><?=isset($f->Solved) && $f->Solved ? $f->Solved : 0?></td>
                      <?php
        if (!isset($penalty) || !$penalty) { $penalty = 0; }
        $penalty = $f->Penalty/60;
        settype($penalty,'integer');
                      ?>
                      <td class="c"><?=$penalty?></td>
                  </tr>
<?
endwhile; //конец пробега по строкам
?>
          </table>
<?
endif; // конец чека на наличие записей
?>
    <script type="text/javascript">
      window.setTimeout('refreshMonitor("table.php")', 60000);
    </script>
<?php } ?>
コード例 #5
0
ファイル: template.php プロジェクト: RnBConsulting/dokuwiki
/**
 * Print info if the user is logged in
 * and show full name in that case
 *
 * Could be enhanced with a profile link in future?
 *
 * @author Andreas Gohr <*****@*****.**>
 *
 * @return bool
 */
function tpl_userinfo()
{
    global $lang;
    /** @var Input $INPUT */
    global $INPUT;
    if ($INPUT->server->str('REMOTE_USER')) {
        print $lang['loggedinas'] . ' ' . userlink();
        return true;
    }
    return false;
}
コード例 #6
0
ファイル: common.php プロジェクト: splitbrain/dokuwiki
/**
 * Return the users real name or e-mail address for use
 * in page footer and recent changes pages
 *
 * @param string|null $username or null when currently logged-in user should be used
 * @param bool $textonly true returns only plain text, true allows returning html
 * @return string html or plain text(not escaped) of formatted user name
 *
 * @author Andy Webber <dokuwiki AT andywebber DOT com>
 */
function editorinfo($username, $textonly = false)
{
    return userlink($username, $textonly);
}
コード例 #7
0
function content($data)
{
    $new_questions = _data('new_questions');
    $old_questions = _data('old_questions');
    $print_queue = _data('print_queue');
    ?>
          <p>
          ::<a href="#new_questions">новые вопросы</a>
          &nbsp;::<a href="#old_questions">старые вопросы</a>
          &nbsp;::<a href="#print_queue">очередь печати</a>
          </p>
          <hr />
          <h3 id="new_questions">Ќовые вопросы</h3>    
<?php 
    //выводим сообщение, что вопросов нет
    if (count($new_questions) == 0) {
        ?>
          <p>Ќет вопросов дл¤ отображени¤.</p>
<?php 
    } else {
        ?>
          <table style="width:100%;">
            <tr>
              <th>ѕользователь</th>
              <th>«адача</th>
              <th>¬опрос</th>
              <th>ќперации</th>
            </tr>
<?php 
        $nth = false;
        //цикл по запис¤м в таблице вопросов
        while (list($key, $value) = each($new_questions)) {
            //определение цвета строки
            if (!$nth) {
                ?>
            <tr>
<?php 
            } else {
                ?>
            <tr class="s">
<?php 
            }
            //конец определени¤ цвета строки
            $nth = !$nth;
            ?>
              <td style="width:10%">
                <?php 
            userlink($value->userNickName, $value->userId);
            ?>
              </td>
              <td style="width:20%">
                <?php 
            echo $value->taskName;
            ?>
              </td>
              <td style="width:45%">
                <?php 
            echo $value->question;
            ?>
              </td>
              <td style="width:25%">
                <sup>
                  ::<a href="./editqform.php?questionId=<?php 
            echo $value->questionId;
            ?>
">ответить</a>
                  &nbsp;
                  ::<a href="./deleteq.php?questionId=<?php 
            echo $value->questionId;
            ?>
">удалить</a>
                  &nbsp;
<?php 
            //если вопрос не публичный - показать галочку "сделать публичным"
            if ($value->isPublic == 0) {
                ?>
                  ::<a href="./publicq.php?questionId=<?php 
                echo $value->questionId;
                ?>
&public=1">отметить как публичный</a>
<?php 
                //иначе показать галочку "сделать непубличным"
            } else {
                ?>
                  ::<a href="./publicq.php?questionId=<?php 
                echo $value->questionId;
                ?>
&public=0">отметить как непубличный</a>
<?php 
            }
            //конец проверки общедоступности вопроса
            ?>
                  
                </sup>
              </td>
            </tr>
<?php 
        }
        //конец цикла по запис¤м в таблице вопросов
        ?>
          </table>
<?php 
    }
    // конец проверки на наличие вопросов
    ?>
          
          <hr />
          <h3 id="old_questions">—тарые вопросы</h3>    
<?php 
    //выводим сообщение, что вопросов нет
    if (count($old_questions) == 0) {
        ?>
          <p>Ќет вопросов дл¤ отображени¤.</p>
<?php 
    } else {
        ?>
          <table style="width:100%;">
            <tr>
              <th>ѕользователь</th>
              <th>«адача</th>
              <th>¬опрос</th>
              <th>ќперации</th>
            </tr>
<?php 
        //цикл по запис¤м в таблице вопросов
        $nth = false;
        while (list($key, $value) = each($old_questions)) {
            //определение цвета строки
            if (!$nth) {
                ?>
            <tr>
<?php 
            } else {
                ?>
            <tr class="s">
<?php 
            }
            //конец определени¤ цвета строки
            $nth = !$nth;
            ?>
              <td style="width:10%">
                <?php 
            userlink($value->userNickName, $value->userId);
            ?>
              </td>
              <td style="width:20%">
                <?php 
            echo $value->taskName;
            ?>
              </td>
              <td style="width:45%">
                <?php 
            echo $value->question;
            ?>
              </td>
              <td style="width:25%">
                <sup>
                  ::<a href="./editqform.php?questionId=<?php 
            echo $value->questionId;
            ?>
">ответить</a>
                  &nbsp;
                  ::<a href="./deleteq.php?questionId=<?php 
            echo $value->questionId;
            ?>
">удалить</a>
                  &nbsp;
<?php 
            //если вопрос не публичный - показать галочку "сделать публичным"
            if ($value->isPublic == 0) {
                ?>
                  ::<a href="./publicq.php?questionId=<?php 
                echo $value->questionId;
                ?>
&public=1">отметить как публичный</a>
<?php 
                //иначе показать галочку "сделать непубличным"
            } else {
                ?>
                  ::<a href="./publicq.php?questionId=<?php 
                echo $value->questionId;
                ?>
&public=0">отметить как непубличный</a>
<?php 
            }
            //конец проверки общедоступности вопроса
            ?>
                  
                </sup>
              </td>
            </tr>
<?php 
        }
        //конец цикла по запис¤м в таблице вопросов
        ?>
          </table>
<?php 
    }
    // конец проверки на наличие вопросов
    ?>
          
          <hr />
          <h3 id="print_queue">ќчередь печати</h3>
<?php 
    //выводим сообщение, что вопросов нет
    if (count($print_queue) == 0) {
        ?>
          <p>ќчередь пуста.</p>
<?php 
    } else {
        ?>
          <table style="width:100%;">
            <tr>
              <th style="width:30%">ѕользователь</th>
              <th style="width:30%">«адача</th>
              <th style="width:5%">—татус</th>
              <th style="width:45%">ќперации</th>
            </tr>
<?php 
        //цикл по запис¤м в очереди печати
        $nth = false;
        while (list($key, $value) = each($print_queue)) {
            //определение текста в колонке статус
            $status = 'ќжидание...';
            $status_color = '';
            if (3 == $value->isPrinted) {
                $status = 'OK';
                $status_color = ' style="color:green" ';
            } else {
                if (4 == $value->isPrinted) {
                    $status = 'Failed';
                    $status_color = ' style="color:red" ';
                } else {
                    if (1 == $value->isPrinted) {
                        $status = '¬ очереди';
                        $status_color = ' style="color:gray" ';
                    }
                }
            }
            //определение цвета строки
            if (!$nth) {
                ?>
            <tr>
<?php 
            } else {
                ?>
            <tr class="s">
<?php 
            }
            //конец определени¤ цвета строки
            $nth = !$nth;
            ?>
              <td>
                <?php 
            userlink($value->userNickName, $value->userId);
            ?>
              </td>
              <td>
                <?php 
            echo $value->taskName;
            ?>
              </td>
              <td<?php 
            echo $status_color;
            ?>
>
                <?php 
            echo $status;
            ?>
              </td>
              <td>
                <sup>
                  ::<a href="./deletep.php?printId=<?php 
            echo $value->printId;
            ?>
">удалить</a>
                  &nbsp;
<?php 
            if (1 == $value->isPrinted || 3 == $value->isPrinted || 4 == $value->isPrinted) {
                ?>
                  
                  ::<a href="./clearp.php?printId=<?php 
                echo $value->printId;
                ?>
">печатать заново</a>
<?php 
            }
            ?>
                  
                </sup>
              </td>
            </tr>
<?php 
        }
        //конец цикла по запис¤м в очереди печати
    }
    // конец проверки на наличие записей в очереди печати
    ?>
          </table>
<?php 
}
コード例 #8
0
function content($data)
{
    global $authorized;
    global $is_admin;
    $questions = _data('questions');
    ?>
<h3>¬опросы по задаче: <?php 
    echo _data('taskName');
    ?>
</h3>
<hr />
<p>¬опрос должен быть составлен в такой форме, чтобы на него можно было ответить "ƒа" или "Ќет". ¬опросы, на которые нельз¤ ответить подобным образом, а также вопросы, ответы на которые содержатс¤ в условии, будут получать ответ "Ѕез комментариев".</p>
<p>¬опросы (и ответы), добавленные ¬ашей командой, будут видимы исключительно ¬ам, кроме того случа¤, когда вопрос действительно важен дл¤ понимани¤ услови¤ задачи, или если по изучении вопроса жюри пришло к выводу, что условие либо тесты содержат ошибку. ¬ этом случае вопрос помечаетс¤ как "общий" и становитс¤ видимым всем командам.</p>
<hr />
<?php 
    if ($authorized == 1) {
        ?>
<p>::<a href="./addqform.php?taskId=<?php 
        echo _data('taskId');
        ?>
">добавить новый вопрос</a>&nbsp;</p>
<?php 
    } else {
        ?>
<p class="message">ƒобавл¤ть новые вопросы могут только зарегистрированные пользователи.</p>
<?php 
    }
    ?>
    
<hr />
<?php 
    if (0 == count($questions)) {
        //выводим сообщение, что вопросов нет
        ?>
<p class="message">Ќет вопросов дл¤ отображени¤.</p>
<?php 
    }
    //цикл по запис¤м в таблице вопросов
    while (list($key, $instance) = each($questions)) {
        //сколько строк по высоте будет запись
        $row_span = 0;
        if ($instance->question) {
            $row_span++;
        }
        if ($instance->result > 0) {
            $row_span++;
        }
        if ($instance->comment) {
            $row_span++;
        }
        //определ¤ем, какие из чекбоксов будут помечены
        $yes_checkbox_value = $instance->result == 1 ? ' checked="checked ' : '';
        $no_checkbox_value = $instance->result == 2 ? ' checked="checked ' : '';
        $nocomment_checkbox_value = $instance->result == 3 ? ' checked="checked" ' : '';
        $class = '0' === $instance->result && ('' === $instance->comment || null == $instance->comment) && $is_admin == 1 ? ' new' : '';
        //признак того, что строка была переведена
        $new_line = false;
        ?>
          <table class="forum<?php 
        echo $class;
        ?>
">
<?php 
        //в случае админской авторизации показываем панель управлени¤
        if (1 == $is_admin) {
            ?>
            <tr>
              <td colspan="2" class="actions">
                <sup>
                  ::<a href="./editqform.php?questionId=<?php 
            echo $instance->questionId;
            ?>
">ответить</a>
                  &nbsp;
                  ::<a href="./deleteq.php?questionId=<?php 
            echo $instance->questionId;
            ?>
">удалить</a>
                  &nbsp;
<?php 
            //если вопрос не публичный - показать галочку "сделать публичным"
            if ($instance->isPublic == 0) {
                ?>
                  ::<a href="./publicq.php?questionId=<?php 
                echo $instance->questionId;
                ?>
&public=1">отметить как публичный</a>
<?php 
                //иначе показать галочку "сделать непубличным"
            } else {
                ?>
                  ::<a href="./publicq.php?questionId=<?php 
                echo $instance->questionId;
                ?>
&public=0">отметить как непубличный</a>
<?php 
            }
            //конец проверки общедоступности вопроса
            ?>
                  
                </sup>
              </td>
            </tr>
<?php 
        }
        //конец обработки панели управлени¤
        ?>
          
            <tr>
              <td rowspan="<?php 
        echo $row_span;
        ?>
" class="userdate">
                <?php 
        userlink($instance->userNickName, $instance->userId);
        ?>
                <sup><?php 
        echo $instance->dateTime;
        ?>
</sup>
<?php 
        if ($instance->isPublic == 1) {
            ?>
                <sup>публичный</sup>
<?php 
        }
        ?>
                
              </td>
<?php 
        if ($instance->question) {
            ?>
              <td class="question">
                <?php 
            echo $instance->question;
            ?>
              </td>
            </tr>
<?php 
            $new_line = true;
        }
        if ($instance->result > 0) {
            if (!$new_line) {
                $new_line = true;
            } else {
                ?>
            <tr>
<?php 
            }
            ?>
              <td class="controls">
                <input type="checkbox" class="checkbox" name="yes" <?php 
            echo $yes_checkbox_value;
            ?>
 disabled="disabled" /> ƒа&nbsp;&nbsp;
                <input type="checkbox" class="checkbox" name="no" <?php 
            echo $no_checkbox_value;
            ?>
 disabled="disabled" /> Ќет&nbsp;&nbsp;
                <input type="checkbox" class="checkbox" name="nocomment" <?php 
            echo $nocomment_checkbox_value;
            ?>
 disabled="disabled" /> Ѕез комментариев&nbsp;&nbsp;
              </td>
            </tr>
<?php 
        }
        if ($instance->comment) {
            if (!$new_line) {
                $new_line = true;
            } else {
                ?>
            <tr>
<?php 
            }
            ?>
              <td class="comment">
                <?php 
            echo $instance->comment;
            ?>
              </td>
            </tr>
<?php 
        }
        if (!$new_line) {
            //проверка, что нужно принудительно закрыть строку
            ?>
            </tr>
<?php 
        }
        //конец проверки на необходимость закрыть строку
        ?>
          </table>
<?php 
    }
    //конец цикла по запис¤м в таблице вопросов
    ?>
          
<?php 
}
コード例 #9
0
ファイル: wiki.inc.php プロジェクト: aquarion/AqWiki
function wiki($wiki, $article)
{
    global $dataSource;
    global $_CONFIG;
    global $_EXTRAS;
    $out = '';
    //if ($_CONFIG['oneWiki']){
    $base = $_CONFIG['base'];
    $url = $_CONFIG['base'] . "/{$article}";
    //} else {
    //	$base = $_CONFIG['base']."/".$wiki;
    //	$url = $_CONFIG['base']."/$wiki/$article";
    //}
    $content = array($wiki, $article, "", "aqWiki (Admin)", date("r"));
    if (!isset($_GET['action'])) {
        $_GET['action'] = false;
    }
    switch ($_GET['action']) {
        case "viewrev":
            if (!$_GET['id']) {
                panic("View Revision", "Parameters incorrect");
            }
            $id = $_GET['id'];
            $pages = $dataSource->getPage($article);
            debug("Found " . count($pages) . " pages");
            $row = $pages[$id];
            $content[2] = '<div class="info"><b>Note:</b> This is a <i>specific revision</i> of this page, and may be outdated, The current version is ((here|' . $article . ')). You can see the differences between this and the current revision <a href="' . $url . '?action=diff&amp;from=' . $id . '">here</a></div>';
            if (in_array($_EXTRAS['me'], $_EXTRAS['admins'])) {
                $content[2] .= '<div class="adminFunctions">Admin Actions: 
				<a href="' . $url . '?action=revert&id=' . $id . '">Revert back to this version</a>
				</div>';
            }
            $content[2] .= $row['content'];
            #."\n\n [ \"Edit This Page\":$url?action=edit | \"View Source\":$url?action=src ]";
            $content[3] = $row['creator'];
            $content[4] = date("r", $row['created']);
            $limit = 3;
            $current = 0;
            $_EXTRAS['versions'] = '';
            foreach ($pages as $row) {
                $line = date("r", $row['created']) . " - \"" . $row['creator'] . "\":{$base}/~" . $row['creator'];
                if ($row['comment']) {
                    $line .= " : " . $row['comment'];
                }
                if ($row['revision'] == $id) {
                    $_EXTRAS['versions'] .= "# " . $line . " [ Current ]\n";
                } else {
                    $_EXTRAS['versions'] .= "# " . $line . " [ <a href=\"" . $url . "?action=viewrev&amp;id=" . $row['revision'] . "\" title=\"View this revision\">View</a> |" . " <a href=\"" . $url . "?action=diff&amp;from=" . $id . "&amp;to=" . $row['revision'] . "\"\" title=\"View differences between this and the current revision\">Diff</a> ]\n";
                }
                $current++;
                if ($id < $row['revision']) {
                    // Nothing happens
                } elseif ($current >= $limit && $_GET['action'] != "allrev") {
                    if ($id == $row['revision']) {
                        $limit += 6;
                    } else {
                        $_EXTRAS['versions'] .= "# \"Show rest of revisions\":" . $url . "?action=allrev\n";
                        break;
                    }
                }
            }
            $content[2] .= $out;
            break;
        case "diff":
            $content[2] = "These are the differences between two versions of (({$article})). Lines styled <span class=\"added\">" . "like this</span> have been added to the entry, lines <span class=\"removed\">like this</span> have been removed.\n\n";
            $from = isset($_GET['from']) ? $_GET['from'] : false;
            $to = isset($_GET['to']) ? $_GET['to'] : false;
            $_EXTRAS['textarea'] = $dataSource->diff($article, $from, $to);
            $content[2] .= "[[TEXTAREA]]";
            break;
        case "newUser":
            /*mysql> describe users;
            		+---------------+------------------+-------------------+
            		| Field         | Type             | Collation         |
            		+---------------+------------------+-------------------+
            		| id            | int(10) unsigned | binary            |
            		| username      | varchar(64)      | latin1_swedish_ci |
            		| real_name     | tinytext         | latin1_swedish_ci |
            		| email         | tinytext         | latin1_swedish_ci |
            		| birthday      | date             | latin1_swedish_ci |
            		| password      | tinytext         | latin1_swedish_ci |
            		| location      | int(11)          | binary            |
            		| last_access   | timestamp        | latin1_swedish_ci |
            		| date_creation | timestamp        | latin1_swedish_ci |
            		| access_level  | int(11)          | binary            |
            		+---------------+------------------+-------------------+
            		10 rows in set (0.05 sec)
            		*/
            $form = '<form class="shiny" method=post action="' . $_SERVER['REQUEST_URI'] . '"><h2>New User</h2>' . "\n\n" . '|Username|<input type="text" name="username" value="' . $_POST['username'] . '">|(Must not be blank)|' . "\n" . '|Display Name|<input type="text" name="name" value="' . $_POST['name'] . '">|(Must not be blank)<br>|' . "\n" . '|e-Mail|<input type="text" name="email" value="' . $_POST['email'] . '">|(Must not be blank)<br>|' . "\n" . '|Password|<input type="password" name="password">|(Must not be blank)<br>|' . "\n" . '|Repeat Password |<input type="password" name="password2">| (Must match above) |' . "\n\n";
            if (isset($_CONFIG['recaptcha_public_key'])) {
                require_once 'recaptchalib.php';
                $public_key = $_CONFIG['recaptcha_public_key'];
                $form .= '<aqWikiNoProcess>' . recaptcha_get_html($public_key) . "</aqWikiNoProcess>\n\n";
            }
            $form .= '<input type="submit" name="submit" value="Create User">' . "\n\n" . '</form>';
            #print_r($_POST);
            if ($_POST['submit']) {
                $errors = array();
                if ($_POST['username'] == "") {
                    $errors[] = "Username cannot be blank";
                } elseif (strstr($_POST['username'], ",")) {
                    $errors[] = "Username cannot contain commas";
                } elseif (isset($_EXTRAS['reservedUsers']) && in_array($_POST['username'], $_EXTRAS['reservedUsers'])) {
                    $errors[] = "Username invalid";
                } elseif (!$dataSource->unique("users", "username", $_POST['username'])) {
                    $errors[] = "Username must be unique";
                }
                if ($_POST['email'] == "") {
                    $errors[] = "email cannot be blank";
                } elseif (!$dataSource->unique("users", "email", $_POST['email'])) {
                    $errors[] = "email must be unique";
                }
                if ($_POST['name'] == "") {
                    $errors[] = "Display Name cannot be blank";
                } elseif (!$dataSource->unique("users", "real_name", $_POST['name'])) {
                    $errors[] = "Display Name must be unique";
                }
                if ($_POST['password'] == "") {
                    $errors[] = "password cannot be blank";
                } elseif ($_POST['password'] != $_POST['password2']) {
                    $errors[] = "passwords must match";
                }
                if (isset($_CONFIG['recaptcha_private_key'])) {
                    $privatekey = $_CONFIG['recaptcha_private_key'];
                    $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
                    if (!$resp->is_valid) {
                        $errors[] = "Captcha invalid";
                    }
                }
                if (count($errors) == 0) {
                    $dataSource->newUser($_POST['username'], $_POST['name'], $_POST['password'], $_POST['email']);
                    sendAdminEmail('New User Created', $_POST);
                    $out = "h2. New user created\n\n";
                    $out .= "Hi, " . $_POST['name'] . ", Welcome to this aqWiki install.\n\n";
                    $url = parse_url($_SERVER['REQUEST_URI']);
                    $out .= "You should now \"login\":" . $url['path'] . "?action=login";
                } else {
                    $out = "h2. Error in user creation\n\n";
                    foreach ($errors as $error) {
                        $out .= "* " . $error . "\n";
                    }
                    $out .= "\n\n" . $form;
                }
            } else {
                $out = "h2. New user\n\n";
                $out .= $form;
            }
            $content[2] = $out;
            break;
        case "edit":
            if ($_EXTRAS['reqEdit']) {
                doAuth($_EXTRAS['reqEdit'], "edit a page");
            }
            if ($_EXTRAS['restrictNewPages']) {
                doAuth($_EXTRAS['restrictNewPages'], "create a new page");
            }
            $form = true;
            $text = false;
            switch ($_POST['submit']) {
                case "Preview":
                    $out = $_POST['content'];
                    $text = stripslashes($_POST['content']);
                    break;
                case "Spell Check":
                    $checker = new Spellchecker();
                    $text = strip_tags(textile($_POST['content']));
                    $num_errors = $checker->check($text);
                    if ($num_errors > 0) {
                        $out .= "h3. Spell Check\n\n";
                        #$out .= "Items <span class=\"spellCorrect\">like this</span> could be errors, hover over for suggestions. Items <span class=\"spellNoSuggest\">like this</span> arn't in the dictionary, and the spell checker has no idea.\n\n";
                        $errors = $checker->getErrors();
                        $oldtext = $text;
                        foreach ($errors as $word => $suggestions) {
                            /*$title = trim(implode(', ', $suggestions));
                            		if ($title == ""){
                            			$span = '<|-|'.$title.'|-|>'.$word.'</-|>';
                            		} else {
                            			$span = '<|||'.$title.'|||>'.$word.'</||>';
                            		}*/
                            $suggs = implode(' ', $suggestions);
                            if ($suggs != " ") {
                                $errorlist .= "*" . $word . ":* " . $suggs . "\n\n";
                            } else {
                                $noidea[] = $word;
                            }
                            # $text = str_replace($word, $span, $text);
                            #$text = preg_replace("/(\W|^)$word(\W|\$)/i", "$1$span$2", $text);
                        }
                        /*
                        						//if ($title == ""){
                        							$text = str_replace('<|-|', '<span class="spellNoSuggest"', $text);
                        							$text = str_replace('|-|>', '>', $text);
                        							$text = str_replace('</-|>', '</span>', $text);
                        						//} else {
                        							$text = str_replace('<|||', '<span class="spellCorrect" title="', $text);
                        							$text = str_replace('|||>', '">', $text);
                        							$text = str_replace('</||>', '</span>', $text);
                        						//}*/
                    }
                    if ($noidea) {
                        $errorlist .= "*No idea about:* " . implode(' ', $noidea) . "\n\n";
                    }
                    #$out .= $text;
                    $out .= $errorlist . "\n";
                    $text = stripslashes($_POST['content']);
                    break;
                case "Post":
                    $page = array_shift($dataSource->getPage($article));
                    if ($page['rev_created'] > $_POST['edittime']) {
                        $content[2] .= collision_detection($page, $_POST);
                        $text = $_POST['content'];
                        //$form = false;
                    } else {
                        $dataSource->post($article, $_POST['content'], $_POST['comment']);
                        $form = false;
                        header("location: {$url}");
                    }
            }
            if ($text) {
                $_EXTRAS['textarea'] = $text;
            } elseif (!$dataSource->pageExists($article)) {
                $_POST['comment'] = "Start of a brand new world";
                $_EXTRAS['textarea'] = "";
            } else {
                $_EXTRAS['textarea'] = stripslashes($dataSource->getContent($article));
            }
            preg_match_all("/\\[\\[LOCKED\\|(.*?)\\]\\]/", $_EXTRAS['textarea'], $matches);
            foreach ($matches[0] as $index => $match) {
                $users = $matches[1][$index];
                doAuth($users, "view this");
            }
            if ($form) {
                $out .= "<form method=post action=\"" . $_SERVER['REQUEST_URI'] . "\" class=\"shiny wikiedit\">";
                $out .= '<h2>Editing "' . $content[1] . '"</h2>';
                $out .= "<p>You should read the ((help)). If you are having problems with the formatting, post it and add a note explaining the problem to ((formattingProblems)) and I'll dive in and fix it. If you believe you've found a bug in the wiki software, post your problem to \"the bug tracker\":http://trac.aqxs.net/aqwiki/newticket and I'll dive in and fix that too.</p>\n";
                //$out .= "<label for=\"creator\">Author</label>\n";
                //$out .= $_EXTRAS['me']."<br>\n";
                $out .= "<label for=\"content\">Content of page \"" . $content[1] . "\"</label>\n";
                $out .= "<textarea name=\"content\" id=\"content\" rows=\"30\" cols=\"72\">[[TEXTAREA]]</textarea>\n<br>\n";
                $out .= "<label for=\"comment\">Comment</label>\n";
                $out .= "<input type=\"text\" name=\"comment\" id=\"comment\" size=\"72\" value=\"" . $_POST['comment'] . "\"><br>\n";
                $out .= "<input class=\"submit\" type=\"hidden\" name=\"edittime\" value=\"" . time() . "\">\n";
                $out .= "<input class=\"submit\" type=\"submit\" name=\"submit\" value=\"Post\"> ";
                $out .= "<input class=\"submit\" type=\"submit\" name=\"submit\" value=\"Preview\"> ";
                $out .= "<input class=\"submit\" type=\"submit\" name=\"submit\" value=\"Spell Check\"> ";
                $out .= "<input class=\"submit\" type=\"reset\"  name=\"revert\" value=\"Revert to pre-editing\">\n";
                $out .= "</form>";
                $content[2] .= $out;
                break;
            }
        case "allrev":
            if (!$dataSource->pageExists($article)) {
                $content[2] = 'Error: Page doesn\'t exist. What are you playing at?';
                break;
            }
            $content[2] = '<form method="GET" action="' . $url . '" style="width: auto;">';
            $content[2] .= '<h2>Viewing all revisions for ((' . $article . "))</h2>\n\n";
            $content[2] .= 'Select the <input type="radio" /> boxes to compare two revisions' . "\n\n";
            $pages = $dataSource->getPage($article);
            $pages = array_reverse($pages);
            foreach ($pages as $row) {
                $line = '<input type="radio" name="from" value="' . $row['revision'] . '">';
                $line .= '<input type="radio" name="to" value="' . $row['revision'] . '">';
                $line .= date("Y-m-d H:i", $row['created']) . " - " . userlink($row['creator']);
                if ($row['comment']) {
                    $line .= " : " . $row['comment'];
                }
                $content[2] .= "# " . $line . " [ <a href=\"" . $url . "?action=viewrev&amp;id=" . $row['revision'] . "\" title=\"View this revision\">View</a> |" . " <a href=\"" . $url . "?action=diff&amp;from=" . $row['revision'] . "\"\" title=\"View differences between this and the current revision\">Diff</a> ]\n";
            }
            $content[2] .= '<input type="submit" value="Compare Revisions">
			<input type="hidden" value="diff" name="action">
			</form>';
            break;
        case "revert":
            if (!in_array($_EXTRAS['me'], $_EXTRAS['admins'])) {
                panic('AqWiki Reversion', 'You\'re not an admin, you can\'t do this shit');
            }
            if (!$_GET['id']) {
                die("Parameters incorrect");
            }
            $id = $_GET['id'];
            $pages = $dataSource->getPage($article);
            $oldVersion = $pages[$id];
            //die($oldVersion['content']);
            $dataSource->post($article, $oldVersion['content'], 'reverted back to version ' . $id);
            $form = false;
            $content[2] = 'Reverted ((' . $article . ')) back to version ' . $id;
            break;
        default:
            $_EXTRAS['versions'] = "";
            if (!$dataSource->pageExists($article)) {
                if ($_EXTRAS['restrictNewPages'] || $_EXTRAS['reqEdit']) {
                    if ($_EXTRAS['restrictNewPages'] == "register") {
                        $message = "any registered users";
                    } else {
                        $message = "only certain users";
                    }
                    if (!isset($_EXTRAS['newPageMessage'])) {
                        $npm = "This page doesn't exist yet. [[TYPES]] can create new pages. Do you want to do so?\n\n\"Go On Then\":[[EDITURL]]";
                    } else {
                        $npm = $_EXTRAS['newPageMessage'];
                    }
                    $content[2] = str_replace(array("[[TYPES]]", "[[EDITURL]]"), array($message, $url . "?action=edit"), $npm);
                } else {
                    $content[2] = "This page doesn't exist yet, Would you like to create it?\n\n\"Go On Then\":" . $url . "?action=edit";
                }
            } else {
                $_EXTRAS['nearby'] = $dataSource->nearby($article);
                $pages = $dataSource->getPage($article);
                $row = array_shift($pages);
                if (strcmp($row['wiki'], $wiki) != 0) {
                    $base = $_CONFIG['base'] . "/" . $row['wiki'];
                    $url = $base . "/" . $article;
                    header("location: " . $url);
                }
                $content[2] = $row['content'];
                $content[3] = $row['creator'];
                $content[4] = date("r", $row['created']);
                $line = date("r", $row['created']) . " - " . userlink($row['creator']);
                if ($row['comment']) {
                    $line .= " : " . $row['comment'];
                }
                if ($_EXTRAS['current'] != $article) {
                    $pages = $dataSource->getPage($_EXTRAS['current']);
                    $row = array_shift($pages);
                }
                $_EXTRAS['versions'] .= "# " . $line . " [ Current ]\n";
                $limit = 10;
                $current = 0;
                foreach ($pages as $row) {
                    $line = date("Y-m-d\tH:i", $row['created']) . " - " . userlink($row['creator']);
                    if ($row['comment']) {
                        $line .= " : " . $row['comment'];
                    }
                    $_EXTRAS['versions'] .= "# " . $line . " [ <a href=\"" . $url . "?action=viewrev&amp;id=" . $row['revision'] . "\" title=\"View this revision\">View</a> |" . " <a href=\"" . $url . "?action=diff&amp;from=" . $row['revision'] . "\"\" title=\"View differences between this and the current revision\">Diff</a> ]\n";
                    $current++;
                    if ($_GET['action'] != "allrev" && $current > $limit) {
                        $_EXTRAS['versions'] .= "# \"Show list of revisions\":" . $url . "?action=allrev\n";
                        break;
                    }
                }
                #$content[2] .= $out;
            }
    }
    return $content;
}
コード例 #10
0
ファイル: gbook.php プロジェクト: djqhuan/CSCMS-v4.0-UTF8
 public function add()
 {
     $callback = $this->input->get('callback', true);
     $token = $this->input->get_post('token', TRUE);
     $add['uida'] = (int) $this->input->get_post('uid', TRUE);
     $add['neir'] = $this->input->get_post('neir', TRUE);
     $add['neir'] = facehtml(filter(get_bm($add['neir'])));
     //转化回复
     preg_match_all('/' . L('gbook_02') . '@(.*)@:/i', $add['neir'], $bs);
     if (!empty($bs[0][0]) && !empty($bs[1][0])) {
         $uid = getzd('user', 'id', $bs[1][0], 'name');
         $nichen = getzd('user', 'nichen', $bs[1][0], 'name');
         $ulink = userlink('index', $uid, $bs[1][0]);
         if (empty($nichen)) {
             $nichen = $bs[1][0];
         }
         $b = L('gbook_02') . '<a target="_blank" href="' . $ulink . '">@' . $nichen . '@</a>:';
         $add['neir'] = str_replace($bs[0][0], $b, $add['neir']);
     }
     unset($bs);
     if ($add['uida'] == 0) {
         $error = '10000';
     } elseif (!isset($_SESSION['gbooktoken']) || $token != $_SESSION['gbooktoken']) {
         $error = '10001';
     } elseif (isset($_SESSION['gbookaddtime']) && time() < $_SESSION['gbookaddtime'] + 30) {
         $error = '10006';
     } elseif (empty($add['neir'])) {
         $error = '10002';
     } elseif (empty($_SESSION['cscms__id'])) {
         $error = '10003';
     } else {
         $add['uidb'] = $_SESSION['cscms__id'];
         $add['fid'] = intval($this->input->get_post('fid'));
         $add['ip'] = getip();
         $add['addtime'] = time();
         $ids = $this->CsdjDB->get_insert('gbook', $add);
         if (intval($ids) == 0) {
             $error = '10004';
             //失败
         } else {
             //摧毁token
             unset($_SESSION['token']);
             $error = '10005';
             $_SESSION['gbookaddtime'] = time();
             //发送通知
             $addm['uida'] = $add['uida'];
             $addm['uidb'] = $_SESSION['cscms__id'];
             $addm['name'] = L('gbook_03');
             $addm['neir'] = vsprintf(L('ajax_04'), array($_SESSION['cscms__name']));
             $addm['addtime'] = time();
             $this->CsdjDB->get_insert('msg', $addm);
         }
     }
     echo $callback . "({error:" . $error . "})";
 }
コード例 #11
0
ファイル: users.php プロジェクト: Treeki/historical-tboard
     break;
 case 'profile':
     $userid = $_GET['id'];
     if (!is_numeric($userid)) {
         print "Invalid user ID.<br><a href='index.php'>Return to the main page</a>";
         break;
     }
     $userid = intval($userid);
     // just to be safe
     $memberquery = dbquery("SELECT * FROM users WHERE userid = {$userid}");
     if (mysql_num_rows($memberquery) == 0) {
         print "No user with this ID exists.<br><a href='index.php'>Return to the main page</a>";
     } else {
         $member = dbrow($memberquery);
         //$member[username] = htmlspecialchars($member[username]);
         $namelink = userlink($member[userid], htmlspecialchars($member[username]), $member[powerlevel]);
         print "<table class='styled' style='width: 100%; margin: 0px auto; border: 0px' cellpadding='0' cellspacing='0'>";
         print "<tr><td colspan='2' style='font-size: 15px; font-weight: bold'>Profile for {$namelink}</td></tr>";
         print "<tr>";
         // left bit
         print "<td style='width: 50%' valign='top'>";
         print "<table class='styled' style='width: 100%'>";
         print "<tr class='header'><td>Profile Info</td></tr>";
         print "<tr><td style='text-align: left'>";
         if ($member[hasavatar] == 1) {
             print "<img src='avatars/{$member['userid']}.{$member['avatarext']}' alt='Avatar' style='display: block; margin: 0 auto'>";
             print "<div class='bigspacing'></div>";
         }
         if ($member[usertitle]) {
             $member[usertitle] = htmlspecialchars($member[usertitle]);
             print "<div style='text-align: center'>{$member['usertitle']}</div>";
コード例 #12
0
ファイル: idx.php プロジェクト: Treeki/historical-tboard
        } else {
            print "<tr>";
        }
        print "<td style='text-align: center'>{$forumicon}</td>";
        print "<td style='font-size: 12px'><a href='index.php?showforum={$forum['id']}' style='font-size: 14px; font-weight: bold'>{$forum['name']}</a><br>{$forum['desc']}</td>";
        print "<td style='font-size: 11px'>{$forum['threads']} threads<br>{$forum['posts']} posts</td>";
        if ($forum[lastpostdate] == 0) {
            print "<td>Never</td>";
        } else {
            if (strlen($forum[lastpostedin]) > 35) {
                $forum[lastpostedin] = substr($forum[lastpostedin], 0, 32) . '...';
            }
            $forum[lastpostedin] = htmlspecialchars($forum[lastpostedin]);
            $lastpostdate = parsedate($forum[lastpostdate]);
            print "<td>";
            print "<a href='index.php?showthread={$forum['lastpostedinid']}&page=last'>{$forum['lastpostedin']}</a><br>";
            print "{$lastpostdate}<br>";
            $lastposter = userlink($forum[lastposterid], htmlspecialchars($forum[lastposter]), $forum[powerlevel]);
            print "by {$lastposter}";
            print "</td>";
        }
        print "</tr>";
    }
    print "</table>";
    print "<div class='bigspacing'></div>";
}
if ($s[logged_in]) {
    print "<form action='index.php?m=board' method='post'>";
    print "<input type='submit' name='markread' class='button' value='Mark all threads/forums as read'>";
    print "</form>";
}
コード例 #13
0
ファイル: main.php プロジェクト: projectesIF/Ateneu
" class="dw-navbar-brand">
					<i class="uk-icon-wrench"></i> <?php 
echo $conf['title'];
?>
				</a>
			</div>
			
			<?php 
if (!empty($_SERVER['REMOTE_USER'])) {
    ?>
					
				<div class="uk-navbar-flip uk-hidden-small">
					<ul class="uk-navbar-nav">
						<li data-uk-dropdown>
							<a href=""><?php 
    echo userlink();
    ?>
 <i class="uk-icon-caret-down"></i></a>
							<div class="uk-dropdown uk-dropdown-navbar">
								<ul class="uk-nav uk-nav-navbar">															
									<?php 
    tpl_action('profile', 1, 'li');
    ?>
									<?php 
    tpl_action('login', 1, 'li');
    ?>
								</ul>
							</div>
						</li>						
					</ul>
				</div>
コード例 #14
0
ファイル: status.php プロジェクト: bearf/xicl-web-interface
function content($data)
{
    $requested_contest_name = _data('requested_contest_name');
    //$contest = _data('contest');
    //$kind = _data('kind');
    //$indexes = _data('indexes');
    //$names = _data('names');
    $status = _data('status');
    //$first = _data('first');
    //$teams = _data('teams');
    //$pagesize = _data('pagesize');
    //$rowcount = _data('rowcount');
    //$page = _data('page');
    $params = _data('params');
    $topparams = _data('topparams');
    $top_submit = _data('top_submit');
    $bottom_submit = _data('bottom_submit');
    global $curcontest;
    global $is_admin;
    if (0 == count($status)) {
        if (_data('contest') != $curcontest) {
            ?>
<h3>Статус посылок: <?php 
            echo $requested_contest_name;
            ?>
</h3>
<?php 
        }
        ?>
<p class="message">При заданных условиях поиска не найдено ни одного отправленного решения</p>
<?php 
    } else {
        if (_data('contest') != $curcontest) {
            ?>
<h3>Статус посылок: <?php 
            echo _data('requested_contest_name');
            ?>
</h3>
<?php 
        }
        ?>
          <table>
            <tr>
              <th>ID</th>
              <th>Дата</th>
              <th>Задача</th>
              <th>Пользователь</th>
              <th>Язык</th>
              <th>Статус</th>
<?php 
        if (_settings_show_submit_info || 1 == $is_admin) {
            ?>
              <th>Время</th>
              <th>Память</th>
<?php 
        }
        ?>
              
            </tr>
<?php 
        $nth = false;
        while (list($key, $f) = each($status)) {
            $nth = !$nth;
            ?>
            <tr <?php 
            echo !$nth ? 'class="s"' : '';
            ?>
>
                <?php 
            if (1 == $is_admin) {
                ?>
                    <td><a href="./source.php?submitid=<?php 
                echo $f->SubmitID;
                ?>
&top=<?php 
                echo _data('first_submit') . $params;
                ?>
" title="Исходный код"><?php 
                echo $f->SubmitID;
                ?>
</a></td>
                <?php 
            } else {
                ?>
                    <td><?php 
                echo $f->SubmitID;
                ?>
</td>
                <?php 
            }
            ?>
              <td><?php 
            echo $f->SubmitTime;
            ?>
</td>
              <td><a href="./problem.php?contest=<?php 
            echo _data('contest');
            ?>
&amp;problem=<?php 
            echo $f->ProblemID;
            ?>
"><?php 
            echo $f->ProblemID;
            ?>
</a></td>
              <td><?php 
            userlink($f->Nickname, $f->ID);
            ?>
</td>
              <td><?php 
            echo $f->Ext;
            ?>
</td>
<?php 
            // определение цвета ячейки статуса
            $color = 0 != $f->StatusID ? ' ' : (0 != $f->ResultID ? ' class="wa"' : ' class="ok"');
            ?>
              <td<?php 
            echo $color;
            ?>
>
                <?php 
            echo $f->Message;
            ?>
              </td>
<?php 
            if (_settings_show_submit_info || 1 == $is_admin) {
                ?>
              <td><?php 
                echo '0' === $f->TotalTime ? '-' : $f->TotalTime . ' ms';
                ?>
</td>
              <td><?php 
                echo '0' === $f->TotalMemory ? '-' : $f->TotalMemory . ' kb';
                ?>
</td>
<?php 
            }
            ?>
              
            </tr>
<?php 
        }
        //конец прохода по строкам таблицы статуса
        ?>
          </table>

          <table class="links">
            <tr>
<?
if (-1 != $top_submit):
?>
              <td style="width:33%">
                <a href="status.php?top=<?php 
        echo $top_submit;
        echo $params;
        ?>
">
                  ::вверх на 10
                </a>
              </td>
<?
else:
?>
              <td style="width:33%">
                &nbsp;
              </td>
<?
endif;
?>
              <td style="width:34%">
                <a href="status.php?<?php 
        echo $topparams;
        ?>
">
                  ::наверх
                </a>
              </td>
<?
if (-1 != $bottom_submit):
?>
              <td style="width:33%">
                <a href="status.php?top=<?php 
        echo $bottom_submit;
        echo $params;
        ?>
">
                  ::вниз на 10
                </a>
              </td>
<?
else:
?>
              <td style="width:33%">
                &nbsp;
              </td>
<?
endif;
// конец отображения таблицы ссылок
?>
            </tr>
          </table>
<?php 
    }
    // конец проверки наличия сабмитов
    ?>
          
<?php 
}
コード例 #15
0
ファイル: main.php プロジェクト: Treeki/historical-tboard
    $lastread[$row[id]] = intval($row[lastread]);
}
$canview = implode(',', $canview_arr);
$eachone = array(array('Newest Threads', 'ORDER BY threads.id DESC LIMIT 5', '', 'author'), array('Latest Posts', 'ORDER BY threads.lastpostdate DESC LIMIT 5', '&page=last', 'lastposter'));
foreach ($eachone as $doit) {
    ?>
      <div class='portalheader'><?php 
    echo $doit[0];
    ?>
</div>
      <div class='portalbox'>
<?php 
    $getthreads = dbquery("SELECT threads.id, threads.name, threads.{$doit[3]}id, threads.forum, threads.lastpostdate, authorusers.username as authorname, authorusers.powerlevel as authorpower, threadread.thread FROM threads LEFT JOIN users as authorusers ON threads.{$doit[3]}id=authorusers.userid LEFT JOIN threadread ON threads.id=threadread.thread AND threadread.user={$s[user][userid]} WHERE threads.forum IN ({$canview}) {$doit['1']}");
    while ($row = dbrow($getthreads)) {
        $row[name] = htmlspecialchars($row[name]);
        $author = userlink($row[$doit[3] . 'id'], htmlspecialchars($row[authorname]), $row[authorpower]);
        $unread = '';
        if ($s[logged_in] && $row[lastpostdate] > $lastread[$row[forum]] && $row[id] != $row[thread]) {
            $icon = "<img src='{$theme}images/icon_unreadtiny.png' alt='This thread has unread posts.' title='This thread has unread posts.'>";
        } else {
            $icon = "<img src='{$theme}images/icon_tiny.png' alt='This thread has no unread posts.' title='This thread has no unread posts.'>";
        }
        print "{$icon} <a href='index.php?showthread={$row['id']}{$doit['2']}'>{$row['name']}</a> by {$author}<br>";
    }
    ?>
      </div>
<?php 
}
?>
      <div class='portalheader'>Board Statistics</div>
      <div class='portalbox'>
コード例 #16
0
 /**
  * Returns the meta line below the included page
  * @param $renderer Doku_Renderer_xhtml The (xhtml) renderer
  * @return string The HTML code of the footer
  */
 function html_footer($page, $sect, $sect_title, $flags, $footer_lvl, &$renderer)
 {
     global $conf, $ID;
     if (!$flags['footer']) {
         return '';
     }
     $meta = p_get_metadata($page);
     $exists = page_exists($page);
     $xhtml = array();
     // permalink
     if ($flags['permalink']) {
         $class = $exists ? 'wikilink1' : 'wikilink2';
         $url = $sect ? wl($page) . '#' . $sect : wl($page);
         $name = $sect ? $sect_title : $page;
         $title = $sect ? $page . '#' . $sect : $page;
         if (!$title) {
             $title = str_replace('_', ' ', noNS($page));
         }
         $link = array('url' => $url, 'title' => $title, 'name' => $name, 'target' => $conf['target']['wiki'], 'class' => $class . ' permalink', 'more' => 'rel="bookmark"');
         $xhtml[] = $renderer->_formatLink($link);
     }
     // date
     if ($flags['date'] && $exists) {
         $date = $meta['date']['created'];
         if ($date) {
             $xhtml[] = '<abbr class="published" title="' . strftime('%Y-%m-%dT%H:%M:%SZ', $date) . '">' . strftime($conf['dformat'], $date) . '</abbr>';
         }
     }
     // modified date
     if ($flags['mdate'] && $exists) {
         $mdate = $meta['date']['modified'];
         if ($mdate) {
             $xhtml[] = '<abbr class="published" title="' . strftime('%Y-%m-%dT%H:%M:%SZ', $mdate) . '">' . strftime($conf['dformat'], $mdate) . '</abbr>';
         }
     }
     // author
     if ($flags['user'] && $exists) {
         $author = $meta['user'];
         if ($author) {
             if (function_exists('userlink')) {
                 $xhtml[] = '<span class="vcard author">' . userlink($author) . '</span>';
             } else {
                 // DokuWiki versions < 2014-05-05 doesn't have userlink support, fall back to not providing a link
                 $xhtml[] = '<span class="vcard author">' . editorinfo($author) . '</span>';
             }
         }
     }
     // comments - let Discussion Plugin do the work for us
     if (empty($sect) && $flags['comments'] && !plugin_isdisabled('discussion') && ($discussion =& plugin_load('helper', 'discussion'))) {
         $disc = $discussion->td($page);
         if ($disc) {
             $xhtml[] = '<span class="comment">' . $disc . '</span>';
         }
     }
     // linkbacks - let Linkback Plugin do the work for us
     if (empty($sect) && $flags['linkbacks'] && !plugin_isdisabled('linkback') && ($linkback =& plugin_load('helper', 'linkback'))) {
         $link = $linkback->td($page);
         if ($link) {
             $xhtml[] = '<span class="linkback">' . $link . '</span>';
         }
     }
     $xhtml = implode(DOKU_LF . DOKU_TAB . '&middot; ', $xhtml);
     // tags - let Tag Plugin do the work for us
     if (empty($sect) && $flags['tags'] && !plugin_isdisabled('tag') && ($tag =& plugin_load('helper', 'tag'))) {
         $tags = $tag->td($page);
         if ($tags) {
             $xhtml .= '<div class="tags"><span>' . DOKU_LF . DOKU_TAB . $tags . DOKU_LF . DOKU_TAB . '</span></div>' . DOKU_LF;
         }
     }
     if (!$xhtml) {
         $xhtml = '&nbsp;';
     }
     $class = 'inclmeta';
     $class .= ' level' . $footer_lvl;
     return '<div class="' . $class . '">' . DOKU_LF . DOKU_TAB . $xhtml . DOKU_LF . '</div>' . DOKU_LF;
 }
コード例 #17
0
ファイル: standing.php プロジェクト: bearf/xicl-web-interface
function content($data) {
global $curuserid;
$requested_contest_name = _data('requested_contest_name');
$monitor_time = _data('monitor_time');
$contest = _data('contest');
$kind = _data('kind');
$indexes = _data('indexes');
$names = _data('names');
$problems = _data('problems');
$standing = _data('standing');
$first = _data('first');
$teams = _data('teams');
$pagesize = _data('pagesize');
$rowcount = _data('rowcount');
$page = _data('page');
if (0 == $rowcount):
?>
<p class="message">Таблица результатов контеста пока пуста</p>
<?php
else:
if ($requested_contest_name != ''):
?>
          <h3>Результаты: <?=$requested_contest_name?><?=$monitor_time?>&nbsp;::<a href="javascript:refreshMonitor({'div':1});">студенты</a>&nbsp;::<a href="javascript:refreshMonitor({'div':2});">школьники</a>&nbsp;::<a href="javascript:refreshMonitor({'div':0});">все</a></h3>
<?php
else:
?>
          <h3>Результаты<?=$monitor_time?>&nbsp;::<a href="javascript:refreshMonitor({'div':1});">студенты</a>&nbsp;::<a href="javascript:refreshMonitor({'div':2});">школьники</a>&nbsp;::<a href="javascript:refreshMonitor({'div':0});">все</a></h3>
<?php
endif;
?>
          <table class="standing">
            <tr>
<?php
if ($kind==1):
?>
              <th>#</th>
              <th>Пользователь</th>
              <th class="c">OK</th>
              <th>Последняя сдача</th>
<?php
elseif ($kind==2):
?>
              <th>#</th>
              <th>Пользователь</th>
              <th class="c">OK</th>
              <th class="c">Последняя сдача</th>
              <th>Баллы</th>
<?php
else:
?>
              <th>#</th>
              <th>Пользователь</th>
<?php
    if (3==$kind || 4==$kind):
        //контест третьего типа - надо вывести индексы задач
        for ($i=0; $i<count($indexes); $i++):
?>              
              <th><a class="white" href="problem.php?contest=<?=$contest?>&amp;problem=<?=$indexes[$i]?>" title="<?=$names[$i]?>"><?=$indexes[$i]?></a></th>
<?php
        endfor; //конец цикла по индексам задач
    endif; // конец обработки контеста третьего типа
?>
              <th>OK</th>
              <th>Время</th>
<?php              
    if (3 != $kind):
?>              
              <th>Последняя сдача</th>
<?php
    endif;
    
    if (2 == $kind || 4 == $kind):
?>
              <th>Баллы</th>
<?php
    endif;
endif; //конец рисования заголовка
?>
              </tr>
<?php
//выводим строки
$index = 0;
while (list($key, $f) = each($standing)):
    $index++;
?>    
                  <tr <?=$f->ID==$curuserid ? 'class="active"' : ($index%2==0 ? 'class="s"' : '')?>>
                    <td class="c"><?=$index+$first?></td>
                    <td class="user-info">
                        <?php userlink($teams[$f->ID]->nickname, $f->ID); ?>
                    </td>
<?php
    //контест типа 3/4 - надо писать индексы задач
    if ($kind == 3 || $kind == 4):
        //цикл по индексам задач
        for ($j=0; $j<count($indexes); $j++):
            //если задача решена с первой попытки - выводим +
            //если задача решена - выводим +<количество неудачных попыток>
            //попыток не было - выводим .
            $valueIndex = 'A'.$indexes[$j];
            $value = $f->$valueIndex;
            $solvedClass = $value == 0 ? '' : ($value > 0 ? 'solved' : 'unsolved');
            $value = $value == 1 ? $value = '+' : ($value > 1 ? $value = '+'.($value-1) : ($value == 0 ? '.' : $value));
            $timeIndex = 'T'.$indexes[$j];
            $problem = $problems[$j];
            $division = 2 == $problem->division ? 'div2' : (1 == $problem->division ? 'div1' : '');
?>
                    <td class="c task <?=$solvedClass?> <?php echo $division; ?>"><?=$value?><?='solved' == $solvedClass ? '<br /><span class="time">'.solvedAt($f->$timeIndex).'</span>' : ''?></td>
<?php
        endfor; //конец цикла по индексам задач
    endif; //конец проверки на необходимость отрисовки индексов задач
?>                    
                    <td class="c"><?=isset($f->Solved) && $f->Solved ? $f->Solved : 0?></td>
<?php
    // контест третьего или четвертого типа - нам нужно штрафное время
    if (3 == $kind || 4 == $kind):
        if (!isset($penalty) || !$penalty) { $penalty = 0; }
        $penalty = $f->Penalty/60;
        settype($penalty,'integer');
?>
                    <td class="c"><?=$penalty?></td>
<?php        
    endif; // конец вывода штрафного времени
    
    // в контестах всех типов кроме третьего нам нужно время последней сдачи
    if (3 != $kind):
?>                    
                    <td class="c"><?=isset($f->Solved) && isset($f->LastAC) && $f->Solved>0 && $f->LastAC ? $f->LastAC : '-'?></td>
<?
    endif; // конец показа последней сдачи
    // в контестах второго и четвертого типов нам нужны баллы
    if (2 == $kind || 4 == $kind):
?>    
                    <td class="c"><?=isset($f->Points) && $f->Points ? $f->Points : '0'?></td>
<?php             
    endif; // конец показа баллов       
    // конец строки
?>
                  </tr>
<?
endwhile; //конец пробега по строкам
?>
          </table>
<?php
$params = '&contest='.$contest;
$npage = $rowcount / $pagesize;
if ($rowcount%$pagesize != 0) { $npage += 1; }
if ($npage > 0):
?>
          <hr />
          <p class="pages">cтраницы:
<?php
    for ($i=1; $i<=$npage; $i++):
        if ($page==$i):
?>
            <strong><?=$i?></strong>
<?php
        else:
?>
            <a href="standing.php?page=<?=$i?><?=$params?>"><?=$i?></a>
<?php
        endif; //конец вывода номера страницы
    endfor; // конец цикла по номерам страниц
?>
          </p>
<?
endif; //конец вывода номеров страниц
endif; // конец чека на наличие записей
?>
    <script type="text/javascript">
      window.setTimeout('refreshMonitor("standing.php")', 60000);
    </script>
<?php } ?>
コード例 #18
0
ファイル: login.php プロジェクト: bearf/xicl-web-interface
function login()
{
    global $authorized;
    global $is_admin;
    global $curnickname;
    global $curuserid;
    global $messagecount;
    global $mysqli_;
    // запрос количества сообщений
    if (1 == $authorized) {
        $q = $mysqli_->prepare('select count(*) from `messages` M inner join `reads` R on M.messageid=R.messageid and R.userid=? where M.kind=1 and M.touser=?');
        $q->bind_param('ii', $curuserid, $curuserid);
        $q->bind_result($tmp1);
        if (!$q->execute()) {
            fail(_error_mysql_query_error_code);
        }
        // auto-close query
        $q->fetch();
        // always one row
        $q->close();
        $q = $mysqli_->prepare('select count(*) from `messages` M where M.kind=1 and M.touser=?');
        $q->bind_param('i', $curuserid);
        $q->bind_result($tmp2);
        if (!$q->execute()) {
            fail(_error_mysql_query_error_code);
        }
        // auto-close query
        $q->fetch();
        // always one row
        $messagecount = $tmp2 - $tmp1;
        $q->close();
    }
    // конец запроса количества уведомлений
    if ($authorized == 1) {
        ?>
<form name="frmLogout" action="logout.php" method="post" style="text-align:right;">
    <?php 
        userlink($curnickname, $curuserid);
        ?>
    &nbsp;&nbsp;::<a href="javascript:void(0);" onclick="document.frmLogout.submit();">выйти</a>
</form>
<?php 
    } else {
        ?>
<form name="frmLogin" action="login.php" method="post" style="text-align:right;">
    <span style="float:left;width:40px;text-align:left;">login</span>&nbsp;<input type="text" name="login" maxlength="50" /><br /><br />
    <span style="float:left;width:40px;text-align:left;">пароль</span>&nbsp;<input type="password" name="password" maxlength="20" /><br /><br />
    ::<input type="submit" id="btnsubmit" class="submit" name="btnsubmit" value="войти" />
    <?php 
        if (_permission_allow_register_new_user || $is_admin == 1) {
            // если разрешено показывать регистрацию или мы в админском режиме - показываем
            ?>
          
    &nbsp;::<a href="./register.php">регистрация</a>
    <?php 
        }
        //конец проверки возможности показа регистрации
        ?>
</form>
<?php 
    }
}
コード例 #19
0
ファイル: forum.php プロジェクト: Treeki/historical-tboard
function showthreads($threadquery, $alternating)
{
    global $postspp, $s, $lastread, $theme;
    while ($thread = dbrow($threadquery)) {
        $thread[name] = htmlspecialchars($thread[name]);
        $thread[desc] = htmlspecialchars($thread[desc]);
        $alternating = !$alternating;
        if ($alternating) {
            print "<tr class='rowalt'>";
        } else {
            print "<tr>";
        }
        $dot = '';
        if ($thread[checkpostedin]) {
            $dot = 'dot';
        }
        if ($s[logged_in] && $thread[lastpostdate] >= $lastread && $thread[thread] != $thread[id]) {
            if ($thread[locked] == 1) {
                $threadicon = "<img src='{$theme}images/icon_threadlockedunread.png' alt='This thread has unread posts, and is locked.' title='This thread has unread posts, and is locked.'>";
            } else {
                $threadicon = "<img src='{$theme}images/icon_threadunread{$dot}.png' alt='This thread has unread posts.' title='This thread has unread posts.'>";
            }
        } else {
            if ($thread[locked] == 1) {
                $threadicon = "<img src='{$theme}images/icon_threadlocked.png' alt='This thread has no unread posts, and is locked.' title='This thread has no unread posts, and is locked.'>";
            } else {
                $threadicon = "<img src='{$theme}images/icon_thread{$dot}.png' alt='This thread has no unread posts.' title='This thread has no unread posts.'>";
            }
        }
        $pages = '';
        if ($thread[replies] + 1 > $postspp) {
            $threadpagecount = ceil(($thread[replies] + 1) / $postspp);
            $pages .= ' <span class=\'pages\'>(pages: ';
            if ($threadpagecount > 6) {
                $dleft = 3;
                $dright = $threadpagecount - 2;
            } else {
                $dleft = 7;
                $dright = -1;
            }
            $docomma = false;
            for ($cp = 1; $cp <= $threadpagecount; $cp++) {
                if ($cp > $dleft && $cp < $dright) {
                    continue;
                }
                if ($docomma) {
                    $pages .= ', ';
                } else {
                    $docomma = true;
                }
                $pages .= "<a href='index.php?showthread={$thread['id']}&page={$cp}'>{$cp}</a>";
                if ($cp == $dleft) {
                    $pages .= "...";
                    $docomma = false;
                }
            }
            $pages .= ')</span>';
        }
        print "<td>{$threadicon}</td>";
        $threadcustomicon = '';
        if ($thread[icon]) {
            $threadcustomicon = "<img src='smilies/{$thread['icon']}' alt='Icon'>";
        }
        print "<td>{$threadcustomicon}</td>";
        print "<td style='text-align: left'><a href='index.php?showthread={$thread['id']}' style='font-size: 12px'>{$thread['name']}</a><br><div style='font-size: 11px; margin: 2px 0px 0px 2px'>{$thread['desc']}{$pages}</div></td>";
        $author = userlink($thread[authorid], htmlspecialchars($thread[authorname]), $thread[authorpower]);
        print "<td>{$author}</td>";
        print "<td>{$thread['replies']}</td>";
        print "<td style='font-size: 11px'>";
        $lastpostdate = parsedate($thread[lastpostdate]);
        print "{$lastpostdate}<br>";
        $lastposter = userlink($thread[lastposterid], htmlspecialchars($thread[lastpostername]), $thread[lastposterpower]);
        print "by {$lastposter}";
        print "</td>";
        print "</tr>";
    }
}
コード例 #20
0
ファイル: group.php プロジェクト: chaobj001/tt
													<div class="addadmins"><?php 
            echo $u->username;
            ?>
</div>
													<?php 
        }
        ?>
												</div>
												<div id="group_admins_list"></div>
											</td>
										</tr>
										<tr>
											<td></td>
											<td>
												<form method="post" name="admform" action="<?php 
        echo userlink($D->g->groupname);
        ?>
/tab:settings/subtab:privmembers">
													<input type="hidden" name="admins" value="" />
													<input type="submit" value="<?php 
        echo $this->lang('group_privmmb_f_btn');
        ?>
" style="padding:4px; font-weight:bold;" />
												</form>
											</td>
										</tr>
									</table>
								</div>
							</div>
						</div>
						<script type="text/javascript">
コード例 #21
0
ファイル: Skins.php プロジェクト: djqhuan/CSCMS-v4.0-UTF8
 public function cscms_skins($field, $str, $label, $row, $sorti = 1, $autoarr = array())
 {
     preg_match_all('/\\[' . $field . ':\\s*([0-9a-zA-Z\\_\\-]+)([\\s]*[link|ulink|dir|level|zd|len|style]*)[=]??([\\d0-9a-zA-Z\\,\\{\\}\\/\\-\\\\:\\s]*)\\]/', $str, $field_arr);
     if (!empty($field_arr)) {
         //判断是否嵌套二级
         preg_match('/{cscmstype:([\\S]+)\\s+(.*?)}([\\s\\S]+?){\\/cscmstype:\\1}/', $label, $type_arr);
         if (!empty($type_arr)) {
             $label = $this->cscms_sql_to($type_arr[1], $type_arr[2], $type_arr[0], $type_arr[3], $label, $row['id']);
         }
         unset($type_arr);
         for ($i = 0; $i < count($field_arr[0]); $i++) {
             $type = $field_arr[1][$i];
             if (array_key_exists($type, $row) && trim($field_arr[2][$i]) != 'zd') {
                 if ($type == 'addtime') {
                     $label = str_replace('[' . $field . ':' . $type . ']', date('Y-m-d H:i:s', $row[$type]), $label);
                 } else {
                     $label = str_replace('[' . $field . ':' . $type . ']', $row[$type], $label);
                 }
                 //判断自定义标签
                 if (!empty($field_arr[2][$i]) && !empty($field_arr[3][$i])) {
                     //格式化时间
                     if (trim($field_arr[2][$i]) == 'style' && trim($field_arr[3][$i]) == 'time') {
                         $label = str_replace($field_arr[0][$i], datetime($row[$type]), $label);
                         //获取IP地区
                     } elseif (trim($field_arr[2][$i]) == 'style' && trim($field_arr[3][$i]) == 'city') {
                         $ci =& get_instance();
                         $ci->load->library('ip');
                         $label = str_replace($field_arr[0][$i], $ci->ip->address($row[$type]), $label);
                         //自定义时间
                     } elseif (trim($field_arr[2][$i]) == 'style') {
                         $label = str_replace($field_arr[0][$i], date(str_replace('f', 'i', $field_arr[3][$i]), $row[$type]), $label);
                         //图片地址
                     } elseif (trim($field_arr[2][$i]) == 'dir') {
                         $lall = explode(",", $field_arr[3][$i]);
                         $lass = count($lall) > 1 ? $lall[1] : '';
                         $pic = piclink($lall[0], $row[$type], $lass);
                         $label = str_replace($field_arr[0][$i], $pic, $label);
                     }
                     //字符截取
                     if (trim($field_arr[2][$i]) == 'len') {
                         $label = str_replace($field_arr[0][$i], sub_str(str_checkhtml($row[$type]), $field_arr[3][$i]), $label);
                     }
                 }
             } else {
                 //外部字段
                 switch ($type) {
                     //序
                     case 'i':
                         $label = str_replace($field_arr[0][$i], $sorti, $label);
                         break;
                         //序
                     //序
                     case 'addres':
                         if (trim($field_arr[2][$i]) == 'zd' && !empty($field_arr[3][$i]) && array_key_exists($field_arr[3][$i], $row)) {
                             $zd = $field_arr[3][$i];
                             $ci =& get_instance();
                             $ci->load->library('ip');
                             $label = str_replace($field_arr[0][$i], $ci->ip->address($row[$zd]), $label);
                         }
                         break;
                         //数据统计
                     //数据统计
                     case 'count':
                         if (trim($field_arr[2][$i]) == 'zdy' && !empty($field_arr[3][$i])) {
                             $count = 0;
                             $arr = explode(',', $field_arr[3][$i]);
                             $table = $arr[0];
                             $czd = empty($arr[1]) ? 'id' : $arr[1];
                             $szd = empty($arr[2]) ? 'id' : $arr[2];
                             if (array_key_exists($szd, $row)) {
                                 $ci =& get_instance();
                                 if (!isset($ci->db)) {
                                     $ci->load->database();
                                 }
                                 $uid = !empty($row[$szd]) ? $row[$szd] : (!empty($row['uid']) ? $row['uid'] : 0);
                                 if (!empty($table) && $ci->db->table_exists(CS_SqlPrefix . $table) && $ci->db->field_exists($czd, CS_SqlPrefix . $table)) {
                                     if (!empty($arr[3]) && (!empty($arr[4]) || (int) $arr[4] == 0)) {
                                         if ($ci->db->field_exists($arr[3], CS_SqlPrefix . $table)) {
                                             $count = $ci->db->query("SELECT id FROM " . CS_SqlPrefix . $table . " where " . $czd . "='" . $uid . "' and " . $arr[3] . "='" . $arr[4] . "'")->num_rows();
                                         }
                                     } else {
                                         $count = $ci->db->query("SELECT id FROM " . CS_SqlPrefix . $table . " where " . $czd . "='" . $uid . "'")->num_rows();
                                     }
                                 }
                             }
                             $label = str_replace($field_arr[0][$i], $count, $label);
                         }
                         break;
                         //会员信息
                     //会员信息
                     case 'user':
                         if (($field == 'user' or array_key_exists('uid', $row) or array_key_exists('uidb', $row)) && trim($field_arr[2][$i]) == 'zd' && !empty($field_arr[3][$i])) {
                             $ci =& get_instance();
                             if (!isset($ci->db)) {
                                 $ci->load->database();
                             }
                             $ziduan = $field_arr[3][$i];
                             $zdneir = ($field == 'gbook' or $field == 'pl') ? '游客' : 'null';
                             if ($field == 'user') {
                                 $uid = $row['id'];
                             } else {
                                 $lall = explode(",", $ziduan);
                                 if (!empty($lall[1])) {
                                     $uid = !empty($lall[1]) ? $lall[1] : 0;
                                     $ziduan = $lall[1];
                                 } else {
                                     if (!empty($row['uid'])) {
                                         $uid = $row['uid'];
                                     } else {
                                         $uid = !empty($row['uidb']) ? $row['uidb'] : 0;
                                     }
                                 }
                             }
                             $czd = $ziduan == 'nichen' ? $ziduan . ',name' : $ziduan;
                             if ($ci->db->field_exists($ziduan, CS_SqlPrefix . 'user')) {
                                 $rowu = $ci->db->query("SELECT " . $czd . " FROM " . CS_SqlPrefix . "user where id='" . $uid . "'")->row();
                                 if ($rowu) {
                                     $zdneir = $field_arr[3][$i] == 'nichen' && empty($rowu->{$ziduan}) ? $rowu->name : $rowu->{$ziduan};
                                 }
                             }
                             if ($ziduan == 'logo') {
                                 if ($uid == 0) {
                                     $zdneir = '';
                                 }
                                 $zdneir = piclink('logo', $zdneir);
                             }
                             if ($ziduan == 'zid') {
                                 if ($zdneir == 0) {
                                     $zdneir = 1;
                                 }
                                 $zdneir = getzd('userzu', 'name', $zdneir);
                             }
                             if ($ziduan == 'qianm') {
                                 if (empty($zdneir)) {
                                     $zdneir = '暂时没有签名...';
                                 }
                             }
                             if ($ziduan == 'city') {
                                 if (empty($zdneir)) {
                                     $zdneir = '保密';
                                 }
                             }
                             $label = str_replace($field_arr[0][$i], $zdneir, $label);
                             //会员等级
                         } elseif (($field == 'user' or array_key_exists('uid', $row) or array_key_exists('uidb', $row)) && trim($field_arr[2][$i]) == 'level' && !empty($field_arr[3][$i])) {
                             $zdneir = '';
                             if ($field == 'user') {
                                 $uid = $row['id'];
                             } else {
                                 $uid = !empty($row['uid']) ? $row['uid'] : (!empty($row['uidb']) ? $row['uidb'] : 0);
                             }
                             $jinyan = getzd('user', 'jinyan', $uid);
                             if ($field_arr[3][$i] == '1') {
                                 //星星数
                                 $zdneir = getlevel($jinyan, 1);
                             }
                             if ($field_arr[3][$i] == '2') {
                                 //下个级别需要经验
                                 $zdneir = getlevel($jinyan, 2);
                             }
                             if ($field_arr[3][$i] == '3') {
                                 //下个级别剩余经验
                                 $zdneir = getlevel($jinyan, 3);
                             }
                             if ($field_arr[3][$i] == '4') {
                                 //剩余百分比
                                 $zdneir = getlevel($jinyan, 4);
                             }
                             if ($field_arr[3][$i] == '5') {
                                 //名称
                                 $zdneir = getlevel($jinyan, 5);
                             }
                             $label = str_replace($field_arr[0][$i], $zdneir, $label);
                         }
                         break;
                         //歌手信息
                     //歌手信息
                     case 'singer':
                         if (array_key_exists('singerid', $row) && trim($field_arr[2][$i]) == 'zd' && !empty($field_arr[3][$i])) {
                             $ci =& get_instance();
                             if (!isset($ci->db)) {
                                 $ci->load->database();
                             }
                             $zdneir = 'null';
                             if ($ci->db->table_exists(CS_SqlPrefix . 'singer')) {
                                 //歌手表存在
                                 $ziduan = $field_arr[3][$i];
                                 if ($ci->db->field_exists($ziduan, CS_SqlPrefix . 'singer')) {
                                     $rows = $ci->db->query("SELECT " . $ziduan . " FROM " . CS_SqlPrefix . "singer where id='" . $row['singerid'] . "'")->row();
                                     if ($rows) {
                                         $zdneir = $rows->{$ziduan};
                                     }
                                 }
                                 if ($ziduan == 'pic') {
                                     if ($row['singerid'] == 0) {
                                         $zdneir = '';
                                     }
                                     $zdneir = piclink('singer', $zdneir);
                                 }
                             }
                             $label = str_replace($field_arr[0][$i], $zdneir, $label);
                         }
                         break;
                         //版块链接
                     //版块链接
                     case 'murl':
                         if (array_key_exists('dir', $row)) {
                             $link = cscmslink($row['dir']);
                             $label = str_replace($field_arr[0][$i], $link, $label);
                         }
                         break;
                         //网站链接
                     //网站链接
                     case 'url':
                         //全局
                         if (array_key_exists('id', $row) && trim($field_arr[2][$i]) == 'link' && !empty($field_arr[3][$i])) {
                             $lall = explode(",", $field_arr[3][$i]);
                             $lass = count($lall) > 1 ? $lall[1] : '';
                             $link = linkurl($lall[0], $lass, $row['id']);
                             $label = str_replace($field_arr[0][$i], $link, $label);
                         }
                         //会员
                         if ((array_key_exists('uid', $row) || array_key_exists('uidb', $row) || $field == 'user') && trim($field_arr[2][$i]) == 'ulink' && !empty($field_arr[3][$i])) {
                             $ci =& get_instance();
                             if (!isset($ci->db)) {
                                 $ci->load->database();
                             }
                             $link = '';
                             if ($field == 'user') {
                                 if (array_key_exists('id', $row) && array_key_exists('name', $row)) {
                                     $lall = explode(",", $field_arr[3][$i]);
                                     $lass = count($lall) > 1 ? $lall[1] : '';
                                     $link = userlink($lall[0], $row['id'], $row['name'], $lass);
                                 }
                             } else {
                                 $uid = !empty($row['uid']) ? $row['uid'] : (!empty($row['uidb']) ? $row['uidb'] : 0);
                                 $rowu = $ci->db->query("SELECT id,name FROM " . CS_SqlPrefix . "user where id='" . $uid . "'")->row();
                                 if (!$rowu) {
                                     $link = 'http://' . Web_Url . Web_Path;
                                 } else {
                                     $lall = explode(",", $field_arr[3][$i]);
                                     $lass = count($lall) > 1 ? $lall[1] : '';
                                     $link = userlink($lall[0], $rowu->id, $rowu->name, $lass);
                                 }
                             }
                             $label = str_replace($field_arr[0][$i], $link, $label);
                         }
                         //会员中心...
                         if (trim($field_arr[2][$i]) == 'userlink' && !empty($field_arr[3][$i])) {
                             $link = spacelink($field_arr[3][$i]);
                             $label = str_replace($field_arr[0][$i], $link, $label);
                         }
                         //自定义URL,板块,字段,参数,参数...
                         if (trim($field_arr[2][$i]) == 'zdy' && !empty($field_arr[3][$i])) {
                             $lall = explode(",", $field_arr[3][$i]);
                             if (!array_key_exists($lall[1], $row) || $row[$lall[1]] == 0) {
                                 $link = 'http://' . Web_Url . Web_Path;
                             } else {
                                 $lass = count($lall) > 3 ? $lall[3] : '';
                                 $link = linkurl($lall[2], $lass, $row[$lall[1]], 1, $lall[0]);
                             }
                             $label = str_replace($field_arr[0][$i], $link, $label);
                         }
                         break;
                 }
             }
         }
     }
     unset($field_arr);
     return $label;
 }
コード例 #22
0
ファイル: layout.php プロジェクト: Treeki/historical-tboard
        }
        print userlink($row[userid], htmlspecialchars($row[username]), $row[powerlevel]);
    }
}
$bddate = date('d-m-%');
$getpeople = dbquery("SELECT userid,username,powerlevel FROM users WHERE birthday LIKE '{$bddate}'");
if (dbrows($getpeople) != 0) {
    print " &middot; <b>Today's Birthdays:</b> ";
    $comma = false;
    while ($row = dbrow($getpeople)) {
        if ($comma) {
            print ', ';
        } else {
            $comma = true;
        }
        print userlink($row[userid], htmlspecialchars($row[username]), $row[powerlevel]);
    }
}
?>
    </div>
    <?php 
echo $page;
?>
    <div style='font-style: italic; color: #555; margin: 4px 0px; border-top: 1px solid #aad6ff; padding-top: 4px; text-align: right;'>perpetually unfinished, totally custom board software - &copy; 2009-2010 Treeki</div>
    <!-- random debug info: render time: <?php 
echo gettimeofday(true) - $start_time;
?>
 - mysql query count: <?php 
echo $query_count;
?>
 -->
コード例 #23
0
ファイル: dashboard.php プロジェクト: chaobj001/tt
}
?>
						
						<?php 
if (count($D->last_online) > 0) {
    ?>
						<div class="ttl" style="margin-top:0px; margin-bottom:8px;"><div class="ttl2"><h3><?php 
    echo $this->lang('dbrd_right_lastonline');
    ?>
</h3></div></div>
						<div class="slimusergroup" style="margin-right:-10px; margin-bottom:5px;">
							<?php 
    foreach ($D->last_online as $u) {
        ?>
							<a href="<?php 
        echo userlink($u['username']);
        ?>
" class="slimuser" title="<?php 
        echo htmlspecialchars($u['username']);
        ?>
"><img src="<?php 
        echo $C->IMG_URL;
        ?>
avatars/thumbs1/<?php 
        echo $u['avatar'];
        ?>
" alt="" style="padding:3px;" /></a>
							<?php 
    }
    ?>
						</div>
コード例 #24
0
ファイル: single_post.php プロジェクト: chaobj001/tt
            echo $c->comment_id;
            ?>
">
							<a href="<?php 
            echo userlink($c->comment_user->username);
            ?>
" class="commentavatar" title="<?php 
            echo htmlspecialchars($c->comment_user->fullname);
            ?>
"><img src="<?php 
            echo $C->IMG_URL . 'avatars/thumbs3/' . $c->comment_user->avatar;
            ?>
" alt="" /></a>
							<div class="comment_right" style="width: 600px;">
								<a href="<?php 
            echo userlink($c->comment_user->username);
            ?>
" class="commentname" title="<?php 
            echo htmlspecialchars($c->comment_user->fullname);
            ?>
"><?php 
            echo $c->comment_user->username;
            ?>
</a>
								<p><?php 
            echo nl2br($c->parse_text());
            ?>
</p>
								<?php 
            echo post::parse_date($c->comment_date);
            ?>
コード例 #25
0
ファイル: home.php プロジェクト: chaobj001/tt
							<div id="loginftr"></div>
						</div>
						
						<?php 
if (count($D->last_online) > 0) {
    ?>
						<div class="ttl" style="margin-top:0px; margin-bottom:8px;"><div class="ttl2"><h3><?php 
    echo $this->lang('dbrd_right_lastonline');
    ?>
</h3></div></div>
						<div class="slimusergroup" style="margin-right:-10px; margin-bottom:5px;">
							<?php 
    foreach ($D->last_online as $u) {
        ?>
							<a href="<?php 
        echo userlink($u->username);
        ?>
" class="slimuser" title="<?php 
        echo htmlspecialchars($u->username);
        ?>
"><img src="<?php 
        echo $C->IMG_URL;
        ?>
avatars/thumbs1/<?php 
        echo $u->avatar;
        ?>
" alt="" style="padding:3px;" /></a>
							<?php 
    }
    ?>
						</div>
コード例 #26
0
ファイル: ajax.php プロジェクト: djqhuan/CSCMS-v4.0-UTF8
 public function blog()
 {
     $callback = $this->input->get('callback', true);
     $neir = $this->input->get_post('neir', TRUE, TRUE);
     //内容
     if (!$this->CsdjUser->User_Login(1)) {
         //未登陆
         $err = 1000;
     } elseif (empty($neir)) {
         $err = 1001;
         //内容为空
     } elseif (strlen($neir) > 280) {
         $err = 1002;
         //内容过长
     } elseif (isset($_SESSION['blogtime']) && time() < $_SESSION['blogtime'] + 60) {
         $err = 1003;
         //时间太短
     } else {
         $add['uid'] = $_SESSION['cscms__id'];
         $add['neir'] = facehtml($neir);
         $add['addtime'] = time();
         $ids = $this->CsdjDB->get_insert('blog', $add);
         if ($ids) {
             //发表动态
             $dt['dir'] = 'blog';
             $dt['uid'] = $_SESSION['cscms__id'];
             $dt['did'] = $ids;
             $dt['title'] = L('ajax_07');
             $dt['name'] = facehtml($neir);
             $dt['link'] = userlink('blog', $_SESSION['cscms__id'], $_SESSION['cscms__name'], $ids);
             $dt['addtime'] = time();
             $this->CsdjDB->get_insert('dt', $dt);
             $_SESSION['blogtime'] = time();
             $err = 1004;
         } else {
             $err = 1005;
         }
     }
     echo $callback . "({error:" . $err . "})";
 }
コード例 #27
0
function homepage($sqlstr, $nums, $pagesize, $pagenum, $op, $uid, $user, $id = 0, $pages = 1)
{
    $znums = $nums;
    if ($nums == 0) {
        $nums = 1;
    }
    $pagejs = ceil($nums / $pagesize);
    //总页数
    if ($pages == 0) {
        $pages = 1;
    }
    if ($pages > $pagejs) {
        $pages = $pagejs;
    }
    $sqlstr .= " LIMIT " . $pagesize * ($pages - 1) . "," . $pagesize;
    $str = "";
    $first = userlink($op, $uid, $user, $id, 1);
    if ($pages == 1) {
        $pageup = userlink($op, $uid, $user, $id, 1);
    } else {
        $pageup = userlink($op, $uid, $user, $id, $pages - 1);
    }
    if ($pagejs > $pages) {
        $pagenext = userlink($op, $uid, $user, $id, $pages + 1);
    } else {
        $pagenext = userlink($op, $uid, $user, $id, $pagejs);
    }
    $last = userlink($op, $uid, $user, $id, $pagejs);
    $pagelist = "<select  onchange=javascript:window.location=this.options[this.selectedIndex].value;>\r\n<option value='0'>跳转</option>\r\n";
    for ($k = 1; $k <= $pagejs; $k++) {
        $pagelist .= "<option value='" . userlink($op, $uid, $user, $id, $k) . "'>第" . $k . "页</option>\r\n";
    }
    $pagelist .= "</select>";
    if ($pagejs <= $pagenum) {
        for ($i = 1; $i <= $pagejs; $i++) {
            if ($i == $pages) {
                $str .= "<a href='" . userlink($op, $uid, $user, $id, $i) . "' class='on'>" . $i . "</a>";
            } else {
                $str .= "<a href='" . userlink($op, $uid, $user, $id, $i) . "'>" . $i . "</a>";
            }
        }
    } else {
        if ($pages >= $pagenum) {
            for ($i = $pages - intval($pagenum / 2); $i <= $pages + intval($pagenum / 2); $i++) {
                if ($i <= $pagejs) {
                    if ($i == $pages) {
                        $str .= "<a href='" . userlink($op, $uid, $user, $id, $i) . "' class='on'>" . $i . "</a>";
                    } else {
                        $str .= "<a href='" . userlink($op, $uid, $user, $id, $i) . "'>" . $i . "</a>";
                    }
                }
            }
            if ($i <= $pagejs) {
                $str .= "<a href='" . userlink($op, $uid, $user, $id, $pagejs) . "'>" . $pagejs . "</a>";
            }
        } else {
            for ($i = 1; $i <= $pagenum; $i++) {
                if ($i == $pages) {
                    $str .= "<a href='" . userlink($op, $uid, $user, $id, $i) . "' class='on'>" . $i . "</a>";
                } else {
                    $str .= "<a href='" . userlink($op, $uid, $user, $id, $i) . "'>" . $i . "</a>";
                }
            }
            if ($i <= $pagejs) {
                $str .= "<a href='" . userlink($op, $uid, $user, $id, $pagejs) . "'>" . $pagejs . "</a>";
            }
        }
    }
    $arr = array($sqlstr, $first, $last, $pageup, $pagenext, $pages, $pagejs, $pagesize, $str, $pagelist, $znums);
    return $arr;
}
コード例 #28
0
ファイル: leaders.php プロジェクト: chaobj001/tt
        ?>
			
			<?php 
        if (count($D->get_mostfollowed_groups) > 0) {
            $place = 0;
            ?>
			<div class="ttl" style="margin-top:10px; margin-bottom:10px;"><div class="ttl2"><h3><?php 
            echo $this->lang('competitions_group_competition2');
            ?>
</h3></div></div>
			<div class="slimusergroup" style="margin-right:-10px; margin-bottom:5px;">
				<?php 
            foreach ($D->get_mostfollowed_groups as $gid => $dtls) {
                ?>
					<a href="<?php 
                echo userlink($dtls[0]);
                ?>
" class="slimuser" title="<?php 
                echo htmlspecialchars($dtls[0]);
                ?>
">
						<div class="leaders_icon" style="background: url('<?php 
                echo $C->IMG_URL;
                ?>
avatars/thumbs1/<?php 
                echo $dtls[1];
                ?>
') no-repeat;">
							<p>
								<?php 
                echo ++$place;
コード例 #29
0
ファイル: single_user.php プロジェクト: essa/sharetronix_ja
									<a href="<?php 
echo userlink($D->u->username);
?>
" class="groupavatar" title="<?php 
echo htmlspecialchars($D->u->fullname);
?>
"><img src="<?php 
echo $C->IMG_URL;
?>
avatars/thumbs1/<?php 
echo $D->u->avatar;
?>
" style="width:50px; height:50px;" /></a>
									<div class="groupinfo">
										<a href="<?php 
echo userlink($D->u->username);
?>
" class="groupname" title="<?php 
echo htmlspecialchars($D->u->fullname);
?>
"><?php 
echo str_cut($D->u->username, 18);
?>
</a>
										<div class="followbtnsbox">
										<?php 
if (!$this->user->is_logged) {
    ?>
										<?php 
} elseif ($D->u->id != $this->user->id && !$this->user->if_follow_user($D->u->id)) {
    ?>
コード例 #30
0
ファイル: stuff.php プロジェクト: bearf/xicl-web-interface
function stuff($content_tile_name = null)
{
    global $data;
    global $authorized;
    global $curuserid;
    global $curnickname;
    global $is_admin;
    global $teaminvited;
    global $teamordersent;
    ?>
    <span style="float:right">12+</span>
    <?php 
    if ('нет контеста' == _data('contestname') || 'contest' == get_site_branch($content_tile_name)) {
        ?>
        &nbsp;&nbsp;::<a href="./contest.php" title="сменить текущий контест"><?php 
        echo _data('contestname');
        ?>
</a>
    <?php 
    } else {
        ?>
        &nbsp;&nbsp;::<a href="./problemset.php" title="задачи текущего контеста"><?php 
        echo _data('contestname');
        ?>
</a>
    <?php 
    }
    ?>
    <?php 
    echo _has('timeleft') ? ' - ' . _data('timeleft') : '';
    ?>
    <?php 
    if (1 == $authorized) {
        ?>
        &nbsp;&nbsp;::<?php 
        userlink($curnickname, $curuserid);
        ?>
        &nbsp;&nbsp;::<a href="./notifylist.php">уведомления</a><?php 
        echo 0 < _data('notifycount') ? '(' . _data('notifycount') . ')' : '';
        ?>
        <?php 
        if (_settings_show_tournament_menu) {
            ?>
            &nbsp;&nbsp;::<a href="./team/update/">команда</a>
        <?php 
        }
        ?>
        &nbsp;&nbsp;::<a href="./logout.php">выйти</a>
    <?php 
    } else {
        ?>
 
        &nbsp;&nbsp;::<a href="./login.php?firstattempt=true">вход</a>
        <?php 
        if (_permission_allow_register_new_user || $is_admin == 1) {
            // если разрешено показывать регистрацию или мы в админском режиме - показываем
            ?>
          
            &nbsp;&nbsp;::<a href="./register.php">регистрация</a>
        <?php 
        }
        ?>
    <?php 
    }
}