Fork me on GitHub




(1) 2 »


Variable Smarty
Régulier
Inscrit: 04/02/2003 08:53
De Paris
Messages: 312
Bonjour,
Je n'ai pas tout compris aux variables Smarty.
J'utilise sans trop de problème les surcharges de thème avec les templates pour des petites modifications.
Mais est-il possible d'utiliser une variable smarty d'un module (ici News), <{$story.morelink}> par exemple, dans un autre template que celui où je l'ai découvert ? Quelle est la marche à suivre ? Il faut la déclarer quelque part ? Bref, je n'y arrive pas à réutiliser cette variable ailleurs.
Pouvez-vous m'indiquer la marche à suivre ?

Posté le : 14/04/2020 23:14

Open in new window
18 ans sous XOOPS !
Partager Twitter Partagez cette article sur GG+
Re: Variable Smarty
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
Salut,
attention, je ne suis pas du tout un expert, je suis plutôt comme toi, pour l'instant, c'est à dire utilisateurs de smarty.

Les smarty sont déclarés dans les fichiers PHP et utilisés dans les fichiers tpl.

Voici une doc à lire, certes pas toute jeune mais qui je pense, donne une bonne explication sur ce que sont les smarty sous XOOPS.

Ensuite, parfois, je modifie dans les templates les smarty avec des fonctions smarty, à explorer ici.

Pour le module news, les smarty sont définies dans les fichiers php :
/modules/news/article.php
/modules/news/class/class.newsstory.php

Posté le : 15/04/2020 09:04

Open in new window
Partager Twitter Partagez cette article sur GG+
Re: Variable Smarty
Régulier
Inscrit: 04/02/2003 08:53
De Paris
Messages: 312
Merci Alain.
Du coup, je ne comprends pas pourquoi je n'arrive pas à utiliser <{$story.morelink}> dans ma surcharge du block news_block_top alors que la variable est défini effectivement dans /modules/news/class/class.newsstory.php qui est bien appelé par le fichier /news/blocks/news_top.php à l'aide d'un include. Mystère.
A moins qu'elle ne soit vide ?

Et dans la fenêtre de deboggage Smarty, y'a pas tout ?

Posté le : 15/04/2020 11:07

Open in new window
18 ans sous XOOPS !
Partager Twitter Partagez cette article sur GG+
Re: Variable Smarty
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
Citation :
escrime-info a écrit :
A moins qu'elle ne soit vide ?
Oui, les fichiers PHP "renseignent les variables déclarées.

(J'espère ne pas dire de bêtises, lol)

Citation :
escrime-info a écrit :
Et dans la fenêtre de deboggage Smarty, y'a pas tout ?
Non, juste les smartys déclarés dans la page demandée (et celles incluent évidemment)

Posté le : 15/04/2020 11:14

Open in new window
Partager Twitter Partagez cette article sur GG+
Re: Variable Smarty
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
Dans les fichiers php, tu vas trouver des :
$xoopsTpl->assign('

c'est ça .

Le hic, c'est qui si tu ajoutes des choses dans les fichiers PHP, tu Hacks le module, et ça, moi je me le refuse... Trop de soucis de maintenance par la suite.
Donc ne jamais faire...

... sauf comme je l'ai indiqué plus haut, si tu modifies le contenu d'un smarty, à l'aide de fonction smarty, à faire directement dans le fichier surcharge tpl.
Dans ce cas, ce n'est pas un hack.

S'il te faut de vraies nouvelles variables, il faut en faire la demande sur github, sans quoi tu vas Haaaaaacherrrrrrrr !!!

Posté le : 15/04/2020 11:27

Open in new window
Partager Twitter Partagez cette article sur GG+
Re: Variable Smarty
Régulier
Inscrit: 04/02/2003 08:53
De Paris
Messages: 312
Citation :
alain01 a écrit :
sans quoi tu vas Haaaaaacherrrrrrrr !!!

Promis je vais éviter !!

J'en reviens à mon cas, plus simple normalement. La variable est déjà existante, elle fonctionne sur d'autres pages. Le fichier .php qui la défini est à priori bien appelé dans le .php du bloc, et pourtant elle ne renvoie rien apparemment.
Je ne l'ai pas dans la fenêtre smarty car c'est pour l'utiliser dans un bloc, donc elle n'apparait pas (ce n'est pas directement la page appelée).
Comment trouver où ça coince ?

Posté le : 15/04/2020 13:13

Open in new window
18 ans sous XOOPS !
Partager Twitter Partagez cette article sur GG+
Re: Variable Smarty
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
Ok,
Dans ton cas concret, sois le plus précis possible en donnant toutes les infos :
fichier php,
fichier surcharge tpl
variable smarty à utiliser
ce que tu as,
ce que tu voudrais...

Parlons concrètement, maintenant

Parfois, c'est le nom de la smarty qui change selon les fichiers tpl, cela encore est défini dans les php.
Et puis, si c'est un tableau ou une valeur
article n'affiche qu'un article donc 1 seul auteur

Dans index, liste d'article donc tableau d'auteur donc la variable n'est pas la même


Exemple ?

index.php : * @template_var string poster A link to see the author's profil and his name or "Anonymous"

article.php : * @template_var string poster A link to see the author's profil and his name or "Anonymous"
<{$story.poster}> issu de article issu lui-même de news_item

Posté le : 15/04/2020 13:59

Open in new window
Partager Twitter Partagez cette article sur GG+
Re: Variable Smarty
Régulier
Inscrit: 04/02/2003 08:53
De Paris
Messages: 312
Je souhaite faire une surcharge du bloc news_top.

news/bocks/news_top.php :
<?php // $Id: news_top.php 9767 2012-07-02 06:02:52Z beckmi $ //  ------------------------------------------------------------------------ // //                XOOPS - PHP Content Management System                      // //                    Copyright (c) 2000 XOOPS.org                           // //                       <http://www.xoops.org/>   ... ;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 // //  ------------------------------------------------------------------------ // if (!defined('XOOPS_ROOT_PATH')) {     die('XOOPS root path not defined'); }  include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php'; include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newstopic.php';  /** * Notes about the spotlight : * If you have restricted topics on index page (in fact if the program must completly respect the permissions) and if * the news you have selected to be viewed in the spotlight can't be viewed by someone then the spotlight is not visible ! * This is available in the classical and in the tabbed view. * But if you have uncheck the option "Restrict topics on index page", then the news will be visible but users without * permissions will be rejected when they will try to read news content. * * Also, if you have selected a tabbed view and wanted to use the Spotlight but did not choosed a story, then the block * will switch to the "most recent news" mode (the visible news will be searched according to the permissions) */ function b_news_top_show($options) {     global $xoopsConfig;     include_once XOOPS_ROOT_PATH.'/modules/news/include/functions.php';     $myts =& MyTextSanitizer::getInstance();     $block = array();     $displayname = news_getmoduleoption('displayname');     $tabskin = news_getmoduleoption('tabskin');      if (file_exists(XOOPS_ROOT_PATH.'/modules/news/language/'.$xoopsConfig['language'].'/main.php')) {         include_once XOOPS_ROOT_PATH.'/modules/news/language/'.$xoopsConfig['language'].'/main.php';     } else {         include_once XOOPS_ROOT_PATH.'/modules/news/language/english/main.php';     }      $block['displayview']=$options[8];     $block['tabskin']=$tabskin;     $block['imagesurl']=XOOPS_URL.'/modules/news/images/';      $restricted=news_getmoduleoption('restrictindex');     $dateformat=news_getmoduleoption('dateformat');     $infotips=news_getmoduleoption('infotips');     $newsrating=news_getmoduleoption('ratenews');     if($dateformat=='') {         $dateformat='s';     }      $perm_verified=false;     $news_visible=true;     // Is the spotlight visible ?     if($options[4]==1 && $restricted && $options[5]==0) {         $perm_verified=true;         $permittedtopics=news_MygetItemIds();         $permstory = new NewsStory($options[6]);         if(!in_array($permstory->topicid(),$permittedtopics)) {             $usespotlight=false;             $news_visible = false;             $topicstitles=array();         }         $options[4]==0;     }     // Try to see what tabs are visibles (if we are in restricted view of course)     if($options[8]==2 && $restricted && $options[14] != 0) {         $topics2=array();         $permittedtopics=news_MygetItemIds();         $topics = array_slice($options, 14);         foreach($topics as $onetopic) {             if(in_array($onetopic,$permittedtopics)) {                 $topics2[]=$onetopic;             }         }         $before=array_slice($options, 0,14);         $options=array_merge($before,$topics2);     }      if($options[8]==2) {        // Tabbed view ********************************************************************************************         $defcolors[1]=array('#F90','#FFFFFF','#F90','#C60','#999');        // Bar Style         $defcolors[2]=array('#F90','#FFFFFF','#F90','#AAA','#666');        // Beveled         $defcolors[3]=array('#F90','#FFFFFF','','#789','#789');            // Classic         $defcolors[4]=array('#F90','#FFFFFF','','','');                    // Folders         $defcolors[5]=array('#F90','#FFFFFF','#CCC','inherit','#999');    // MacOs         $defcolors[6]=array('#F90','#FFFFFF','#FFF','#DDD','#999');        // Plain         $defcolors[7]=array('#F90','#FFFFFF','','','');                    // Rounded         $defcolors[8]=array('#F90','#FFFFFF','#F90','#930','#C60');        // ZDnet          $myurl=$_SERVER['PHP_SELF'];         if(substr($myurl,strlen($myurl)-1,1) == '/') {             $myurl.='index.php';         }         $myurl.='?';          foreach($_GET as $key => $value) {             if($key!='NewsTab') {                 $myurl.=$key.'='.$value.'&';             }         }         $block['url']=$myurl;          $tabscount=0;         $usespotlight=false;          if(isset($_GET['NewsTab'])) {             $_SESSION['NewsTab']=intval($_GET['NewsTab']);             $currenttab = intval($_GET['NewsTab']);         } elseif(isset($_SESSION['NewsTab'])) {             $currenttab = intval($_SESSION['NewsTab']);         } else {             $currenttab=0;         }          $tmpstory = new NewsStory();         $topic= new NewsTopic();         $topicstitles=array();         if($options[4]==1) {    // Spotlight enabled             $topicstitles[0]=_MB_NEWS_SPOTLIGHT_TITLE;             $tabscount++;             $usespotlight=true;         }          if($options[5]==0 && $restricted) {    // Use a specific news and we are in restricted mode             if(!$perm_verified) {                 $permittedtopics=news_MygetItemIds();                 $permstory = new NewsStory($options[6]);                 if(!in_array($permstory->topicid(),$permittedtopics)) {                     $usespotlight=false;                     $topicstitles=array();                 }                 //unset($permstory);             } else {                 if(!$news_visible) {                     $usespotlight=false;                     $topicstitles=array();                 }             }         }          $block['use_spotlight']=$usespotlight;          if (isset($options[14]) && $options[14] != 0) {        // Topic to use             $topics = array_slice($options, 14);             $tabscount+=count($topics);             $topicstitles=$topic->getTopicTitleFromId($topics,$topicstitles);         }         $tabs=array();         if($usespotlight) {             $tabs[]=array('id'=>0,'title'=>_MB_NEWS_SPOTLIGHT_TITLE);         }         if(count($topics)>0) {             foreach($topics as $onetopic) {                 if(isset($topicstitles[$onetopic])) {                     $tabs[]=array('id'=>$onetopic, 'title'=>$topicstitles[$onetopic]['title'], 'picture'=>$topicstitles[$onetopic]['picture']);                 }             }         }         $block['tabs']=$tabs;         $block['current_is_spotlight']=false;         $block['current_tab']=$currenttab;         $block['use_rating']=$newsrating;           if($currenttab==0 && $usespotlight) {    // Spotlight or not ?             $block['current_is_spotlight']=true;             if($options[5]==0 && $options[6]==0) {    // If the story to use was no selected then we switch to the "recent news" mode.                 $options[5]=1;             }              if($options[5]==0) {    // Use a specific news                 if(!isset($permstory)) {                     $tmpstory->NewsStory($options[6]);                 } else {                     $tmpstory = $permstory;                 }             } else {                // Use the most recent news                 $stories=array();                 $stories=$tmpstory->getAllPublished(1,0,$restricted,0,1,true,$options[0]);                 if(count($stories)>0)                 {                     $firststory=$stories[0];                     $tmpstory->NewsStory($firststory->storyid());                 } else {                     $block['use_spotlight']=false;                 }             }             $spotlight = array();             $spotlight['title'] = $tmpstory->title();                if ($options[7] != '') {                 $spotlight['image'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL.'/modules/news/article.php?storyid='.$tmpstory->storyid(),$myts->displayTarea($options[7], $tmpstory->nohtml));             }                $spotlight['text'] = $tmpstory->hometext();                 // Added 16 february 2007 *****************************************                $story_user = null;             $story_user = new XoopsUser($tmpstory->uid());             if(is_object($story_user)) {                    $spotlight['avatar'] = XOOPS_UPLOAD_URL.'/'.$story_user->getVar('user_avatar');                }             // ****************************************************************                $spotlight['id'] = $tmpstory->storyid();                $spotlight['date'] = formatTimestamp($tmpstory->published(), $dateformat);                $spotlight['hits'] = $tmpstory->counter();                $spotlight['rating'] = number_format($tmpstory->rating(), 2);                $spotlight['votes'] = $tmpstory->votes();             if(strlen(xoops_trim($tmpstory->bodytext()))>0) {                 $spotlight['read_more']=true;             } else {                 $spotlight['read_more']=false;             }                 $spotlight['readmore'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL.'/modules/news/article.php?storyid='.$tmpstory->storyid(),_MB_READMORE);                $spotlight['title_with_link'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL.'/modules/news/article.php?storyid='.$tmpstory->storyid(),$tmpstory->title());                if($tmpstory->votes()==1) {                 $spotlight['number_votes']=_NW_ONEVOTE;             } else {                 $spotlight['number_votes']=sprintf(_NW_NUMVOTES,$tmpstory->votes());             }                 $spotlight['votes_with_text']=sprintf(_NW_NUMVOTES,$tmpstory->votes());                $spotlight['topicid'] = $tmpstory->topicid();                $spotlight['topic_title'] = $tmpstory->topic_title();             // Added, topic's image and description                $spotlight['topic_image']=XOOPS_URL.'/modules/news/images/topics/'.$tmpstory->topic_imgurl();                $spotlight['topic_description']=$myts->displayTarea($tmpstory->topic_description,1);                 if($displayname!=3) {                 $spotlight['author'] = sprintf("%s %s",_POSTEDBY,$tmpstory->uname());                    $spotlight['author_with_link'] = sprintf("%s <a href='%s'>%s</a>",_POSTEDBY,XOOPS_URL.'/userinfo.php?uid='.$tmpstory->uid(),$tmpstory->uname());                } else {                 $spotlight['author'] = '';                    $spotlight['author_with_link'] = '';                }                $spotlight['author_id'] = $tmpstory->uid();              // Create the summary table under the spotlight text             if (isset($options[14]) && $options[14] == 0) {        // Use all topics                 $stories = $tmpstory->getAllPublished($options[1],0,$restricted,0,1,true,$options[0]);                } else {                    // Use some topics                 $topics = array_slice($options, 14);                    $stories = $tmpstory->getAllPublished($options[1],0,$restricted,$topics,1,true,$options[0]);                }                if(count($stories)>0) {                    foreach ($stories as $key => $story) {                     $news = array();                     $title = $story->title();                     if (strlen($title) > $options[2]) {                         $title = xoops_substr($title,0,$options[2]+3);                     }                        $news['title'] = $title;                        $news['id'] = $story->storyid();                        $news['date'] = formatTimestamp($story->published(), $dateformat);                        $news['hits'] = $story->counter();                        $news['rating'] = number_format($story->rating(), 2);                        $news['votes'] = $story->votes();                        $news['topicid'] = $story->topicid();                        $news['topic_title'] = $story->topic_title();                        $news['topic_color'] = '#'.$myts->displayTarea($story->topic_color);                        $news['picture'] = XOOPS_URL.'/uploads/news/image/'.$story->picture();                    $news['pictureinfo'] = $story->pictureinfo();                        if($displayname!=3) {                         $news['author']= sprintf("%s %s",_POSTEDBY,$story->uname());                        } else {                         $news['author']= '';                        }                     if ($options[3] > 0) {                         $html = $story->nohtml() == 1 ? 0 : 1;                         $news['teaser'] = news_truncate_tagsafe($myts->displayTarea($story->hometext(), $html), $options[3]+3);                        } else {                         $news['teaser'] = '';                        }                     if($infotips>0) {                         $news['infotips'] = ' title="'.news_make_infotips($story->hometext()).'"';                     } else {                         $news['infotips'] = '';                     }                         $news['title_with_link'] = sprintf("<a href='%s'%s>%s</a>", XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),$news['infotips'],$title);                        $spotlight['news'][] = $news;                    }             }              $block['spotlight'] = $spotlight;         } else {             if($tabscount>0) {                    $topics = array_slice($options, 14);                    $thetopic=$currenttab;                    $stories = $tmpstory->getAllPublished($options[1],0,$restricted,$thetopic,1,true,$options[0]);                     $topic->getTopic($thetopic);                    // Added, topic's image and description                    $block['topic_image']=XOOPS_URL.'/modules/news/images/topics/'.$topic->topic_imgurl();                    $block['topic_description']=$topic->topic_description();                  $smallheader=array();                 $stats=$topic->getTopicMiniStats($thetopic);                 $smallheader[]=sprintf("<a href='%s'>%s</a>", XOOPS_URL.'/modules/news/index.php?storytopic='.$thetopic,_MB_READMORE);                 $smallheader[]=sprintf("%u %s",$stats['count'],_NW_ARTICLES);                 $smallheader[]=sprintf("%u %s",$stats['reads'],_READS);                 if(count($stories)>0) {                     foreach ($stories as $key => $story) {                         $news = array();                         $title = $story->title();                         if (strlen($title) > $options[2]) {                             $title = news_truncate_tagsafe($title, $options[2]+3);                         }                         if ($options[7] != '') {                             $news['image'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),$myts->displayTarea($options[7], $story->nohtml));                         }                         if($options[3]>0) {                             $html = $story->nohtml() == 1 ? 0 : 1;                             $news['text'] = news_truncate_tagsafe($myts->displayTarea($story->hometext(), $html), $options[3]+3);                         } else {                             $news['text'] = '';                         }                          if($story->votes()==1) {                             $news['number_votes']=_NW_ONEVOTE;                         } else {                             $news['number_votes']=sprintf(_NW_NUMVOTES,$story->votes());                         }                         if($infotips>0) {                             $news['infotips'] = ' title="'.news_make_infotips($story->hometext()).'"';                         } else {                             $news['infotips'] = '';                         }                         $news['title']=sprintf("<a href='%s' %s>%s</a>", XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),$news['infotips'],$title);                         $news['id'] = $story->storyid();                         $news['date'] = formatTimestamp($story->published(), $dateformat);                         $news['hits'] = $story->counter();                         $news['rating'] = number_format($story->rating(), 2);                         $news['votes'] = $story->votes();                         $news['topicid'] = $story->topicid();                         $news['topic_title'] = $story->topic_title();                         $news['topic_color'] = '#'.$myts->displayTarea($story->topic_color);                      $news['picture'] = XOOPS_URL.'/uploads/news/image/'.$story->picture();                       $news['pictureinfo'] = $story->pictureinfo();                                                if($displayname!=3) {                             $news['author'] = sprintf("%s %s",_POSTEDBY,$story->uname());                         } else {                             $news['author'] = '';                         }                         $news['title_with_link'] = sprintf("<a href='%s'%s>%s</a>", XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),$news['infotips'],$title);                         $block['news'][] = $news;                     }                     $block['smallheader']=$smallheader;                 }             }         }         $block['lang_on']=_ON;                            // on         $block['lang_reads']=_READS;                    // reads         // Default values         $block['color1']=$defcolors[$tabskin][0];         $block['color2']=$defcolors[$tabskin][1];         $block['color3']=$defcolors[$tabskin][2];         $block['color4']=$defcolors[$tabskin][3];         $block['color5']=$defcolors[$tabskin][4];          if(xoops_trim($options[9])!='') {             $block['color1']=$options[9];         }         if(xoops_trim($options[10])!='') {             $block['color2']=$options[10];         }         if(xoops_trim($options[11])!='') {             $block['color3']=$options[11];         }         if(xoops_trim($options[12])!='') {             $block['color4']=$options[12];         }         if(xoops_trim($options[13])!='') {             $block['color5']=$options[13];         }     } else {        // ************************ Classical view **************************************************************************************************************         $tmpstory = new NewsStory;         if (isset($options[14]) && $options[14] == 0) {             $stories = $tmpstory->getAllPublished($options[1],0,$restricted,0,1,true,$options[0]);         } else {             $topics = array_slice($options, 14);             $stories = $tmpstory->getAllPublished($options[1],0,$restricted,$topics,1,true,$options[0]);         }          if(!count($stories)) {             return '';         }         $topic= new NewsTopic();          foreach ($stories as $key => $story) {             $news = array();             $title = $story->title();             if (strlen($title) > $options[2]) {                 $title = xoops_substr($title,0,$options[2]+3);             }              //if spotlight is enabled and this is either the first article or the selected one             if (($options[5]==0) && ($options[4] == 1) && (($options[6] > 0 && $options[6] == $story->storyid()) || ($options[6] == 0 && $key == 0))) {                 $spotlight = array();                 $visible=true;                 if($restricted) {                     $permittedtopics=news_MygetItemIds();                     if(!in_array($story->topicid(),$permittedtopics)) {                         $visible=false;                     }                 }                  if($visible) {                     $spotlight['title'] = $title;                     if ($options[7] != '') {                         $spotlight['image']= sprintf("<a href='%s'>%s</a>", XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),$myts->displayTarea($options[7], $story->nohtml));                     }                        // Added 16 february 2007 *****************************************                        $story_user = null;                     $story_user = new XoopsUser($story->uid());                     if(is_object($story_user)) {                            $spotlight['avatar'] = XOOPS_UPLOAD_URL.'/'.$story_user->getVar('user_avatar');                        }                     // ****************************************************************                     $spotlight['text'] = $story->hometext();                     $spotlight['id'] = $story->storyid();                     $spotlight['date'] = formatTimestamp($story->published(), $dateformat);                     $spotlight['hits'] = $story->counter();                     $spotlight['rating'] = $story->rating();                     $spotlight['votes'] = $story->votes();                     $spotlight['topicid'] = $story->topicid();                     $spotlight['topic_title'] = $story->topic_title();                     $spotlight['topic_color'] = '#'.$myts->displayTarea($story->topic_color);                     // Added, topic's image and description                        $spotlight['topic_image']=XOOPS_URL.'/modules/news/images/topics/'.$story->topic_imgurl();                        $spotlight['topic_description']=$myts->displayTarea($story->topic_description,1);                        if(strlen(xoops_trim($story->bodytext()))>0) {                            $spotlight['read_more']=true;                        } else {                            $spotlight['read_more']=false;                        }                      if($displayname!=3) {                         $spotlight['author'] = sprintf("%s %s",_POSTEDBY,$story->uname());                     } else {                         $spotlight['author'] = '';                     }                 }                 $block['spotlight'] = $spotlight;             } else {                 $news['title'] = $title;                 $news['id'] = $story->storyid();                 $news['date'] = formatTimestamp($story->published(), $dateformat);                 $news['hits'] = $story->counter();                 $news['rating'] = $story->rating();                 $news['votes'] = $story->votes();                 $news['topicid'] = $story->topicid();                 $news['topic_title'] = $story->topic_title();                 $news['topic_color'] = '#'.$myts->displayTarea($story->topic_color);                 $news['picture'] = XOOPS_URL.'/uploads/news/image/'.$story->picture();                 $news['pictureinfo'] = $story->pictureinfo();                                  if($displayname!=3) {                     $news['author']= sprintf("%s %s",_POSTEDBY,$story->uname());                 } else {                     $news['author']= '';                 }                 if ($options[3] > 0) {                     $html = $story->nohtml() == 1 ? 0 : 1;                     $news['teaser'] = news_truncate_tagsafe($myts->displayTarea($story->hometext(), $html), $options[3]+3);                                         $news['infotips'] = '';                 } else {                     $news['teaser'] = '';                     if($infotips>0) {                         $news['infotips'] = ' title="'.news_make_infotips($story->hometext()).'"';                     } else {                         $news['infotips'] = '';                     }                 }                 $block['stories'][] = $news;             }         }          // If spotlight article was not in the fetched stories         if (!isset($spotlight) && $options[4]) {             $block['use_spotlight']=true;             $visible=true;             if($options[5]==0 && $restricted) {    // Use a specific news and we are in restricted mode                    $permittedtopics=news_MygetItemIds();                    $permstory = new NewsStory($options[6]);                    if(!in_array($permstory->topicid(),$permittedtopics)) {                        $visible=false;                    }                    unset($permstory);                }              if($options[5]==0) {    // Use a specific news                 if($visible) {                     $spotlightArticle = new NewsStory($options[6]);                 } else {                     $block['use_spotlight']=false;                 }             } else {                // Use the most recent news                 $stories=array();                 $stories=$tmpstory->getAllPublished(1,0,$restricted,0,1,true,$options[0]);                 if(count($stories)>0) {                     $firststory=$stories[0];                     $spotlightArticle = new NewsStory($firststory->storyid());                 } else {                     $block['use_spotlight']=false;                 }             }             if($block['use_spotlight']==true) {                 $spotlight = array();                 $spotlight['title'] = xoops_substr($spotlightArticle->title(),0,($options[2]-1));;                 if ($options[7] != '') {                     $spotlight['image'] = sprintf("<a href='%s'>%s</a>", XOOPS_URL.'/modules/news/article.php?storyid='.$spotlightArticle->storyid(),$myts->displayTarea($options[7], $spotlightArticle->nohtml));                 }                    // Added 16 february 2007 *****************************************                    $story_user = null;                 $story_user = new XoopsUser($spotlightArticle->uid());                 if(is_object($story_user)) {                        $spotlight['avatar'] = XOOPS_UPLOAD_URL.'/'.$story_user->getVar('user_avatar');                    }                 // ****************************************************************                 $spotlight['topicid'] = $spotlightArticle->topicid();                 $spotlight['topic_title'] = $spotlightArticle->topic_title();                 $spotlight['topic_color'] = '#'.$myts->displayTarea($spotlightArticle->topic_color);                 $spotlight['text'] = $spotlightArticle->hometext();                 $spotlight['id'] = $spotlightArticle->storyid();                 $spotlight['date'] = formatTimestamp($spotlightArticle->published(), $dateformat);                 $spotlight['hits'] = $spotlightArticle->counter();                 $spotlight['rating'] = $spotlightArticle->rating();                 $spotlight['votes'] = $spotlightArticle->votes();                 // Added, topic's image and description                    $spotlight['topic_image']=XOOPS_URL.'/modules/news/images/topics/'.$spotlightArticle->topic_imgurl();                 $spotlight['topic_description']=$myts->displayTarea($spotlightArticle->topic_description,1);                 if($displayname!=3) {                     $spotlight['author'] = sprintf("%s %s",_POSTEDBY,$spotlightArticle->uname());                 } else {                     $spotlight['author'] = '';                 }                 if(strlen(xoops_trim($spotlightArticle->bodytext()))>0) {                     $spotlight['read_more']=true;                 } else {                     $spotlight['read_more']=false;                 }                 $block['spotlight'] = $spotlight;             }         }     }     if(isset($permstory)) {         unset($permstory);     }        $block['lang_read_more'] = $myts->htmlSpecialChars(_MB_READMORE);            // Read More...        $block['lang_orderby'] = $myts->htmlSpecialChars(_MB_NEWS_ORDER);            // "Order By"        $block['lang_orderby_date'] = $myts->htmlSpecialChars(_MB_NEWS_DATE);        // Published date        $block['lang_orderby_hits'] = $myts->htmlSpecialChars(_MB_NEWS_HITS);        // Number of Hits        $block['lang_orderby_rating'] = $myts->htmlSpecialChars(_MB_NEWS_RATE);    // Rating        $block['sort'] = $options[0];                        // "published" or "counter" or "rating"     return $block; }  /** * Function used to edit the block */ function b_news_top_edit($options) {     global $xoopsDB;     $tmpstory = new NewsStory;     $form = _MB_NEWS_ORDER."&nbsp;<select name='options[]'>";     $form .= "<option value='published'";     if ( $options[0] == 'published' ) {         $form .= " selected='selected'";     }     $form .= '>'._MB_NEWS_DATE."</option>n";      $form .= "<option value='counter'";     if($options[0] == 'counter'){         $form .= " selected='selected'";     }     $form .= '>'._MB_NEWS_HITS.'</option>';     $form .= "<option value='rating'";     if ( $options[0] == 'rating' ) {         $form .= " selected='selected'";     }     $form .= '>' . _MB_NEWS_RATE . '</option>';     $form .= "</select>n";      $form .= '&nbsp;'._MB_NEWS_DISP."&nbsp;<input type='text' name='options[]' value='".$options[1]."'/>&nbsp;"._MB_NEWS_ARTCLS;     $form .= "&nbsp;<br /><br />"._MB_NEWS_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[2]."'/>&nbsp;"._MB_NEWS_LENGTH.'<br /><br />';      $form .= _MB_NEWS_TEASER." <input type='text' name='options[]' value='".$options[3]."' />"._MB_NEWS_LENGTH;     $form .= '<br /><br />';      $form .= _MB_NEWS_SPOTLIGHT." <input type='radio' name='options[]' value='1'";     if ($options[4] == 1) {         $form .= " checked='checked'";     }     $form .= ' />'._YES;     $form .= "<input type='radio' name='options[]' value='0'";     if ($options[4] == 0) {         $form .= " checked='checked'";     }     $form .= ' />'._NO.'<br /><br />';      $form .= _MB_NEWS_WHAT_PUBLISH ." <select name='options[]'><option value='1'";     if ($options[5] == 1) {         $form .= ' selected';     }     $form .= ' />'._MB_NEWS_RECENT_NEWS;     $form .= "</option><option value='0'";     if ($options[5] == 0) {         $form .= ' selected';     }     $form .= ' />'._MB_NEWS_RECENT_SPECIFIC.'</option></select>';      $form .= '<br /><br />'._MB_NEWS_SPOTLIGHT_ARTICLE.'<br />';     $articles = $tmpstory->getAllPublished(200,0,false,0,0,false);        // I have limited the listbox to the last 200 articles     $form .= "<select name ='options[]'>";     $form .= "<option value='0'>"._MB_NEWS_FIRST.'</option>';     foreach ($articles as $storyid => $storytitle) {         $sel = '';         if ($options[6] == $storyid) {             $sel = " selected='selected'";         }         $form .= "<option value='$storyid'$sel>".$storytitle.'</option>';     }     $form .= '</select><br /><br />';      $form .= _MB_NEWS_IMAGE."&nbsp;<input type='text' id='spotlightimage' name='options[]' value='".$options[7]."' size='50'/>";     $form .= "&nbsp;<img align='middle' onmouseover='style.cursor="hand"' onclick='javascript:openWithSelfMain("".XOOPS_URL."/imagemanager.php?target=spotlightimage","imgmanager",400,430);' src='".XOOPS_URL."/images/image.gif' alt='image' title='image' />";     $form .= '<br /><br />'._MB_NEWS_DISP."&nbsp;<select name='options[]'><option value='1' ";     if($options[8]==1) {         $form .= 'selected';     }     $form .= '>'._MB_NEWS_VIEW_TYPE1."</option><option value='2' ";     if($options[8]==2) {         $form .= 'selected';     }     $form .= '>'._MB_NEWS_VIEW_TYPE2.'</option></select><br /><br />';      $form .= "<table border=0>n";     $form .= "<tr><td colspan='2' align='center'><u>"._MB_NEWS_DEFAULT_COLORS."</u></td></tr>";     $form .= "<tr><td>"._MB_NEWS_TAB_COLOR1 . "</td><td><input type='text' name='options[]' value='".$options[9]."' size=7></td></tr>";     $form .= "<tr><td>"._MB_NEWS_TAB_COLOR2 . "</td><td><input type='text' name='options[]' value='".$options[10]."' size=7></td></tr>";     $form .= "<tr><td>"._MB_NEWS_TAB_COLOR3 . "</td><td><input type='text' name='options[]' value='".$options[11]."' size=7></td></tr>";     $form .= "<tr><td>"._MB_NEWS_TAB_COLOR4 . "</td><td><input type='text' name='options[]' value='".$options[12]."' size=7></td></tr>";     $form .= "<tr><td>"._MB_NEWS_TAB_COLOR5 . "</td><td><input type='text' name='options[]' value='".$options[13]."' size=7></td></tr>";     $form .= "</table>n";      $form .= '<br /><br />'._MB_SPOTLIGHT_TOPIC."<br /><select name='options[]' multiple='multiple'>";     include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newstopic.php';     $topics_arr=array();     include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';     $xt = new XoopsTree($xoopsDB->prefix('topics'), 'topic_id', 'topic_pid');     $topics_arr = $xt->getChildTreeArray(0,'topic_title');     $size = count($options);     foreach ($topics_arr as $onetopic) {         $sel = '';         if($onetopic['topic_pid']!=0) {             $onetopic['prefix'] = str_replace('.','-',$onetopic['prefix']) . '&nbsp;';         } else {             $onetopic['prefix'] = str_replace('.','',$onetopic['prefix']);         }         for ( $i = 14; $i < $size; $i++ ) {             if ($options[$i] == $onetopic['topic_id']) {                 $sel = " selected='selected'";             }         }         $form .= "<option value='".$onetopic['topic_id']."'$sel>".$onetopic['prefix'].$onetopic['topic_title'].'</option>';     }     $form .= '</select><br />';     return $form; }  function b_news_top_onthefly($options) {     $options = explode('|',$options);     $block = & b_news_top_show($options);      $tpl = new XoopsTpl();     $tpl->assign('block', $block);     $tpl->display('db:news_block_top.html'); } ?>


Ligne 31, j'ai bien
include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';


Dans /modules/news/class/class.newsstory.php il y a ce morceau de code :

$morelink '';
        if ( 
$fullcount ) {
            
$morelink .= '<a href="'.XOOPS_URL.'/modules/news/article.php?storyid='.$this->storyid().'';
            
$morelink .= '">'._NW_READMORE.'</a>';
            
$morelink .= ' | '.sprintf(_NW_BYTESMORE,$totalcount);
            if (
XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) {
                
$morelink .= ' | ';
            }
        }
        if (
XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) {
            
$ccount $this->comments();
            
$morelink .= '<a href="'.XOOPS_URL.'/modules/news/article.php?storyid='.$this->storyid().'';
            
$morelink2 '<a href="'.XOOPS_URL.'/modules/news/article.php?storyid='.$this->storyid().'';
            if ( 
$ccount == ) {
                
$morelink .= '">'._NW_COMMENTS.'</a>';
            } else {
                if ( 
$fullcount ) {
                    if ( 
$ccount == ) {
                        
$morelink .= '">'._NW_READMORE.'</a> | '.$morelink2.'">'._NW_ONECOMMENT.'</a>';
                    } else {
                        
$morelink .= '">'._NW_READMORE.'</a> | '.$morelink2.'">';
                        
$morelink .= sprintf(_NW_NUMCOMMENTS$ccount);
                        
$morelink .= '</a>';
                    }
                } else {
                    if ( 
$ccount == ) {
                        
$morelink .= '">'._NW_ONECOMMENT.'</a>';
                    } else {
                        
$morelink .= '">';
                        
$morelink .= sprintf(_NW_NUMCOMMENTS$ccount);
                        
$morelink .= '</a>';
                    }
                }
            }
        }
        
$story['morelink'] = $morelink;


Et dans mon template (modules/news/templates/blocks/news_block_top.html) :

<{if $block.displayview==2}>        <{* Classical view *}>

<
style type="text/css">
#fullSupport {
    
padding1.5em;
    
background: <{$block.color2}>;
    
min-height300px;
}

<{if 
$block.tabskin==1}>            <{* Bar Style *}>
#tabNavigation {
    
background#F90;
    
border-bottom1px solid #000;
    
border-top1px solid #000;
    
list-stylenone outside none;
    
colorinherit;
    
margin0;
    
padding0
}

html #tabNavigation/* */ {
    
padding4px 0 4px 0
}

html>body #tabNavigation {
    
margin0;
    
padding4px 0 4px 0
}

#tabNavigation li {
    
displayinline;
    
line-height1em
}

#tabNavigation a, #tabNavigation a:link, #tabNavigation a:visited {
    
background: <{$block.color4}>;
    
border-bottom1px solid #000;
    
border-right1px solid #000;
    
color#FFF;
    
cursorpointer;
    
height1em;
    
margin: -1px 0 -1px 0;
    
padding3px 6px 3px 6px;
    
text-decorationnone
}

html #tabNavigation a/* */, html #tabNavigation a:link/* */, html #tabNavigation a:visited/* */ {
    
border-bottomnone;
    
heightauto;
    
margin0
}

html>body #tabNavigation a, html>body #tabNavigation a:link, html>body #tabNavigation a:visited {
    
border-bottomnone;
    
padding4px 6px 4px 6px
}

head+body #tabNavigation a, head+body #tabNavigation a:link, head+body #tabNavigation a:visited {
    
padding3px 6px 3px 6px
}

#tabNavigation a:hover {
    
background: <{$block.color5}>;
    
colorinherit
}

#tabNavigation a:active {
    
background#CCC;
    
border-right1px solid #000;
    
colorinherit
}

#tabNavigation .selectedTab a, #tabNavigation .selectedTab a:link, #tabNavigation .selectedTab a:visited, #tabNavigation .selectedTab a:hover {
    
background: <{$block.color3}>;
    
border-bottomnone;
    
border-right1px solid #000;
    
border-top1px solid #000;
    
color#000;
    
cursortext;
    
padding3px 5px 4px 5px
}

html>body #tabNavigation .selectedTab a, html>body #tabNavigation .selectedTab a:link, html>body #tabNavigation .selectedTab a:visited {
    
padding4px 5px 5px 5px
}

head+body #tabNavigation .selectedTab a, head+body #tabNavigation .selectedTab a:link, head+body #tabNavigation .selectedTab a:visited, head+body #tabNavigation .selectedTab a:hover {
    
padding3px 5px 4px 5px
}

.
fixTabsIE {
    
visibilityhidden
}
<{elseif 
$block.tabskin==2}>        <{* Beveled *}>
#tabNavigation {
    
border-bottom1px solid #000;
    
list-stylenone outside none;
    
margin0;
    
padding0
}

html #tabNavigation/* */ {
    
padding4px 0 2px 0
}

html>body #tabNavigation {
    
padding3px 0 1px 0
}

head+body #tabNavigation {
    
padding4px 0 2px 0
}

#tabNavigation li {
    
border-left1px solid #000;
    
border-right1px solid #000;
    
border-top1px solid #000;
    
displayinline;
    
height1em;
    
margin0 0 0 3px;
    
padding0;
    
z-index1000
}

html #tabNavigation li/* */ {
    
heightauto
}

html>body #tabNavigation li {
    
heightauto;
    
margin-5px 0 -3px;
    
padding3px 5px 2px 5px
}

html>body ul[id]#tabNavigation li {
    
margin0 0 0 3px;
    
padding3px 0 2px 0
}

#tabNavigation a, #tabNavigation a:link, #tabNavigation a:visited {
    
background: <{$block.color4}>;
    
border-left1px solid #CCC;
    
border-right1px solid #CCC;
    
border-top1px solid #CCC;
    
color#FFF;
    
height1em;
    
padding2px 4px 2px 4px;
    
text-decorationnone
}

html #tabNavigation a/* */, html #tabNavigation a:link/* */, html #tabNavigation a:visited/* */ {
    
heightauto
}

#tabNavigation a:hover {
    
background: <{$block.color5}>;
    
border-left1px solid #888;
    
border-right1px solid #888;
    
border-top1px solid #888;
    
color#FFF
}

#tabNavigation a:active {
    
background#C60;
    
border-left1px solid #E80;
    
border-right1px solid #E80;
    
border-top1px solid #E80;
    
color#FFF
}

html>body #tabNavigation li.selectedTab {
    
margin-5px 0 -3px;
    
padding3px 5px 2px 5px
}

html>body ul[id]#tabNavigation li.selectedTab {
    
margin0 0 0 3px;
    
padding3px 0 2px 0
}

#tabNavigation .selectedTab a, #tabNavigation .selectedTab a:link, #tabNavigation .selectedTab a:visited, #tabNavigation .selectedTab a:hover {
    
background: <{$block.color3}>;
    
border-left1px solid #FC3;
    
border-right1px solid #FC3;
    
border-top1px solid #FC3;
    
color#FFF;
    
margin: -2px 0 0 0;
    
padding3px 4px 3px 4px;
    
positionrelative;
    
top2px
}

html #tabNavigation .selectedTab a/* */, html #tabNavigation .selectedTab a:link/* */, html #tabNavigation .selectedTab a:visited/* */, html #tabNavigation .selectedTab a:hover/* */ {
    
margin: -1px 0 0 0;
    
top1px
}

html>body #tabNavigation .selectedTab a, html>body #tabNavigation .selectedTab a:link, html>body #tabNavigation .selectedTab a:visited, html>body #tabNavigation .selectedTab a:hover {
    
padding2px 4px 2px 4px;
    
top0
}

head:first-child+body #tabNavigation .selectedTab a, head:first-child+body #tabNavigation .selectedTab a:link, head:first-child+body #tabNavigation .selectedTab a:visited, head:first-child+body #tabNavigation .selectedTab a:hover {
    
margin: -1px 0 0 0;
    
padding2px 4px 4px 4px;
    
top0
}

head:first-child+body ul[id]#tabNavigation .selectedTab a, head:first-child+body ul[id]#tabNavigation .selectedTab a:link, head:first-child+body ul[id]#tabNavigation .selectedTab a:visited, head:first-child+body ul[id]#tabNavigation .selectedTab a:hover {
    
padding3px 4px 3px 4px;
    
top1px
}

.
fixTabsIE {
    
visibilityhidden
}
<{elseif 
$block.tabskin==3}>        <{* Classic *}>
ulli {
    list-
styledisc;
    
margin0 10px 0 10px
}

#tabNavigation {
    
background#789;
    
colorinherit;
    list-
stylenone outside none;
    
margin0;
    
padding0
}

html #tabNavigation/* */ {
    
padding6px 0 6px 1px
}

html>body #tabNavigation {
    
margin0;
    
padding6px 0 6px 1px;
}

#tabNavigation li {
    
displayinline;
    
line-height1em;
    
margin0;
    
padding0
}

#tabNavigation a, #tabNavigation a:link, #tabNavigation a:visited {
    
backgroundurl(<{$block.imagesurl}>unselectedEnd.gif) <{$block.color4}> no-repeat scroll top right;
    
color#FFF;
    
cursorpointer;
    
height1em;
    
padding5px 21px 5px 2px;
    
text-decorationnone;
    
z-index1000
}

html #tabNavigation a/* */, html #tabNavigation a:link/* */, html #tabNavigation a:visited/* */ {
    
heightauto;
    
margin0;
    
padding5px 21px 5px 2px
}

#tabNavigation a:hover {
    
backgroundurl(<{$block.imagesurl}>unselectedEnd.gif) <{$block.color5}> no-repeat scroll top right;
    
color#FFF;
    
text-decorationunderline
}

#tabNavigation a:active {
    
backgroundurl(<{$block.imagesurl}>unselectedEnd.gif#789 no-repeat scroll top right;
    
color#567;
    
text-decorationnone
}

#tabNavigation li.selectedTab {
    
backgroundurl(<{$block.imagesurl}>selectedStart.gif#FFF no-repeat scroll top left;
    
colorinherit;
    
margin0 0 0 -22px;
    
padding0 0 0 23px
}

html>body #tabNavigation li.selectedTab {
    
backgroundurl(<{$block.imagesurl}>selectedStart.gif#FFF no-repeat scroll top left;
    
colorinherit;
    
margin0 0 0 -22px;
    
padding5px 1px 5px 22px
}

html>body ul[id]#tabNavigation li.selectedTab {
    
backgroundurl(<{$block.imagesurl}>selectedStart.gif#FFF no-repeat scroll top left;
    
colorinherit;
    
margin0 0 0 -22px;
    
padding5px 0 5px 23px
}

#tabNavigation .selectedTab a, #tabNavigation .selectedTab a:link, #tabNavigation .selectedTab a:visited, #tabNavigation .selectedTab a:hover {
    
backgroundtransparent url(<{$block.imagesurl}>selectedEnd.gifno-repeat scroll top right;
    
border-bottomnone;
    
color#000;
    
cursortext;
    
padding5px 21px 5px 2px;
    
text-decorationnone
}

html #tabNavigation .selectedTab a/* */, html #tabNavigation .selectedTab a:link/* */, html #tabNavigation .selectedTab a:visited/* */, html #tabNavigation .selectedTab a:hover/* */ {
    
padding5px 21px 5px 1px
}

#tabNavigation .fixTabsIE a, #tabNavigation .fixTabsIE a:link, #tabNavigation .fixTabsIE a:visited, #tabNavigation .fixTabsIE a:hover {
    
displaynone;
}
<{elseif 
$block.tabskin==4}>        <{* Folders *}>
#tabNavigation {
    
border-bottom1px solid #C60;
    
list-stylenone outside none;
    
margin0;
    
padding0 0 0 20px
}

html #tabNavigation/* */ {
    
margin0;
    
padding3px 0 3px 20px
}

html>body #tabNavigation {
    
margin0;
    
padding0 0 1px 20px
}

head+body #tabNavigation {
    
padding0 0 3px 20px
}

html>body ul[id#tabNavigation {
    
padding0 0 0 20px
}

#tabNavigation li,  #subNavigation li {
    
displayinline;
    list-
stylenone outside none
}

#tabNavigation .preloadUnselected {
    
backgroundtransparent url(<{$block.imagesurl}>unselected.gif);
}

#tabNavigation .preloadSelected {
    
backgroundtransparent url(<{$block.imagesurl}>selected.gif);
}

#tabNavigation .preloadHover {
    
backgroundtransparent url(<{$block.imagesurl}>hover.gif);
}

#tabNavigation .preloadActive {
    
backgroundtransparent url(<{$block.imagesurl}>active.gif);
}

html>body #tabNavigation li {
    
backgroundtransparent url(<{$block.imagesurl}>unselected.gifno-repeat top left;
    
border-right1px solid #666;
    
displayblock;
    
floatleft;
    
height1em;
    
margin3px 5px 3px -15px;
    
padding3px 5px 5px 27px
}

head:first-child+body #tabNavigation li {
    
backgroundnone;
    
border-rightnone;
    
displayinline;
    
floatnone;
    
margin0;
    
padding0
}

#tabNavigation a, #tabNavigation a:link, #tabNavigation a:visited {
    
backgroundtransparent url(<{$block.imagesurl}>unselected.gifno-repeat top left;
    
border-right1px solid #666;
    
color#FFF;
    
displayinline;
    
height1em;
    
margin0 0 0 -15px;
    
padding3px 5px 3px 27px;
    
text-decorationnone
}

html>body #tabNavigation a, html>body #tabNavigation a:link, html>body #tabNavigation a:visited {
    
border-rightnone;
    
margin0;
    
padding0
}

head:first-child+body #tabNavigation a, head:first-child+body #tabNavigation a:link, head:first-child+body #tabNavigation a:visited {
    
border-right1px solid #666;
    
margin0 0 0 -15px;
    
padding3px 5px 3px 27px;
    
positionrelative;
    
z-index50
}

#tabNavigation a:hover {
    
backgroundtransparent url(<{$block.imagesurl}>hover.gifno-repeat top left;
    
border-right1px solid #333;
    
color#FFF;
    
text-decorationnone
}

html>body #tabNavigation a:hover {
    
border-rightnone;
    
text-decorationunderline
}

head:first-child+body #tabNavigation a:hover {
    
border-right1px solid #333;
    
padding4px 5px 3px 27px;
    
positionrelative;
    
text-decorationnone;
    
z-index5000
}

#tabNavigation a:active {
    
backgroundtransparent url(<{$block.imagesurl}>active.gifno-repeat top left;
    
color#FFF;
    
text-decorationnone
}

html>body #tabNavigation a:active {
    
text-decorationunderline
}

head:first-child+body #tabNavigation a:active {
    
text-decorationnone
}

html>body #tabNavigation li.selectedTab {
    
backgroundtransparent url(<{$block.imagesurl}>selected.gifno-repeat top left;
    
border-right1px solid #C60;
    
displayblock;
    
floatleft;
    
height1em;
    
margin3px 5px 5px -15px;
    
padding3px 5px 5px 27px
}

head:first-child+body #tabNavigation li.selectedTab {
    
backgroundnone;
    
border-rightnone;
    
displayinline;
    
floatnone;
    
margin0;
    
padding0
}

#tabNavigation .selectedTab a, #tabNavigation .selectedTab a:link, #tabNavigation .selectedTab a:visited {
    
backgroundtransparent url(<{$block.imagesurl}>selected.gifno-repeat top left;
    
border-right1px solid #C60;
    
color#FFF;
    
cursortext;
    
displayinline;
    
height1em;
    
margin0 0 0 -15px;
    
padding3px 5px 3px 27px
}

html>body #tabNavigation .selectedTab a, html>body #tabNavigation .selectedTab a:link, html>body #tabNavigation .selectedTab a:visited {
    
border-rightnone;
    
margin0;
    
padding0
}

head:first-child+body #tabNavigation .selectedTab a, head:first-child+body #tabNavigation .selectedTab a:link, head:first-child+body #tabNavigation .selectedTab a:visited, head:first-child+body #tabNavigation .selectedTab a:hover {
    
backgroundtransparent url(<{$block.imagesurl}>selected.gifno-repeat top left;
    
border-right1px solid #C60;
    
margin0 0 0 -15px;
    
padding3px 5px 3px 27px;
    
positionrelative;
    
z-index10000
}

html head:first-child+body #tabNavigation .selectedTab a, html head:first-child+body #tabNavigation .selectedTab a:link, html head:first-child+body #tabNavigation .selectedTab a:visited, html head:first-child+body #tabNavigation .selectedTab a:hover {
    
padding4px 5px 5px 27px
}

.
fixTabsIE {
    
visibilityhidden
}
<{elseif 
$block.tabskin==5}>        <{* MacOs *}>
#tabNavigation {
    
background#CCC;
    
border-bottom1px solid #999;
    
border-top1px solid #FFF;
    
colorinherit;
    list-
stylenone outside none;
    
margin0;
    
padding0;
}

html #tabNavigation/* */ {
    
padding4px 0 4px 0
}

html>body #tabNavigation {
    
margin0;
    
padding4px 0 4px 0
}

#tabNavigation li {
    
displayinline;
    
line-height1em
}

#tabNavigation a, #tabNavigation a:link, #tabNavigation a:visited {
    
backgroundinherit;
    
border-bottom1px solid #999;
    
border-left1px solid #FFF;
    
border-right1px solid #999;
    
border-top1px solid #FFF;
    
color#000;
    
cursorpointer;
    
height1em;
    
margin: -1px 0 -1px 0;
    
padding3px 6px 3px 6px;
    
text-decorationnone;
    
white-spacenormal;
}

html #tabNavigation a/* */, html #tabNavigation a:link/* */, html #tabNavigation a:visited/* */ {
    
heightauto;
    
margin0
}

html>body #tabNavigation a, html>body #tabNavigation a:link, html>body #tabNavigation a:visited {
    
padding4px 6px 4px 6px
}

head+body #tabNavigation a, head+body #tabNavigation a:link, head+body #tabNavigation a:visited {
    
padding3px 6px 3px 6px
}

#tabNavigation a:hover {
    
background: <{$block.color5}>;
    
border-bottom1px solid #666;
    
border-left1px solid #CCC;
    
border-right1px solid #666;
    
border-top1px solid #CCC;
    
colorinherit
}

#tabNavigation a:active {
    
background#CCC;
    
border-bottom1px solid #FFF;
    
border-left1px solid #999;
    
border-right1px solid #FFF;
    
border-top1px solid #999;
    
colorinherit
}

#tabNavigation .selectedTab a, #tabNavigation .selectedTab a:link, #tabNavigation .selectedTab a:visited, #tabNavigation .selectedTab a:hover {
    
background: <{$block.color3}>;
    
border-bottom1px solid #999;
    
border-left1px solid #FFF;
    
border-right1px solid #999;
    
border-top1px solid #FFF;
    
color#000;
    
cursortext;
    
font-weightbold
}

#tabNavigation .fixTabsIE a, #tabNavigation .fixTabsIE a:link, #tabNavigation .fixTabsIE a:visited {
    
visibilityhidden
}

html #tabNavigation .fixTabsIE a/* */, html #tabNavigation .fixTabsIE a:link/* */, html #tabNavigation .fixTabsIE a:visited/* */ {
    
background#CCC;
    
border-bottomnone;
    
border-left1px solid #FFF;
    
border-rightnone;
    
border-topnone;
    
colorinherit;
    
cursortext;
    
margin0;
    
padding3px 6px 3px 6px;
    
visibilityvisible
}
<{elseif 
$block.tabskin==6}>        <{* Plain *}>
#tabNavigation {
    
border-bottom1px solid #000;
    
fontnormal 11px VerdanaGenevaArialHelveticasans-serif;
    
margin0;
    
padding0 0 18px 0;
}

ul#tabNavigation li {
    
displayinline;
    list-
style-imagenone;
    list-
style-positionoutside;
    list-
style-typenone;
}

ul#tabNavigation a, ul#tabNavigation a:link, ul#tabNavigation a:visited {
    
background: <{$block.color4}>;
    
border1px solid #000;
    
color#000;
    
floatleft;
    
margin0 0 0 5px;
    
padding2px 6px 2px 6px;
    
text-decorationnone
}

ul#tabNavigation a:hover, ul#tabNavigation a:focus {
    
background: <{$block.color5}>;
    
color#FFF;
}

ul#tabNavigation a:active {
    
background#FFF;
    
border-bottomnone;
    
border-left1px solid #000;
    
border-right1px solid #000;
    
border-top1px solid #000;
    
color#00F;
    
padding2px 6px 3px 6px
}

ul#tabNavigation li.selectedTab a, ul#tabNavigation li.selectedTab a:link, ul#tabNavigation li.selectedTab a:visited {
    
background: <{$block.color3}>;
    
border-bottomnone;
    
border-left1px solid #000;
    
border-right1px solid #000;
    
border-top1px solid #000;
    
color#000;
    
cursortext;
    
margin0 0 0 5px;
    
padding2px 6px 3px 6px
}

ul#tabNavigation li.fixTabsIE {
    
displaynone;
    
visibilityhidden
}
<{elseif 
$block.tabskin==7}>        <{* Rounded *}>
#tabNavigation {
    
background#FFF;
    
border-bottom1px solid #000;
    
colorinherit;
    list-
stylenone outside none;
    
margin1px 0 0 0;
    
padding0;
}

html #tabNavigation/* */ {
    
padding4px 0 4px 0
}

html>body #tabNavigation {
    
margin0;
    
padding4px 0 4px 0
}

#tabNavigation li {
    
backgroundurl(<{$block.imagesurl}>unselected_left.gif#C60 no-repeat scroll top left;
    
colorinherit;
    
displayinline;
    
line-height1em;
    
margin0 0 0 2px;
    
padding0
}

html>body #tabNavigation li {
    
margin0 0 0 -6px;
    
padding3px 0 3px 8px
}

html>body ul[id]#tabNavigation li {
    
margin0 0 0 2px;
    
padding3px 0 3px 0
}

#tabNavigation a, #tabNavigation a:link, #tabNavigation a:visited {
    
backgroundtransparent url(<{$block.imagesurl}>unselected_right.gifno-repeat scroll top right;
    
border-bottom1px solid #000;
    
color#FFF;
    
cursorpointer;
    
height1em;
    
margin: -1px 0 -1px 0;
    
padding3px 8px 3px 8px;
    
text-decorationnone
}

html #tabNavigation a/* */, html #tabNavigation a:link/* */, html #tabNavigation a:visited/* */ {
    
border-bottomnone;
    
heightauto;
    
margin0 0 0 4px;
    
padding3px 8px 3px 4px
}

#tabNavigation a:hover {
    
backgroundtransparent url(<{$block.imagesurl}>unselected_right.gifno-repeat scroll top right;
    
color#FFF;
    
text-decorationunderline
}

#tabNavigation a:active {
    
backgroundtransparent url(<{$block.imagesurl}>unselected_right.gifno-repeat scroll top right;
    
color#000;
    
text-decorationunderline
}

#tabNavigation li.selectedTab {
    
backgroundtransparent url(<{$block.imagesurl}>selected_left_F90.gifno-repeat scroll top left;
    
colorinherit;
    
padding0
}

html>body #tabNavigation li.selectedTab {
    
margin0 0 0 -6px;
    
padding4px 0 4px 8px
}

html>body ul[id]#tabNavigation li.selectedTab {
    
margin0 0 0 2px;
    
padding4px 0 4px 0
}

#tabNavigation .selectedTab a, #tabNavigation .selectedTab a:link, #tabNavigation .selectedTab a:visited, #tabNavigation .selectedTab a:hover {
    
backgroundtransparent url(<{$block.imagesurl}>selected_right_F90.gifno-repeat scroll top right;
    
border-bottomnone;
    
color#000;
    
cursortext;
    
padding4px 8px 4px 8px;
    
text-decorationnone
}

html #tabNavigation .selectedTab a/* */, html #tabNavigation .selectedTab a:link/* */, html #tabNavigation .selectedTab a:visited/* */, html #tabNavigation .selectedTab a:hover/* */ {
    
padding4px 8px 4px 4px
}

.
fixTabsIE {
    
visibilityhidden
}
<{elseif 
$block.tabskin==8}>        <{* ZDnet *}>
#tabNavigation {
    
list-stylenone outside none;
    
margin0;
    
padding4px 0 3px 0
}

@
media all {
    
#tabNavigation {
        
text-aligncenter
    
}
}

#tabNavigation li {
    
background#000;
    
displayinline;
    
line-height1em;
    
margin0 4px 0 4px;
    
padding0;
    
positionrelative;
    
top10px
}

html #tabNavigation li/* */ {
    
line-height1.2em;
    
top6px
}

html>body #tabNavigation li {
    
margin0 2px 0 4px;
    
padding4px 0 4px 0
}

#tabNavigation a, #tabNavigation a:link, #tabNavigation a:visited {
    
background: <{$block.color4}>;
    
border1px solid #FFF;
    
bottom2px;
    
color#FFF;
    
cursorpointer;
    
displayinline;
    
height1em;
    
margin0 4px 0 0;
    
padding3px 5px 3px 5px;
    
positionrelative;
    
right2px;
    
text-decorationnone
}

html #tabNavigation a/* */, html #tabNavigation a:link/* */, html #tabNavigation a:visited/* */ {
    
heightauto;
    
margin-4px 0 0
}

html>body #tabNavigation a, html>body #tabNavigation a:link, html>body #tabNavigation a:visited {
    
margin0
}

#tabNavigation a:hover {
    
background: <{$block.color5}>;
    
border1px solid #FFF;
    
bottom1px;
    
color#FFF;
    
padding3px 5px 3px 5px;
    
positionrelative;
    
right1px
}

#tabNavigation a:active {
    
background#666;
    
border1px solid #FFF;
    
bottom0;
    
color#FFF;
    
padding3px 5px 3px 5px;
    
positionrelative;
    
right0
}

#tabNavigation li.selectedTab {
    
background: <{$block.color3}>;
    
displayinline;
    
margin0 4px 0 4px;
    
positionrelative;
    
top4px
}

#tabNavigation .selectedTab a, #tabNavigation .selectedTab a:link, #tabNavigation .selectedTab a:visited, #tabNavigation .selectedTab a:hover {
    
background#F90;
    
border-bottomnone;
    
border-left1px solid #000;
    
border-right1px solid #000;
    
border-top1px solid #000;
    
bottom0;
    
color#FFF;
    
cursortext;
    
margin0 5px 0 0;
    
padding3px 5px 0 5px;
    
positionrelative;
    
right0
}

html #tabNavigation .selectedTab a/* */, html #tabNavigation .selectedTab a:link/* */, html #tabNavigation .selectedTab a:visited/* */, html #tabNavigation .selectedTab a:hover/* */ {
    
margin-2px 0 0
}

.
fixTabsIE {
    
visibilityhidden
}
<{/if}>
</
style>
    <{* ************************************** 
Tabs creation ************************************** *}>
<
ul id="tabNavigation">
<{foreach 
item=onetab from=$block.tabs}>
    <{if 
$block.current_tab == $onetab.id}>
    <
li class="selectedTab"><a href='#'><{$onetab.title}></a></li>
    <{else}>
    <
li><a href="<{$block.url}>NewsTab=<{$onetab.id}>"><{$onetab.title}></a></li>
    <{/if}>
<{/foreach}>
    <
li class="fixTabsIE"><a href="javascript:void(0);">&nbsp;</a></li>
</
ul>

<{if 
$block.current_is_spotlight}>
    <
div style="border-top: 1px solid rgb(0, 0, 0); background: <{$block.color1}> none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><{$block.spotlight.author}> <{$block.lang_on}> <{$block.spotlight.date}> <{if $block.use_rating}> - <{$block.spotlight.rating}>/10 (<{$block.spotlight.number_votes}>)<{/if}>, <{$block.spotlight.hits}> <{$block.lang_reads}><br /></div>
<{else}>
    <
div style="border-top: 1px solid rgb(0, 0, 0); background: <{$block.color1}> none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">
    <{foreach 
item=onesummary from=$block.smallheader}>
        <{
$onesummary}>&nbsp;
    <{/foreach}>
    <
br /></div>
<{/if}>
    <{* ************************************** 
Body of the current tab ************************************** *}>
<
div id="fullSupport">
    <{if 
$block.current_is_spotlight && $block.tabs.id==0}>
        <
table border='0'>
        <
tr>
            <
td colspan='2'>
                <
table border='0'>
                <
tr><td><img src='<{$block.spotlight.topic_image}>' border='0' alt='' /></td><td align='left'><{$block.spotlight.topic_description}></td></tr>
                </
table>
            <
div class="itemBody"><ul><li><{$block.spotlight.title_with_link}></li></ul></div></td>
        </
tr>
        <
tr>
            <
td><{$block.spotlight.image}>&nbsp;</td><td><class="note"><{$block.spotlight.text}></p></td>
        </
tr>
        </
table>
        <
br /><center><hr width='85%' /></center>
        <
ul>
            <{foreach 
item=onenews from=$block.spotlight.news}>
                <
li><{$onenews.date}> - <{$onenews.title_with_link}></li>
            <{/foreach}>
        </
ul>
    <{else}>
        <
table border='0'>
        <
tr><td><img src='<{$block.topic_image}>' border='0' alt='' /></td><td align='left'><{$block.topic_description}></td></tr>
        </
table>
        <{foreach 
item=onenews from=$block.news}>
            <
div class="itemBody"><ul><li><{$onenews.title}></li></ul><span class="itemStats">&nbsp;&nbsp;<{$onenews.author}> <{$block.lang_on}> <{$onenews.date}> - <{if $block.use_rating}> <{$onenews.rating}>/10 (<{$onenews.number_votes}>)<{/if}>, <{$onenews.hits}> <{$block.lang_reads}></span></div>
            <
class="note"><{$onenews.text}></p>
        <{/foreach}>
    <{/if}>
</
div>
<{else}>    <{* ************************************** 
Classical view ************************************** *}>
<
table>
    <{if 
$block.spotlight}>
    <
tr>
        <
td><table>
        <
tr>
            <
td colspan='2'>
                <
table border='0'>
                <
tr><td><img src='<{$block.spotlight.topic_image}>' border='0' alt='<{$block.spotlight.title}>' /></td><td align='left'><{$block.spotlight.topic_description}></td></tr>
                </
table>
                <
font color="#FF6600"><b><{$block.spotlight.title}></b></font> <{$block.spotlight.author}>
            <{if 
$block.sort=='counter'}>
                (<{
$block.spotlight.hits}>)
            <{elseif 
$block.sort=='published'}>
                (<{
$block.spotlight.date}>)
            <{else}>
                (<{
$block.spotlight.rating}>)
            <{/if}>
            </
td>
        </
tr>
        <
tr>
            <
td><{$block.spotlight.image}></td><td><{$block.spotlight.text}></td>
        </
tr>
        <
tr>
            <
td colspan='2'>
            <{if 
$block.spotlight.read_more}>
                <
hr width='98%' />
                <
div align='right'><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$block.spotlight.id}>"><{$block.lang_read_more}></a> &nbsp;&nbsp;&nbsp;</div>
                <
hr width='98%' />
            <{/if}>
            </
td>
        </
tr>
        </
table></td>
    </
tr>
    <{/if}>
    <
tr>
        <
td>
            <
ul>
                <{foreach 
item=news from=$block.stories}>
                    <{if 
$news.id != $block.spotlight.id}>
                        <
li>
                        <
h2>
                           <
span>
                            <{if 
$block.sort=='counter'}>
                                [<{
$news.hits}>]
                            <{elseif 
$block.sort=='published'}>
                                [<{
$news.date}>]
                            <{else}>
                                [<{
$news.rating}>]
                            <{/if}>
                            </
span>
                            <
a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>" <{$news.infotips}>><{$news.title}></a>
                        </
h2>
                        <{if 
$news.teaser}><p><{$news.teaser}></p><{/if}>
                        </
li>
                    <{/if}>
                <{/foreach}>
            </
ul>
        </
td>
    </
tr>
</
table>
<{/if}>

Dans ce template, je voudrais utiliser la variable <{$story.morelink}> qui me parait bien être définie dans /modules/news/class/class.newsstory.php qui est bien appelé dnas le fichier php du bloc !

Posté le : 15/04/2020 14:28

Open in new window
18 ans sous XOOPS !
Partager Twitter Partagez cette article sur GG+
Re: Variable Smarty
Régulier
Inscrit: 04/02/2003 08:53
De Paris
Messages: 312
Je précise : News 1.68 Final sur un xoops 2.5.10

Posté le : 15/04/2020 14:35

Open in new window
18 ans sous XOOPS !
Partager Twitter Partagez cette article sur GG+
Re: Variable Smarty
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
Citation :
escrime-info a écrit :

Dans ce template, je voudrais utiliser la variable <{$story.morelink}> qui me parait bien être définie dans /modules/news/class/class.newsstory.php qui est bien appelé dnas le fichier php du bloc !


Ben non, les variables dans ce template sont plutôt du type :
<{$block.imagesurl}>

donc ta variable sera plutôt du type :

<{$block.morelink}>

Encore une fois, je ne suis pas spécialiste...

et attention, le lien de ton template est le vrai, pas la surchage.
Il faudra modifier la surcharge, donc sur :
/themes/mon_theme/modules/news/block/news_block_top.html (ou tpl)

Posté le : 15/04/2020 14:43

Open in new window
Partager Twitter Partagez cette article sur GG+

 Haut   Précédent   Suivant
(1) 2 »



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

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