本文整理汇总了PHP中DAOFactory::getComentarioDAO方法的典型用法代码示例。如果您正苦于以下问题:PHP DAOFactory::getComentarioDAO方法的具体用法?PHP DAOFactory::getComentarioDAO怎么用?PHP DAOFactory::getComentarioDAO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAOFactory
的用法示例。
在下文中一共展示了DAOFactory::getComentarioDAO方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formataData
"><?php
echo $valor->titulo;
?>
</a></h3>
<p><?php
echo $valor->texto;
?>
</p>
<div class="commentbox">Postado por <?php
echo $valor->emailUsuario;
?>
| <?php
echo formataData($valor->data);
?>
| <?php
echo DAOFactory::getComentarioDAO()->getCountComentariosByIdPost($valor->idPost);
?>
comentarios <br> Categoria : <?php
echo $valor->nomeCategoria;
?>
</div><br clear="left" />
<?php
}
?>
</div>
</div>
示例2: foreach
<div id="wrapper">
<?php
require '../includes/menu.php';
?>
<div id="content-wrapper">
<div id="content">
<table style="width:auto">
<?php
foreach ($post as $key => $value) {
//Comentario > lista>
$comentario = DAOFactory::getComentarioDAO()->getComentariosByIdPost($value->idPost);
if (!empty($comentario)) {
?>
<tr><td><h4><a href="post.php?id_post=<?php
echo $value->idPost;
?>
"> <?php
echo $value->titulo;
?>
</a></h4></tr></td>
<?php
foreach ($comentario as $chave => $valor) {
?>
<tr>
示例3: session_start
<?php
require_once '..\\config.php';
session_start();
$id = $_POST['id_post'];
$texto = $_POST['texto'];
$nome = $_POST['nome'];
$site = $_POST['site'];
$email = $_POST['email'];
$comet = new Comentario();
$comet->idPost = $id;
$comet->texto = $texto;
if ($nome != "") {
$comet->nome = $nome;
} else {
$comet->nome = "Anônimo";
}
$comet->email = $email;
$comet->site = $site;
DAOFactory::getComentarioDAO()->insert($comet);
header('location:' . $_SERVER['HTTP_REFERER']);
示例4: session_start
// Helpers
require 'helpers/formataData.php';
// Sess�o Login
session_start();
// Head
require 'includes/head.php';
// Post
// Parametros
$id_post = $_GET['id_post'];
// Lista
$post = DAOFactory::getPostDAO()->getPosts(null, $id_post);
// Comentarios
// Lista
$comentario = DAOFactory::getComentarioDAO()->getComentariosByIdPost($id_post);
// Quantidade (Count)
$totalComentarios = DAOFactory::getComentarioDAO()->getCountComentariosByIdPost($id_post);
// Categoria > Lista
$categoria = DAOFactory::getCategoriaDAO()->queryAllOrderBy('nome');
?>
<body>
<div id="container">
<?php
require 'includes/topo.php';
?>
<div id="wrapper">
示例5:
<?php
require_once '..\\config.php';
$id_comentario = $_GET['id_comentario'];
$id_post = $_GET['id_post'];
DAOFactory::getComentarioDAO()->delete($id_comentario, $id_post);
header('location: ../admin/comentario.php');