当前位置: 首页>>代码示例>>PHP>>正文


PHP delibera_get_situacao函数代码示例

本文整理汇总了PHP中delibera_get_situacao函数的典型用法代码示例。如果您正苦于以下问题:PHP delibera_get_situacao函数的具体用法?PHP delibera_get_situacao怎么用?PHP delibera_get_situacao使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了delibera_get_situacao函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delibera_novo_prazo

function delibera_novo_prazo($postID)
{
    $situacao = delibera_get_situacao($postID);
    $opts = delibera_get_config();
    switch ($situacao->slug) {
        case 'validacao':
            $inova_data = strtotime("+{$opts['dias_novo_prazo']} days");
            $nova_data = date("d/m/Y", $inova_data);
            $inova_datad = strtotime("+{$opts['dias_discussao']} days", $inova_data);
            $nova_datad = date("d/m/Y", $inova_datad);
            $inova_datavt = strtotime("+{$opts['dias_votacao']} days", $inova_datad);
            $nova_datavt = date("d/m/Y", $inova_datavt);
            $inova_datarel = strtotime("+{$opts['dias_votacao_relator']} days", $inova_datavt);
            $nova_datarel = date("d/m/Y", $inova_datarel);
            $inova_datar = strtotime("+{$opts['dias_relatoria']} days", $inova_datarel);
            $nova_datar = date("d/m/Y", $inova_datar);
            $events_meta['prazo_validacao'] = $opts['validacao'] == 'S' ? $nova_data : date('d/m/Y');
            $events_meta['prazo_discussao'] = $nova_datad;
            $events_meta['prazo_relatoria'] = $opts['relatoria'] == 'S' ? $nova_datar : date('d/m/Y');
            $events_meta['prazo_eleicao_relator'] = $opts['relatoria'] == 'S' && $opts['eleicao_relator'] == 'S' ? $nova_datarel : date('d/m/Y');
            $events_meta['prazo_votacao'] = $nova_datavt;
            foreach ($events_meta as $key => $value) {
                if (get_post_meta($postID, $key, true)) {
                    update_post_meta($postID, $key, $value);
                    // Atualiza
                } else {
                    add_post_meta($postID, $key, $value, true);
                    // Se não cria
                }
            }
            delibera_del_cron($postID);
            delibera_criar_agenda($postID, $nova_data, $nova_datad, $nova_datavt, $nova_datar, $nova_datarel);
            break;
        case 'discussao':
        case 'relatoria':
            $inova_data = strtotime("+{$opts['dias_novo_prazo']} days");
            delibera_set_novo_prazo_discussao_relatoria($postID, $inova_data, $opts);
            break;
        case 'emvotacao':
            $inova_data = strtotime("+{$opts['dias_novo_prazo']} days");
            $nova_data = date("d/m/Y", $inova_data);
            update_post_meta($postID, 'prazo_votacao', $nova_data);
            delibera_del_cron($postID);
            delibera_criar_agenda($postID, false, false, $nova_data);
            break;
    }
    //delibera_notificar_situacao($postID);
}
开发者ID:samueldu,项目名称:delibera,代码行数:48,代码来源:delibera.php

示例2: delibera_get_situacao

<?php

require_once ABSPATH . 'wp-admin/includes/screen.php';
global $delibera_comments_padrao;
$situacao = delibera_get_situacao($id);
if ($situacao->slug == 'comresolucao') {
    $title = __('Encaminhamentos propostos', 'delibera');
} else {
    if ($situacao->slug == 'validacao') {
        $title = '';
        $votes = delibera_get_comments_validacoes($post->ID);
        $approvals = (int) get_post_meta($post->ID, 'numero_validacoes', true);
        $rejections = (int) get_post_meta($post->ID, 'delibera_numero_comments_validacoes', true) - $approvals;
    } else {
        if ($situacao->slug == 'relatoria') {
            $title = __('Encaminhamentos propostos na discussão', 'delibera');
        } else {
            if ($situacao->slug == 'emvotacao') {
                $title = __('Usuários que já votaram', 'delibera');
            } else {
                $title = __('Discussão sobre a pauta', 'delibera');
            }
        }
    }
}
if (($situacao->slug == "validacao" || $situacao->slug == "emvotacao") && !$delibera_comments_padrao === true) {
    comment_form();
}
?>

<div class="actions">
开发者ID:kailIII,项目名称:pensandoodireito-tema,代码行数:31,代码来源:delibera_comments.php

示例3: query_posts

//Verifica se há alguma mudança no filtro de pautas por página
if (isset($_REQUEST['number-options'])) {
    // adiciona posts por página aos argumentos da query
    $wp_query->set('posts_per_page', $_REQUEST['number-options']);
}
//verifica se há algum 'filtro' do título da pauta
if (isset($_REQUEST['filter_pauta'])) {
    $wp_query->set('s', $_REQUEST['filter_pauta']);
}
// realiza a query
query_posts($wp_query->query_vars);
if (have_posts()) {
    while (have_posts()) {
        the_post();
        $temas = wp_get_post_terms($post->ID, 'tema');
        $situacao = delibera_get_situacao($post->ID);
        ?>

<div class="topic divider-bottom pb-md mt-md">
  <div class="clearfix mb-0">
    <p class="status pull-left fontsize-sm text-muted">
      <i class="fa fa-users"></i>
      <?php 
        echo $situacao->name;
        ?>
    </p>
    <p class="deadline pull-left ml-lg fontsize-sm text-muted">
      <i class="fa fa-calendar"></i>
      <?php 
        if (delibera_get_prazo($post->ID) == -1) {
            echo 'Prazo encerrado';
开发者ID:josafafilho,项目名称:marcocivil-tema,代码行数:31,代码来源:delibera-loop-archive.php

示例4: delibera_gerar_discordar

/**
 *
 * Gera código html para criação do botão discordar do sistema delibera
 *
 * @param $ID int post_ID ou comment_ID
 * @param $type string 'pauta' ou 'comment'
 */
function delibera_gerar_discordar($ID, $type = 'pauta')
{
    global $post;
    $situacoes_validas = array('validacao' => false, 'discussao' => true, 'emvotacao' => false);
    $ndiscordou = intval($type == 'pauta' || $type == 'post' ? get_post_meta($ID, 'delibera_numero_discordar', true) : get_comment_meta($ID, 'delibera_numero_discordar', true));
    $postID = 0;
    if (is_object($ID)) {
        if ($type == 'post' || $type == 'pauta') {
            $ID = $ID->ID;
            $postID = $ID;
        } else {
            $postID = $ID->comment_post_ID;
            $ID = $ID->comment_ID;
        }
    }
    $situacao = delibera_get_situacao($postID);
    if (delibera_current_user_can_participate()) {
        $user_id = get_current_user_id();
        $ip = $_SERVER['REMOTE_ADDR'];
        if (!delibera_ja_discordou($ID, $user_id, $ip, $type) && (is_object($situacao) && array_key_exists($situacao->slug, $situacoes_validas)) && $situacoes_validas[$situacao->slug] && !delibera_ja_curtiu($ID, $user_id, $ip, $type)) {
            $html = '';
            // $html .= (!$ndiscordou ? '<div class="delibera-unlike-count"></div>' : '');
            $html .= '<button class="btn btn-mini btn-danger delibera_unlike"><span class="delibera_unlike_text">' . __('Discordo', 'delibera') . '</span>';
            $html .= "<input type='hidden' name='object_id' value='{$ID}' />";
            $html .= "<input type='hidden' name='type' value='{$type}' />";
            $html .= '</button>';
            return $html;
        }
    }
}
开发者ID:kailIII,项目名称:pensandoodireito-tema,代码行数:37,代码来源:functions.php

示例5: delibera_get_comments_link

            echo delibera_get_comments_link();
            ?>
">
					<?php 
            _e('Discuta', 'delibera');
            comments_number('', ' (' . __('Um comentário', 'delibera') . ')', ' (' . __('% comentários', 'delibera') . ')');
            ?>
					</a>
				</span>
				<?php 
        }
        if ($show_situacao == 1) {
            ?>
				<span class="archive-situacao delibera-widget-archive-situacao">
					<?php 
            echo delibera_get_situacao($post->ID)->name;
            ?>
				</span>
				<?php 
        }
        ?>
			</div><!-- .entry-utility -->
			<?php 
    }
    ?>
		</div><!-- #post-## -->
	
	<?php 
}
?>
</div>
开发者ID:cabelotaina,项目名称:delibera,代码行数:31,代码来源:view.php

示例6: delibera_mailer_comment_type

/**
 * Detecta o tipo do comentário e set a variábel global $_POST
 */
function delibera_mailer_comment_type($text, $parent_comment)
{
    global $_POST;
    $_POST = array();
    $tipo = delibera_get_situacao($parent_comment->comment_post_ID);
    switch ($tipo) {
        case "validacao":
            $_POST['delibera_validacao'] = "S";
            break;
        case 'discussao':
        case 'encaminhamento':
            $_POST['delibera_encaminha'] = "S";
            $_POST['delibera-baseouseem'] = '';
            break;
        case 'voto':
            foreach ($_POST as $postkey => $postvar) {
                if (substr($postkey, 0, strlen('delibera_voto')) == 'delibera_voto') {
                    $votos[] = $postvar;
                }
            }
            break;
    }
}
开发者ID:cabelotaina,项目名称:delibera,代码行数:26,代码来源:delibera_mailer.php

示例7: get_header

<?php

get_header();
$situacao = delibera_get_situacao(get_the_ID());
?>

<div id="delibera" class="situacao-<?php 
echo $situacao->slug;
?>
">
    <div id="container">
    	<div id="content" role="main">
    		<?php 
get_delibera_header();
load_template(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'loop-pauta.php', true);
?>
    	</div><!-- #content -->
    </div><!-- #container -->
</div>

<?php 
get_footer();
开发者ID:cabelotaina,项目名称:delibera,代码行数:22,代码来源:single-pauta.php

示例8: start_el

    /**
     * @see Walker::start_el()
     * @since 2.7.0
     *
     * @param string $output Passed by reference. Used to append additional content.
     * @param object $comment Comment data object.
     * @param int $depth Depth of comment in reference to parents.
     * @param array $args
     */
    function start_el(&$output, $comment, $depth = 0, $args = array(), $current_object_id = 0)
    {
        global $deliberaThemes;
        $depth++;
        $GLOBALS['comment_depth'] = $depth;
        $args['avatar_size'] = '85';
        if (!empty($args['callback'])) {
            call_user_func($args['callback'], $comment, $args, $depth);
            return;
        }
        $GLOBALS['comment'] = $comment;
        $tipo = get_comment_meta($comment->comment_ID, "delibera_comment_tipo", true);
        $situacao = delibera_get_situacao($comment->comment_post_ID);
        extract($args, EXTR_SKIP);
        if ('div' == $args['style']) {
            $tag = 'div';
            $add_below = 'comment';
        } else {
            $tag = 'li';
            $add_below = 'delibera-comment';
        }
        $classes = array();
        if (!empty($args['has_children'])) {
            $classes[] = 'parent';
        }
        if ($tipo == 'encaminhamento' || $tipo == 'resolucao' || $tipo == 'encaminhamento_selecionado') {
            $classes[] = 'encaminhamento';
            if (in_array($situacao->slug, array('comresolucao', 'emvotacao'))) {
                $classes[] = 'encaminhamentos-selecionados';
            }
        }
        ob_start();
        ?>

        <?php 
        if (($tipo == 'resolucao' || $tipo == 'encaminhamento') && $situacao->slug == 'comresolucao') {
            ?>
            <?php 
            $nvotos = get_comment_meta($comment->comment_ID, "delibera_comment_numero_votos", true);
            ?>
            <?php 
            $classes[] = 'clearfix';
            ?>
            <li <?php 
            comment_class($classes);
            ?>
>
                <div class="alignleft votos">
                    <span><?php 
            echo $nvotos == 1 ? sprintf(__('%d voto', 'delibera'), $nvotos) : sprintf(__('%d votos', 'delibera'), $nvotos);
            ?>
</span>
                </div>
                <div class="alignleft content">
                    <?php 
            comment_text();
            ?>
                </div>
            </li>
        <?php 
        } elseif ($situacao->slug == 'emvotacao' && $tipo == 'voto') {
            ?>
            <?php 
            $avatar = get_avatar_with_title($comment->user_id);
            ?>
            <li><?php 
            echo $avatar;
            ?>
</li>
        <?php 
        } else {
            ?>
            <li <?php 
            comment_class($classes);
            ?>
>
                <article id="delibera-comment-<?php 
            echo $comment->comment_ID;
            ?>
">
                    <header class="coment-meta comment-author vcard clearfix">
                        <div class="alignleft">
                            <?php 
            echo get_avatar($comment, 44);
            ?>
                            <cite class="fn"><?php 
            echo $comment->comment_author;
            ?>
</cite>
                            <a href="<?php 
            echo htmlspecialchars(delibera_get_comment_link($comment->comment_ID));
//.........这里部分代码省略.........
开发者ID:josafafilho,项目名称:marcocivil-tema,代码行数:101,代码来源:delibera_comments_template.php

示例9: delibera_gerar_discordar

/**
 * 
 * Gera código html para criação do botão discordar do sistema delibera
 * @param $ID int post_ID ou comment_ID
 * @param $type string 'pauta' ou 'comment'
 */
function delibera_gerar_discordar($ID, $type = 'pauta')
{
    global $post;
    $situacoes_validas = array('validacao' => false, 'discussao' => true, 'emvotacao' => false, 'comresolucao' => true);
    $postID = 0;
    if (is_object($ID)) {
        if ($type == 'post' || $type == 'pauta') {
            $ID = $ID->ID;
            $postID = $ID;
        } else {
            $postID = $ID->comment_post_ID;
            $ID = $ID->comment_ID;
        }
    }
    $situacao = delibera_get_situacao($postID);
    if (is_user_logged_in()) {
        $user_id = get_current_user_id();
        $ip = $_SERVER['REMOTE_ADDR'];
        if (!delibera_ja_discordou($ID, $user_id, $ip, $type) && (is_object($situacao) && array_key_exists($situacao->slug, $situacoes_validas)) && $situacoes_validas[$situacao->slug] && !delibera_ja_curtiu($ID, $user_id, $ip, $type)) {
            $html = '<div id="thebuttonDiscordo' . $type . $ID . '" class="delibera_unlike" ><span class="delibera_unlike_text">' . __('Discordo', 'delibera') . '</span>';
            $html .= "<input type='hidden' name='object_id' value='{$ID}' />";
            $html .= "<input type='hidden' name='type' value='{$type}' />";
            $html .= '</div>';
            return $html;
        }
    } else {
        $html = '<div id="thebuttonDiscordo' . $type . $ID . '" class="delibera_unlike" >';
        if (is_object($situacao) && array_key_exists($situacao->slug, $situacoes_validas) && $situacoes_validas[$situacao->slug]) {
            $html .= '<a class="delibera-unlike-login" href="';
            $html .= wp_login_url($type == "pauta" ? get_permalink() : delibera_get_comment_link());
            $html .= '" ><span class="delibera_unlike_text">' . __('Discordo', 'delibera') . '</span></a>';
        }
        return $html;
    }
}
开发者ID:cabelotaina,项目名称:delibera,代码行数:41,代码来源:functions.php

示例10: dirname

 * Gera um arquivo XLS com as opiniões e propostas de
 * encaminhamento feitos pelos usuários nas pautas
 */
// contorna problema com links simbolicos no ambiente de desenvolvimento
$wp_root = dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . '/../../';
require_once $wp_root . 'wp-load.php';
if (!current_user_can('manage_options')) {
    die('Você não deveria estar aqui');
}
$pautas = get_posts(array('post_type' => 'pauta', 'post_status' => 'publish'));
$comments = array();
foreach ($pautas as $pauta) {
    $comments = array_merge($comments, delibera_get_comments($pauta->ID, array('discussao', 'encaminhamento', 'encaminhamento_selecionado', 'resolucao')));
}
foreach ($comments as $comment) {
    $situacao = delibera_get_situacao($comment->comment_post_ID);
    $comment->pauta_title = get_the_title($comment->comment_post_ID);
    $comment->pauta_status = $situacao->name;
    $comment->type = delibera_get_comment_type_label($comment, false, false);
    $comment->link = get_comment_link($comment);
    $comment->concordaram = (int) get_comment_meta($comment->comment_ID, 'delibera_numero_curtir', true);
    $comment->discordaram = (int) get_comment_meta($comment->comment_ID, 'delibera_numero_discordar', true);
    $comment->votes_count = (int) get_comment_meta($comment->comment_ID, "delibera_comment_numero_votos", true);
}
header('Pragma: public');
header('Cache-Control: no-store, no-cache, must-revalidate');
// HTTP/1.1
header("Pragma: no-cache");
header("Expires: 0");
header('Content-Transfer-Encoding: none');
header('Content-Type: application/vnd.ms-excel; charset=UTF-8');
开发者ID:cabelotaina,项目名称:delibera,代码行数:31,代码来源:delibera_relatorio_xls.php

示例11: start_el

    /**
     * @see Walker::start_el()
     * @since 2.7.0
     *
     * @param string $output Passed by reference. Used to append additional content.
     * @param object $comment Comment data object.
     * @param int $depth Depth of comment in reference to parents.
     * @param array $args
     */
    function start_el(&$output, $comment, $depth = 0, $args = array(), $current_object_id = 0)
    {
        $depth++;
        $GLOBALS['comment_depth'] = $depth;
        $args['avatar_size'] = '85';
        if (!empty($args['callback'])) {
            call_user_func($args['callback'], $comment, $args, $depth);
            return;
        }
        $GLOBALS['comment'] = $comment;
        $tipo = get_comment_meta($comment->comment_ID, "delibera_comment_tipo", true);
        $situacao = delibera_get_situacao($comment->comment_post_ID);
        extract($args, EXTR_SKIP);
        if ('div' == $args['style']) {
            $tag = 'div';
            $add_below = 'comment';
        } else {
            $tag = 'li';
            $add_below = 'div-comment';
        }
        ob_start();
        ?>
		<<?php 
        echo $tag;
        ?>
 <?php 
        comment_class(empty($args['has_children']) ? '' : 'parent');
        ?>
 id="delibera-comment-<?php 
        comment_ID();
        ?>
">
		<?php 
        if ('div' != $args['style']) {
            ?>
		<div id="delibera-div-comment-<?php 
            comment_ID();
            ?>
" class="delibera-comment-body">
		<?php 
        }
        ?>
		<div id="delibera-div-comment-header-<?php 
        comment_ID();
        ?>
" class="delibera-comment-header">
			<div class="delibera-comment-author vcard">
			<?php 
        if ($args['avatar_size'] != 0) {
            echo get_avatar($comment, $args['avatar_size']);
        }
        ?>
			<?php 
        $url = get_author_posts_url($comment->user_id);
        //print_r($comment);
        $autor_link = "<a href='{$url}' rel='external nofollow' class='url'>{$comment->comment_author}</a>";
        printf('<cite class="fn">%s</cite><span class="delibera-says"></span>', $autor_link);
        ?>
			</div>
	<?php 
        if ($comment->comment_approved == '0') {
            ?>
			<em class="delibera-comment-awaiting-moderation"><?php 
            _e('Seu comentário está aguardando moderação.', 'delibera');
            ?>
</em>
			<br />
	<?php 
        }
        ?>
	
			<div class="delibera-comment-meta commentmetadata">
				<a href="<?php 
        echo htmlspecialchars(delibera_get_comment_link($comment->comment_ID));
        ?>
">
					<?php 
        $time = mysql2date('G', $comment->comment_date);
        $time_diff = time() - $time;
        if ($time_diff > 0 && $time_diff < 30 * 24 * 60 * 60) {
            printf('&nbsp;' . __('há %s', 'delibera'), human_time_diff(mysql2date('U', $comment->comment_date, true)));
        } else {
            echo '&nbsp;' . __('em', 'delibera') . '&nbsp;' . get_comment_date();
        }
        ?>
				</a>
				&nbsp;
				
				<?php 
        if ($situacao->slug == 'discussao' || $situacao->slug == 'relatoria' && current_user_can('relatoria')) {
            delibera_edit_comment_link(__('(Edit)'), '&nbsp;&nbsp;', '');
//.........这里部分代码省略.........
开发者ID:cabelotaina,项目名称:delibera,代码行数:101,代码来源:delibera_comments_template.php

示例12: delibera_notificar_fim_prazo

function delibera_notificar_fim_prazo($args)
{
    $post = $args['post_ID'];
    if (is_int($post)) {
        $post = get_post($post);
    }
    $message = '';
    $situacao = delibera_get_situacao($post->ID);
    delibera_notificar_representantes($message, "mensagem_fim_prazo_{$situacao->slug}", $post);
}
开发者ID:cabelotaina,项目名称:delibera,代码行数:10,代码来源:delibera_notificar.php


注:本文中的delibera_get_situacao函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。