Fork me on GitHub




« 1 (2) 3 4 »


Re: CATADS page d"accueil et sous catégories
Supporter Xoops
Inscrit: 09/01/2005 13:37
De Breizh
Messages: 16972
oui si ton affichage concerne cette page, sinon pour un bloc, regardes dans le fichier php de ce dernier

Posté le : 04/06/2011 13:36

La connaissance s'accroît quand on la partage ...
Partager Twitter Partagez cette article sur GG+
Re: CATADS page d"accueil et sous catégories
Semi pro
Inscrit: 27/04/2011 13:29
De Seine et marne
Messages: 809
C'est pour enlever des sous-sous catégories de la page d'accueil de Catads.
Sais-tu ce que je dois modifier dans mon fichier index.php Catads çi-dessous pour qu'elles n'apparaissent plus?

<?php
// $Id: index.php,v 1.41 2005/07/07 C. Felix AKA the Cat
// ------------------------------------------------------------------------- //
// Catads for Xoops                                                          //
// ------------------------------------------------------------------------- //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  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.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//---------------------------------------------------------------------------//
include "header.php";
include(
"../../mainfile.php");
include_once(
XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/include/functions.php");
include_once(
XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/class/cat.php");
include_once(
XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/class/ads.php");
include_once(
XOOPS_ROOT_PATH."/class/xoopstree.php");
include_once 
XOOPS_ROOT_PATH.'/modules/catads/class/permissions.php';

//////Parametres////////
$reduireTitle 25//Nb de caracteres
$afficherBlocNbAnnonces 1//1 = Affichage du bloc nb annonces, 0 = le contraire
$afficherBlocDernieresAnnonces 1//1 =  Affichage du bloc derniere annonces, 0 = le contraire
$afficherNbDernieresAnnonces 4//Nombre d'annonces à afficher dans le bloc "dernieres annonces"
////////////////////////
$xoopsOption['template_main'] = 'catads_index.html';
include(
XOOPS_ROOT_PATH."/header.php");

//Ajout
$affichage_titre = isset($_GET['affichage_titre']) ? $_GET['affichage_titre'] : '';
$affichage_prix = isset($_GET['affichage_prix']) ? $_GET['affichage_prix'] : '';
$affichage_option_prix = isset($_GET['affichage_option_prix']) ? $_GET['affichage_option_prix'] : '';
$affichage_localisation = isset($_GET['affichage_localisation']) ? $_GET['affichage_localisation'] : '';
$affichage_date = isset($_GET['affichage_date']) ? $_GET['affichage_date'] : '';
//Ajout


//rss hack by InBox Solutions for Philippe Montalbetti
$link=sprintf("<a href='%s' title='%s'><img src='%s' border='0' alt='%s' /></a>",XOOPS_URL."/modules/catads/backend.php"_MD_CATADS_RSSFEEDXOOPS_URL."/modules/catads/images/icon/rss.gif",_MD_CATADS_RSSFEED);
$xoopsTpl->assign('rssfeed_link',$link);
//end rss hack by InBox Solutions for Philippe Montalbetti

// pk get module pref
$show_ad_type $xoopsModuleConfig['show_ad_type'] ;

$ads_handler =& xoops_getmodulehandler('ads');
$ts =& MyTextSanitizer::getInstance();

// array des sous-catégories 'enfant' d'une catégorie
        
function getFirstChild($topic_id 0) {
                global 
$allcat;
                
$firstChild = array();
                        foreach(
$allcat as $onechild)         {
                                if( 
$onechild['topic_pid'] == $topic_id) {
                                        
array_push($firstChild$onechild);
                                        
/*echo $topic_id;*/
                                
}
                        }
                return 
$firstChild;
        }

        function 
showsubcat($categorys$level 0$topic_id 0$topic_pid) {
                global 
$xoopsModule$ts$lastchildren$nbadspercat$newads$arr_subcat$cptsubcat$nbcol$tpltype$xoTheme;


                foreach(
$categorys as $onecat)         {


                        
$link XOOPS_URL '/modules/' $xoopsModule->dirname() . '/adslist.php?topic_id=' $onecat['topic_id'];
                        
$title $ts->htmlSpecialChars($onecat['topic_title']);
                        
$desc $ts->htmlSpecialChars($onecat['topic_desc']);
                        if (
in_array($onecat['topic_id'], $lastchildren)) {
                                
$arr_scat['nb'] = (array_key_exists($onecat['topic_id'], $nbadspercat)) ?  "(".$nbadspercat[$onecat['topic_id']].")"'';
                                
$arr_scat['new'] = (array_key_exists($onecat['topic_id'], $newads)) ? $newads[$onecat['topic_id']]: '';
                        }
                        
$arr_scat['link'] = XOOPS_URL '/modules/' $xoopsModule->dirname() . '/adslist.php?topic_id=' $onecat['topic_id'];
                        
$arr_scat['id'] = $onecat['topic_id'];
                        
$arr_scat['title'] = $title;
                        
$arr_scat['desc'] = $desc;

                        
// pk add conditional statement to stop broken image icon if no category image is selected
                        
if($onecat['img'] != '') {
                        
$arr_scat['img'] = "<img src='".XOOPS_URL."/uploads/".$xoopsModule->dirname()."/images/categories/".$onecat['img']."' align='middle' alt='' />";
                        }else{
                        
$arr_scat['img'] = '' ;
                        }
                        
// end pk mod

                        
if ($level == && $tpltype == 1) {
                                
$arr_scat['newcol'] = ($cptsubcat 0) ? true false;
                                
$cptsubcat++;
                                
$arr_scat['newline'] = ($cptsubcat $nbcol == 1) ? true false;
                        }
                        
array_push($arr_subcat$arr_scat);
                        
$childcats =  getFirstChild($onecat['topic_id']);
                                if (
count($childcats) > 0) {
                                        
showsubcat($childcats$level 1$onecat['topic_id'], $topic_pid);
                                }
                        }
                return;
                }


// annonces en attente de validation - pk if moderated
                
if ($xoopsModuleConfig['moderated'] == '1') {
                        
$ads_wait $ads_handler->getCount(new Criteria('waiting''1'));
                        
$xoopsTpl->assign('moderated'true);
                        
// si administrateur du module
                        
if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
                                
$xoopsTpl->assign('admin_block'_MD_CATADS_ADM_WAIT);
                                if(
$ads_wait == 0) {
                                        
$xoopsTpl->assign('confirm_ads'_MD_CATADS_NO_WAIT);
                                } else {
                                        
$xoopsTpl->assign('confirm_ads'sprintf(_MD_CATADS_NBWAIT$ads_wait)."<br /><a href="admin/ads.php?sel_status=1&amp;sel_order=ASC">"._MD_CATADS_SEEWAIT."</a>");
                                }
                        }
                }

                
$tpltype $xoopsModuleConfig['tpltype'];// 1 en lignes, 2 en colonnes
                
$xoopsTpl->assign('tpltype'$tpltype);
                
$nbcol $xoopsModuleConfig['nbcol'];
                
$wcol 100/$nbcol;
                
$xoopsTpl->assign('wcol'$wcol);

                
// nombre annonces actives par catégorie. pk - bugfix add suspend criteria
                
$criteria = new CriteriaCompo(new Criteria('waiting''0'));
                
$criteria->add(new Criteria('suspend''0'));
                
$criteria->add(new Criteria('published'time(), '<'));
                
$criteria->add(new Criteria('expired'time(),'>'));
                
$nbadspercat $ads_handler->getCountAdsByCat($criteria);

                
// nombre annonces nouvelles par catégorie. pk bugfix - add suspend criteria. Fix duplicate publish criteria
                
$criteria = new CriteriaCompo(new Criteria('published'time()- $xoopsModuleConfig['nb_days_new']*86400'>'));
                
$criteria->add(new Criteria('waiting''0'));
                
$criteria->add(new Criteria('suspend''0'));
                
$criteria->add(new Criteria('expired'time(),'>'));
                
// $criteria->add(new Criteria('published', time(),'<'));

                
$newads $ads_handler->getCountAdsByCat($criteria);

                
$allcat =  AdsCategory::getAllCat(); // array de toutes les catégories
                
$lastchildren AdsCategory::getAllLastChild(); //array des catégories 'terminales'''
                
$parray AdsCategory::getCatWithPid(); //array des objets catégories principales
                
$pcount count($parray);
                
$ptitle '';
            
$pdesc '';

                
// catégories principales
                
for ( $i 0$i $pcount$i++ ) {
                        
$arr_cat = array();
                        
$arr_scat = array();
                        
$arr_subcat = array();
                        
$cptsubcat 0;
                        
$topic_id $parray[$i]->topic_id();

                        
$title $ts->htmlSpecialChars($parray[$i]->topic_title());
                        
$ptitle .= $title.' -';

                        
$desc $ts->htmlSpecialChars($parray[$i]->topic_desc());
                        
$pdesc .= $desc.' -';

                        
// pk correct popbox code for valid W3C
                        
if ( $parray[$i]->img() != '')
                        {
                                
// $arr_cat[$i]['image'] = "<img  id="".$i."" alt="".$i."" src="".XOOPS_URL."/uploads/".$xoopsModule->dirname()."/images/categories/".$parray[$i]->img()."" pbshowcaption="false" pbcaption="".$i."" class="PopBoxImageSmall" onclick="Pop(this,50,'PopBoxImageLarge');" />";
                                
$arr_cat[$i]['image'] = "<img  id="photo".$i."" alt="photo".$i."" src="".XOOPS_URL."/uploads/".$xoopsModule->dirname()."/images/categories/".$parray[$i]->img()."" class="PopBoxImageSmall" onclick="Pop(this,50,'PopBoxImageLarge');" />";
                        }
                        else
                        {
                                
$arr_cat[$i]['image'] = "<img src='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/images/no_dispo_mini.gif' align='middle' alt='' />";
                        }
                        
$arr_cat[$i]['link'] = XOOPS_URL '/modules/' $xoopsModule->dirname() . '/adslist.php?topic_id=' $topic_id;
                        
$arr_cat[$i]['id'] = $topic_id;
                        
$arr_cat[$i]['title'] = $title;
                        
$arr_cat[$i]['desc'] = $desc;

                        if (
in_array($topic_id$lastchildren)) {
                                
$arr_cat[$i]['nb'] = (array_key_exists($topic_id$nbadspercat)) ?  "(".$nbadspercat[$topic_id].")"'';
                                
$arr_cat[$i]['new'] = (array_key_exists($topic_id$newads)) ? $newads[$topic_id]: '';
                        }
                        
$level 0;
                        
$childcats =  AdsCategory::getFirstChildArr($topic_id'weight');
                        unset(
$arr_scat);

                        
showsubcat($childcats0$topic_id$topic_id);
                        if (
$tpltype == 1) {
                        
// ajout blocks vides si template en lignes
                                
$mod count($childcats) % $nbcol;
                                
$adjust = ($mod 0) ? $nbcol $mod 0;
                                for ( 
$j 0$j $adjust$j++ ) {
                                        
$cptsubcat++;
                                        
$arr_scat['newcol']=1;
                                        
array_push($arr_subcat$arr_scat);
                                }
                        } else {
                        
// calcul saut de ligne si template en colonnes
                                
$mod = ($i+1) % $nbcol;
                                
$arr_cat[$i]['newline'] = ($mod == 0) ? true false;
                        }
                        
$arr_cat[$i]['subcat'] = $arr_subcat;
                        
$xoopsTpl->append('categories'$arr_cat[$i]);
                }
                if (
$tpltype == 2) {
                
// ajout blocks vides si template en colonnes
                        
unset($arr_cat);
                        
$mod $pcount $nbcol;
                        
$adjust = ($mod 0) ? $nbcol $mod 0;
                        for ( 
$j 0$j $adjust$j++ ) {
                                
$arr_cat[$j]['title'] = "";
                                
$xoopsTpl->append('categories'$arr_cat[$j]);
                        }

                }
                
$xoopsTpl->assign('nb_col_or_row'$nbcol);
                
// $xoopsTpl->assign('xoops_pagetitle', $xoopsModule->name() . ' -' . $ptitle);
                
$xoopsTpl->assign('xoops_pagetitle'$xoopsModule->name());

                
// pk add meta description from main category list
                
$catlistclean '';
                for ( 
$i 0$i $pcount$i++ ) {
                
$title $ts->htmlSpecialChars($parray[$i]->topic_title());
                
$catlistclean .= $title.', ';
                }
                
$xoTheme->addMeta('meta''description'substr($catlistclean0140));
                
// end pk mod

                // nombre annonces actives
                
$criteria = new CriteriaCompo(new Criteria('waiting''0'));
                
$criteria->add(new Criteria('suspend''0'));
                
$criteria->add(new Criteria('published'time(),'<'));
                
$criteria->add(new Criteria('expired'time(),'>'));

                
$nbads $ads_handler->getCount($criteria);
                
$xoopsTpl->assign('nbads'$nbads);
                
$xoopsTpl->assign('total_annonces',sprintf_MD_CATADS_ACTUALY$nbads));
                if (
$xoopsModuleConfig['moderated'] == '1') {
                        
$xoopsTpl->assign('total_confirm'sprintf(_MD_CATADS_ANDWAIT$ads_wait));
                }

                
$xoopsTpl->assign('show_card'$xoopsModuleConfig['show_card']);


if ( 
$xoopsModuleConfig['show_card'] == '0' )
{
                
// dernières annonces
                
if ($xoopsModuleConfig['nb_news'] > )
                {
                        if (
$nbads 0)
                        {
                                
$xoopsTpl->assign('lang_title'_MD_CATADS_LASTADD);

                                
//Recuperer les annonces en fonction des categories
                                
$permHandler CatadsPermHandler::getHandler();
                                if( 
$permHandler->listAds($xoopsUser'catads_access') )
                                {
                                        
$show_topic_id $permHandler->listAds($xoopsUser'catads_access');
                                }
                                
$arr_lastads showListAds($show_topic_id0$affichage_titre$affichage_prix$affichage_option_prix$affichage_localisation$affichage_date0$xoopsModuleConfig['nb_news']);
                                
$xoopsTpl->assign('items'$arr_lastads);
                        }
                }
}
else
{
                
$xoopsTpl->assign('total_annonces',sprintf_MD_CATADS_ACTUALY$nbads));
                
$xoopsTpl->assign('afficherBlocNbAnnonces'$afficherBlocNbAnnonces);
                
$xoopsTpl->assign('afficherBlocDernieresAnnonces'$afficherBlocDernieresAnnonces);

                
//Recuperer les annonces en fonction des categories
                
$permHandler CatadsPermHandler::getHandler();
                if( 
$permHandler->listAds($xoopsUser'catads_access') )
                {
                        
$show_topic_id $permHandler->listAds($xoopsUser'catads_access');
                }
                
$arr_lastads showListLastAds($show_topic_id$reduireTitle00$afficherNbDernieresAnnonces);
                
$xoopsTpl->assign('items'$arr_lastads);
}

// pk pass ad_type pref to template
$xoopsTpl->assign('show_ad_type'$show_ad_type);

// pk transfer pop-up script CSS to here from catads_index.html, catads_sub_list.html and catads_block_new.html
$xoopsTpl->assign("xoops_module_header",'<link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="css/highslide.css" />');

include(
XOOPS_ROOT_PATH."/footer.php");
?>

Posté le : 04/06/2011 13:51
Partager Twitter Partagez cette article sur GG+
Re: CATADS page d"accueil et sous catégories
Semi pro
Inscrit: 16/12/2008 16:38
Messages: 1644
je remet sa en code
<?php // $Id: index.php,v 1.41 2005/07/07 C. Felix AKA the Cat // ------------------------------------------------------------------------- // // Catads for Xoops // // ------------------------------------------------------------------------- // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // // // 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. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //---------------------------------------------------------------------------// include "header.php"; include("../../mainfile.php"); include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/include/functions.php"); include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/class/cat.php"); include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/class/ads.php"); include_once(XOOPS_ROOT_PATH."/class/xoopstree.php"); include_once XOOPS_ROOT_PATH.'/modules/catads/class/permissions.php';  //////Parametres//////// $reduireTitle = 25; //Nb de caracteres $afficherBlocNbAnnonces = 1; //1 = Affichage du bloc nb annonces, 0 = le contraire $afficherBlocDernieresAnnonces = 1; //1 = Affichage du bloc derniere annonces, 0 = le contraire $afficherNbDernieresAnnonces = 4; //Nombre d'annonces à afficher dans le bloc "dernieres annonces" //////////////////////// $xoopsOption['template_main'] = 'catads_index.html'; include(XOOPS_ROOT_PATH."/header.php");  //Ajout $affichage_titre = isset($_GET['affichage_titre']) ? $_GET['affichage_titre'] : ''; $affichage_prix = isset($_GET['affichage_prix']) ? $_GET['affichage_prix'] : ''; $affichage_option_prix = isset($_GET['affichage_option_prix']) ? $_GET['affichage_option_prix'] : ''; $affichage_localisation = isset($_GET['affichage_localisation']) ? $_GET['affichage_localisation'] : ''; $affichage_date = isset($_GET['affichage_date']) ? $_GET['affichage_date'] : ''; //Ajout   //rss hack by InBox Solutions for Philippe Montalbetti $link=sprintf("<a href='%s' title='%s'><img src='%s' border='0' alt='%s' /></a>",XOOPS_URL."/modules/catads/backend.php", _MD_CATADS_RSSFEED, XOOPS_URL."/modules/catads/images/icon/rss.gif",_MD_CATADS_RSSFEED); $xoopsTpl->assign('rssfeed_link',$link); //end rss hack by InBox Solutions for Philippe Montalbetti  // pk get module pref $show_ad_type = $xoopsModuleConfig['show_ad_type'] ;  $ads_handler =& xoops_getmodulehandler('ads'); $ts =& MyTextSanitizer::getInstance();  // array des sous-catégories 'enfant' d'une catégorie function getFirstChild($topic_id = 0) { global $allcat; $firstChild = array(); foreach($allcat as $onechild) { if( $onechild['topic_pid'] == $topic_id) { array_push($firstChild, $onechild); /*echo $topic_id;*/ } } return $firstChild; }  function showsubcat($categorys, $level = 0, $topic_id = 0, $topic_pid) { global $xoopsModule, $ts, $lastchildren, $nbadspercat, $newads, $arr_subcat, $cptsubcat, $nbcol, $tpltype, $xoTheme;   foreach($categorys as $onecat) {   $link = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/adslist.php?topic_id=' . $onecat['topic_id']; $title = $ts->htmlSpecialChars($onecat['topic_title']); $desc = $ts->htmlSpecialChars($onecat['topic_desc']); if (in_array($onecat['topic_id'], $lastchildren)) { $arr_scat['nb'] = (array_key_exists($onecat['topic_id'], $nbadspercat)) ? "(".$nbadspercat[$onecat['topic_id']].")": ''; $arr_scat['new'] = (array_key_exists($onecat['topic_id'], $newads)) ? $newads[$onecat['topic_id']]: ''; } $arr_scat['link'] = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/adslist.php?topic_id=' . $onecat['topic_id']; $arr_scat['id'] = $onecat['topic_id']; $arr_scat['title'] = $title; $arr_scat['desc'] = $desc;  // pk add conditional statement to stop broken image icon if no category image is selected if($onecat['img'] != '') { $arr_scat['img'] = "<img src='".XOOPS_URL."/uploads/".$xoopsModule->dirname()."/images/categories/".$onecat['img']."' align='middle' alt='' />"; }else{ $arr_scat['img'] = '' ; } // end pk mod  if ($level == 0 && $tpltype == 1) { $arr_scat['newcol'] = ($cptsubcat > 0) ? true : false; $cptsubcat++; $arr_scat['newline'] = ($cptsubcat % $nbcol == 1) ? true : false; } array_push($arr_subcat, $arr_scat); $childcats = getFirstChild($onecat['topic_id']); if (count($childcats) > 0) { showsubcat($childcats, $level + 1, $onecat['topic_id'], $topic_pid); } } return; }   // annonces en attente de validation - pk if moderated if ($xoopsModuleConfig['moderated'] == '1') { $ads_wait = $ads_handler->getCount(new Criteria('waiting', '1')); $xoopsTpl->assign('moderated', true); // si administrateur du module if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { $xoopsTpl->assign('admin_block', _MD_CATADS_ADM_WAIT); if($ads_wait == 0) { $xoopsTpl->assign('confirm_ads', _MD_CATADS_NO_WAIT); } else { $xoopsTpl->assign('confirm_ads', sprintf(_MD_CATADS_NBWAIT, $ads_wait)."<br /><a href="admin/ads.php?sel_status=1&sel_order=ASC">"._MD_CATADS_SEEWAIT."</a>"); } } }  $tpltype = $xoopsModuleConfig['tpltype'];// 1 en lignes, 2 en colonnes $xoopsTpl->assign('tpltype', $tpltype); $nbcol = $xoopsModuleConfig['nbcol']; $wcol = 100/$nbcol; $xoopsTpl->assign('wcol', $wcol);  // nombre annonces actives par catégorie. pk - bugfix add suspend criteria $criteria = new CriteriaCompo(new Criteria('waiting', '0')); $criteria->add(new Criteria('suspend', '0')); $criteria->add(new Criteria('published', time(), '<')); $criteria->add(new Criteria('expired', time(),'>')); $nbadspercat = $ads_handler->getCountAdsByCat($criteria);  // nombre annonces nouvelles par catégorie. pk bugfix - add suspend criteria. Fix duplicate publish criteria $criteria = new CriteriaCompo(new Criteria('published', time()- $xoopsModuleConfig['nb_days_new']*86400, '>')); $criteria->add(new Criteria('waiting', '0')); $criteria->add(new Criteria('suspend', '0')); $criteria->add(new Criteria('expired', time(),'>')); // $criteria->add(new Criteria('published', time(),'<'));  $newads = $ads_handler->getCountAdsByCat($criteria);  $allcat = AdsCategory::getAllCat(); // array de toutes les catégories $lastchildren = AdsCategory::getAllLastChild(); //array des catégories 'terminales''' $parray = AdsCategory::getCatWithPid(); //array des objets catégories principales $pcount = count($parray); $ptitle = ''; $pdesc = '';  // catégories principales for ( $i = 0; $i < $pcount; $i++ ) { $arr_cat = array(); $arr_scat = array(); $arr_subcat = array(); $cptsubcat = 0; $topic_id = $parray[$i]->topic_id();  $title = $ts->htmlSpecialChars($parray[$i]->topic_title()); $ptitle .= $title.' -';  $desc = $ts->htmlSpecialChars($parray[$i]->topic_desc()); $pdesc .= $desc.' -';  // pk correct popbox code for valid W3C if ( $parray[$i]->img() != '') { // $arr_cat[$i]['image'] = "<img id="".$i."" alt="".$i."" src="".XOOPS_URL."/uploads/".$xoopsModule->dirname()."/images/categories/".$parray[$i]->img()."" pbshowcaption="false" pbcaption="".$i."" class="PopBoxImageSmall" onclick="Pop(this,50,'PopBoxImageLarge');" />"; $arr_cat[$i]['image'] = "<img id="photo".$i."" alt="photo".$i."" src="".XOOPS_URL."/uploads/".$xoopsModule->dirname()."/images/categories/".$parray[$i]->img()."" class="PopBoxImageSmall" onclick="Pop(this,50,'PopBoxImageLarge');" />"; } else { $arr_cat[$i]['image'] = "<img src='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/images/no_dispo_mini.gif' align='middle' alt='' />"; } $arr_cat[$i]['link'] = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/adslist.php?topic_id=' . $topic_id; $arr_cat[$i]['id'] = $topic_id; $arr_cat[$i]['title'] = $title; $arr_cat[$i]['desc'] = $desc;  if (in_array($topic_id, $lastchildren)) { $arr_cat[$i]['nb'] = (array_key_exists($topic_id, $nbadspercat)) ? "(".$nbadspercat[$topic_id].")": ''; $arr_cat[$i]['new'] = (array_key_exists($topic_id, $newads)) ? $newads[$topic_id]: ''; } $level = 0; $childcats = AdsCategory::getFirstChildArr($topic_id, 'weight'); unset($arr_scat);  showsubcat($childcats, 0, $topic_id, $topic_id); if ($tpltype == 1) { // ajout blocks vides si template en lignes $mod = count($childcats) % $nbcol; $adjust = ($mod > 0) ? $nbcol - $mod : 0; for ( $j = 0; $j < $adjust; $j++ ) { $cptsubcat++; $arr_scat['newcol']=1; array_push($arr_subcat, $arr_scat); } } else { // calcul saut de ligne si template en colonnes $mod = ($i+1) % $nbcol; $arr_cat[$i]['newline'] = ($mod == 0) ? true : false; } $arr_cat[$i]['subcat'] = $arr_subcat; $xoopsTpl->append('categories', $arr_cat[$i]); } if ($tpltype == 2) { // ajout blocks vides si template en colonnes unset($arr_cat); $mod = $pcount % $nbcol; $adjust = ($mod > 0) ? $nbcol - $mod : 0; for ( $j = 0; $j < $adjust; $j++ ) { $arr_cat[$j]['title'] = ""; $xoopsTpl->append('categories', $arr_cat[$j]); }  } $xoopsTpl->assign('nb_col_or_row', $nbcol); // $xoopsTpl->assign('xoops_pagetitle', $xoopsModule->name() . ' -' . $ptitle); $xoopsTpl->assign('xoops_pagetitle', $xoopsModule->name());  // pk add meta description from main category list $catlistclean = ''; for ( $i = 0; $i < $pcount; $i++ ) { $title = $ts->htmlSpecialChars($parray[$i]->topic_title()); $catlistclean .= $title.', '; } $xoTheme->addMeta('meta', 'description', substr($catlistclean, 0, 140)); // end pk mod  // nombre annonces actives $criteria = new CriteriaCompo(new Criteria('waiting', '0')); $criteria->add(new Criteria('suspend', '0')); $criteria->add(new Criteria('published', time(),'<')); $criteria->add(new Criteria('expired', time(),'>'));  $nbads = $ads_handler->getCount($criteria); $xoopsTpl->assign('nbads', $nbads); $xoopsTpl->assign('total_annonces',sprintf( _MD_CATADS_ACTUALY, $nbads)); if ($xoopsModuleConfig['moderated'] == '1') { $xoopsTpl->assign('total_confirm', sprintf(_MD_CATADS_ANDWAIT, $ads_wait)); }  $xoopsTpl->assign('show_card', $xoopsModuleConfig['show_card']);   if ( $xoopsModuleConfig['show_card'] == '0' ) { // dernières annonces if ($xoopsModuleConfig['nb_news'] > 0 ) { if ($nbads > 0) { $xoopsTpl->assign('lang_title', _MD_CATADS_LASTADD);  //Recuperer les annonces en fonction des categories $permHandler = CatadsPermHandler::getHandler(); if( $permHandler->listAds($xoopsUser, 'catads_access') ) { $show_topic_id = $permHandler->listAds($xoopsUser, 'catads_access'); } $arr_lastads = showListAds($show_topic_id, 0, $affichage_titre, $affichage_prix, $affichage_option_prix, $affichage_localisation, $affichage_date, 0, $xoopsModuleConfig['nb_news']); $xoopsTpl->assign('items', $arr_lastads); } } } else { $xoopsTpl->assign('total_annonces',sprintf( _MD_CATADS_ACTUALY, $nbads)); $xoopsTpl->assign('afficherBlocNbAnnonces', $afficherBlocNbAnnonces); $xoopsTpl->assign('afficherBlocDernieresAnnonces', $afficherBlocDernieresAnnonces);  //Recuperer les annonces en fonction des categories $permHandler = CatadsPermHandler::getHandler(); if( $permHandler->listAds($xoopsUser, 'catads_access') ) { $show_topic_id = $permHandler->listAds($xoopsUser, 'catads_access'); } $arr_lastads = showListLastAds($show_topic_id, $reduireTitle, 0, 0, $afficherNbDernieresAnnonces); $xoopsTpl->assign('items', $arr_lastads); }  // pk pass ad_type pref to template $xoopsTpl->assign('show_ad_type', $show_ad_type);  // pk transfer pop-up script CSS to here from catads_index.html, catads_sub_list.html and catads_block_new.html $xoopsTpl->assign("xoops_module_header",'<link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="css/highslide.css" />');  include(XOOPS_ROOT_PATH."/footer.php"); ?>


d habitude sa fais mieux mais la j ai un doute

Posté le : 04/06/2011 14:30

http://www.troc-lorraine.com
vendre en lorraine

Partager Twitter Partagez cette article sur GG+
Re: CATADS page d"accueil et sous catégories
Semi pro
Inscrit: 06/09/2005 01:34
De Royan
Messages: 609
salut virtual


@virtual
Citation :
C'est pour enlever des sous-sous catégories de la page d'accueil de Catads. Sais-tu ce que je dois modifier dans mon fichier index.php Catads çi-dessous pour qu'elles n'apparaissent plus?


visiblement tu utilise la version 1.52 ou 1.53RC3 (ou quelques chose comme sa), je n'est plus ces versions tu as une nouvelle version ici

mais quelques soit les versions tu doit mettre la mains a la pâte

le plus simple selon moi ouvre le template: catads_cat.html
et met en commentaire cette ligne:
Citation :

<{include file="db:catads_subcat.html" type = $tpltype}>


attention dans le template: catads_cat.html tu as deux fois cette ligne selon le mode d'affichage que tu choisi
donc met les deux en commentaire

cette option sera gérable depuis les préférences du module dans la version 1.6RC2


Posté le : 05/06/2011 05:55
Partager Twitter Partagez cette article sur GG+
Re: CATADS page d"accueil et sous catégories
Semi pro
Inscrit: 27/04/2011 13:29
De Seine et marne
Messages: 809
Bonjour CPascal,
effectivement, j'utilise 1.53RC .
Sais-tu quand la 1.6 rc2 sortira avec la gestion des sous-sous catégories?
Cordialement.

Posté le : 05/06/2011 10:44
Partager Twitter Partagez cette article sur GG+
Re: CATADS page d"accueil et sous catégories
Semi pro
Inscrit: 06/09/2005 01:34
De Royan
Messages: 609

@virtual
Citation :
Sais-tu quand la 1.6 rc2 sortira avec la gestion des sous-sous catégories?


je suis désolé ! je ne peut te donner de date même approximative, je m'y suis aventuré une fois cela ma servis de leçon, tout dépend des difficultés rencontrer. en tout cas le plus vite que possible, je doit absolument tenté de créer deux modules dont j'ai besoin

mais en mettant en commentaire la ligne
Citation :

<{include file="db:catads_subcat.html" type = $tpltype}>

tes sous catégories ne s’afficheront plus sur ta page d'accueil



Posté le : 05/06/2011 18:51
Partager Twitter Partagez cette article sur GG+
Re: CATADS page d"accueil et sous catégories
Semi pro
Inscrit: 27/04/2011 13:29
De Seine et marne
Messages: 809
merci CPascal, je vais essayer.

Posté le : 05/06/2011 21:37
Partager Twitter Partagez cette article sur GG+
Re: CATADS page d"accueil et sous catégories
Semi pro
Inscrit: 27/04/2011 13:29
De Seine et marne
Messages: 809
Citation :
CPascal a écrit :

@virtual
Citation :
Sais-tu quand la 1.6 rc2 sortira avec la gestion des sous-sous catégories?


je suis désolé ! je ne peut te donner de date même approximative, je m'y suis aventuré une fois cela ma servis de leçon, tout dépend des difficultés rencontrer. en tout cas le plus vite que possible, je doit absolument tenté de créer deux modules dont j'ai besoin

mais en mettant en commentaire la ligne
Citation :

<{include file="db:catads_subcat.html" type = $tpltype}>

tes sous catégories ne s’afficheront plus sur ta page d'accueil





Bonjour CPascal,
J'ai bien trouvé les 2 lignes dont tu parles dans catads_cat.html:

<td class="annoncesCategoriesSub" >
<{include file="db:catads_subcat.html" type = $tpltype}>


<{/if}>
</div>
<br />
<div class="annoncesCategoriesSub"><{include file="db:catads_subcat.html" type = $tpltype}></div>

Par contre je suis débutant dans Xoops et je n'ai pas compris ce que je dois faire :

>>> met en commentaire cette ligne

Pourrais tu m'éclairer sur cette manip?
Cordialement.

Posté le : 07/06/2011 09:59
Partager Twitter Partagez cette article sur GG+
Re: CATADS page d"accueil et sous catégories
Semi pro
Inscrit: 27/04/2011 13:29
De Seine et marne
Messages: 809
Finalement j'ai essayé de mettre en commentaire les 2 lignes:

<td class="annoncesCategoriesSub" >
<!-- <{include file="db:catads_subcat.html" type = $tpltype}> -->


<div class="annoncesCategoriesSub"><!-- <{include file="db:catads_subcat.html" type = $tpltype}> --></div>


mais le résultat n'est pas au rendez-vous:

Open in new window


peugeot qui est une sous catégorie de CYCLES qui est une sous catégorie de VEHICULES apparait toujours (peugeot)en page d'accueil.
J'aurai voulu que Peugeot n'apparaisse pas en page d'accueil...

Posté le : 07/06/2011 10:34
Partager Twitter Partagez cette article sur GG+
Re: CATADS page d"accueil et sous catégories
Semi pro
Inscrit: 06/09/2005 01:34
De Royan
Messages: 609
salut virtual

pour mettre en commentaire dans les fichiers templates/html c'est bien comme sa (<--- code --->)

pour ta demande visiblement tes sous catégories ne s'affiche plus sur la page d'accueil du module donc sa c'est bon c'est ce que tu souhaité, sauf pour peugeot et cycle, j'ai bien compris ?

pour être plus clair:

catégorie principal: véhicules
sous-catégories: cycles
sous-sous catégories : peugeot

je n'est jamais eu l'idée de mettre des sous sous catégorie, mais logiquement ils ne devrai pas apparaitre en page d'accueil si tu as bien commenté les lignes de code
<{include file="db:catads_subcat.html" type $tpltype}>


j’attends ta confirmation, si personne a apporté une solution je ferrai des tests en soirée






Posté le : 07/06/2011 12:59
Partager Twitter Partagez cette article sur GG+

 Haut   Précédent   Suivant
« 1 (2) 3 4 »



Vous pouvez voir les sujets.
Vous ne pouvez pas débuter de nouveaux sujets.
Vous ne pouvez pas répondre aux contributions.
Vous ne pouvez pas éditer vos contributions.
Vous ne pouvez pas effacez vos contributions.
Vous ne pouvez pas ajouter de nouveaux sondages.
Vous ne pouvez pas voter en sondage.
Vous ne pouvez pas attacher des fichiers à vos contributions.
Vous ne pouvez pas poster sans approbation.

Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

18 Personne(s) en ligne (14 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 18 | Plus ...