function draw($bottom = false) { global $page; $count = count($this->rows); if (!$this->title) { $this->title = $page['breadcrumbs'] . $page['title']; } $return = draw_div_class('title', format_string($this->title, 40) . draw_nav($this->controls)); $counter = 1; foreach ($this->rows as $label => $content) { $class = 'row'; if ($counter == 1) { $class .= ' first'; } if ($counter == $count) { $class .= ' last'; } $return .= draw_div_class($class, draw_div_class('label', $label) . draw_div_class('content', $content)); $counter++; } if ($bottom) { $return .= draw_div_class('bottom', $bottom); } if (!empty($this->class)) { $this->class = ' ' . $this->class; } return draw_div_class('display' . $this->class, $return); }
<?php include '../../include.php'; echo drawTop(); $f = new form('translate', false, $page['title']); $f->set_field(array('type' => 'textarea', 'name' => 'text_to_translate', 'class' => 'tinymce', 'label' => 'English text', 'value' => @$_POST['text_to_translate'])); $f->set_title_prefix($page['breadcrumbs']); echo $f->draw(); if ($posting) { echo draw_div_class('message', language_translate(@$_POST['text_to_translate'], 'en', 'es')); echo draw_div_class('message', language_translate(@$_POST['text_to_translate'], 'en', 'fr')); echo draw_div_class('message', language_translate(@$_POST['text_to_translate'], 'en', 'ru')); } echo drawBottom();
function drawTicketFilter() { global $total, $default, $pageName, $_GET; $target = isset($_GET["id"]) ? $pageName . "?id=" . $_GET["id"] : $pageName . "?"; return draw_javascript(' function goToMonth(str) { if (str == "") { location.href=\'' . $target . '\'; } else { arr = str.split("/"); location.href=\'' . $target . '&month=\' + arr[0] + \'&year=\' + arr[1]; } return true; } ') . draw_div_class('message', 'Filter by month: ' . draw_form_select_month("month", $total["month"] . "/" . $total["year"], $default, false, "sleek", "goToMonth(this.value)", true)); return $return; }
<?php include '../include.php'; echo drawTop(); $clips = db_query('SELECT c.id, c.title, c.url, c.publication, c.pub_date, c.description, t.title type FROM press_clips c JOIN press_clips_types t ON c.type_id = t.id WHERE c.is_active = 1 AND ' . db_datediff('c.pub_date') . ' < 7 ORDER BY t.precedence, c.pub_date'); $return = ''; $lastType = ''; while ($c = db_fetch($clips)) { if ($lastType != $c['type']) { $return .= '<div style="font-size:18px;margin-top:24px;">' . $c['type'] . ':</div>'; $lastType = $c['type']; } $return .= draw_link($c['url'], $c['title'], false, array('style' => 'font-size:14px;')) . '<br>' . $c['publication'] . '<br>' . format_date($c['pub_date'], ' ', 'M d, Y', false) . $c['description']; } echo draw_div_class('press_export', $return); echo '<textarea class="press_export">' . htmlentities($return, ENT_QUOTES, 'UTF-8') . '</textarea>'; echo drawBottom();
<?php $corners = array('top-left', 'top-right', 'bottom-left', 'bottom-right'); foreach ($corners as $c) { echo draw_div_class($c, draw_img('/images/corners-white/' . $c . '.png')); } echo draw_img(DIRECTORY_WRITE . "/login.png"); $f = new form('login', false, getString('submit')); $f->set_field(array('name' => 'email', 'type' => 'text', 'label' => getString('email'), 'value' => @$_COOKIE["last_email"])); $f->set_field(array('name' => 'password', 'type' => 'password', 'label' => getString('password'))); $f->set_field(array('name' => 'goto', 'type' => 'hidden', 'value' => @$_GET["goto"])); $f->set_focus(@$_COOKIE["last_email"] ? 'password' : 'email'); echo $f->draw(); ?> </div> <div id="grey"> <?php foreach ($corners as $c) { echo draw_div_class($c, draw_img('/images/corners-grey/' . $c . '.png')); } echo getString("app_welcome"); echo draw_nav(array('/login/password_reset.php' => getString("login_forgot_password"), '/login/account_request.php' => getString("login_need_account"), 'mailto:' . $_josh['email_default'] => getString("login_ask_question"))); ?> </div> <?php if (getOption('languages')) { echo draw_div('language', draw_form_select('language_id', 'SELECT id, title FROM languages ORDER BY title', $_SESSION['language_id'], true, 'grey', 'url_query_set(\'language_id\', this.value)')); } ?> </div> </body> </html>
function bbDrawTopic($id, $email = false) { global $_josh, $page; if (!($r = db_grab('SELECT t.title' . langExt() . ' title, t.description' . langExt() . ' description, t.created_date, t.is_admin, t.type_id, y.title' . langExt() . ' type, u.id created_user, ISNULL(u.nickname, u.firstname) firstname, u.lastname, ' . db_updated('u') . ' FROM bb_topics t JOIN users u ON t.created_user = u.id LEFT JOIN bb_topics_types y ON t.type_id = y.id WHERE t.id = ' . $id))) { return false; } $return = ''; if ($r['is_admin'] == 1) { $return .= drawMessage(getString('topic_admin')); } $options = ($page['is_admin'] || user() == $r['created_user']) && !$email ? array('edit.php?id=' . $id => getString('edit'), 'javascript:checkDelete();' => getString('delete')) : false; //display topic thread $d = new display($page['breadcrumbs'] . $r['title'], false, $options, 'thread'); //if categories if (getOption('bb_types') && $r['type']) { $r['description'] .= draw_div_class('light', getString('category') . ': ' . draw_link('category.php?id=' . $r['type_id'], $r['type'])); } //channels if (getOption('channels') && ($channels = db_array('SELECT c.title' . langExt() . ' title FROM channels c JOIN bb_topics_to_channels t2c ON c.id = t2c.channel_id WHERE t2c.topic_id = ' . $id . ' ORDER BY title' . langExt()))) { $r['description'] .= draw_div_class('light', 'Networks: ' . implode(', ', $channels)); } $d->row(drawName($r['created_user'], $r['firstname'] . ' ' . $r['lastname'], $r['created_date'], true, BR, $r['updated']), '<h1>' . $r['title'] . '</h1>' . $r['description']); //append followups if ($r['is_admin']) { $return .= $d->draw(); } else { $followups = db_table('SELECT f.description' . langExt() . ' description, ISNULL(u.nickname, u.firstname) firstname, u.lastname, f.created_date, f.created_user, ' . db_updated('u') . ' FROM bb_followups f JOIN users u ON u.id = f.created_user WHERE f.is_active = 1 AND f.topic_id = ' . $id . ' ORDER BY f.created_date'); foreach ($followups as $f) { $d->row(drawName($f['created_user'], $f['firstname'] . ' ' . $f['lastname'], $f['created_date'], true, BR, $f['updated']), $f['description']); } $return .= $d->draw(); if (!$email) { //add a followup form $f = new form('bb_followups', false, getString('add_followup')); $f->unset_fields('topic_id'); langUnsetFields($f, 'description'); $return .= $f->draw(false, false); } } return $return; }