$xoopsTpl->assign('story', $story); // DNPROSSI SEO $seo_enabled = nw_getmoduleoption('nw_seo_enable', NW_MODULE_DIR_NAME); if ( $seo_enabled == 1 ) { $xoopsTpl->assign('urlrewrite', true); $print_item = nw_remove_accents(_MA_NW_PRINTERFRIENDLY); $xoopsTpl->assign('print_item', $print_item); $direurl = nw_remove_accents($article->title()); $xoopsTpl->assign('direurl', $direurl); if( !empty($previous) && count($previous) > 0 ) { $previousurl = nw_remove_accents($previous['title']); $xoopsTpl->assign('previousdireurl', $previousurl); } if( !empty($next) && count($next) > 0 ) { $nexturl = nw_remove_accents($next['title']); $xoopsTpl->assign('nextdireurl', $nexturl); } } else { $xoopsTpl->assign('urlrewrite', false); } // Added in version 1.63, TAGS if(nw_getmoduleoption('tags', NW_MODULE_DIR_NAME)) { require_once XOOPS_ROOT_PATH.'/modules/tag/include/tagbar.php'; $xoopsTpl->assign('tags', true); $xoopsTpl->assign('tagbar', tagBar($storyid, 0)); } else { $xoopsTpl->assign('tags', false); }
$articlestpl[] = array( 'id'=>$article['storyid'], 'hometext'=>$article['hometext'], 'title'=>$article['title'], 'hits'=>$article['counter'], 'created'=>formatTimestamp($article['created'],$dateformat), 'article_link'=>sprintf("<a href='%s'%s>%s</a>",NW_MODULE_URL . '/article.php?storyid=' . $article['storyid'], $htmltitle,$article['title']), 'published'=>formatTimestamp($article['published'],$dateformat), 'rating' => $article['rating']); } } } // DNPROSSI SEO if ( $seo_enabled == 1 ) { $cat_path = str_replace('"', '', nw_remove_accents($article['topic_title'])); $topic_link=sprintf("<a href='%s'>%s</a>", NW_MODULE_URL . '/articles.cat.' . $oldtopic . '/' . $cat_path, $oldtopictitle); } else { $topic_link=sprintf("<a href='%s'>%s</a>", NW_MODULE_URL . '/index.php?storytopic=' . $oldtopic, $oldtopictitle); } $xoopsTpl->append('topics',array('topic_id'=>$oldtopic, 'topic_title'=>$oldtopictitle, 'topic_link'=> $topic_link, 'news'=>$articlestpl)); $xoopsTpl->assign('xoops_pagetitle', _MI_NW_NEWSBYTHISAUTHOR . ' - ' .$authname . ' - ' . $myts->htmlSpecialChars($xoopsModule->name()) ); $xoopsTpl->assign('advertisement', nw_getmoduleoption('advertisement', NW_MODULE_DIR_NAME)); /** * Create the meta datas */ nw_CreateMetaDatas(); $meta_description = _MI_NW_NEWSBYTHISAUTHOR . ' - ' .$authname . ' - ' . $myts->htmlSpecialChars($xoopsModule->name());
/** * Function used to prepare an article to be showned */ function prepare2show($filescount) { include_once NW_MODULE_PATH . '/include/functions.php'; global $xoopsUser, $xoopsConfig, $xoopsModuleConfig; $myts =& MyTextSanitizer::getInstance(); $infotips = nw_getmoduleoption('infotips', NW_MODULE_DIR_NAME); //DNPROSSI SEO $seo_enabled = nw_getmoduleoption('nw_seo_enable', NW_MODULE_DIR_NAME); $story = array(); $story['id'] = $this->storyid(); $story['poster'] = $this->uname(); $story['author_name'] = $this->uname(); $story['author_uid'] = $this->uid(); if ( $story['poster'] != false ) { $story['poster'] = "<a href='".XOOPS_URL."/userinfo.php?uid=".$this->uid()."'>".$story['poster']."</a>"; } else { if($xoopsModuleConfig['displayname']!=3) { $story['poster'] = $xoopsConfig['anonymous']; } } if ($xoopsModuleConfig['ratenews']) { $story['rating'] = number_format($this->rating(), 2); if ($this->votes == 1) { $story['votes'] = _MA_NW_ONEVOTE; } else { $story['votes'] = sprintf(_MA_NW_NUMVOTES,$this->votes); } } $story['posttimestamp'] = $this->published(); $story['posttime'] = formatTimestamp($story['posttimestamp'],nw_getmoduleoption('dateformat', NW_MODULE_DIR_NAME)); $story['topic_description'] = $myts->displayTarea($this->topic_description); $auto_summary = ''; $tmp = ''; $auto_summary = $this->auto_summary($this->bodytext(),$tmp); $story['text'] = $this->hometext(); $story['text'] = str_replace('[summary]', $auto_summary, $story['text']); $introcount = strlen($story['text']); $fullcount = strlen($this->bodytext()); $totalcount = $introcount + $fullcount; $morelink = ''; if ( $fullcount > 1 ) { //DNPROSSI SEO if ( $seo_enabled == 1 ) { $story_path = nw_remove_accents($this->title()); $morelink .= '<a href="' . NW_MODULE_URL . '/articles.item.' . $this->storyid() . '/' . $story_path . ''; } else { $morelink .= '<a href="' . NW_MODULE_URL . '/article.php?storyid=' . $this->storyid() . ''; } $morelink .= '">'._MA_NW_READMORE.'</a>'; $morelink .= ' | '.sprintf(_MA_NW_BYTESMORE,$totalcount); if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) { $morelink .= ' | '; } } if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) { $ccount = $this->comments(); //DNPROSSI SEO if ( $seo_enabled == 1 ) { $story_url = nw_remove_accents($this->title()); $morelink .= '<a href="' . NW_MODULE_URL . '/articles.item.' . $this->storyid() . '/'.$story_url . ''; $morelink2 = '<a href="' . NW_MODULE_URL . '/articles.item.' . $this->storyid() . '/'.$story_url . ''; } else { $morelink .= '<a href="' . NW_MODULE_URL . '/article.php?storyid=' . $this->storyid() . ''; $morelink2 = '<a href="' . NW_MODULE_URL . '/article.php?storyid=' . $this->storyid() . ''; } if ( $ccount == 0 ) { $morelink .= '">'._MA_NW_COMMENTS.'</a>'; } else { if ( $fullcount < 1 ) { if ( $ccount == 1 ) { $morelink .= '">'._MA_NW_READMORE.'</a> | '.$morelink2.'">'._MA_NW_ONECOMMENT.'</a>'; } else { $morelink .= '">'._MA_NW_READMORE.'</a> | '.$morelink2.'">'; $morelink .= sprintf(_MA_NW_NUMCOMMENTS, $ccount); $morelink .= '</a>'; } } else { if ( $ccount == 1 ) { $morelink .= '">'._MA_NW_ONECOMMENT.'</a>'; } else { $morelink .= '">'; $morelink .= sprintf(_MA_NW_NUMCOMMENTS, $ccount); $morelink .= '</a>'; } } } } $story['morelink'] = $morelink; $story['adminlink'] = ''; $approveprivilege = 0; if(nw_is_admin_group()) { $approveprivilege = 1; } if($xoopsModuleConfig['authoredit']==1 && (is_object($xoopsUser) && $xoopsUser->getVar('uid')==$this->uid())) { $approveprivilege = 1; } if ($approveprivilege) { $story['adminlink'] = $this->adminlink(); } $story['mail_link'] = 'mailto:?subject='.sprintf(_MA_NW_INTARTICLE,$xoopsConfig['sitename']).'&body='.sprintf(_MA_NW_INTARTFOUND, $xoopsConfig['sitename']).': '.NW_MODULE_URL . '/article.php?storyid='.$this->storyid(); $story['imglink'] = ''; $story['align'] = ''; if ( $this->topicdisplay() ) { $story['imglink'] = $this->imglink(); $story['align'] = $this->topicalign(); } if($infotips>0) { $story['infotips'] = ' title="'.nw_make_infotips($this->hometext()).'"'; } else { $story['infotips'] = ''; } //DNPROSSI SEO if ( $seo_enabled == 1 ) { $story_path = nw_remove_accents($this->title()); $story['title'] = "<a href='" . NW_MODULE_URL . "/articles.item." . $this->storyid() . "/" . $story_path . "'>" . $this->title() . "</a>"; } else { $story['title'] = "<a href='" . NW_MODULE_URL . "/article.php?storyid=" . $this->storyid() . "'" . $story['infotips'] . ">" . $this->title() . "</a>"; } $story['hits'] = $this->counter(); if($filescount>0) { $story['files_attached']= true; $story['attached_link']="<a href='".NW_MODULE_URL . '/article.php?storyid='.$this->storyid()."' title='"._MA_NW_ATTACHEDLIB."'><img src='".NW_MODULE_URL . '/images/attach.png'."' title='"._MA_NW_ATTACHEDLIB."'></a>"; } else { $story['files_attached']= false; $story['attached_link']=''; } return $story; }
$news = new nw_NewsStory(); $storyarray = $news->getArchive($monthstart, $monthend, $restricted); $count=count($storyarray); if(is_array($storyarray) && $count>0) { foreach ($storyarray as $article) { $story = array(); $htmltitle=''; if($infotips>0) { $story['infotips'] = nw_make_infotips($article->hometext()); $htmltitle=' title="'.$story['infotips'].'"'; } $seo_enabled = nw_getmoduleoption('nw_seo_enable', NW_MODULE_DIR_NAME); if ( $seo_enabled == 1 ) { $cat_path = nw_remove_accents($article->topic_title()); $item_path = nw_remove_accents($article->title()); $print_item = nw_remove_accents(_MA_NW_PRINTERFRIENDLY); $story['title'] = "<a href='" . NW_MODULE_URL . '/articles.cat.' . $article->topicid() . '/' . $cat_path . '' . "'>" . $article->topic_title() . "</a>: <a href='". NW_MODULE_URL ."/articles.item." . $article->storyid() . "/" . $item_path . "'" . $htmltitle . ">" . $article->title() . "</a>"; $story['print_link'] = NW_MODULE_URL . '/articles.print.' . $article->storyid() . '/' .$print_item; } else { $story['title'] = "<a href='". NW_MODULE_URL . '/index.php?storytopic=' . $article->topicid() . "'>" . $article->topic_title() . "</a>: <a href='" . NW_MODULE_URL . "/article.php?storyid=" . $article->storyid() . "'" . $htmltitle.">" . $article->title() . "</a>"; $story['print_link'] = NW_MODULE_URL . '/print.php?storyid=' . $article->storyid(); } $story['counter'] = $article->counter(); $story['date'] = formatTimestamp($article->published(),$dateformat,$useroffset); $story['mail_link'] = 'mailto:?subject='.sprintf(_MA_NW_INTARTICLE, $xoopsConfig['sitename']).'&body='.sprintf(_MA_NW_INTARTFOUND, $xoopsConfig['sitename']).': ' . NW_MODULE_URL . '/article.php?storyid='.$article->storyid(); $xoopsTpl->append('stories', $story); } } $xoopsTpl->assign('lang_printer', _MA_NW_PRINTERFRIENDLY); $xoopsTpl->assign('lang_sendstory', _MA_NW_SENDSTORY); $xoopsTpl->assign('lang_storytotal', sprintf(_MA_NW_THEREAREINTOTAL, $count));