51
hervet
Re: Cannot Add New Items. How to Debug? Oledrion
  • 2009/1/29 9:11

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


As Mamba suggested, please update to the last version.



52
hervet
Re: Oledrion serach option case withot results
  • 2009/1/29 9:09

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


You can replace the full script (search.php) with this :
<?php
/**
 * ****************************************************************************
 * oledrion - MODULE FOR XOOPS
 * Copyright (c) Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * 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.
 *
 * @copyright       Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         oledrion
 * @author             Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
 *
 * Version : $Id:
 * ****************************************************************************
 */

/**
 * Recherche dans les produits
 */
require 'header.php';
require_once 
OLEDRION_PATH.'class/tree.php';
$GLOBALS['current_category'] = -1;        // Pour le bloc des catégories
$xoopsOption['template_main'] = 'oledrion_search.html';
require_once 
XOOPS_ROOT_PATH.'/header.php';

$limit oledrion_utils::getModuleOption('newproducts');    // Nombre maximum d'éléments à afficher
$categories $manufacturers $vendors = array();
$baseurl OLEDRION_URL.basename(__FILE__);                // URL de ce script (sans son nom)

$xoopsTpl->assign('mod_pref'$mod_pref);                // Préférences du module


$categories $h_oledrion_cat->getAllCategories();
$vendors $h_oledrion_vendors->getAllVendors();
$manufacturers $h_oledrion_manufacturer->getItems(00'manu_name''ASC'false);


if((isset(
$_POST['op']) && $_POST['op'] == 'go') || isset($_GET['start'])) {    // Recherche des résultats
    
$xoopsTpl->assign('search_results'true);
    
$xoopsTpl->assign('global_advert'oledrion_utils::getModuleOption('advertisement'));
    
$xoopsTpl->assign('breadcrumb'oledrion_utils::breadcrumb(array(OLEDRION_URL.basename(__FILE__) => _OLEDRION_SEARCHRESULTS)));
    
oledrion_utils::setMetas(oledrion_utils::getModuleName().' - '._OLEDRION_SEARCHRESULTSoledrion_utils::getModuleName().' - '._OLEDRION_SEARCHRESULTS);

    if(!isset(
$_GET['start'])) {
        
$sql 'SELECT b.product_id, b.product_title, b.product_submitted, b.product_submitter FROM '.$xoopsDB->prefix('oledrion_products').' b, '.$xoopsDB->prefix('oledrion_productsmanu').' a WHERE (b.product_id = a.pm_product_id AND b.product_online = 1 ';
        if(
oledrion_utils::getModuleOption('show_unpublished') == 0) {    // Ne pas afficher les produits qui ne sont pas publiés
            
$sql .= ' AND b.product_submitted <= '.time();
        }
        if(
oledrion_utils::getModuleOption('nostock_display') == 0) {    // Se limiter aux seuls produits encore en stock
            
$sql .= ' AND b.product_stock > 0';
        }
        
$sql .= ') ';

        
// Recherche sur une catégorie
        
if(isset($_POST['product_category'])) {
            
$cat_cid intval($_POST['product_category']);
            if(
$cat_cid ) {
                
$sql .= 'AND (b.product_cid = '.$cat_cid.')';
            }
        }

        
// Recherche sur les fabricants
        
if(isset($_POST['product_manufacturers'])) {
            
$submittedManufacturers null;
            
$submittedManufacturers $_POST['product_manufacturers'];
            if(
is_array($submittedManufacturers) && intval($submittedManufacturers[0]) == 0) {
                
$submittedManufacturers array_shift($submittedManufacturers);
            }
            if(
is_array($submittedManufacturers) && count($submittedManufacturers) > 0) {
                
array_walk($submittedManufacturers'intval');
                
$sql .= ' AND (a.pm_manu_id IN ( '.implode(','$submittedManufacturers).'))';
            } else {
                
$submittedManufacturer intval($submittedManufacturers);
                if(
$submittedManufacturer 0) {
                    
$sql .= ' AND (a.pm_manu_id = '.$submittedManufacturer.')';
                }
            }
        }

        
// Recherche sur les vendeurs
        
if(isset($_POST['product_vendors'])) {
            
$vendor intval($_POST['product_vendors']);
            if( 
$vendor ) {
                
$sql .= ' AND (product_vendor_id = '.$vendor.')';
            }
        }

        
// Recherche sur du texte
        
if(isset($_POST['product_text']) && xoops_trim($_POST['product_text']) != '') {
            
$temp_queries $queries = array();
            
$temp_queries preg_split('/[s,]+/'$_POST['product_text']);

            foreach (
$temp_queries as $q) {
                
$q trim($q);
                
$queries[] = $myts->addSlashes($q);
            }
            if( 
count($queries) > ) {
                
$tmpObject = new oledrion_products();
                
$datas $tmpObject->getVars();
                
$fields = array();
                
$cnt 0;
                foreach(
$datas as $key => $value) {
                    if(
$value['data_type'] == XOBJ_DTYPE_TXTBOX || $value['data_type'] == XOBJ_DTYPE_TXTAREA) {
                        if(
$cnt == 0) {
                            
$fields[] = 'b.'.$key;
                        } else {
                            
$fields[] = ' OR b.'.$key;
                        }
                        
$cnt++;
                    }
                }
                
$count count($queries);
                
$cnt 0;
                
$sql .= ' AND ';
                
$searchType intval($_POST['search_type']);
                
$andor  ' OR ';
                foreach(
$queries as $oneQuery) {
                    
$sql .= '(';
                    switch(
$searchType) {
                        case 
0:        // Commence par
                            
$cond " LIKE '".$oneQuery."%' ";
                            break;
                        case 
1:        // Finit par
                            
$cond " LIKE '%".$oneQuery."' ";
                            break;
                        case 
2:        // Correspond à
                            
$cond " = '".$oneQuery."' ";
                            break;
                        case 
3:        // Contient
                            
$cond " LIKE '%".$oneQuery."%' ";
                            break;
                    }
                    
$sql .= implode($cond$fields).$cond.')';
                    
$cnt++;
                    if(
$cnt != $count) {
                        
$sql .= ' '.$andor.' ';
                    }
                }
            }
        }
        
$_SESSION['criteria_oledrion'] = serialize($sql);
    } else { 
// $_GET['start'] est en place, on a cliqué sur un chevron pour aller voir les autres pages, il faut travailler à partir des informations de la session
        
if(isset($_SESSION['criteria_oledrion'])) {
            
$sql unserialize($_SESSION['criteria_oledrion']);
        }
    }
    
$start = isset($_GET['start']) ? intval($_GET['start']) : 0;
    
$sqlCount str_replace("b.product_id, b.product_title, b.product_submitted, b.product_submitter""Count(*) as cpt"$sql);
    
$result $xoopsDB->query($sqlCount);
    
$rowCount $xoopsDB->fetchArray($result);
    if(
$rowCount['cpt'] > $limit) {
        require_once 
XOOPS_ROOT_PATH.'/class/pagenav.php';
        
$pagenav = new XoopsPageNav($rowCount['cpt'], $limit $start'start');
        
$xoopsTpl->assign('pagenav'$pagenav->renderNav());
    }

    
$sql .= ' GROUP BY b.product_id ORDER BY product_submitted DESC';
    
$result $xoopsDB->query($sql$limit$start);
    
$ret = array();
    
$tempProduct $h_oledrion_products->create(true);
     while (
$myrow $xoopsDB->fetchArray($result)) {
        
$ret = array();
        
$ret['link'] = $tempProduct->getLink($myrow['product_id'], $myrow['product_title']);
        
$ret['title'] = $myts->htmlSpecialChars($myrow['product_title']);
        
$ret['href_title'] = oledrion_utils::makeHrefTitle($myts->htmlSpecialChars($myrow['product_title']));
        
$ret['time'] = $myrow['product_submitted'];
        
$ret['uid'] = $myrow['product_submitter'];
        
$xoopsTpl->append('products'$ret);
    }
    unset(
$tempProduct);
} else {
    
$xoopsTpl->assign('search_results'false);
    
$xoopsTpl->assign('global_advert'oledrion_utils::getModuleOption('advertisement'));
    
$xoopsTpl->assign('breadcrumb'oledrion_utils::breadcrumb(array(OLEDRION_URL.basename(__FILE__) => _OLEDRION_SEARCHFOR)));
    
oledrion_utils::setMetas(oledrion_utils::getModuleName().' - '._OLEDRION_SEARCHFORoledrion_utils::getModuleName().' - '._OLEDRION_SEARCHFOR);
}

require_once 
OLEDRION_PATH.'include/product_search_form.php';
$sform oledrion_utils::formMarkRequiredFields($sform);
$xoopsTpl->assign('search_form',$sform->render());

oledrion_utils::setCSS();

require_once 
XOOPS_ROOT_PATH.'/footer.php';
?>



53
hervet
Re: Oledrion search option case without results
  • 2009/1/28 17:08

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


it will be corrected in a new version



54
hervet
Re: xoops 2.3 oledrion
  • 2009/1/28 17:07

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Blank page = Php debug's mode



55
hervet
Re: Olédrion 2
  • 2009/1/24 13:57

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


now yes.



56
hervet
Re: Olédrion 2
  • 2009/1/24 13:25

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Problem solved !

1/ If you want to use online payment you must fill the information concerning Paypal in the module's administration (in the part called "Gateways")
2/ The module fails to send emails if you don't have a translation for your language in the module's folder

In the present case, this folder (and files) was not existing :
/xoops/modules/oledrion/language/srpski



57
hervet
Re: Olédrion 2
  • 2009/1/22 7:06

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Is the module accessible to anonymous users ?



58
hervet
Re: Olédrion 2
  • 2009/1/21 9:07

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


1/ Activate Php debug's mode and report any error
2/ Verify that a file called logmail_oledrion.php exists in your uploads folder. If it exists, see its content



59
hervet
Re: Notification not working
  • 2009/1/14 13:26

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Problem definitively solved.

In this folder:
/xoops/language
tehre was a sub folder called "cri".

Then, in the genral preferences, in the "Default language" select box, there was : "cri" selected.
Instead of “english”

As a consequence, XOOPS was trying to find, for each module, the notifications templates in this kind of folder:
/xoops/modules/mymodule/language/CRI/mail_template/notification_email.tpl

Instead of:
/Xoops/modules/mymodule/language/english/mail_template/notification_email.tpl

Of course, the mails templates of each module could not be found !

Hope this will help someone help because I spent a incredible amount of hours on this problem !

Where I did not had help: in Xoopsmailer.
Because each template is opened with something like this :
@fread(...)

So even with Php debug's mode activated, you can't detect that the mailer can't read the template file...
WTF !



60
hervet
Re: Notification not working
  • 2009/1/14 10:25

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


David had two problems:

1/ The notifications block is not updated when there is some cache on the modules
2/ There is a permissions problem (the linux/unix) user which runs Apache can't access the modules templates files




TopTop
« 1 ... 3 4 5 (6) 7 8 9 ... 139 »



Login

Who's Online

260 user(s) are online (175 user(s) are browsing Support Forums)


Members: 0


Guests: 260


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits