Advertisement:

Author Topic: Regions on Sidebar  (Read 2131 times)

brk

  • Newbie
  • *
  • Posts: 6
Regions on Sidebar
« on: July 23, 2015, 07:49:59 pm »
Hi, i want to show the regions in the sidebars of Modern Theme, i know there is a lot of topics related to this but i have tried all them and is not working for me. I guess maybe is cuz the post are olds (2012 / 2013) and im using the latest Osclass and Modern Theme. Can someone  show me the code that i need to show all regions even if they are without ads on latest version of Modern theme. Thx everyone.

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Regions on Sidebar
« Reply #1 on: July 23, 2015, 09:08:15 pm »
Hi,

See here:

http://forums.osclass.org/modern/how-to-show-all-regions

Important note: This new function uses stats database table. First go to Admin Dashboard / Show More / Tools / Location stats and regenerate.

Regards
« Last Edit: July 27, 2015, 05:23:59 pm by teseo »

brk

  • Newbie
  • *
  • Posts: 6
Re: Regions on Sidebar
« Reply #2 on: July 23, 2015, 10:24:43 pm »
Not Working, i paste my entire code maybe you can help to correct my error.

Code: [Select]
<?php
    
/*
     *      Osclass – software for creating and publishing online classified
     *                           advertising platforms
     *
     *                        Copyright (C) 2012 OSCLASS
     *
     *       This program is free software: you can redistribute it and/or
     *     modify it under the terms of the GNU Affero General Public License
     *     as published by the Free Software Foundation, either version 3 of
     *            the License, or (at your option) any later version.
     *
     *     This program is distributed in the hope that it will be useful, but
     *         WITHOUT ANY WARRANTY; without even the implied warranty of
     *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *             GNU Affero General Public License for more details.
     *
     *      You should have received a copy of the GNU Affero General Public
     * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="<?php echo str_replace('_''-'osc_current_user_locale()); ?>">
    <head>
        <?php osc_current_web_theme_path('head.php'); ?>
        <meta name="robots" content="index, follow" />
        <meta name="googlebot" content="index, follow" />
    </head>
    <body>
        <?php osc_current_web_theme_path('header.php'); ?>
        <div class="form_publish">
            <?php osc_current_web_theme_path('inc.search.php'); ?>
        </div>
        <div class="content home">
            <div id="main" class="home-left-side">
                <?php osc_current_web_theme_path('inc.main.php') ; ?>
               <div class="latest_ads">
                    <h1><strong><?php _e('Latest Listings''modern'); ?></strong></h1>
                    <?php if( osc_count_latest_items() == 0) { ?>
                        <p class="empty"><?php _e('No Latest Listings''modern'); ?></p>
                    <?php } else { ?>
                        <table border="0" cellspacing="0">
                             <tbody>
                                <?php $class "even"?>
                                <?php while ( osc_has_latest_items() ) { ?>
                                 <tr class="<?php echo $class. (osc_item_is_premium()?" premium":""); ?>">
                                        <?php if( osc_images_enabled_at_items() ) { ?>
                                         <td class="photo">
                                            <?php if( osc_count_item_resources() ) { ?>
                                                <a href="<?php echo osc_item_url(); ?>">
                                                    <img src="<?php echo osc_resource_thumbnail_url(); ?>" width="75" height="56" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" />
                                                </a>
                                            <?php } else { ?>
                                                <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif'); ?>" alt="" title="" />
                                            <?php ?>
                                         </td>
                                        <?php ?>
                                         <td class="text">
                                             <h3><a href="<?php echo osc_item_url(); ?>"><?php echo osc_item_title(); ?></a></h3>
                                             <p><strong><?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled() ) { echo osc_item_formated_price(); ?> - <?php } echo osc_item_city(); ?> (<?php echo osc_item_region();?>) - <?php echo osc_format_date(osc_item_pub_date()); ?></strong></p>
                                             <p><?php echo osc_highlightstrip_tagsosc_item_description() ) ); ?></p>
                                         </td>
                                     </tr>
                                    <?php $class = ($class == 'even') ? 'odd' 'even'?>
                                <?php ?>
                            </tbody>
                        </table>
                        <?php if( osc_count_latest_items() == osc_max_latest_items() ) { ?>
                        <p class='pagination'><?php echo osc_search_pagination(); ?></p>
                            <p class="see_more_link"><a href="<?php echo osc_search_show_all_url();?>"><strong><?php _e("See all offers"'modern'); ?> &raquo;</strong></a></p>
                        <?php ?>
                    <?php View::newInstance()->_erase('items'); } ?>
                </div>
            </div>
            <div id="sidebar" class="home-right-side">
                <?php if( osc_get_preference('sidebar-300x250''modern') != '') {?>
                <!-- sidebar ad 350x250 -->
                <div class="ads_300">
                    <?php echo osc_get_preference('sidebar-300x250''modern'); ?>
                </div>
                <!-- /sidebar ad 350x250 -->
                <?php ?>
                <div class="navigation">
                    <?php View::newInstance()->_exportVariableToView('list_regions'Search::newInstance()->listRegions('%%%%''>=') ) ; ?>
                    <?php if(osc_count_list_regions() > ) { ?>
                    <div class="box location">
                        <h3><strong><?php _e("Location"'modern'); ?></strong></h3>
                        <ul>
                        <?php while(osc_has_list_regions() ) { ?>
                            <li><a href="<?php echo osc_list_region_url(); ?>"><?php echo osc_list_region_name(); ?></a> <em>(<?php echo osc_list_region_items(); ?>)</em></li>
                        <?php ?>
                        </ul>
                    </div>
                    <?php ?>
                </div>
            </div>
            <div class="clear"></div>
            <?php if( osc_get_preference('homepage-728x90''modern') != '') { ?>
            <!-- homepage ad 728x60-->
            <div class="ads_728">
                <?php echo osc_get_preference('homepage-728x90''modern'); ?>
            </div>
            <!-- /homepage ad 728x60-->
            <?php ?>
        </div>
        <?php osc_current_web_theme_path('footer.php') ; ?>
    </body>
</html>

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Regions on Sidebar
« Reply #3 on: July 23, 2015, 11:34:25 pm »
I've replaced my Modern main.php with your code and it's working for me... ???

Regards

brk

  • Newbie
  • *
  • Posts: 6
Re: Regions on Sidebar
« Reply #4 on: July 24, 2015, 02:41:35 am »
It is possible im doing something wrong in the admin panel? I tried install the modern theme again and replace the code and still not working, just regions with ads are being showed :/

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Regions on Sidebar
« Reply #5 on: July 24, 2015, 02:16:56 pm »
I think I know what's happening to you: this new function uses stats database table. Go to Admin Dashboard / Show More / Tools / Location stats.

Regards

brk

  • Newbie
  • *
  • Posts: 6
Re: Regions on Sidebar
« Reply #6 on: July 27, 2015, 05:09:35 pm »
It's working! thx u for the help my friend!!  :D

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Regions on Sidebar
« Reply #7 on: July 27, 2015, 05:22:45 pm »
You're welcome. :) Would you mind changing the title of this thread to something more descriptive, such as "All regions on Sidebar [SOLVED]"? Thanks.

Regards

tumbin2300

  • Newbie
  • *
  • Posts: 3
Re: Regions on Sidebar
« Reply #8 on: July 29, 2015, 12:26:33 pm »
HELLO FRIENDS,
Me new here ...... help me

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Regions on Sidebar
« Reply #9 on: July 30, 2015, 02:23:47 am »
Hi, welcome, please start a new thread and be more specific about the help needed please ;)

HELLO FRIENDS,
Me new here ...... help me

Aficionado

  • Guest
Re: Regions on Sidebar
« Reply #10 on: July 30, 2015, 02:30:59 am »
HELLO FRIENDS,
Me new here ...... help me

You are a filthy spammer.