Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • _CONEJO 9:25 am on March 19, 2013 Permalink | Reply  

    Upcomming changes in Osclass 3.2 

    We’re going to make a few changes in Osclass 3.2, one of them is we’re updating Jquery library to its 1.9 version, that means JQuery will be on 1.9, JQuery-ui on 1.10.2, Fancybox on 2.1.4 and JQuery-uniform will be on current development branch (since stable does not support JQuery 1.9 yet). We also have added JQuery-migrate plugin, which makes JQuery 1.9 backward compatible, but it’s not used by default.

     

     

    I suggest you to start updating your themes and plugins to work with  JQuery 1.9

     

     
    • pubic52 7:12 pm on March 23, 2013 Permalink | Reply

      please please try include this in next version http://osclass.uservoice.com/forums/183966-general/suggestions/3771363-searching-by-seller-name-list-of-sellers-0-9-a-z
      basically user manage page in admin panel is directly that (search by name + directory list)
      i so damn wanna use osclass but absence of this keep me away
      some donate will follow for sure ;) thx

    • Ankita 2:19 pm on April 7, 2013 Permalink | Reply

      how do I download the latest version of OS Class.. I am only able to download the 3.1 version from the website. Please advice

    • M 6:33 pm on April 9, 2013 Permalink | Reply

      Please include in the new version the option to remove “PRICE” from any category that has not sense for price. but example .. Personals, Adults, Community…. etc… it should be an option.

      Thanks you.. great job. hope very soon when I get more involve with the code give my collaboration.

      thanks.

      M

    • greg 4:29 am on May 17, 2013 Permalink | Reply

      Unfortunately no one is fixing this bug. If the “PRICE” box remains in the Personals, it basically makes it out to be a prostitution service.

    • ankita 11:47 am on April 9, 2013 Permalink | Reply

      I want to add a menu (which is being added using categories) like “How it works” for my site.. and this menu of “How it works” has only text on it.. but I am not able to create such menu with only text and no listing on it..
      I thought I should add a page from the backend and than try to link it to that menu somehow but still it doesn’t work that way too..
      Please advice how do I add a menu in the main menu of the site?

    • ashok 7:25 am on April 10, 2013 Permalink | Reply

      hi,

      we are using osclass framework and stuck in b/w on some place

      we need developer help can anyone help us out

      we can pay for that thing

      please approch us on flash.ria.developer@gmail.com

      sorry if i am not approaching right candidate but you can help us in finding developer.

  • _CONEJO 12:48 pm on February 19, 2013 Permalink | Reply  

    Make your plugins more secure with anti CSRF functions 

    In Osclass 3.1 we included some anti-csrf functions. What is CSRF? Wikipedia has a good explanation about Cross-site request forgery (CSRF). You probably have seen it in some videos or images shared on social networks. You think you’re clicking on the play button, but instead, you’re doing a “like”, “share” or “retweet” without even knowing.

     

    This attack relays on cookies and session that keep alive the identity and login of the victim, for example, I do not enter my password every time I go to Facebook or Twitter, therefor someone could craft an URL and open it inside an iframe. So when I visit the attacker’s page, an iframe with a specially crafted url is opened by the browser (but invisible to the user), it will take the credentials from the browsers (if cookies and session are not cleaned) and access the iframe impersonating me, and it could do a like, share or whatever, it could make any change that the website allows me.

     

    To avoid this, we included anti-csrf functionality in Osclass 3.1. It works creating two variables an storing them in the session and sending it to the user, on each form or link, the user should send back the variables and Osclass will check them against the stored values, after that, delete them to never be used again. In short, you tell the visitor a random number, and if he wants to do something on your site has to tell you that number or he will not be allowed. Each time he wants to do something, you think of a different number.

     

    Most of functions that make this possible are at the end of utils.php, but in theory your only need to work with the three helpers at hSecurity.php osc_csrf_token_form, osc_csrf_token_url and osc_csrf_check.

    • osc_csrf_token_form(): Will include the two variables in form format (<input type=”hidden” />). NOTE: To maintain compatibility with themes, this  is added automatically in every form, no need to do it by yourself.
    • osc_csrf_token_url(): Will include the two variables in url format (CSRFName=ABC&CSRFToken=XYZ). NOTE: There’s no character befor “CSRFName”, sometimes you will need a “&” and others a “?”, depends on your url
    • osc_csrf_check($drop): This will perform the check if the tokens are correct or not, if not, it will ouput the message “Probable invalid request” and stop the execution of the PHP file. This function should be used on the code that receives the information. NOTE: $drop is a boolean (true / false) variable. It will drop (clear, delete) the variables every time (to be more secure), but ajax request needs to reuse the tokens, so if you’re doing an ajax request, use osc_csrf_check(false) to not clear the variables (but they will be invalid after an hour of the creation).

     

    If you want to make more secure your plugins, start using these functions but remember they’re only available on Osclass 3.1 (and later)

     
  • _CONEJO 2:34 pm on January 7, 2013 Permalink | Reply  

    Going back to work 

    Some of you maybe have noticed that the development of Osclass has slowed down a little bit, that’s true and we’re going to fix that. We’ve lost focus for a moment, but we’re back on tracks and next version (3.1) will be released very soon with some new features (a lot of them!).

    In the meantime, we’ve opened a new website for your suggestions about Osclass, so if you have any idea tell us there. Please, for problems, we still have the forums.

    Happy new years!

     
    • David 11:41 pm on February 4, 2013 Permalink | Reply

      Customize columns and data in admin’s tables

      What happened to the example plugin?

    • enjoyPB 12:42 am on February 6, 2013 Permalink | Reply

      Hi there. I posted a request to help fix the map of the USA because it’s missing our nation’s capital, which is not a state but, a 51st zone (in Maryland). I also recently discovered this open-source CSS based US map (http://intridea.github.com/stately/) and was wondering if you might be able to incorporate it in OSClass. My site is at http://www.gunbuyback.us/buy and if anyone wants to help please let me know! Thanks :)

  • juanramon 1:43 pm on October 22, 2012 Permalink | Reply
    Tags: database, host, mysql, port, port-number   

    MySQL alternate port number 

    If your host uses an alternate port number you just need to add it after the mysql host name constant: DB_HOST. For example:

    define('DB_HOST', 'localhost:3300');

    Another example:

    define('DB_HOST', 'mysql.dreamhost.com:3300');
     
    • Dan 9:17 am on October 24, 2012 Permalink | Reply

      Thanks for the information! I was testing Osclass with MAMPP at localhost, so the mysql default port was the 8889 and I didn’t know how to fix the problem. Cleaner that than change the default mysql port!

  • garciademarina 4:25 pm on September 7, 2012 Permalink | Reply  

    Email templates improvements 

    Osclass have email templates for multiple purposes such as verify user account, notify new items, etc.

    You can customize your email templates like you want, going to

    ‘Admin panel -> Settings -> Email templates’

    Edit email template » osclass test - OSClass

    As you can see, email templates can have email variables  like {EMAIL_VAR}  in Title and Description (  title as email subject and description as email body ).

    For example you can have a email template with a subject like this:

        ‘Hi {USER_NAME} welcome to {WEB_TITLE}’

    There are two email variables, which will be replaced before email is sent.

        {WEB_TITLE}  , will be replaced by web title.

        {USER_NAME}, will be replaced by user name.

    We will receive an email with subject like:

        ‘Hi Carlos, welcome to osclass.org’

    Recently added :

    •  Test it button, that allows you given an email to send a template preview of the actual template.
    •  A legend with short descriptions of email variables to make email templates more understandable.
    Edit email template » osclass test - OSClass
    Edit email template » osclass test - OSClass

    Example of Use

    Plugin name: send_email_example

    Description: This is an example that create his own email template and send emails with custom email variables.

    This plugin sends an email saying thanks and showing the number of items belonging to a user, when a listing is added by user and only if user have more than one item published.

    This plugin use EmailVariables class, that is used when edit email templates for show the legend, in this case add {NUMBER_LISTINGS} variable and set a description.

    EmailVariables::newInstance()->add(‘{NUMBER_LISTINGS}’, __(‘Number of listing that belong to user.’, ‘send_email_example’));

    Here you can download a plugin example. ( Plugin is well documented If you have any doubt don’t hesitate to ask )

    NOTE: This features are only available if you use a develop branch of Osclass. Will be added on Osclass 3.1.0.

     
  • _CONEJO 7:26 am on August 29, 2012 Permalink | Reply  

    Import listings from other sources easily 

    We’ve just created a new plugin that allows you to batch import listings from other sources. The plugin import a XML file with all the information of your listings, the XML have to be carefully crafted in order to work smoothly. Please, consider the plugin as in test state, it works well under specific circumstances, it could fail if something is wrong with the XML structure. There’s included an example.xml file to serve as an example, it’s pretty self-explanatory

    Some notes about the XML structure:

    • The first line has to be  <?xml version=”1.0″ encoding=”utf-8″?>
    • You could import as many listings as you want, but we suggest to import them few by few to avoid timeouts (strongly suggested if you’re also importing pictures) In order to import pictures, the oc-content/downloads folder should be writable
    •  Importing pictures could take quite a time, please, be sure to set the PHP script timeout is enough high so it will not fail
    • The plugin will insert the basic data, if you have any plugin that required some kind of extra data (as cars, jobs, real estate attributes,…) it will fail (we’re working on that)
    • Only one field is required to set the category, <categoryid> is a NUMBER, the category’s id which already exists, <category> is a string, the title of the category, it may exists or not, if it does not exists, it will create one with that title
    • category, title and content fields required an attribute “lang” to specify the language, if none is set, the default language of OSClass will be used
    • If a field is not set, an empty string will be used

    Remember, this is an importer, it WILL NOT create the XML by itself. We’re working on solutions for most popular classifieds softwares, that will allow you to export the data in the correct XML format.

     

    Warning: It’s a beta version, DO NOT use it on a production environment or with data you don’t have backup of. We’ve just released it via our plugin market.

     
    • Jay 2:05 pm on August 29, 2012 Permalink | Reply

      This looks like a great plugin. For some reason though I cannot import the example.xml file. The error it gives me is “Category invalid. (Item 0) Category invalid. (Item 1)”

      Jay

      • mmks 7:51 pm on October 8, 2012 Permalink | Reply

        Hi, problem is file index.php line 37, now is:

        $catId = @$listing->getElementsByTagName(“catehgoryid”)->item(0)->nodeValue;
        must be
        $catId = @$listing->getElementsByTagName(“categoryid”)->item(0)->nodeValue;

    • _CONEJO 2:11 pm on August 29, 2012 Permalink | Reply

      Hi Jay,

      That’s probably because you have no category with ID = 1, I leave and as an example, feel free to remove tags on both listings, and it should work (and create new categories with the names specified).

      We’re currently working on a plugin for Classipress to export listings to this format, not sure which other software should be interesting to.

      • Jay 3:27 am on August 30, 2012 Permalink | Reply

        I tried it by removing the category id and it created a new category but did not add the ads. I also tried setting the category id to the id of the new category that was created and got the same error as above.

        Jay

    • Alejandro 6:11 pm on September 2, 2012 Permalink | Reply

      Hola CONEJO, me alegra mucho la idea de desarrollo del plugin de importación de anuncios en formato XML. Desconozco en que avance del plugin estas ene ste momento. Mi consulta o sugerencia es si no será recomendable insertar las imágenes en los anuncios desde la url donde se realiza el anuncio e insertarlo con DIV IMAGE en lugar de descargar las imágenes al servidor del sitio. Esto nos ahorraría demoras con el plugin, además al desconocer el tamaño de las imágenes creo que puede generar muchas demoras tal como te está sucediendo.

      • _CONEJO 6:25 pm on September 2, 2012 Permalink | Reply

        Hola Alejandro,

        Es una idea, claro y perfectamente realizable tal cual está el plugin (ahora mismo). En el contenido del anuncio solo debes concatenar las imágenes en tags “” y listo. Sin embargo, ocurren varios problemas con eso:
        Al estar en el contenido puede ser que las imágenes no se adapten al estilo/theme que tengas, haciendo que se vea raro (en mitad del contenido y no en el sitio especificado por el theme). También, las imágenes estarían alojadas en la vieja ruta, si estas cambiando de servidor, de dominio o cualquier otra cosa, se vería que la imagen está alojada en otro sitio.

        En cualquier caso, tu idea se puede hacer tal como está el plugin, nosotros solo ofrecemos una posibilidad más, en mi humilde opinión, la más correcta, o al menos que debería hacerse.

        Como bien dices, puede tardar demasiado en descargarse las imágenes, por eso hago tanto incapié en ese tema. En teoría, un servidor decente tiene 1000/100Mbps más o menos, lo cual hace que la descarga sea bastante más rápida que tu conexión de casa y no debería haber mucho problema. Sin embargo, el timeout por defecto de PHP es de 30 segundos, si estás importando una gran cantidad de anuncios, está claro que vas a superar ese límite, por eso, simplemente aviso. Sin embargo, mover gran cantidad de información y datos, es lo que tiene, tiempo de proceso/transferencia.

    • claudio klemp 8:24 pm on October 25, 2012 Permalink | Reply

      Hi everyone… I’m pretty new to this board, but can you tell me where I can find this plugin, in http://market.osclass.org/plugins/ I couldn’t find it.

    • claudio klemp 4:45 pm on October 27, 2012 Permalink | Reply

      Hi _CONEJO, first of all thanks for the speed in answering, furthermore before answering enjoy the weekend… here in Brazil it becomes just summer….

      Now the question :

      If the xml file does have additional fields outside of :

      quote

      Only one field is required to set the category, is a NUMBER, the category’s id which already exists, is a string, the title of the category, it may exists or not, if it does not exists, it will create one with that title

      unquote

      1.) Will those fields become database fields , so usable or will those fields just been ignored ?

      .. or better ( might be a good idea for programming )

      If I have an XML File , I have also the fields and the field names, accordingly I can copy the basic template structure and build an automatically the input / output screens / reports and data tables.

      2.) I guess a major issue of whoever is setting up the system is that you start up with an empty market / database, generating the problem of other people to start to post their announcements.
      Accordingly one technic could be to scrape some data and import it for the startup …

      Might be a good idea to share this scraping info between users.

      3.) Same is valid to identify the right xml file splitter, as you ask already to use small numbers.

      This by the way could become a module of the same importer allowing you to rewrite also the field names of the xml file , thus setup category and categoryid, then rewriting the original xml file 10 records per time to be thenafter imported.

      Hope , my ideas are a bit useful to you and the board here, looking forward to hear from you.

      Claudio Klemp

      • _CONEJO 5:27 pm on November 5, 2012 Permalink | Reply

        Hi Claudio, sorry for the late reply.

        1.- Yes, if the category’s name is supplied and it does not exists in your current database, a new category will be created (it will be a parent category)

        2.- Default information depends a lot on which kind of classifieds sites you are going to host. Generic info will be useless if your classifieds site is about used cars, that’s the reason (plus add location issues and language) why we didn’t release any “starter pack” to boost your site at the beginning with some bogus/fake ads.

        3.- Great! Thanks for the suggestions, I hope to have a little more free time and improve the plugin with your ideas, I really like them.

        • claudio klemp 7:40 pm on November 7, 2012 Permalink | Reply

          Back again…

          I’m actually struggeling with my point 3 suggestion … which should work with a major real estate network and more than awful xml files ( 6MB and more not UTF-8 … guess you know well what that means )

          At this time I have build a splitter to devide the xml into records and now writing a reader to rebuild the entire thing ….

          Problem arising :

          If you do not have geo-localizzation you get a problem …

          Thus I’m playing again with some combined google / yahoo and j.maxmind.com java scripts allowing to :

          1.) identify the geolocation lat/long based upon the geo- localization capacities of the browser , depending on the internet provider exact up to 2 meters.

          2.) guessing the ip coordinates using your ip against a database.

          3.) guessing your location analyzing the text ( yahoo experimental interface )

          a sample is viewable on http://morethanvoice.net/auto_map/httpmap.php

          Thus now the idea and major question :

          In the module where you enter what you want to sell, you need to place your address data more or less completely…
          why not guess it and accordingly rebuild the street address automatically and fill up the field ?

          Accordingly the question … who dealt with the addressing data, to have a talk with ?

          Regards

          Claudio Klemp

    • ronny das 3:49 pm on November 5, 2012 Permalink | Reply

      when i am login my panel shown me this error ..what can i do for this.. please help me ….

      osc_add_admin_submenu_page() in /home/adxp/public_html/oc-content/plugins/importer/index.php on line 15

      • juanramon 4:39 pm on November 5, 2012 Permalink | Reply

        Are you using Osclass 3.0.x? It’ll work only in version 3.0 or higher.

    • claudio klemp 2:43 pm on November 12, 2012 Permalink | Reply

      Hi Coneo_, The script is working fine and you should advice that the language tag lang=”en_US” is mandatory in certain fields , as the import stucks if missing.

      Unfortunately I also identified an issue …

      Issue : Multiple Image importing
      =========================

      If the xml features images to be imported , and may be also 10 or 11 with the relative http address we obtain may be three or four images usually three out of them with different names, but the same image.

      I understand that there is a problem in streaming, as one image is going to be fetched and in the between the next is overwriting the previous image, problem which could arise as I’m processing 10 xml records per file.

      Here some pages :

      http://todonatal.dunia.net/index.php?page=search&sPattern=natal&sCategory=46

      http://todonatal.dunia.net/index.php?page=item&id=13

      I suggest :

      A.) Prior check if one or more images…, in case of one image fetch it and save it locally, otherwise leave the the external http address and place the hyperlink into the database, which might generate a problem regarding the local-directory/imagename local-directory/imagename_preview, local-directory/imagename_thumbnail construct.

      B.) The importer opens an inner frame ( iframe ) processes the first xml record, then posts the second into the iframe and so on, generating a loop of single posts, where the timeout (new post) could be managed by a callback of the last loaded image.

      I would prefer the solution B.), as in my case I had a 6GB xml file to be imported, thus I had to split it into single records, then I rearranged the xml tags to fit the importer requirements and assembled new xml files of 10 units.

      Thus thinking in terms of automating the task with your importer I would play it the way :

      1.) Upload the XML file whatever size it is ….
      2.) Split the XML file in single records
      3.) Process the XML tags against the required fields through a mask or convert them automatically

      ………. = input xml field name
      …… = input xml field name
      …. = … etc

      *********** note *************

      see postscriptum

      *********** note *************

      4.) Post every single transformed xml record into the plugins/importer/index.php instead
      of the uploaded xml file, issuing a callback (javascript calling the a parent frame function) from plugins/importer/index.php once all images have been loaded, to restart from point 3 fetching the next record.

      Let me know your ideas, or by return give me an email to submit the code of 1,2,3 which is already working for us.

      Claudio

      PS.: I took a open source code working with the Google Api written by Vinsensius Angelo
      ( http://www.phpclasses.org/package/7595-PHP-Get-the-coordinates-of-an-address-with-Google-Maps.html ) allowing to obtain an address by latitude / longitude or viceversa obtain latitude / longitude by passing an address, thus complete the requested dataset.

      • _CONEJO 8:59 am on November 19, 2012 Permalink | Reply

        Hi Claudio,

        I took note of your suggestions, they’re very good ones,

        Thanks!

      • Jake G. 9:25 pm on February 11, 2013 Permalink | Reply

        Complete newby, first post. I’m blown away by the quality of this SW and the community, keep up the good work!

        Re: Multiple Image Importing using Ad Importer
        ==================================

        Hopefully this feedback is helpful for someone experiencing the same problem.

        Had some trouble with duplicate images when importing listings with multiple images. I found a quick fix by changing one line in index.php:

        OLD
        $tmp_name = “adimporterimage_”.time();
        NEW
        $tmp_name = “adimporterimage_”.time().”_”.rand().rand();

        Appears to work for me, so I am assuming that the files were being downloaded faster than one second and therefore creating duplicate download filenames. Disclaimer – Zero PHP experience here, so maybe someone could verify and/or post a better solution. -Jake

    • claudio klemp 2:54 pm on November 12, 2012 Permalink | Reply

      Please read the above :

      ………. = input xml field name
      …… = input xml field name
      …. = … etc

      *********** note *************

      see postscriptum

      *********** note *************

      as :

      listing
      title lang=”en_US” ………. = input xml field name
      content lang=”en_US” ……. = input xml field name
      category lang=”en_US” … etc
      categoryid
      contactemail
      contactname
      price
      currency
      address*********** note *************
      city_area
      city
      postcode see postscriptum
      region
      country
      latitude
      longitude*********** note *************

      image
      image
      image

      datetime
      /listing

      the minor / major signes went truncated in the post

      Claudio

    • Salva 4:00 pm on November 17, 2012 Permalink | Reply

      Hi I think that this would be interesting to include a field to embed a link. It would be possible and if so how? thank you very much

      • claudio klemp 2:11 pm on November 30, 2012 Permalink | Reply

        Hi Salva I’m testing actually additional fields to be imported , let you know asap

        Claudio

    • jose 12:28 pm on November 28, 2012 Permalink | Reply

      Hello, I have ClassiPress theme and I get the following error:

      Fatal error: Call to undefined function osc_register_plugin () in / home / mganware / freeadsclick.com / wp-content / plugins / importer / index.php on line 222

      any solutions?

      thanks

      Jose

      • _CONEJO 12:38 pm on November 28, 2012 Permalink | Reply

        Hi jose,

        This plugin is for Osclass, not for classipress. This plugin should be installed in your Osclass installation and will allow you to import your classpress ads to Osclass.

        Thanks

    • jose 12:44 pm on November 28, 2012 Permalink | Reply

      thanks

    • jose 3:54 pm on November 28, 2012 Permalink | Reply

      Hello, I installed the USA osclass themes folder and I can not run,

      error:

      Fatal error: Call to undefined function osc_add_hook() in /home/mganware/www.unete-net.com/wp-content/themes/usa/functions.php on line 42

      any suggestions?

      thanks

      Jose

      • _CONEJO 4:01 pm on November 28, 2012 Permalink | Reply

        Hi jose,

        All those themes and plugins are meant to be used with Osclass, open source classifieds. We’re not related to wordpress or classipress in any way. They are two different softwares and unfortunately, themes and plugins are not interchangeable among them.

        Thanks

    • jose 4:21 pm on November 28, 2012 Permalink | Reply

      as installed osclass system on my hosting ?

      download link?

      thanks

      jose

    • jose 4:48 pm on November 28, 2012 Permalink | Reply

      Thank you very much for your attention

      I’ll try and install one of one my domains

      thanks

    • jose 6:26 pm on November 29, 2012 Permalink | Reply

      mmmmm

    • ashok 5:51 am on December 19, 2012 Permalink | Reply

      hi i am using OS class but unable use the import listing plugin i have few queries in my mind
      how i come to know category id ?
      please provide sample standard xml so user can understand

      • claudio klemp 2:33 pm on January 7, 2013 Permalink | Reply

        Category_id

        I use Navicat ( works on Apple as well as on Windows ), connect to the database and look into oc_t_category and oc_t_category_description (if you maintain the default naming) otherwise refer to something + category.

        Otherwise install and use the php myadmin (freeware) which allows you to do the same serverwise.

        Regards

    • James 2:24 pm on December 23, 2012 Permalink | Reply

      Great plugin! Thanks.

      How many custom fields can it create?

      • James 1:08 pm on December 27, 2012 Permalink | Reply

        Has anyone successfully used the custom field with the ad import plugin? I’ve tried everything I can think of and yet can’t get it to work. It works fine from within the add a new ad from the site but I can’t get it to work in the upload xml file.

    • James 9:36 pm on January 10, 2013 Permalink | Reply

      The postcode field doesn’t make it to the db and I can’t get the custom field to work. Anyone else have this problem?

    • Claudio klemp 11:25 pm on January 10, 2013 Permalink | Reply

      As i already mentioned in another post above, you are sometimes required to use such a xml structure to get it working, may be it helps.

      title lang=”en_US” ………. = input xml field name
      content lang=”en_US” ……. = input xml field name

      Claudio

    • James 12:12 am on January 15, 2013 Permalink | Reply

      Thanks Claudio, but that didn’t work. Are postcode and custom fields working for you?

      • Claudio klemp 7:41 pm on January 15, 2013 Permalink | Reply

        Postcode is working, also several custom fields… But regarding these i changed the entire program to generate other xml files and comma delimited files to allow a further import on planyo.com , so pls consider just postcode.

        It might be, that you enter into a problem regaring a missing postcode, which in my case didnot happens as i regenerate the address fields using google maps.

        Thus look if the import hangs due to missing values.

        I hope it helps, we have changed that much the original code for our processing here that i have to remember by heart the problems we faced, but the ode sorks for us importing 6.6 mb xml files, thus 3.000 records per file.

    • allan 12:36 pm on January 17, 2013 Permalink | Reply

      Cannot create categories in version osclass.3.0.2 .

    • Chema 2:50 pm on January 19, 2013 Permalink | Reply

      _CONEJO,… a ver si me puedes ayudar,… estoy teniendo problemas en la importación con las imágenes,… solo me toma una, osea si el nodo incluye pe. 4 tags pues inserta 4 imágenes pero es la misma imagen, osea toma la ruta de una ellas, alguna vez 2, es como si no bajara la imagen correctamente,…

      otro detalle menor, en la función adimporter_ad() se indica que se lea el tag “cityarea” pero el tag en el example.xml esta como “city_area”

      si consigo montar un entorno real para testar osclass me gustaría trasladar un site con 60.000 anuncios y 300.000 imágenes pero es fundamental ver como manejamos el tema de importar tanto los anuncios como las cuentas (15.000)

      te agradecería mucho una ayudita

    • Max 5:56 pm on January 19, 2013 Permalink | Reply

      Guys can you explain us how to import ads from Craigslist, if possible?

      • claudio klemp 1:00 pm on January 25, 2013 Permalink | Reply

        You have to take the example file in the distro, then setup a sort of translation between craigslist xml field names and the one of the example file… attention to the language tag, you should copy as it is.
        I did it directly in the importer.php with such a costruction :

        if(is_array($xmlarray1) ) {
        foreach($xmlarray1 as $counter => $fieldarray) {
        if($fieldarray['name'] == ‘title’) {
        $dataset .= ”.” \n\r”;
        }
        if($fieldarray['name'] == ‘content’) {
        $dataset .= ”.” \n\r”;
        }

        where xmlarray1 would be the field array (in your case Craigslist) to be translated into the $dataset string, thus building the xml file to be injected.

        I guess, as you say Craigslist the thing will be pretty huge as in my case, thus I’m going to save with file_put_contents every dataset, then seperately with another routine read one dataset after the other and inject the same into the importer.php routines adding the record to the data tables and importing the images , thus redimensioning them into thumbnails, etc.

        The hook I used to issue these different behaviours is in the upload xml file routine :

        If a file is mentioned I upload and split it into thousands of small xml files (1 record each), if I do not mention a file and press submit, I just pass one xml file (record) after the other into the program routine, (as it would be the import.xml example file) deleting it afterwards.

        By placing an :

        osc_add_flash_error_message(__(“Processing “. $counter .” (“.$filename.”)”, ‘adimporter’), ‘admin’);

        in the middle of the file reading loop, you escape too the php processing timeout of 30 seconds, although you will not show the message except on the last record. I nay case i setted the php timeout in the php.ini file to 300 seconds = 5 minutes to be sure to process 3.000 and more records (more or less 5 hours processing time ).

        Hope it helps

        Claudio

        • claudio klemp 1:05 pm on January 25, 2013 Permalink | Reply

          Sorry the dataset tag did not went through :

          foreach($xmlarray1 as $counter => $fieldarray) {
          if($fieldarray['name'] == ‘title’) {
          $dataset .= ‘[title lang="en_US"][![CDATA['. $fieldarray['text'] .’]] ][/title]‘.” \n\r”;
          }
          if($fieldarray['name'] == ‘content’) {
          $dataset .= ‘[content lang="en_US"][ ![CDATA['. $fieldarray['text'] .’]] ][/content]‘.” \n\r”;
          }

          Have exchanged the minor / major brackets with angle brackets one.

          Sorry for inconvenience

          Claudio

    • Nikolsy 1:25 pm on January 20, 2013 Permalink | Reply

      Hello, and can be imported to Russian text?

    • Nikolsy 1:27 pm on January 20, 2013 Permalink | Reply

      And to do this, please tell me

    • Jagoman 9:46 am on January 25, 2013 Permalink | Reply

      Hi, Looks great! But, rather than importing information from an XML file, is there a way to read XML files that are online (data feeds), which are constantly updated?

    • Nikolsy 9:37 pm on January 27, 2013 Permalink | Reply

      you open the xml file? how to edit?

      • jagoman 9:44 pm on January 27, 2013 Permalink | Reply

        Its for agencies to edit. You just read it and update your database on a daily basis

    • Matthew 5:49 pm on January 29, 2013 Permalink | Reply

      Hi I’m still having problem I tried importing the example xml file into excel and then pasting my data into the columns into the right columns within the example file.

      Does the program require latitude and longitude or can you remove some fields?

      Is there any way of automating the process of creating an xml file from a csv or some excel spreadsheet?

      Kind Regards,

      Matthew

    • Jim 12:17 pm on March 19, 2013 Permalink | Reply

      stupid question but how do you actually import. I installed the plugin fine and everything but how do you actually ‘import’ the data onto your osclass site?

      • Jim 1:39 pm on March 19, 2013 Permalink | Reply

        oh, ok i see but um now its says no ad dectected lol

        • Jim 2:04 pm on March 19, 2013 Permalink | Reply

          ok ok you guys can delete by comments. i figured it out lol but the ads doesnt add to the counter but i guess thats a small price to pay. thanks

          • Jim 2:08 pm on March 19, 2013 Permalink | Reply

            well the counter is updated on the actual category fields but if you have the states listed the right the counter remains the same.

  • _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

     
  • 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.

     
  • 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’);

  • 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 :)

     
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