Exemple #1
0
function drawSubcategory($category)
{
    if (osc_count_subcategories2() > 0) {
        osc_category_move_to_children();
        ?>
            <ul>
                <?php 
        while (osc_has_categories()) {
            ?>
                    <li><a class="category cat_<?php 
            echo osc_category_id();
            ?>
" href="<?php 
            echo osc_search_category_url();
            ?>
"><?php 
            echo osc_category_name();
            ?>
</a> <span>(<?php 
            echo osc_category_total_items();
            ?>
)</span><?php 
            drawSubcategory(osc_category());
            ?>
</li>
                <?php 
        }
        ?>
            </ul>
        <?php 
        osc_category_move_to_parent();
    }
}
Exemple #2
0
function Subcategory($category)
{
    if (osc_count_subcategories2() > 0) {
        osc_category_move_to_children();
        ?>
            <div id="cat_<?php 
        echo $category['pk_i_id'];
        ?>
" class="panel-collapse collapse">
                                <div class="panel-body">
                                    <ul>
                <?php 
        while (osc_has_categories()) {
            ?>
                    <?php 
            if (osc_category_total_items() < 1 && nc_osc_hide_categories()) {
                continue;
            }
            ?>
 
                    <li>
                    <a data-parent="#cat_<?php 
            echo $category['pk_i_id'];
            ?>
" href="<?php 
            echo osc_search_category_url();
            ?>
">
                        <?php 
            echo osc_category_name();
            ?>
                    </a>
                    <span>(<?php 
            echo osc_category_total_items();
            ?>
)</span><?php 
            Subcategory(osc_category());
            ?>
                    </li>
                <?php 
        }
        ?>
            </ul>
        </div>
    </div>
        <?php 
        osc_category_move_to_parent();
    }
}
function chosen_select_optgroup()
{
    View::newInstance()->_exportVariableToView('categories', Category::newInstance()->toTree());
    if (osc_count_categories() > 0) {
        echo '<select name="sCategory" data-placeholder="' . __('Select a category...', 'twitter') . '" style="width: auto;" class="chzn-select"">';
        echo '<option></option>';
        while (osc_has_categories()) {
            echo '<optgroup label="' . osc_category_name() . '">';
            if (osc_count_subcategories() > 0) {
                while (osc_has_subcategories()) {
                    echo '<option value="' . osc_category_name() . '">' . osc_category_name() . '</option>';
                }
            }
            echo '</optgroup>';
        }
        echo '</select>';
    }
    View::newInstance()->_erase('categories');
}
Exemple #4
0
                                </a>
                                <ul>
                                <?php 
            while (osc_has_subcategories()) {
                ?>
                                    <?php 
                if (osc_category_total_items() >= 0) {
                    ?>
                                        <li><a class="<?php 
                    echo osc_category_slug();
                    ?>
" href="<?php 
                    echo osc_search_category_url();
                    ?>
"><?php 
                    echo osc_category_name();
                    ?>
 (<?php 
                    echo osc_category_total_items();
                    ?>
)</a></li>
                                    <?php 
                }
                ?>
                                <?php 
            }
            ?>
                                </ul>
                                <?php 
        }
        ?>
    function pop_draw_categories_list()
    {
        ?>
        <?php 
        if (!osc_is_home_page()) {
            echo '<div class="resp-wrapper">';
        }
        ?>
        <?php 
        //cell_3
        $total_categories = osc_count_categories();
        $col1_max_cat = ceil($total_categories / 3);
        osc_goto_first_category();
        $i = 0;
        while (osc_has_categories()) {
            ?>
            <?php 
            if ($i % $col1_max_cat == 0) {
                if ($i > 0) {
                    echo '</div>';
                }
                if ($i == 0) {
                    echo '<div class="cell_3 first_cel">';
                } else {
                    echo '<div class="cell_3">';
                }
            }
            ?>
            <ul class="r-list">
                <li>
                    <h1>
                        <?php 
            $_slug = osc_category_slug();
            $_url = osc_search_category_url();
            $_name = osc_category_name();
            $_total_items = osc_category_total_items();
            if (osc_count_subcategories() > 0) {
                ?>
                            <span class="collapse resp-toogle"><i class="fa fa-caret-right fa-lg"></i></span>
                        <?php 
            }
            ?>
                        <?php 
            if ($_total_items > 0) {
                ?>
                            <a class="category <?php 
                echo $_slug;
                ?>
" href="<?php 
                echo $_url;
                ?>
"><?php 
                echo $_name;
                ?>
</a> <span>(<?php 
                echo $_total_items;
                ?>
)</span>
                        <?php 
            } else {
                ?>
                            <a class="category <?php 
                echo $_slug;
                ?>
" href="#"><?php 
                echo $_name;
                ?>
</a> <span>(<?php 
                echo $_total_items;
                ?>
)</span>
                        <?php 
            }
            ?>
                    </h1>
                    <?php 
            if (osc_count_subcategories() > 0) {
                ?>
                        <ul>
                            <?php 
                while (osc_has_subcategories()) {
                    ?>
                                <li>
                                    <?php 
                    if (osc_category_total_items() > 0) {
                        ?>
                                        <a class="category sub-category <?php 
                        echo osc_category_slug();
                        ?>
" href="<?php 
                        echo osc_search_category_url();
                        ?>
"><?php 
                        echo osc_category_name();
                        ?>
</a> <span>(<?php 
                        echo osc_category_total_items();
                        ?>
)</span>
                                    <?php 
                    } else {
                        ?>
                                        <a class="category sub-category <?php 
                        echo osc_category_slug();
                        ?>
" href="#"><?php 
                        echo osc_category_name();
                        ?>
</a> <span>(<?php 
                        echo osc_category_total_items();
                        ?>
)</span>
                                    <?php 
                    }
                    ?>
                                </li>
                            <?php 
                }
                ?>
                        </ul>
                    <?php 
            }
            ?>
                </li>
            </ul>
            <?php 
            $i++;
        }
        echo '</div>';
        ?>
        <?php 
        if (!osc_is_home_page()) {
            echo '</div>';
        }
        ?>
        <?php 
    }
Exemple #6
0
function get_parent_subcategories($category_id)
{
    $subcategory = array();
    View::newInstance()->_exportVariableToView('category', osc_get_category('id', $category_id));
    osc_goto_first_category();
    while (osc_has_subcategories()) {
        $sc = array('name' => osc_category_name(), 'url' => osc_search_category_url());
        array_push($subcategory, $sc);
    }
    return $subcategory;
}
Exemple #7
0
    function osclasswizards_draw_categories_list()
    {
        if (!osc_is_home_page()) {
            echo '<div class="resp-wrapper">';
        }
        ?>

<h1 class="title"><?php 
        _e('Categories', OSCLASSWIZARDS_THEME_FOLDER);
        ?>
</h1>
<div class="row">
<?php 
        $total_categories = osc_count_categories();
        $col1_max_cat = ceil($total_categories / 1);
        osc_goto_first_category();
        $catcount = 0;
        while (osc_has_categories()) {
            ?>
<ul class="col-sm-6 col-md-3 grid_list">
  <li>
    <section class="listings">
     <h2><i class="fa fa-<?php 
            echo osclasswizards_category_icon(osc_category_id());
            ?>
"></i>
      <?php 
            $_slug = osc_category_slug();
            $_url = osc_search_category_url();
            $_name = osc_category_name();
            $_total_items = osc_category_total_items();
            if (osc_count_subcategories() > 0) {
                ?>
      <?php 
            }
            ?>
      <?php 
            if ($_total_items > 0) {
                ?>
      <a class="category <?php 
                echo $_slug;
                ?>
" href="<?php 
                echo $_url;
                ?>
"><?php 
                echo $_name;
                ?>
</a> <span><?php 
                echo $_total_items;
                ?>
</span>
      <?php 
            } else {
                ?>
      <a class="category <?php 
                echo $_slug;
                ?>
" href="#"><?php 
                echo $_name;
                ?>
</a> <span><?php 
                echo $_total_items;
                ?>
</span>
      <?php 
            }
            ?>
    </h2>
    <?php 
            if (osc_count_subcategories() > 0) {
                $m = 1;
                ?>
    <ul>
      <?php 
                while (osc_has_subcategories()) {
                    if ($m <= osc_get_preference('sub_cat_limit', 'osclasswizards_theme')) {
                        ?>
      <li>
        <?php 
                        if (osc_category_total_items() > 0) {
                            ?>
        <a class="category sub-category <?php 
                            echo osc_category_slug();
                            ?>
" href="<?php 
                            echo osc_search_category_url();
                            ?>
"><?php 
                            echo osc_category_name();
                            ?>
</a> <span>(<?php 
                            echo osc_category_total_items();
                            ?>
)</span>
        <?php 
                        } else {
                            ?>
        <a class="category sub-category <?php 
                            echo osc_category_slug();
                            ?>
" href="#"><?php 
                            echo osc_category_name();
                            ?>
</a> <span>(<?php 
                            echo osc_category_total_items();
                            ?>
)</span>
        <?php 
                        }
                        ?>
      </li>
      <?php 
                    }
                    $m++;
                }
                if ($m > osc_get_preference('sub_cat_limit', 'osclasswizards_theme') + 1) {
                    ?>
      <li class="last"><a href="<?php 
                    echo $_url;
                    ?>
"><strong><?php 
                    _e('See more listings...', OSCLASSWIZARDS_THEME_FOLDER);
                    ?>
</strong></a></li>
      <?php 
                }
                ?>
    </ul>
    <?php 
            }
            ?>
    </section>
  </li>
</ul>
<?php 
            $catcount++;
            if ($catcount % 4 == 0) {
                echo '</div><div class="row">';
            }
        }
        ?>
 </div>
<?php 
    }
Exemple #8
0
function get_parent_subcategories($iCategoryId)
{
    $aSubCategory = array();
    osc_goto_first_category();
    while (osc_has_categories()) {
        if (osc_category_id() == $iCategoryId) {
            if (osc_count_subcategories() > 0) {
                while (osc_has_subcategories()) {
                    $aSubCat = array('name' => osc_category_name(), 'url' => osc_search_category_url());
                    array_push($aSubCategory, $aSubCat);
                }
            }
        }
    }
    return $aSubCategory;
}
Exemple #9
0
 public function init()
 {
     if (in_array($this->getLocation(), array('item', 'page', 'search', 'login', 'register', 'user', 'contact'))) {
         $l = array('url' => osc_base_url(), 'title' => osc_page_title());
         $this->addLevel($l);
     }
     switch ($this->getLocation()) {
         case 'item':
             if ($this->getSection() == 'item_add') {
                 $l = array('title' => $this->title['item_add']);
                 $this->addLevel($l);
                 break;
             }
             $aCategory = osc_get_category('id', osc_item_category_id());
             // remove
             View::newInstance()->_erase('categories');
             View::newInstance()->_erase('subcategories');
             View::newInstance()->_exportVariableToView('category', $aCategory);
             $l = array('url' => osc_search_category_url(), 'title' => osc_category_name());
             $this->addLevel($l);
             switch ($this->getSection()) {
                 case 'item_edit':
                     $l = array('url' => osc_item_url(), 'title' => osc_item_title());
                     $this->addLevel($l);
                     $l = array('title' => $this->title['item_edit']);
                     $this->addLevel($l);
                     break;
                 case 'send_friend':
                     $l = array('url' => osc_item_url(), 'title' => osc_item_title());
                     $this->addLevel($l);
                     $l = array('title' => $this->title['item_send_friend']);
                     $this->addLevel($l);
                     break;
                 case 'contact':
                     $l = array('url' => osc_item_url(), 'title' => osc_item_title());
                     $this->addLevel($l);
                     $l = array('title' => $this->title['item_contact']);
                     $this->addLevel($l);
                     break;
                 case '':
                     $l = array('title' => osc_item_title());
                     $this->addLevel($l);
                     break;
             }
             break;
         case 'search':
             $region = osc_search_region();
             $city = osc_search_city();
             $pattern = osc_search_pattern();
             $category = osc_search_category_id();
             $category = count($category) == 1 ? $category[0] : '';
             $b_show_all = $pattern == '' && $category == '' && $region == '' && $city == '';
             $b_category = $category != '';
             $b_pattern = $pattern != '';
             $b_region = $region != '';
             $b_city = $city != '';
             $b_location = $b_region || $b_city;
             // show all
             if ($b_show_all) {
                 $l = array('title' => $this->title['search']);
                 $this->addLevel($l);
                 break;
             }
             // category
             if ($b_category) {
                 $aCategories = Category::newInstance()->toRootTree($category);
                 foreach ($aCategories as $c) {
                     View::newInstance()->_erase('categories');
                     View::newInstance()->_erase('subcategories');
                     View::newInstance()->_exportVariableToView('category', $c);
                     $l = array('url' => osc_search_category_url(), 'title' => osc_category_name());
                     $this->addLevel($l);
                 }
             }
             // location
             if ($b_location) {
                 $params = array();
                 if ($b_category) {
                     $params['sCategory'] = $category;
                 }
                 if ($b_city) {
                     //print_r("~~~~~~~~~~~~~~~~~~~".$city."~~~~~~~~~~~~~~~~~~~~");
                     $aCity = City::newInstance()->findByName($city);
                     if (count($aCity) == 0) {
                         $params['sCity'] = $city;
                         $l = array('url' => osc_search_url($params), 'title' => $city);
                         $this->addLevel($l);
                     } else {
                         $aRegion = Region::newInstance()->findByPrimaryKey($aCity['fk_i_region_id']);
                         $params['sRegion'] = $aRegion['s_name'];
                         $l = array('url' => osc_search_url($params), 'title' => $aRegion['s_name']);
                         $this->addLevel($l);
                         $params['sCity'] = $aCity['s_name'];
                         $l = array('url' => osc_search_url($params), 'title' => $aCity['s_name']);
                         $this->addLevel($l);
                     }
                 } else {
                     if ($b_region) {
                         $params['sRegion'] = $region;
                         $l = array('url' => osc_search_url($params), 'title' => $region);
                         $this->addLevel($l);
                     }
                 }
             }
             // pattern
             if ($b_pattern) {
                 $l = array('title' => sprintf($this->title['search_pattern'], $pattern));
                 $this->addLevel($l);
             }
             // remove url from the last node
             $nodes = $this->getaLevel();
             if ($nodes > 0) {
                 if (array_key_exists('url', $nodes[count($nodes) - 1])) {
                     unset($nodes[count($nodes) - 1]['url']);
                 }
             }
             $this->setaLevel($nodes);
             break;
         case 'user':
             // use dashboard without url if you're in the dashboards
             if ($this->getSection() == 'dashboard') {
                 $l = array('title' => $this->title['user_dashboard']);
                 $this->addLevel($l);
                 break;
             }
             // use dashboard without url if you're in the dashboards
             if ($this->getSection() == 'pub_profile') {
                 $l = array('title' => sprintf($this->title['user_dashboard_profile'], osc_user_name()));
                 $this->addLevel($l);
                 break;
             }
             $l = array('url' => osc_user_dashboard_url(), 'title' => $this->title['user_account']);
             $this->addLevel($l);
             switch ($this->getSection()) {
                 case 'items':
                     $l = array('title' => $this->title['user_items']);
                     $this->addLevel($l);
                     break;
                 case 'alerts':
                     $l = array('title' => $this->title['user_alerts']);
                     $this->addLevel($l);
                     break;
                 case 'profile':
                     $l = array('title' => $this->title['user_profile']);
                     $this->addLevel($l);
                     break;
                 case 'change_email':
                     $l = array('title' => $this->title['user_change_email']);
                     $this->addLevel($l);
                     break;
                 case 'change_password':
                     $l = array('title' => $this->title['user_change_password']);
                     $this->addLevel($l);
                     break;
                 case 'change_username':
                     $l = array('title' => $this->title['user_change_username']);
                     $this->addLevel($l);
                     break;
             }
             break;
         case 'login':
             switch ($this->getSection()) {
                 case 'recover':
                     $l = array('title' => $this->title['login_recover']);
                     $this->addLevel($l);
                     break;
                 case 'forgot':
                     $l = array('title' => $this->title['login_forgot']);
                     $this->addLevel($l);
                     break;
                 case '':
                     $l = array('title' => $this->title['login']);
                     $this->addLevel($l);
                     break;
             }
             break;
         case 'register':
             $l = array('title' => $this->title['register']);
             $this->addLevel($l);
             break;
         case 'page':
             $l = array('title' => osc_static_page_title());
             $this->addLevel($l);
             break;
         case 'contact':
             $l = array('title' => $this->title['contact']);
             $this->addLevel($l);
             break;
     }
 }
$current_category_id = '';
$current_category_parent = '';
$_current_category_id = osc_search_category_id();
if (count($_current_category_id) > 0) {
    $current_category_id = $_current_category_id[0];
    $_current_category = Category::newInstance()->findByPrimaryKey($current_category_id);
    $current_category_parent = $_current_category['fk_i_parent_id'];
}
$limit_regions = $limit_cities = 10;
$filter_region_id = '%%%%';
osc_get_non_empty_categories();
osc_goto_first_category();
$aCategories = array();
while (osc_has_categories()) {
    $aCategories[] = array('id' => osc_category_id(), 'slug' => osc_category_slug(), 'name' => osc_category_name(), 'url' => osc_update_search_url(array('sCategory' => osc_category_slug())), 'total_items' => osc_category_total_items());
}
?>
<div class="title-section"><span><i class="ico-filter_category"></i><?php 
_e('Categories', 'pop');
?>
</span></div>
<div class="collections">
    <?php 
foreach ($aCategories as $category) {
    $active = "";
    if ($category['slug'] == Params::getParam('sCategory') || $category['id'] == Params::getParam('sCategory') || $category['id'] == $current_category_parent) {
        $active = "active";
    }
    ?>
    <div>
Exemple #11
0
    function osclasswizards_draw_categories_list()
    {
        if (!osc_is_home_page()) {
            echo '<div class="resp-wrapper">';
        }
        ?>
<h1 class="title">
    <?php 
        _e("Categories", 'osclasswizards');
        ?>
</h1>
<?php 
        //cell_3
        $total_categories = osc_count_categories();
        $col1_max_cat = ceil($total_categories / 1);
        osc_goto_first_category();
        $i = 0;
        $catcount = 0;
        while (osc_has_categories()) {
            $catcount++;
            if ($catcount == 1) {
                echo '<div class="row">';
            }
            ?>
<ul class="col-sm-6 col-md-6 grid_list">
    <li>
        <?php 
            $_slug = osc_category_slug();
            $_url = osc_search_category_url();
            $_name = osc_category_name();
            $_total_items = osc_category_total_items();
            if (osc_count_subcategories() > 0) {
                ?>
        <section class="listings row">

            <h2 class="col-md-7 category <?php 
                echo $_slug;
                ?>
 <?php 
                echo $_name;
                ?>
">


                <?php 
                if ($_total_items > 0) {
                    ?>
                <a href="<?php 
                    echo $_url;
                    ?>
"><?php 
                    echo $_name;
                    ?>
</a> <span><?php 
                    echo $_total_items;
                    ?>
</span>
                <?php 
                } else {
                    ?>
                <a href="#"><?php 
                    echo $_name;
                    ?>
</a> <span><?php 
                    echo $_total_items;
                    ?>
</span>
                <?php 
                }
                ?>
                <?php 
            }
            ?>
            </h2>
            <?php 
            if (osc_count_subcategories() > 0) {
                $m = 1;
                ?>
            <ul class="col-md-5">
                <?php 
                while (osc_has_subcategories()) {
                    if ($m <= 5) {
                        ?>
                <li>
                    <?php 
                        if (osc_category_total_items() > 0) {
                            ?>
                    <a class="category sub-category <?php 
                            echo osc_category_slug();
                            ?>
" href="<?php 
                            echo osc_search_category_url();
                            ?>
"><?php 
                            echo osc_category_name();
                            ?>
</a> <span>(<?php 
                            echo osc_category_total_items();
                            ?>
)</span>
                    <?php 
                        } else {
                            ?>
                    <a class="category sub-category <?php 
                            echo osc_category_slug();
                            ?>
" href="#"><?php 
                            echo osc_category_name();
                            ?>
</a> <span>(<?php 
                            echo osc_category_total_items();
                            ?>
)</span>
                    <?php 
                        }
                        ?>
                </li>
                <?php 
                    }
                    $m++;
                }
                if ($m > 6) {
                    ?>
                <li class="last"><a href="<?php 
                    echo $_url;
                    ?>
"><strong><?php 
                    _e('See more listings...', 'osclasswizards');
                    ?>
</strong></a></li>
                <?php 
                }
                ?>
            </ul>
            <?php 
            }
            ?>


        </section>

    </li>
</ul>
<?php 
            $i++;
            if ($catcount == 4) {
                echo '</div>';
                $catcount = 0;
            }
        }
        echo '</div>';
        if (!osc_is_home_page()) {
            echo '</div>';
        }
    }
Exemple #12
0
    function osclassclsx_draw_categories_list_home()
    {
        //cell_3
        $total_categories = osc_count_categories();
        // $col1_max_cat       = ceil($total_categories/3);
        // $col1_max_cat = 3;
        ?>
        <div class="categories-list row">
    <?php 
        osc_goto_first_category();
        $i = 0;
        while (osc_has_categories()) {
            ?>
        <?php 
            if ($i == 0) {
                echo '<div class="columns small-4 first_cel">';
            } else {
                echo '<div class="columns small-4">';
            }
            ?>
            <h1>
                <?php 
            $_slug = osc_category_slug();
            $_url = osc_search_category_url();
            $_name = osc_category_name();
            $_total_items = osc_category_total_items();
            ?>
                <a class="category <?php 
            echo $_slug;
            ?>
" href="<?php 
            echo $_url;
            ?>
"><?php 
            echo $_name;
            ?>
</a> <span class="hide">(<?php 
            echo $_total_items;
            ?>
)</span>
            </h1>
            <?php 
            if (osc_count_subcategories() > 0) {
                while (osc_has_subcategories()) {
                }
            }
            ?>
        <?php 
            echo '</div>';
            $i++;
        }
        ?>
        </div>
        <?php 
    }