function show_category_form() {
	global $user;

	change_categories();

	echo '<div id="genericform-contents"><div id="genericform"><fieldset><legend>';
	echo '<span class="sign">'._('administración de categorías').'</span></legend>';

	echo '<div class="column-list">'."\n";
	echo '<div class="categorylist">'."\n";
	echo '<form action="categories.php" method="post" id="thisform">' . "\n";
	echo '<input type="hidden" name="process" value="1" />' . "\n";
	echo '<input type="hidden" name="user_id" value="'.$user->id.'" />' . "\n";

	show_categories();

	echo '<br style="clear: both;" />' . "\n";
	echo '</div></div>'."\n";

	echo '<br />' . "\n";
	echo '<p>'._('Introduce una nueva categoría o edita las existentes:').'</p>';

	echo '<p class="l-mid" id="insert-p"><label for="new_cat">' . _("nueva categoría") . ':</label> ' . "\n";
	echo '<input type="text" id="new_cat" name="new_cat" tabindex="1" size="25" /> ' . "\n";
	echo '<label for="new_parent">' . _("hija de") . ':</label> ' . "\n";
	echo '<input type="text" id="new_parent" name="new_parent" tabindex="1" size="1" value="0" />' . "\n";
	echo '<label for="new_feed">' . _("url feed") . ':</label> ' . "\n";
	echo '<input type="text" id="new_feed" name="new_feed" tabindex="1" size="25" /><br />' . "\n";

	echo '<span class="genericformnote"><strong>pocas palabras, genéricas, cortas y separadas por "," (coma)</strong> Ejemplo: <em>web, programación, software libre</em></span><br />';
	echo '<label for="new_tags">' . _("etiquetas por defecto") . ':</label> ' . "\n";
	echo '<input type="text" id="new_tags" name="new_tags" tabindex="1" size="25" /></p>' . "\n";

	echo '<p class="l-bottom" id="submit-p"><input type="submit" name="new" value="'._('enviar').'" class="genericsubmit"></p>';
	echo "</form></fieldset></div></div>\n";
}
Exemple #2
0
        delete_cat();
        break;
    case 'del_cat':
        delete_cat_form();
        break;
    case 'takeedit_cat':
        edit_cat();
        break;
    case 'edit_cat':
        edit_cat_form();
        break;
    case 'cat_form':
        show_cat_form();
        break;
    default:
        show_categories();
        break;
}
function move_cat()
{
    global $INSTALLER09, $params, $mc1, $lang;
    if (!isset($params['id']) or !is_valid_id($params['id']) or (!isset($params['new_cat_id']) or !is_valid_id($params['new_cat_id']))) {
        stderr($lang['categories_error'], $lang['categories_no_id']);
    }
    if (!is_valid_id($params['new_cat_id']) or $params['id'] == $params['new_cat_id']) {
        stderr($lang['categories_error'], $lang['categories_move_error2']);
    }
    $old_cat_id = intval($params['id']);
    $new_cat_id = intval($params['new_cat_id']);
    // make sure both categories exist
    $q = sql_query("SELECT id FROM categories WHERE id IN({$old_cat_id}, {$new_cat_id})");
Exemple #3
0
        show_categories($dbh);
        break;
    case 'add':
        category_form();
        break;
    case 'modif':
        if ($id) {
            $requete = "SELECT * FROM connectors_categ WHERE connectors_categ_id=" . $id;
            $res = pmb_mysql_query($requete, $dbh);
            if (pmb_mysql_num_rows($res)) {
                $row = pmb_mysql_fetch_object($res);
                $categ_name = $row->connectors_categ_name;
                $categ_opac_expanded = $row->opac_expanded;
                category_form($id, $categ_name, $categ_opac_expanded);
            }
        }
        break;
    case 'del':
        if ($id) {
            $ida = addslashes($id);
            $sql = "DELETE FROM connectors_categ WHERE connectors_categ_id=" . $ida;
            pmb_mysql_query($sql, $dbh);
            $sql = "DELETE FROM connectors_categ_sources WHERE num_categ = " . $ida;
            pmb_mysql_query($sql, $dbh);
        }
        show_categories($dbh);
        break;
    default:
        show_categories($dbh);
        break;
}
Exemple #4
0
	</table>
</div>

<?php 
if ($current_category == 0) {
    // If we do..
    if (show_categories()) {
        ?>
<div class="container">
	<h1 class="title topic">Categories</h1>
	<table width="100%" id="topic">
		<tr>
			<th class="subject">Category</th>
			<th class="posts">Posts</th>
			<th class="posts">Topics</th>
<?php 
        load_hook('category_headers');
        ?>
		</tr>
<?php 
        foreach ($categories as $category) {
            if ($category['expanded']) {
                continue;
            }
            ?>
		<tr>
			<td class="subject"><a href="?category=<?php 
            echo $category['id'];
            ?>
"><?php 
            echo $category['name'];
function new_homepage()
{
    global $featured;
    ?>
    <div id="content" class="home-content">

        <h2><?php 
    echo bloginfo('title');
    ?>
</h2>
        <p class="tagline"><?php 
    echo bloginfo('description');
    ?>
</p>
        <?php 
    echo show_categories();
    ?>

        <?php 
    echo featured_series(smarter_slug($featured), $featured->slug);
    ?>

        <h2>Read more posts</h2>
        <?php 
    echo list_posts('latest');
    ?>

        <?php 
    if (function_exists('wpp_get_mostpopular')) {
        wpp_get_mostpopular("range=monthly&limit=10&post_type=post");
    }
    ?>

    </div>
<?php 
}
Exemple #6
0
    $rt = array('chk_sql' => $chk_sql, 'new_sql' => $new_sql);
    if (mysql_num_rows($st) == 0) {
        $rt['query_status'] = 1;
        $rt['query_msg'] = "Category is already at edge, cannot move";
        echo json_encode($rt);
        exit;
    }
    $new = fetch_html_entities($st);
    $upd_sql = sprintf("UPDATE survey_category SET weight = %d WHERE id = %d", $selected['weight'], $new['id']);
    $st = mysql_query($upd_sql);
    $upd_sql = sprintf("UPDATE survey_category SET weight = %d WHERE id = %d", $new['weight'], $selected['id']);
    $st = mysql_query($upd_sql);
    $rt['upd_sql'] = $upd_sql;
    $rt['query_status'] = 0;
    $rt['query_msg'] = "Category moved";
    $sub_rt = show_categories($_GET['survey_config_id']);
    $rt['category_list'] = $sub_rt['categories_list'];
    echo json_encode($rt);
    exit;
}
if (isset($_GET['action']) && $_GET['action'] == 'save_category') {
    $name = SQLString($_GET['name'], 'text');
    $description = SQLString($_GET['description'], 'text');
    $label = SQLString($_GET['label'], 'text');
    $title = isset($_GET['title']) ? $_GET['title'] : NULL;
    $title = SQLString(urldecode($title), 'text');
    $parent_category_id = $_GET['parent_category_id'];
    $survey_config_id = $_GET['survey_config_id'];
    $id = $_GET['id'];
    // just in case parent_category_id is NULL
    $parent_cluse = ' parent_category_id = ' . $parent_category_id;