Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • _CONEJO 11:50 am on August 27, 2012 Permalink | Reply  

    Customize columns and data in admin’s tables 

    In next version of OSClass we’ll be introducing some changes on the admin side. Don’t worry, everything will look and behave the same, but it will be more flexible for plugin developers to customize the information displayed. The changes affect to items, users, alerts, comments, media and page tables, and will allow plugin developers to add and remove columns. For example, the cars attributes plugin will show the make and model on the listings’ table, making it easier to manage your listings.

     

    Example code to modify the columns:

    // ITEMS TABLE HEADER
    function columns_items_table_header($table) {
    /* $table is a pointer to the table and not a copy, so the original DataTable is being used
    * USAGE :
    * $table->addColumn("my_identifier", __("Name of the colum", "columns"), $priority);
    * $priority is an integer from 1 to 10, being 1 the first (left) and 10 the last (right)
    */
    
    $table->addColumn("my_own_first_column", __("My First Column", "columns"), 1);
    $table->addColumn("my_own_last_column", __("My Last Column", "columns"), 10);
    $table->addColumn("my_own_column", __("My Own Column", "columns"));
    $table->removeColumn("category");
    }
    
    // ITEMS TABLE ROWS
    function columns_items_row($row, $aRow) {
    /* $row is the current row of the table (formatted)
    * $aRow is the raw data of the row (in this case, an item)
    * USAGE :
    * $row['column_identifier'] = "Cell text";
    */
    $row['my_own_first_column'] = "First (pk_i_id: ".$aRow['pk_i_id'].")";
    $row['my_own_last_column'] = "Last (s_secret: ".$aRow['s_secret'].")";
    $row['my_own_column'] = "Data (fk_i_category_id: ".$aRow['fk_i_category_id'].")";
    return $row;
    }

    As you could see, it’s very easy and intuitive.

    Download the complete example plugin

     
    • Jay 4:00 am on August 29, 2012 Permalink | Reply

      This will be a great feature. I cannot wait to use it. Thanks

    • Nasrul Kurniawan 5:02 am on March 15, 2013 Permalink | Reply

      Nice plugin..

    • Corey Ward 5:14 pm on July 23, 2013 Permalink | Reply

      Hi _CONJEO, I am trying to change the title displayed to the address (for realestate website) I am having trouble setting it up can you point me in the right direction to a guide or something perhaps?

    • Arnaud 3:55 pm on January 2, 2014 Permalink | Reply

      Hi, the plugin can’t be downloaded (Page not found)

    • Dart 11:48 pm on February 17, 2014 Permalink | Reply

      work with 3.3?

  • juanramon 6:56 pm on August 20, 2012 Permalink | Reply
    Tags: hooks, item-hooks, posted_item   

    Redirect to a landing page after adding a new listing 

    In certain cases, you want to redirect to a specific page after adding a new listing. You can get that result using the posted_item hook. Example:

        function redirect_to_landing($item) {
            osc_get_static_page('publish_ok');
            header('Location: ' . osc_static_page_url()); exit;
        }
        osc_add_hook('posted_item', 'redirect_to_landing');
        // add this code in the functions.php of your theme
    

    The code from above would redirect to a static page that has publish_ok as a slug. So, remember that you will have to create first that static page.

    The next example will redirect to the listing page:

        function redirect_to_landing($item) {
            View::newInstance()->_exportVariableToView('item', $item);
            header('Location: ' . osc_item_url()); exit;
        }
        osc_add_hook('posted_item', 'redirect_to_landing');
        // add this code in the functions.php of your theme
    

    The hook posted_item it’s available since the version 2.0.

     
    • DrLightman 4:32 pm on May 21, 2014 Permalink | Reply

      Thanks, it works

    • Stiffe 4:58 pm on October 9, 2014 Permalink | Reply

      In the first example, what do you mean with “a slug”? (need explanation)

      I have tried to make a static page in osclass adminpanel, with “publish_ok” as an internal name
      and inserted that code to my actual theme’s functions.php.

      And I have also tried the second alternative.

      None of them are working with Boxer theme.

    • hostyasui 9:36 am on December 17, 2014 Permalink | Reply

      not working for logged in users

  • garciademarina 10:37 am on July 17, 2012 Permalink | Reply
    Tags: admin, plugins,   

    Admin Menu example 

    There is an example of how to add new menu sections and submenu to your sidebar admin menu.

    • This example adds two menu sections and one submenu with external link.
    • The menu entries have a customized icon for normal and compact menu mode


    NOTE: Install like a plugin.

    Plugin structure:

    • example_adminmenu/index.php
    • example_adminmenu/ball.png
    • example_adminmenu/ballCompact.png
    • example_adminmenu/twitter.png
    • example_adminmenu/twitterCompact.png

    example_adminmenu

     
    • Lalita 5:01 am on August 3, 2012 Permalink | Reply

      Can you help me to hide or rename menus, add custom menus and more in admin(dashboard) page?

      • garciademarina 8:11 am on August 3, 2012 Permalink | Reply

        Hi @Lalita,

        If you want to remove menu or/and submenu sections form admin menu you can take a look at hAdminMenu.php helper,
        You can remove with osc_remove_admin_menu_page(ID_MENU) the menu entry ID_MENU and all submenus with parent menu id ID_MENU.
        You can remove with osc_remove_admin_submenu_page(ID_SUBMENU) only one submenu with ID_SUBMENU as id.

        If you need to update some data in AdminMenu, you can remove the section and add it again with the proper changes.

        You can see the default menus and submenus at oc-includes/osclass/classes/AdminMenu.php (function init.php) It can help you.

        Regards

    • Lalita 9:19 am on August 3, 2012 Permalink | Reply

      Wow SUPER!!! Thank You so Much…Muchas Gracias 🙂

    • greg 6:27 am on September 2, 2012 Permalink | Reply

      I installed the carousel plug in and it’s messed up the lower section of my admin menu. How can I fix this?

    • Tom shaft 12:24 pm on January 19, 2013 Permalink | Reply

      I installed and using your example, made a couple minor changes and works great. Thanks for posting.
      Tomshaft

    • Muhammad Muaz 6:13 am on March 19, 2013 Permalink | Reply

      Can you help me removing a menu item or menu from side bar of admin panel in OSClass

    • garciademarina 10:49 am on March 19, 2013 Permalink | Reply

      It’s as simple as:

      osc_remove_admin_menu_page(‘plugins’);
      osc_remove_admin_menu_page(‘stats’);
      osc_remove_admin_menu_page(‘settings’);

      or remove submenus:

      osc_remove_admin_submenu_page(‘items’,’items_settings’);
      osc_remove_admin_submenu_page(‘items’,’items_comments’);

    • Juanjo 5:16 pm on August 8, 2013 Permalink | Reply

      Hi, with new version 3.2, this example has stopped working.

      We should do changes in the CSS to adjust.

      My question is for other variables that are not in use in the example.

      Function “osc_add_admin_menu_page”:
      icon_url and position

      Any idea of using it?

  • juanramon 10:47 am on July 13, 2012 Permalink | Reply
    Tags: , translations   

    You can translate the last available themes in translate.osclass.org:

    If you don’t already have your account in translate.osclass.org, fill the form and we’ll get back to you soon 🙂

     
  • juanramon 10:36 am on July 10, 2012 Permalink | Reply
    Tags: pagination, styles   

    Pagination in v3.0 

    In v3.0 there are some changes regarding the pagination class. Now it’s a <ul> structure, so the pagination would be something like this:

    <ul>
        <li><span class="searchPaginationSelected list-first">1</span></li>
        <li><a rel="nofollow" href="http://domain.tld/category/2" class="searchPaginationNonSelected">2</a></li>
        <li><a rel="nofollow" href="http://domain.tld/category/3" class="searchPaginationNonSelected">3</a></li>
        <li><a rel="nofollow" href="http://domain.tld/category/4" class="searchPaginationNext">4</a></li>
        <li><a rel="nofollow" href="http://domain.tld/category/5" class="searchPaginationLast list-last">5</a></li>
    </ul>
        

    Furthermore, now the selected page it’s not a link. The main reason it is to not mislead google, because we were linking to the same page. So, we’re using a <span> tag instead of link .To sum up, remember to modify properly your css to show in a line the pagination.

    For example: .paginate ul li { display: inline; }

    You must upgrade this in your themes in order to work properly in v3.0.

     
    • gian luca 12:23 am on July 16, 2012 Permalink | Reply

      hello, where do i have to make this changes?

      • juanramon 10:54 am on July 17, 2012 Permalink | Reply

        In the style.css file. If you’re using some theme already available in market.osclass.org/themes and it doesn’t looks well, don’t worry, we’re going to update the themes during this week 🙂

    • Carlos 1:00 am on December 11, 2012 Permalink | Reply

      how to show all the ads in pagination the current limit is 100 in modern theme

  • osclass 12:11 am on June 28, 2012 Permalink | Reply  

    Welcome 

    From now on, you can follow our progress here. We’ll post the latest development updates from the OSClass team. As a beginning, we’ve just changed the system to translate OSClass: translate.osclass.org. We’re still working on making all plugins and themes available for translation, but they will be live by the end of this week. If you have any kind of trouble , don’t hesitate on comment it here.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel