osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> modification contrib newsdesk
nexius2
posté 12 Feb 2008, 16:38
Message #1


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



Bonjour,
dans newsdesk, lors de la validation d'un article avec image, l'image est automatiquement copier dans DIR_WS_IMAGES
c'est bien, mais pas top.
ce que je cherche a faire, c'est de changé ce repertoir pour un specifique a newsdesk.
pour ca, normalement, rien de plus simple, on rajoute dans le config de l'admin
define('DIR_WS_NEWSDESK_IMAGES', DIR_WS_CATALOG_IMAGES . 'newsdesk/');
puis dans tout les fichier admin de newsdesk, on change DIR_WS_IMAGES par 'DIR_WS_NEWSDESK_IMAGES' .
seulement voila....ca ne change rien....il envoi toujours les images dans DIR_WS_IMAGES (je vois pas comment il fait).

donc ma premiere question est simple, quelqu'un a t'il deja fait cette modif?
evidement, apres, il faudra aussi faire le changement dans le catalogue, mais pour l'instant, je m'occupe de l'admin...

autre petit tracas que j'ai avec cette contribution, il n'y a pas de limite de taille pour les images, donc j'aurais bien modifié le schmilblick pour qu'il redimmension automatique l'image avant de la mettre dans le bon dossier. mais je ne comprend pas du tout la partie qui gere l'upload d'image... des avis?

Merci
PS: j'utilise newsdesk_v_1.48.3

Ce message a été modifié par nexius2 - 13 Feb 2008, 10:51.


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 12 Feb 2008, 17:20
Message #2


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



trouvé...je coomprennais pas, mais en fait, j'ma trompé dés le depart.....il faut mettre
define('DIR_WS_NEWSDESK_IMAGES', DIR_FS_CATALOG_IMAGES . 'newsdesk/');
dans le configure.php

on va dire que c'est un faute de frappe.... unsure.gif

je continu de chercher pour les dimension d'image....


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 13 Feb 2008, 10:31
Message #3


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



et pour ceux qui veulent afficher la date de creation de la news ou une date future (un evenement future)
dans catalog\includes\modules\newsdesk.php

ligne 95 changer
CODE
if ( DISPLAY_NEWSDESK_DATE ) {
$insert_date = '- <i>' . tep_date_long($newsdesk_var['newsdesk_date_added']) . '</i>';
}


par

CODE
if ( DISPLAY_NEWSDESK_DATE ) {
    if ($newsdesk_var['newsdesk_date_available']) {    
$insert_date = '<i>' . tep_date_long($newsdesk_var['newsdesk_date_available']) . '</i>';
} else {
    $insert_date = '<i>' . tep_date_long($newsdesk_var['newsdesk_date_added']) . '</i>';
}}


apres ca, si dans l'admin vous ne touchez pas a la date, celle du jour est mise, et si vous inscrivez une date future, ce sera cette date la, de marqué dans vos news....

Ce message a été modifié par nexius2 - 13 Feb 2008, 10:36.


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 13 Feb 2008, 10:56
Message #4


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



et tant qu'a faire, maintenant qu'on as les dates d'edition ou de realisation de l'evenement, ou trie les news par date d'evenement

on remplace dans catalog\includes\modules\newsdesk.php

CODE
$newsdesk_var_query = tep_db_query('select p.newsdesk_id, pd.language_id, pd.newsdesk_article_name, pd.newsdesk_article_description, pd.newsdesk_article_shorttext, pd.newsdesk_article_url, pd.newsdesk_article_url_name,
p.newsdesk_image, p.newsdesk_image_two, p.newsdesk_image_three, p.newsdesk_date_added, p.newsdesk_last_modified, pd.newsdesk_article_viewed,
p.newsdesk_date_available, p.newsdesk_status  from ' . TABLE_NEWSDESK . ' p, ' . TABLE_NEWSDESK_DESCRIPTION . '
pd WHERE pd.newsdesk_id = p.newsdesk_id and pd.language_id = "' . $languages_id . '" and newsdesk_status = 1 and p.newsdesk_sticky = 0 ORDER BY newsdesk_date_added DESC LIMIT ' . MAX_DISPLAY_NEWSDESK_NEWS);


par

CODE
$newsdesk_var_query = tep_db_query('select p.newsdesk_id, pd.language_id, pd.newsdesk_article_name, pd.newsdesk_article_description, pd.newsdesk_article_shorttext, pd.newsdesk_article_url, pd.newsdesk_article_url_name,
p.newsdesk_image, p.newsdesk_image_two, p.newsdesk_image_three, p.newsdesk_date_added, p.newsdesk_last_modified, pd.newsdesk_article_viewed,
p.newsdesk_date_available, p.newsdesk_status  from ' . TABLE_NEWSDESK . ' p, ' . TABLE_NEWSDESK_DESCRIPTION . '
pd WHERE pd.newsdesk_id = p.newsdesk_id and pd.language_id = "' . $languages_id . '" and newsdesk_status = 1 and p.newsdesk_sticky = 0 ORDER BY newsdesk_date_available DESC LIMIT ' . MAX_DISPLAY_NEWSDESK_NEWS);


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 13 Feb 2008, 11:38
Message #5


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



j'essai en plus de faire une page dans lequel serais mis toutes les news. seulement dans cette page, apres avoir viré LIMIT ' . MAX_DISPLAY_NEWSDESK_NEWS je me retrouve avec toutes les news dans une seul page. ca va vite devenir chiant pour navigué. donc j'essai de transformer ca pour avoir plusieurs pages.

donc, dans l'idée, on recupere le nombre de news, on etablie un nombre de news que l'on veut par page, une petite division, et on a le nombre de pages qu'il faut afficher. seulement voila, pd.newsdesk_id n'a pas l'air d'affiché le nombre de news...une idée sur ce que pourrais etre la variable qui donne cette info?

j'essai ce genre de chose mais rien, le retour est 0 ....
$newsdesk_total_news=count($newsdesk_id);

Ce message a été modifié par nexius2 - 13 Feb 2008, 12:44.


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 13 Feb 2008, 13:11
Message #6


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



ouf, j'ai trouvé.
CODE
$newsdesk_total_news=tep_db_num_rows ($newsdesk_var_query);
donne le nombre de news active.

je continu rolleyes.gif


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 13 Feb 2008, 16:05
Message #7


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



j'ai une petite erreur quelque part....

d'apres moi, je pense que ca viendrait du LIMIT, quelqu'un a une idée?

CODE
<!-- newsdesk //-->
<?php

// set application wide parameters
// this query set is for NewsDesk

$newsdesk_current_page = isset($_GET['page']) ? $_GET['page'] : 0;
$newsdesk_max_news_per_page=5;        
$newsdesk_last_news = $newsdesk_current_page * $newsdesk_max_news_per_page;

$configuration_query = tep_db_query("select configuration_key as cfgKey, configuration_value as cfgValue from " . TABLE_NEWSDESK_CONFIGURATION . "");
while ($configuration = tep_db_fetch_array($configuration_query)) {
    define($configuration['cfgKey'], $configuration['cfgValue']);
}


$newsdesk_var_query = tep_db_query('select p.newsdesk_id, pd.language_id, pd.newsdesk_article_name, pd.newsdesk_article_description, pd.newsdesk_article_shorttext, pd.newsdesk_article_url, pd.newsdesk_article_url_name,
p.newsdesk_image, p.newsdesk_image_two, p.newsdesk_image_three, p.newsdesk_date_added, p.newsdesk_last_modified, pd.newsdesk_article_viewed,
p.newsdesk_date_available, p.newsdesk_status  from ' . TABLE_NEWSDESK . ' p, ' . TABLE_NEWSDESK_DESCRIPTION . '
pd WHERE pd.newsdesk_id = p.newsdesk_id and pd.language_id = ' . $languages_id . ' and newsdesk_status = 1 and p.newsdesk_sticky = 0 ORDER BY newsdesk_date_available DESC LIMIT ' . $newsdesk_last_news. ',' .$newsdesk_max_news_per_page);


//  pagination        
        //$newsdesk_max_news_per_page=5;        
        $newsdesk_total_news=tep_db_num_rows ($newsdesk_var_query);        
        $newsdesk_page_quantity=ceil($newsdesk_total_news/$newsdesk_max_news_per_page);
        $newsdesk_url = "./" . FILENAME_NEWSDESK_MENU . "?page=";
        //$newsdesk_current_page    = isset($_GET['page']) ? $_GET['page'] : 0;
        $newsdesk_display_page    = ($newsdesk_current_page + 1);


if($newsdesk_page_quantity > 0)
    {    
    $newsdesk_nav_bar = "";    
    if($newsdesk_page_quantity > 1)
    {      
        if($newsdesk_current_page > 0)
        {
            for($i = 0; $i < $newsdesk_current_page; $i++)
            {
                $p = $i + 1;
                $newsdesk_nav_bar .= "<a href=\"". $newsdesk_url . $i ."\" title=\"page ". $p ."\">". $p ."</a> | ";
            }
        }
        $newsdesk_nav_bar .= "<strong>". $newsdesk_display_page ."</strong>";        
        if(($newsdesk_display_page) < $newsdesk_page_quantity)
        {
            $newsdesk_next_news_quantity = $newsdesk_page_quantity - ($newsdesk_display_page);
            for($j = ($newsdesk_display_page); $j < $newsdesk_page_quantity; $j++)
            {
                $p = $j + 1;
                $newsdesk_nav_bar .= " | <a href=\"". $newsdesk_url . $j ."\" title=\"page ". $p ."\">". $p ."</a>";
            }
        }
        $newsdesk_display_page = "Page ". $newsdesk_display_page ." sur un total de ". $newsdesk_page_quantity ." pages.";
    }
    else
    {
        $newsdesk_nav_bar .= "page 1/1";
    }}     

    // fin pagination

if (!tep_db_num_rows($newsdesk_var_query)) { // there is no news
    echo '<!-- ' . TEXT_NO_NEWSDESK_NEWS . ' -->';

} else {

    $info_box_contents = array();
    //$info_box_contents[] = array('align' => 'left',
    //                             'text'  => TABLE_HEADING_NEWSDESK);
    new MainNewsBoxHeading($info_box_contents);

    $info_box_contents = array();
    $row = 0;
    while ($newsdesk_var = tep_db_fetch_array($newsdesk_var_query)) {


if ( DISPLAY_NEWSDESK_IMAGE ) {
if ($newsdesk_var['newsdesk_image'] != '') {
$insert_image = '
<table border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>
<a href="' . tep_href_link(FILENAME_NEWSDESK_INFO, 'newsdesk_id=' . $newsdesk_var['newsdesk_id']) . '">' . tep_image(DIR_WS_NEWSDESK_IMAGES .
$newsdesk_var['newsdesk_image'], '', '150') . '</a>
        </td>
    </tr>
</table>
';
}
}

if ( DISPLAY_NEWSDESK_IMAGE_TWO ) {
if ($newsdesk_var['newsdesk_image_two'] != '') {
$insert_image_two = '
<table border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>
<a href="' . tep_href_link(FILENAME_NEWSDESK_INFO, 'newsdesk_id=' . $newsdesk_var['newsdesk_id']) . '">' . tep_image(DIR_WS_NEWSDESK_IMAGES .
$newsdesk_var['newsdesk_image_two'], '', '150') . '</a>
        </td>
    </tr>
</table>
';
}
}

if ( DISPLAY_NEWSDESK_IMAGE_THREE ) {
if ($newsdesk_var['newsdesk_image_three'] != '') {
$insert_image_three = '
<table border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>
<a href="' . tep_href_link(FILENAME_NEWSDESK_INFO, 'newsdesk_id=' . $newsdesk_var['newsdesk_id']) . '">' . tep_image(DIR_WS_NEWSDESK_IMAGES .
$newsdesk_var['newsdesk_image_three'], '', '150') . '</a>
        </td>
    </tr>
</table>
';
}
}


if ( DISPLAY_NEWSDESK_VIEWCOUNT ) {
$insert_viewcount = '<i>' . TEXT_NEWSDESK_VIEWED . $newsdesk_var['newsdesk_article_viewed'] . '</i>';
}

if ( DISPLAY_NEWSDESK_READMORE ) {
$insert_readmore = '<a class="BigTextGray" href="' . tep_href_link(FILENAME_NEWSDESK_INFO, 'newsdesk_id=' . $newsdesk_var['newsdesk_id']) . '">' . TEXT_NEWSDESK_READMORE .
'</a>';
}

if ( DISPLAY_NEWSDESK_SUMMARY ) {
$insert_summary = '<b>'. $newsdesk_var['newsdesk_article_shorttext'] . '</b>';
}

if ( DISPLAY_NEWSDESK_HEADLINE ) {
$insert_headline = '<b>' . STRTOUPPER($newsdesk_var['newsdesk_article_name']) . '</b>';
}

if ( DISPLAY_NEWSDESK_DATE ) {
    if ($newsdesk_var['newsdesk_date_available']) {    
$insert_date = '<i>' . tep_date_long($newsdesk_var['newsdesk_date_available']) . '</i>';
} else {
    $insert_date = '<i>' . tep_date_long($newsdesk_var['newsdesk_date_added']) . '</i>';
}}


        $info_box_contents[$row] = array(
            'align' => 'left',
            'params' => 'class="smallText" valign="top"',
            'text' => '
<!-- <table border="0" width="100%" cellspacing="3" cellpadding="0">
    <tr>
        <td class="smallText" colspan="2">
' . $insert_headline . $insert_date . '
        </td>
        <td class="smallText" colspan="2" align="right">' . $insert_viewcount . '</td>
    </tr>
    <tr>
        <td class="headerNavigation" colspan="3">' . tep_draw_separator('pixel_trans.gif', '100%', '1') . '</td>
    </tr>
    <tr>
        <td colspan="3">' . tep_draw_separator('pixel_trans.gif', '100%', '5') . '</td>
    </tr>
</table> -->

<table border="0" width="100%" cellspacing="3" cellpadding="0">
    <tr>
        <td valign="top" width="">


<table border="0" width="100%" cellspacing="3" cellpadding="0">
    <tr>
        <td class="smallText" colspan="2">' . $insert_date .'</td>
    </tr>
    <tr>
        <td class="smallTextred" colspan="2">
' . $insert_headline . '
        </td>
    </tr>
    <tr>
        <td class="smallText"><BR>' . $insert_summary . ' ' . $insert_readmore . '</td>
    </tr>
    <!-- <tr>
        <td>' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td>
    </tr>
    <tr>
        <td class="smallText">' . $insert_readmore . '</td>
    </tr> -->
</table>

        </td>
        <td valign="top" align="right">

' . $insert_image . '
' . $insert_image_two . '
' . $insert_image_three . '

        </td>
    </tr>
</table>


<table border="0" width="100%" cellspacing="3" cellpadding="0">
    <tr>
        <td colspan="2">' . tep_draw_separator('pixel_trans.gif', '100%', '5') . '</td>
    <HR></tr>
</table>
'

        );
$insert_image = '';
$insert_image_two = '';
$insert_image_three = '';
        $row++;
    }

    new MainNewsBox($info_box_contents);

}

?><table width="100%"><tr><td align="center"><?php
//if ($newsdesk_page_quantity<1) {
//} else {
//    while($newsdesk_page_default <= $newsdesk_page_quantity){
//        echo $newsdesk_page_default++;
//        }         
//}
echo($newsdesk_nav_bar);
?></td></table></tr><?php
?>

<!-- newsdesk_eof //-->


Ce message a été modifié par nexius2 - 13 Feb 2008, 16:48.


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 13 Feb 2008, 17:12
Message #8


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



bon...erreur trouvé...
$newsdesk_total_news=tep_db_num_rows ($newsdesk_var_query); fait appel a la quantité de news apres la limit...
donc en gros, il n'y aura toujours que le nombre de news delimité.

si je fais un $newsdesk_total_news="15" evidement ca fonctionne....

donc, j'en revient au point de depart..... recuperer la quantité de news ....


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 13 Feb 2008, 17:34
Message #9


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



j'ai une soluce temporaire,
mettre avant l'appel
//zone test nbr news
$newsdesk_var_query_test = tep_db_query('select p.newsdesk_id, pd.language_id, p.newsdesk_status from ' . TABLE_NEWSDESK . ' p, ' . TABLE_NEWSDESK_DESCRIPTION . '
pd WHERE pd.newsdesk_id = p.newsdesk_id and pd.language_id = "' . $languages_id . '" and newsdesk_status = 1 and p.newsdesk_sticky = 0 ');
$newsdesk_total_news_test=tep_db_num_rows ($newsdesk_var_query_test);
//echo $newsdesk_total_news_test;
//zone test nbr news

puis utilisé $newsdesk_total_news_test pour avoir la quantité de news....
mais c'est pas tres propre je trouve....si quelqu'un a une autre idée...


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 14 Feb 2008, 15:15
Message #10


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



nouvelle modif au niveau de la pagination. maintenant il y a des liens precedente/suivant et premiere dernier.
par contre, 'essai de n'avoir que 5 chiffre de page et qu'un roulement dans les pages ce fasse. mais je n'y arrive pas bien...pour les dernier chiffres, ca ne pose pas de soucis, mais pour les premiers, je n'arrive pas a les supprimer... j'veut bien un coup de main sur celui la...

CODE
//condition d'affichage du menu nbr page
if($newsdesk_page_quantity > 0)
    {    
    $newsdesk_nav_bar = "";    
    if($newsdesk_page_quantity > 1)
    {      
        if($newsdesk_current_page > 0)
        {             
            //debut fleche premiere page                
                $newsdesk_first_page.= "<a href=\"". $newsdesk_url . "0" ."\" title=\"".TEXT_PAGE. "1" ."\">". tep_image(DIR_WS_IMAGES.'arrow_double_left_white.gif') ."</a>  ";
            //fin fleche premiere page
            //debut fleche page precedente
            $l = $newsdesk_current_page-1;            
                $p = $l+1;
                $newsdesk_previous_page.= "<a href=\"". $newsdesk_url . $l ."\" title=\"".TEXT_PAGE. $p ."\">". tep_image(DIR_WS_IMAGES.'arrow_left_white.gif') ."</a>  ";
            //fin fleche page precedente
                                    //a partir d ici ca pose probleme
            if (($newsdesk_current_page)<2)
                {
                $newsdesk_previous_quantity_page=$newsdesk_current_page;
                } else {
                $newsdesk_previous_quantity_page=2;
                }
                
            for($i = 0;$i < $newsdesk_previous_quantity_page; $i++)
            {
                $p = $i + 1;
                $newsdesk_nav_bar .= "<a href=\"". $newsdesk_url . $i ."\" title=\"".TEXT_PAGE. $p ."\">". $p ."</a> - ";
            }     
             // jusqua la
        }
        $newsdesk_nav_bar .= "<strong>". $newsdesk_display_page ."</strong>";        
        if(($newsdesk_display_page) < $newsdesk_page_quantity)
        {
            $newsdesk_next_news_quantity = $newsdesk_page_quantity - ($newsdesk_display_page);
            if (($newsdesk_current_page)<2)
                {
                  if (($newsdesk_current_page)<1)
                    {
                       $newsdesk_next_quantity_page=4;
                    } else {$newsdesk_next_quantity_page=3;}
                } else {
                $newsdesk_next_quantity_page=2;
                }
            for($j = ($newsdesk_display_page); $j < ($newsdesk_display_page+$newsdesk_next_quantity_page) and $j <$newsdesk_page_quantity; $j++)
            {
                $p = $j + 1;
                $newsdesk_nav_bar .= " - <a href=\"". $newsdesk_url . $j ."\" title=\"".TEXT_PAGE. $p ."\">". $p ."</a>";                 
            }
            //debut fleche suivante
            $k = $newsdesk_display_page;
            if (($k) < $newsdesk_page_quantity)
            {                
                $p = $k + 1;
                $newsdesk_next_page.="  <a href=\"". $newsdesk_url . $k ."\" title=\"".TEXT_PAGE. $p ."\">". tep_image(DIR_WS_IMAGES.'arrow_right_white.gif') ."</a>";
            }        
            //fin fleche suivante
            //debut fleche fin            
            $o=$newsdesk_page_quantity-1;
                $newsdesk_last_page.="  <a href=\"". $newsdesk_url . $o ."\" title=\"".TEXT_PAGE. $o ."\">". tep_image(DIR_WS_IMAGES.'arrow_double_right_white.gif') ."</a>";                
            //fin fleche fin
        }        
        $newsdesk_display_page = TEXT_PAGE . $newsdesk_display_page .TEXT_PAGE_OF_PAGE. $newsdesk_page_quantity .TEXT_PAGES;         
    }
    else
    {
        $newsdesk_nav_bar .= TEXT_ONLY_ONE_PAGE;
    }}     

    $newsdesk_total_nav_bar=$newsdesk_first_page.$newsdesk_previous_page.$newsdesk_nav_bar.$newsdesk_next_page.$newsdesk_last_page
    //condition d'affichage du menu nbr page


Ce message a été modifié par nexius2 - 14 Feb 2008, 15:16.


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 14 Feb 2008, 16:17
Message #11


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



bon..ben trouvé...

CODE
//condition d'affichage du menu nbr page
if($newsdesk_page_quantity > 0)
    {    
    $newsdesk_nav_bar = "";    
    if($newsdesk_page_quantity > 1)
    {      
        if($newsdesk_current_page > 0)
        {             
            //debut fleche premiere page                
                $newsdesk_first_page.= "<a href=\"". $newsdesk_url . "0" ."\" title=\"".TEXT_PAGE. "1" ."\">". tep_image(DIR_WS_IMAGES.'arrow_double_left_white.gif') ."</a>&nbsp;&nbsp;";
            //fin fleche premiere page
            //debut fleche page precedente
            $l = $newsdesk_current_page-1;            
                $p = $l+1;
                $newsdesk_previous_page.= "<a href=\"". $newsdesk_url . $l ."\" title=\"".TEXT_PAGE. $p ."\">". tep_image(DIR_WS_IMAGES.'arrow_left_white.gif') ."</a>&nbsp;&nbsp;";
            //fin fleche page precedente                 
            if (($newsdesk_current_page)<2)
            {
                $newsdesk_previous_quantity_page=$newsdesk_current_page -1;
            } else {
                    $newsdesk_previous_quantity_page=$newsdesk_current_page -2;
            }
            for($q = $newsdesk_previous_quantity_page; $q>=($newsdesk_previous_quantity_page) and $q < $newsdesk_current_page;$q++)
            {
                $p = $q + 1;
                $newsdesk_nav_bar .= "<a href=\"". $newsdesk_url . $q ."\" title=\"".TEXT_PAGE. $p ."\">". $p ."</a> - ";
            }
        }
        $newsdesk_nav_bar .= "<strong>". $newsdesk_display_page ."</strong>";        
        if(($newsdesk_display_page) < $newsdesk_page_quantity)
        {
            $newsdesk_next_news_quantity = $newsdesk_page_quantity - ($newsdesk_display_page);
            if (($newsdesk_current_page)<2)
                {
                  if (($newsdesk_current_page)<1)
                    {
                       $newsdesk_next_quantity_page=4;
                    } else {$newsdesk_next_quantity_page=3;}
                } else {
                $newsdesk_next_quantity_page=2;
                }
            for($j = ($newsdesk_display_page); $j < ($newsdesk_display_page+$newsdesk_next_quantity_page) and $j <$newsdesk_page_quantity; $j++)
            {
                $p = $j + 1;
                $newsdesk_nav_bar .= " - <a href=\"". $newsdesk_url . $j ."\" title=\"".TEXT_PAGE. $p ."\">". $p ."</a>";                 
            }
            //debut fleche suivante
            $k = $newsdesk_display_page;
            if (($k) < $newsdesk_page_quantity)
            {                
                $p = $k + 1;
                $newsdesk_next_page.="&nbsp;&nbsp;<a href=\"". $newsdesk_url . $k ."\" title=\"".TEXT_PAGE. $p ."\">". tep_image(DIR_WS_IMAGES.'arrow_right_white.gif') ."</a>";
            }        
            //fin fleche suivante
            //debut fleche fin            
            $o=$newsdesk_page_quantity-1;
                $newsdesk_last_page.="&nbsp;&nbsp;<a href=\"". $newsdesk_url . $o ."\" title=\"".TEXT_PAGE. $o ."\">". tep_image(DIR_WS_IMAGES.'arrow_double_right_white.gif') ."</a>";                
            //fin fleche fin
        }        
        $newsdesk_display_page = TEXT_PAGE . $newsdesk_display_page .TEXT_PAGE_OF_PAGE. $newsdesk_page_quantity .TEXT_PAGES;         
    }
    else
    {
        $newsdesk_nav_bar .= TEXT_ONLY_ONE_PAGE;
    }}     

    $newsdesk_total_nav_bar=$newsdesk_first_page.$newsdesk_previous_page.$newsdesk_nav_bar.$newsdesk_next_page.$newsdesk_last_page
    //condition d'affichage du menu nbr page


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 15 Feb 2008, 11:12
Message #12


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



la derniere modif qui permet d'avoir un affichage correct si moins de 5 pages de news sont affiché:

CODE
//condition d'affichage du menu nbr page
if($newsdesk_page_quantity > 0 and $newsdesk_page_quantity <= 5)
{
{    
    $newsdesk_nav_bar = "";    
    if($newsdesk_page_quantity > 1)
    {      
        if($newsdesk_current_page > 0)
        {             
            //debut fleche premiere page                
                $newsdesk_first_page.= "<a href=\"". $newsdesk_url . "0" ."\" title=\"".TEXT_PAGE. "1" ."\">". tep_image(DIR_WS_IMAGES.'arrow_double_left_white.gif') ."</a>  ";
            //fin fleche premiere page
            //debut fleche page precedente
            $l = $newsdesk_current_page-1;            
                $p = $l+1;
                $newsdesk_previous_page.= "<a href=\"". $newsdesk_url . $l ."\" title=\"".TEXT_PAGE. $p ."\">". tep_image(DIR_WS_IMAGES.'arrow_left_white.gif') ."</a>  ";
            //fin fleche page precedente            
            for($q = 0;$q < $newsdesk_current_page;$q++)
            {
                $p = $q + 1;
                $newsdesk_nav_bar .= "<a href=\"". $newsdesk_url . $q ."\" title=\"".TEXT_PAGE. $p ."\">". $p ."</a> - ";
            }
        }
        $newsdesk_nav_bar .= "<strong>". $newsdesk_display_page ."</strong>";        
        if(($newsdesk_display_page) < $newsdesk_page_quantity)
        {
            $newsdesk_next_news_quantity = $newsdesk_page_quantity - ($newsdesk_display_page);
            
            for($j = ($newsdesk_display_page); $j <$newsdesk_page_quantity; $j++)
            {
                $p = $j + 1;
                $newsdesk_nav_bar .= " - <a href=\"". $newsdesk_url . $j ."\" title=\"".TEXT_PAGE. $p ."\">". $p ."</a>";                 
            }
            //debut fleche suivante
            $k = $newsdesk_display_page;
            if (($k) < $newsdesk_page_quantity)
            {                
                $p = $k + 1;
                $newsdesk_next_page.="  <a href=\"". $newsdesk_url . $k ."\" title=\"".TEXT_PAGE. $p ."\">". tep_image(DIR_WS_IMAGES.'arrow_right_white.gif') ."</a>";
            }        
            //fin fleche suivante
            //debut fleche fin            
            $o=$newsdesk_page_quantity-1;
                $newsdesk_last_page.="  <a href=\"". $newsdesk_url . $o ."\" title=\"".TEXT_PAGE. $o ."\">". tep_image(DIR_WS_IMAGES.'arrow_double_right_white.gif') ."</a>";                
            //fin fleche fin
        }        
        $newsdesk_display_page = TEXT_PAGE . $newsdesk_display_page .TEXT_PAGE_OF_PAGE. $newsdesk_page_quantity .TEXT_PAGES;         
    }
    else
    {
        $newsdesk_nav_bar .= TEXT_ONLY_ONE_PAGE;
    }}
} else{
if($newsdesk_page_quantity > 5)
    {    
    $newsdesk_nav_bar = "";    
    if($newsdesk_page_quantity > 1)
    {      
        if($newsdesk_current_page > 0)
        {             
            //debut fleche premiere page                
                $newsdesk_first_page.= "<a href=\"". $newsdesk_url . "0" ."\" title=\"".TEXT_PAGE. "1" ."\">". tep_image(DIR_WS_IMAGES.'arrow_double_left_white.gif') ."</a>  ";
            //fin fleche premiere page
            //debut fleche page precedente
            $l = $newsdesk_current_page-1;            
                $p = $l+1;
                $newsdesk_previous_page.= "<a href=\"". $newsdesk_url . $l ."\" title=\"".TEXT_PAGE. $p ."\">". tep_image(DIR_WS_IMAGES.'arrow_left_white.gif') ."</a>  ";
            //fin fleche page precedente                 
            if (($newsdesk_current_page)<2)
            {
                $newsdesk_previous_quantity_page=$newsdesk_current_page -1;
            } else {
                    $newsdesk_previous_quantity_page=$newsdesk_current_page -2;
            }
            if (($newsdesk_current_page) > ($newsdesk_page_quantity-3))
            {
                if (($newsdesk_current_page) > ($newsdesk_page_quantity-2))
                {
                    $newsdesk_previous_quantity_page=$newsdesk_current_page -4;
                } else {
                    $newsdesk_previous_quantity_page=$newsdesk_current_page -3;
                }
            }
            for($q = $newsdesk_previous_quantity_page; $q>=($newsdesk_previous_quantity_page) and $q < $newsdesk_current_page;$q++)
            {
                $p = $q + 1;
                $newsdesk_nav_bar .= "<a href=\"". $newsdesk_url . $q ."\" title=\"".TEXT_PAGE. $p ."\">". $p ."</a> - ";
            }
        }
        $newsdesk_nav_bar .= "<strong>". $newsdesk_display_page ."</strong>";        
        if(($newsdesk_display_page) < $newsdesk_page_quantity)
        {
            $newsdesk_next_news_quantity = $newsdesk_page_quantity - ($newsdesk_display_page);
            if (($newsdesk_current_page)<2)
                {
                  if (($newsdesk_current_page)<1)
                    {
                       $newsdesk_next_quantity_page=4;
                    } else {$newsdesk_next_quantity_page=3;}
                } else {
                $newsdesk_next_quantity_page=2;
                }
            for($j = ($newsdesk_display_page); $j < ($newsdesk_display_page+$newsdesk_next_quantity_page) and $j <$newsdesk_page_quantity; $j++)
            {
                $p = $j + 1;
                $newsdesk_nav_bar .= " - <a href=\"". $newsdesk_url . $j ."\" title=\"".TEXT_PAGE. $p ."\">". $p ."</a>";                 
            }
            //debut fleche suivante
            $k = $newsdesk_display_page;
            if (($k) < $newsdesk_page_quantity)
            {                
                $p = $k + 1;
                $newsdesk_next_page.="  <a href=\"". $newsdesk_url . $k ."\" title=\"".TEXT_PAGE. $p ."\">". tep_image(DIR_WS_IMAGES.'arrow_right_white.gif') ."</a>";
            }        
            //fin fleche suivante
            //debut fleche fin            
            $o=$newsdesk_page_quantity-1;
                $newsdesk_last_page.="  <a href=\"". $newsdesk_url . $o ."\" title=\"".TEXT_PAGE. $o ."\">". tep_image(DIR_WS_IMAGES.'arrow_double_right_white.gif') ."</a>";                
            //fin fleche fin
        }        
        $newsdesk_display_page = TEXT_PAGE . $newsdesk_display_page .TEXT_PAGE_OF_PAGE. $newsdesk_page_quantity .TEXT_PAGES;         
    }
    else
    {
        $newsdesk_nav_bar .= TEXT_ONLY_ONE_PAGE;
    }}
}
    $newsdesk_total_nav_bar=$newsdesk_first_page.$newsdesk_previous_page.$newsdesk_nav_bar.$newsdesk_next_page.$newsdesk_last_page
    //condition d'affichage du menu nbr page


Ce message a été modifié par nexius2 - 4 Mar 2008, 20:53.


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 29 Feb 2008, 14:12
Message #13


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



bonjour,
maintenant j'essai d'amelirorer le moteur de recherche de la partie admin
je pense ne pas en etre loin, mais la recherche n'a pas l'air de "chercher" partout. une syntaxe erroné peut etre?

CODE
$categories_query = tep_db_query("select cd.newsdesk_id, cd.language_id, cd.newsdesk_article_name, cd.newsdesk_article_description, cd.newsdesk_article_shorttext from " . TABLE_NEWSDESK_CATEGORIES . " c, " . TABLE_NEWSDESK_DESCRIPTION . " cd where cd.language_id = '" . $languages_id . "' and cd.newsdesk_article_description like '%" . $HTTP_GET_VARS['search'] . "%' or cd.newsdesk_article_shorttext like '%" . $HTTP_GET_VARS['search'] . "%' or cd.newsdesk_article_name like '%" . $HTTP_GET_VARS['search'] . "%' order by cd.newsdesk_article_name");


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 
nexius2
posté 5 Mar 2008, 15:59
Message #14


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 27-January 07
Membre no 14931



trouvé... pour que dans la partie admin, la fonction recherche cherche dans les text et desctiption de la news, il faut changer dans le fichier admin/newsdesk.php ligne 1399

CODE
$products_query = tep_db_query("
select p.newsdesk_id, pd.newsdesk_article_name, p.newsdesk_image, p.newsdesk_image_two, p.newsdesk_image_three, p.newsdesk_date_added,
p.newsdesk_last_modified, p.newsdesk_date_available, p.newsdesk_status, p.newsdesk_sticky, p2c.categories_id from " . TABLE_NEWSDESK . " p, "
. TABLE_NEWSDESK_DESCRIPTION . " pd, " . TABLE_NEWSDESK_TO_CATEGORIES . " p2c where p.newsdesk_id = pd.newsdesk_id and pd.language_id = '"
. $languages_id . "' and p.newsdesk_id = p2c.newsdesk_id and pd.newsdesk_article_name like '%" . $HTTP_GET_VARS['search'] . "%'
order by p.newsdesk_date_added desc
");

par
CODE
$products_query = tep_db_query("
select p.newsdesk_id, pd.newsdesk_article_name, pd.newsdesk_article_description, pd.newsdesk_article_shorttext, p.newsdesk_image, p.newsdesk_image_two, p.newsdesk_image_three, p.newsdesk_date_added,
p.newsdesk_last_modified, p.newsdesk_date_available, p.newsdesk_status, p.newsdesk_sticky, p2c.categories_id from " . TABLE_NEWSDESK . " p, "
. TABLE_NEWSDESK_DESCRIPTION . " pd, " . TABLE_NEWSDESK_TO_CATEGORIES . " p2c where p.newsdesk_id = pd.newsdesk_id and pd.language_id = '"
. $languages_id . "' and p.newsdesk_id = p2c.newsdesk_id and ( pd.newsdesk_article_name like '%" . $HTTP_GET_VARS['search'] . "%' or pd.newsdesk_article_description like '%" . $HTTP_GET_VARS['search'] . "%' or pd.newsdesk_article_shorttext like '%" . $HTTP_GET_VARS['search'] . "%' )
order by p.newsdesk_date_added desc
");


--------------------
oscommerce 2.2-ms2 fr
+ header_tag V 2.6.2 + Ultimate_SEO_URLsv21da + autre...
Go to the top of the page
 

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 6th April 2020 - 12:55
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)