"; } else { /*****Navigation Calculation*****/ $letter_seq = $oSystem->getValue("newsletter_seq"); $letter_pageno = $oSystem->getValue("newsletter_pageno"); $oNewsletter_Letter->data = array("letter_id"); if($group_id!=""){ $oNewsletter_Letter->where = "group_id='$group_id' and showletter = 'Yes' AND ((title LIKE '%$searchstring%') OR (bodytext LIKE '%$searchstring%') OR (bodyhtml LIKE '%$searchstring%'))"; } else { $oNewsletter_Letter->where = "showletter = 'Yes' AND ((title LIKE '%$searchstring%') OR (bodytext LIKE '%$searchstring%') OR (bodyhtml LIKE '%$searchstring%'))"; } $result=$oNewsletter_Letter->getList(); if(mysql_num_rows($result)!=0){ $total=mysql_num_rows($result); }else{ $total=0; } mysql_free_result($result); if($start=="" || $start==0){ $start=0; } $prev=$start-$letter_pageno; $next=$start+$letter_pageno; $from=$start+1; $to=$letter_pageno+$from-1; if($to>=$total){ $to=$total; }if($to<$from){ $from=0; } /*****Previous and Next Navigation. Modify To Match Your Display*****/ #w if($prev>=0){ if ($modrewrite_active) { $prevlink=""; } else { $prevlink=""; } } if($next<$total){ if ($modrewrite_active) { $nextlink=""; } else { $nextlink=""; } } if($prevlink!="" && $nextlink!=""){ $navline=" | "; } echo "
 

La stringa di ricerca non può essere vuota.
Ricerca effettuata per '$searchstring'
"; echo ""; $oNewsletter_Letter->data = array("letter_id","title","dateletter"); if($group_id!=""){ $oNewsletter_Letter->where = "group_id='$group_id' and showletter = 'Yes' AND ((title LIKE '%$searchstring%') OR (bodytext LIKE '%$searchstring%') OR (bodyhtml LIKE '%$searchstring%'))"; } else { $oNewsletter_Letter->where = "showletter = 'Yes' AND ((title LIKE '%$searchstring%') OR (bodytext LIKE '%$searchstring%') OR (bodyhtml LIKE '%$searchstring%'))"; } $oNewsletter_Letter->order = "letter_id $letter_seq limit $start,$letter_pageno"; $result=$oNewsletter_Letter->getList(); $count=0; if(mysql_num_rows($result)!=0){ echo " "; while($myrow=mysql_fetch_row($result)){ $count++; $title=""; $dateletter=""; /*****Newsletter Listing. Modify To Match Your Display*****/ if($myrow[1]!=""){ $title=$myrow[1]; } if($myrow[2]!=""){ $dateletter=$myrow[2]; } #convertire $dateletter da ymd a dmy $tempdate = explode ("-",$dateletter); $dateletter = $tempdate[2] . "-" . $tempdate[1] . "-" . $tempdate[0]; ########################## ## titolo news per link ## ########################## $query_tit3 = "SELECT title FROM newsletter_letter WHERE letter_id='$myrow[0]'"; $result_tit3 = mysql_query($query_tit3, $db); $row_tit3 = mysql_fetch_array($result_tit3); $title_link = "$row_tit3[title]"; #nota di william // qui non pare funzionare. $title_link = strtolower($title_link); $title_link = preg_replace("/[^a-z0-9A-Z]/", "_", $title_link); ########################## ## titolo news per link ## ########################## #### Link originale: $title echo " "; } echo " "; mysql_free_result($result); } else { echo ""; } } echo " "; echo "
Titolo News
Data
  ".$title." $dateletter

 $prevlink $navline $nextlink
La ricerca non ha dato nessun risultato.


Effettua una nuova ricerca

"; } else if($letter_id==""){ /*****Navigation Calculation*****/ $letter_seq = $oSystem->getValue("newsletter_seq"); $letter_pageno = $oSystem->getValue("newsletter_pageno"); $oNewsletter_Letter->data = array("letter_id"); if($group_id!=""){ $oNewsletter_Letter->where="group_id='$group_id' and showletter='Yes'"; }else{ $oNewsletter_Letter->where="showletter='Yes'"; } $result=$oNewsletter_Letter->getList(); if(mysql_num_rows($result)!=0){ $total=mysql_num_rows($result); }else{ $total=0; } mysql_free_result($result); if($start=="" || $start==0){ $start=0; } $prev=$start-$letter_pageno; $next=$start+$letter_pageno; $from=$start+1; $to=$letter_pageno+$from-1; if($to>=$total){ $to=$total; }if($to<$from){ $from=0; } /*****Previous and Next Navigation. Modify To Match Your Display*****/ // lavorare qua if($prev>=0){ if ($modrewrite_active) { $prevlink=""; } else { $prevlink=""; } } if($next<$total){ if ($modrewrite_active) { $nextlink=""; } else { $nextlink=""; } } if($prevlink!="" && $nextlink!=""){ $navline=" | "; } echo " "; $oNewsletter_Letter->data = array("letter_id","title","dateletter"); if($group_id!=""){ $oNewsletter_Letter->where="group_id='$group_id' and showletter='Yes'"; }else{ $oNewsletter_Letter->where="showletter='Yes'"; } $oNewsletter_Letter->order = "letter_id $letter_seq limit $start,$letter_pageno"; $result=$oNewsletter_Letter->getList(); $count=0; if(mysql_num_rows($result)!=0){ while($myrow=mysql_fetch_row($result)){ $count++; $title=""; $dateletter=""; /*****Newsletter Listing. Modify To Match Your Display*****/ if($myrow[1]!=""){ $title=$myrow[1]; } if($myrow[2]!=""){ $dateletter=$myrow[2]; } #convertire $dateletter da ymd a dmy $tempdate = explode ("-",$dateletter); $dateletter = $tempdate[2] . "-" . $tempdate[1] . "-" . $tempdate[0]; ########################## ## titolo news per link ## ########################## $query_tit3 = "SELECT title FROM newsletter_letter WHERE letter_id='$myrow[0]'"; $result_tit3 = mysql_query($query_tit3, $db); $row_tit3 = mysql_fetch_array($result_tit3); $title_link = "$row_tit3[title]"; //echo $query_tit3; $title_link = strtolower($title_link); $title_link = preg_replace("/[^a-z0-9A-Z]/", "_", $title_link); ########################## ## titolo news per link ## ########################## #### Link originale: $title #### Link vittorio: $title echo ""; } mysql_free_result($result); echo ""; echo " "; } else { echo ""; } echo "
Titolo News
Data
" ."".$title."" ."$dateletter

 $prevlink $navline $nextlink


Nessuna News trovata

"; }//if letter_id="" /*****View Newsletter Detail*****/ if($letter_id!=""){ /*****Navigation Calculation*****/ $letter_seq = $oSystem->getValue("newsletter_seq"); $oNewsletter_Letter->data=array("letter_id"); if($group_id!=""){ $oNewsletter_Letter->where="group_id='$group_id' and showletter='Yes'"; }else{ $oNewsletter_Letter->where="showletter='Yes'"; } $oNewsletter_Letter->order = "letter_id $letter_seq"; $result=$oNewsletter_Letter->getList(); $count=0; while($myrow=mysql_fetch_row($result)){ if($myrow[0]==$letter_id){ $curpos=$count; } $count++; } $prevpos=$curpos-1; $nextpos=$curpos+1; $curpos=$curpos+1; $total=mysql_num_rows($result); if($prevpos>=0){ mysql_data_seek($result,$prevpos); if($myrow=mysql_fetch_row($result)){ $previd=$myrow[0]; }} if($nextpos<$total){ mysql_data_seek($result,$nextpos); if($myrow=mysql_fetch_row($result)){ $nextid=$myrow[0]; }} mysql_free_result($result); /*****Previous and Next Navigation. Modify To Match Your Display*****/ if($prev>=0){ if ($modrewrite_active) { $prevlink=""; } else { $prevlink=""; } } if($next<$total){ if ($modrewrite_active) { $nextlink=""; } else { $nextlink=""; } } # if($previd!=""){ $prevlink="Indietro"; } # if($nextid!=""){ $nextlink="Avanti"; } if($prevlink!="" && $nextlink!=""){ $navline=" | "; } if($lettertype=="Text"){ $oNewsletter_Letter->data = array("title","dateletter","bodytext"); }else{ $oNewsletter_Letter->data = array("title","dateletter","bodyhtml"); } $result=$oNewsletter_Letter->getDetail($letter_id); if($myrow=mysql_fetch_row($result)){ /*****Newsletter Details. Modify To Match Your Display*****/ $title=""; $date=""; $letterbody=""; if($myrow[0]!=""){ $title="$myrow[0]
"; } #convertire $dateletter da ymd a dmy $tempdate = explode ("-",$myrow[1]); $myrow[1] = $tempdate[2] . "-" . $tempdate[1] . "-" . $tempdate[0]; # if($myrow[1]!="0000-00-00"){ $date="Data: $myrow[1]
"; } if($myrow[2]!="" && $lettertype=="Text"){ $letterbody=nl2br("
$myrow[2]
"); }else{ $letterbody="
$myrow[2]
"; } #### Link originale: echo "
Archivio News"; if ($group_id!="") { echo " Archivio Generale"; } echo "

$title
$date

$letterbody

"; /*
*/ } mysql_free_result($result); } ?>  
 







 

Credits