function GetDate($controlname) { $d = POST::GetInt($controlname . '_d'); $m = POST::GetInt($controlname . '_m'); $y = POST::GetInt($controlname . '_y'); return mktime(0, 0, 0, $m, $d, $y); }
static function GetDate($controlname) { $d = POST::GetInt($controlname . '_d'); $m = POST::GetInt($controlname . '_m'); $y = POST::GetInt($controlname . '_y'); //echo __LINE__.":'$d,$m,$y'"; return mktime(0, 0, 0, $m, $d, $y); }
public function create() { if (parent::auth()) { if ($_POST) { if (isset($_FILES['picture'])) { parent::uploadImage($_FILES['picture'], 'post'); } $_POST['slug'] = parent::createSlug($_POST['title']); $_POST['user_id'] = $_SESSION['id']; $post = new POST($_POST); $post->save(); parent::redirect('post/myposts'); } parent::render('post/create'); } else { parent::redirect('site/index'); } }
/** * Generates the hyperlinks for post tags. * This is mainly used by the view that displays a post. * @param Post the post instance * @return string the hyperlinks for the post tags */ public function getTagLinks($post) { $links = array(); $tags = POST::getTagArray($post); foreach ($tags as $tag) { $links[] = CHtml::link($tag, array('/', 'tag' => $tag)); } return implode(', ', $links); }
update_activity('dashboard'); Output::Assign('sidebar', $sidebar); Output::$tpl->display('dashhead.tpl.php'); $page_title = $User->Level . ' Dashboard'; // Get our user's settings from the database. // Done by User class now if ($_POST['form_sent']) { $name = POST::GetEString('memorable_name', true); $pass = POST::GetEString('memorable_password', true); $pass2 = POST::GetEString('memorable_password2', true); $email = POST::GetEString('email', true); $theme = POST::GetEString('theme', true, 'atbbs'); $flag_topics = POST::GetInt('topics_mode') == 1; $flag_ostrich = POST::GetInt('ostrich_mode') == 1; $flag_spoiler = POST::GetInt('spoiler_mode') == 1; $snippet_len = POST::GetInt('snippet_length'); // Make some specific validations ... if (!empty($_POST['form']['memorable_name']) && $_POST['form']['memorable_name'] != $user_config['memorable_name']) { // Check if the name is already being used. $res = DB::Execute('SELECT 1 FROM {P}UserSettings WHERE LOWER(usrName) = LOWER(' . DB::Q($_POST['form']['memorable_name']) . ')'); if ($res->RecordCount() > 0) { add_error('The memorable name "' . htmlspecialchars($_POST['memorable_name']) . '" is already being used.'); } } if ($pass != $pass2) { add_error(' Both password fields must match.'); } if (!array_key_exists($theme, getAvailableThemes())) { Output::HardError($theme . ' isn\'t a valid theme.'); } if (!$erred) {
<div class="well" style="max-width: 340px; padding: 8px 0;"> <li class="nav-header"><?php echo CHtml::encode($this->title); ?> </li> <?php $recentPosts = POST::model()->findAll(array('order' => 'update_time DESC', 'limit' => 5)); foreach ($recentPosts as $post) { $itemRecentPosts[] = array('label' => CHtml::encode($post->title), 'icon' => 'th-list', 'url' => $post->getUrl()); } $this->widget('bootstrap.widgets.TbMenu', array('type' => 'list', 'items' => $itemRecentPosts)); ?> </div>
include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/erreur.class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/user.class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/profil.class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/img.class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/friends.class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/posts.class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/like.class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/comment.class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/messagerie.class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/classe.class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/app/class/fichier.class.php'; $user = new USER($DB_con); $profil = new PROFIL($DB_con); $img = new IMG($DB_con); $amis = new AMIS($DB_con); $post = new POST($DB_con); $like = new LIKE($DB_con); $comment = new COMMENT($DB_con); $message = new MESSAGE($DB_con); $classe = new CLASSE($DB_con); $fichier = new FICHIER($DB_con); /* Publication d'une image avec un post */ if (isset($_POST['post']) && isset($_POST['conf'])) { $post_content = htmlspecialchars($_POST['post']); $post_content = nl2br($post_content); $conf = htmlspecialchars($_POST['conf']); if ($conf == "friends") { $conf = "0"; } else { if ($conf == "public") { $conf = "1";
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ require 'includes/header.php'; if (!$administrator) { add_error('You are not wise enough.', true); } $page_data = array(); Output::Assign('sidebar', $sidebar); Output::$tpl->display('dashhead.tpl.php'); if ($_POST['form_sent']) { $page_data['url'] = POST::GetEString('url'); $page_data['page_title'] = POST::GetEString('title'); $page_data['content'] = POST::GetEString('content'); } if ($_GET['edit']) { if (!ctype_digit($_GET['edit'])) { add_error('Invalid page ID.', true); } $res = DB::Execute('SELECT url, page_title, content FROM {P}Pages WHERE id = ' . $_GET['edit']); if ($res->RecordCount() < 1) { $page_title = 'Non-existent page'; add_error('There is no page with that ID.', true); } if (!$_POST['form_sent']) { $page_data = $res->fields; } $editing = true; $page_title = 'Editing page: <a href="/' . $page_data['url'] . '">' . htmlspecialchars($page_data['page_title']) . '</a>';