function article() { $helper_obj = new Helper(); global $user, $base_path; ///$this->content = $this->menu; if ($helper_obj->user_is_logged_in() && $helper_obj->check_role(CLIENT_ROLE_ID)) { $article_obj = new Article(); // $validation_js_obj = new Validation_js(); // pr($_POST); //$this->content .= $validation_js_obj->add_video_validation(); $this->content = '<!-- Validation --> <script src="' . $base_path . 'js/plugins/validation/jquery.validate.min.js"></script> <script src="' . $base_path . 'js/plugins/validation/additional-methods.min.js"></script>'; $this->content .= $article_obj->build_add_article_form(); $this->content .= $article_obj->get_all_articles($user['cid']); } }
<?php require_once 'init/config.php'; $articles = Article::get_all_articles(); ?> <a href="new_article.php">[New Article]</a><hr> <?php foreach ($articles as $article) { ?> <h1><a href="article.php?id=<?php echo $article->get_id(); ?> "><?php echo $article->get_title(); ?> </a></h1> <small>Written by: <?php echo $article->get_author_name(); ?> </small> <h1><?php echo $article->get_id(); ?> </h1> <p><?php echo substr($article->get_content(), 0, 100); ?> ...<a href="article.php?id=<?php echo $article->get_id();