Advertisement:

Recent Posts

Pages: [1] 2 3 ... 10
1
General help / Re: Search only in the title of the article
« Last post by patrickFromCroatia on Today at 12:10:23 am »
Hello,

I checked the search model file, don't see any hooks in makeSQL function. If you want a core mod, I think replacing
    "$this->dao->where(sprintf("MATCH(d.s_title) AGAINST('%s' IN BOOLEAN MODE)", $this->sPattern) );"
with
    "$this->dao->where(sprintf("MATCH(d.s_title) AGAINST('%s' IN BOOLEAN MODE)", $this->sPattern) );"
in oc-includes/osclass/model/Search.php may work.

But what if we use 'search_conditions' hook and change "sPattern" in theme files with something like "sKeyword" and then add this function:

Code: [Select]
<?php
function wm_search_keyword_title($params) {
    foreach(
$params as $key => $value) {
        switch(
$key) {
            case 
'sKeyword':
                
Search::newInstance()->join(DB_TABLE_PREFIX.'t_item_description as d','d.fk_i_item_id = '.DB_TABLE_PREFIX.'t_item.pk_i_id','LEFT');
                
Search::newInstance()->addConditions(sprintf("MATCH(d.s_title, d.s_description) AGAINST('%s' IN BOOLEAN MODE)"$value));
                if(
OC_ADMIN) {
                    
$locale_code[osc_current_admin_locale()] = osc_current_admin_locale();
                 } else {
                    
$locale_code[osc_current_user_locale()] = osc_current_user_locale();
                 }
                 
$this->dao->where(sprintf("( d.fk_c_locale_code LIKE '%s' )"implode("' d.fk_c_locale_code LIKE '"$locale_code)));
                 break;
             default:
                 break;
        }
    }
}
osc_add_hook('search_conditions''wm_search_keyword_title');

Well honestly, I have no idea. But you can try it, it may work.  :P

Regards.
2
Okay, good luck. :) You may try putting <?php echo osc_item_description(); ?> in a wrapper and playing with CSS, or putting "<br>" after <?php echo osc_item_description(); ?> etc.

Regards.
3
General help / Re: Protect your OSCLASS ADMIN
« Last post by patrickFromCroatia on January 18, 2019, 11:57:19 pm »
Hello,

So we can protect oc-admin with various techniques, but how to protect config.php which is in the public folder? Well, the answer is actually very simple - I just tested it and it works fine.
But please, do this at your own risk!

  • Backup oc-load.php and config.php.
  • Move config.php to oc-admin or any other protected directory.
  • Open oc-load.php.
  • Replace all "config.php" with "directory_name/config.php". "directory_name" is for example "oc_admin".

Example when config.php is in oc_admin:

Code: [Select]
if( !file_exists(ABS_PATH . 'oc-admin/config.php') ) { // <--- oc_admin/config.php
    require_once LIB_PATH . 'osclass/helpers/hErrors.php';

    $title   = 'Osclass &raquo; Error';
    $message = 'There doesn\'t seem to be a <code>config.php</code> file. Osclass isn\'t installed. <a href="http://forums.osclass.org/">Need more help?</a></p>';
    $message .= '<p><a class="button" href="' . osc_get_absolute_url() .'oc-includes/osclass/install.php">Install</a></p>';
    $message .= '<hr><br>';
    $message .= '<div class="form-table" style="text-align:center">';
    $message .= '<h3 style="font-weight: 400;font-size: 1.1rem;margin: 0;margin-bottom: 10px;">Discover the best hosting providers and promotions for Osclass</h3>';
    $message .= '<p style="line-height: 1.5em; margin:0px;">We have a partnership with the best hosting companies, check our promotions and get premium Osclass plugins and themes for free!</p>';
    $message .= '<p><a href="https://osclass.org/page/hosting?utm_source=installation-hosting-page&utm_medium=installation-error&utm_campaign=hosting_page" target="_blank" class="button"/>Get Hosting!</a></p>';
    $message .= '</div>';
    osc_die($title, $message);
}

// load database configuration
require_once ABS_PATH . 'oc-admin/config.php';  // <--- oc_admin/config.php
require_once LIB_PATH . 'osclass/default-constants.php';

I hope this helps.

Regards.
4
General help / Re: Delete all ads with images older than xxx days
« Last post by marius-ciclistu on January 18, 2019, 10:57:51 pm »
I forgot about this functionality of osclass. But then why are there expired ads showing in UI?
5
General help / Re: Delete all ads with images older than xxx days
« Last post by cartagena68 on January 18, 2019, 10:33:00 pm »
he said
Quote
I changed this value from 0 to 100 (days), but old ads are still displaying
so i think they are expired
6
General help / Re: Delete all ads with images older than xxx days
« Last post by marius-ciclistu on January 18, 2019, 10:30:01 pm »
they are not expired:)
7
General help / Re: Protect your OSCLASS ADMIN
« Last post by marius-ciclistu on January 18, 2019, 10:28:37 pm »
I tried wget. it retrieves empty config.php just like in browser.
8
Español / problemas con campos personalizados url
« Last post by javipcriot on January 18, 2019, 10:23:18 pm »
¿alguien sabe a que es debido que al añadir un enlace en el anuncio (campo personalizado url) el anuncio no se publique?
cuando no se pone enlace si se publica
he probado con varias versiones de osclass
3.8.0
3.7.4
3.7.1
con la plantilla que viene por defecto ¿bender? y osclasswizard
gracias.
9
General help / Re: Protect your OSCLASS ADMIN
« Last post by davidyan on January 18, 2019, 09:59:54 pm »
Hi Aficionado,
I did not expected when publishing my little trick that it will go to so many posts.
The best thing to protect any server is doing it through SSH console.
That's what I've done with my dedicated ones
David
10
General help / Re: Delete all ads with images older than xxx days
« Last post by cartagena68 on January 18, 2019, 09:43:12 pm »
you can google "renew ads plugin", the plugin have the function to delete the expired ads
Pages: [1] 2 3 ... 10