示例#1
0
                <div class="content col-xs-9">
                  <ul class="form-set">
                  
                    <li class="form-group row underlined">
                      <label class="control-label col-xs-3" for="category">Category <span>*</span></label>
                      
                      <div class="col-xs-9">
                        <select class="form-control" id="category" name="category" disabled>
                        
						  <?php 
foreach ($all_news_category as $category) {
    // CALL FUNCTION
    $check_cat_lang = check_news_cat_lang($category['category_id'], $_SESSION['lang_admin']);
    if ($check_cat_lang['rows'] > 0) {
        // CALL FUNCTION
        $categories = get_category_lang($category['category_id'], $_SESSION['lang_admin']);
        $category['id_param'] = $categories['id_param'];
        $category['category_name'] = $categories['category_name'];
    } else {
        $category['id_param'] = $category['category_id'];
        $category['category_name'] = $category['category_name'];
    }
    echo "<option value=\"" . $category['id_param'] . "\">" . $category['category_name'] . "</option>";
}
?>
                          
                        </select>
                      </div>
                    </li>
                    
                    <li class="form-group row">
示例#2
0
    $sql = "INSERT INTO tbl_news_category_lang (`category_name`, `id_param`, `category_active`, `category_visibility`, `language_code`) \n                                           VALUES('{$post_category_name}', '{$post_id_param}', '{$post_category_active}', '{$post_category_visibility}', '{$post_lang_code}')";
    $query = mysql_query($sql, $conn) or die(mysql_error());
}
/*
*---------------------------------------------
* CONTROL
*---------------------------------------------
*/
// REQUEST VARIABLE
$category_id = $_REQUEST['nid'];
// DEFINED VARIABLE
$_SESSION['lang_admin'] = $_REQUEST['lang'];
// CALL FUNCTION
$check = count_category_lang($category_id);
if ($check['rows'] > 0) {
    $detail_category = get_category_lang($category_id, $_SESSION['lang_admin']);
} else {
    $detail_category = get_category($category_id);
}
$default = get_category($category_id);
if (isset($_POST['btn_detail_news_category_lang'])) {
    // DEFINED VARIABLE
    $category_id = $_POST['hidden_category_id'];
    if (!empty($_POST['custom_lang_default_name'])) {
        $category_name = 'default';
    } else {
        $category_name = stripslashes($_POST['category_name']);
    }
    $category_active = $detail_category['category_active'];
    $category_visibility = $detail_category['category_visibility'];
    $lang_code = $_SESSION['lang_admin'];
示例#3
0
$def_cat_id = $default['category_recipes'];
$def_name = $default['recipe_name'];
$def_image = $default['recipe_image'];
$def_date = $default['recipe_date'];
$def_ingredients = $default['recipe_ingredients'];
$def_sauce = $default['recipe_sauce'];
$def_method = $default['method'];
$def_alias = $default['alias'];
$def_visibility = $default['visibility_status'];
$def_additional = $default['additional'];
$check_cat_lang = count_category_lang($def_cat_id, $_REQUEST['lang']);
$check_lang = check_recipe_lang($def_id, $_REQUEST['lang']);
// CALL FUNCTION
// CATEGORY
if ($check_cat_lang['rows'] > 0) {
    $recipe_category = get_category_lang($def_cat_id, $_REQUEST['lang']);
} else {
    $recipe_category = get_default_category($def_cat_id);
}
if ($check_lang['rows'] > 0) {
    $value = getDetails_lang($def_id, $lang_code);
} else {
    $value = get_default_recipe($recipe_alias);
}
// CONNECT DEFAULT
// RECIPE NAME
if ($value['recipe_name'] === "default") {
    $default_name = $def_name;
} else {
    $default_name = $value['recipe_name'];
}