Data de publicação entre limites $pub = $_type->getParameter("pub"); if($pub == 1) { $where.= " and t1.pub = 2"; } elseif($pub == 2) { $where.= " and t1.datapi<=now() and t1.datapf>=now()"; } // Processa o $_cop if($_cop || $_flags & 8) { $where.= " and t1.codfth=$_cop"; } /* // Introduzir o campo codlingua se o módulo tiver multilingua $lgsuport = $_type->getParamter("lgsuport"); if($lgsuport) { $where.= " and t1.codlg=$_LG"; } */ // Variáveis que serão utilizadas dentro do ciclo e fora do ciclo, mais do que uma vez $autoDest = $_type->getParameter("autoDest"); $text_f = isset($_v["TEXT"]); $title_f = isset($_v["TITLE"]); $headline_f = isset($_v["HEADLINE"]); $text2_f = isset($_v["TEXT2"]); $record_url_f = isset($_v["RECORD_URL"]); $fields = getFields($_it); if(!$fields) { $fields =" t1.codinf as _co, t1.codtype as _tp, t1.codfth as _cop"; if($title_f) { $fields.= ",t1.title"; } if($text_f) { $fields.= ",t1.itext"; } if($text2_f) { $fields.= ",t1.itext2"; } if($headline_f) { if($autoDest && !$text_f) { $fields.= ",t1.itext"; } else { $fields.= ",t1.headline"; } } setFields($_it, $fields); } // destFlag = 2 - Destaque if($_flags & 2) { $where.= " and t1.destFlag = 2" ; } /** Processamento Final **/ //dia if($_d && $_d!="-1" && $_d!="") $where.= " and DAY(data)=$_d"; //mes if($_m && $_m!="-1" && $_m!="") $where.= " and MONTH(data)=$_m"; //ano if($_y && $_y!="-1" && $_y!="") $where.= " and YEAR(data)=$_y"; if($where) $where = substr($where, 5); // and // $sql = "select SQL_CALC_FOUND_ROWS ".$fields." from ".$from.($where?" where $where":""); $vpini = ""; if(isset($_p["pini"])) { $vpini = $_p["pini"]; repvar("COP", $_cop, $vpini); $_pini = prepData($vpini); } $numreg = $_p["numreg"]; if($numreg) { // Verifica se existe um valor de co, sem valor de pini. Pode acontecer que o valor de co está // numa página diferente da primeira. // Nesse caso, temos que calcular um valor para o pini, para que o cursor e a listagem surjam com // o registo selecionado activo. /* $auxordem = 0; if($_co) { $res = $bd->e("select ord from infrecord where codinf=$_co"); if(nr($res)) $auxordem = fc($res); fr($res); } if($_p["numlimit"]) { $_numlimit = $_p["numlimit"]; } if(!$vpini) { $vpini = "pini"; } if(!$_pini && $auxordem) { $auxWhere = "where ".($where?$where." and ":"")." t1.ord>=$auxordem"; $res = $bd->e("select count(t1.codnoticia) from $from $auxWhere $order"); $totRegAntes = fc($res); fr($res); if($totRegAntes > $_numreg) { $_pini = (divInt($totRegAntes, $_numreg) - 1) * $_numreg; if($totRegAntes % $_numreg) $_pini += $_numreg; $pini = $GLOBALS[$vpini] = $_pini; } } $_pini+=$_numlimit; */ //apenas estava esta linha $order.= " limit $_pini, ".$numreg; } $sql.= $order; $r1 = $bd->e($sql); $total = sql_total(); $totalreg = nr($r1); if($_debug) debug($this, "_TP:$_tp; _COP:$_cop; _CO: $_co; _CTD=$_ctd", $sql, $totalreg); $lst = $lstcolunas= ""; if($totalreg) { if($_p["colini"]) { $ncol = $_p["colini"]; } else { $ncol = 1; } $parimpar = $parimparlinha = 0; $totalcount = 0; $nlinha = $nColunas = 1; $record = $first = $first_on = $colaux = $row = $odd = $even = $last_on = $last = $on = $row_odd = $row_even = $last_of_line=""; if(isset($_i["odd"])) $odd = $_i["odd"]; if(isset($_i["even"])) $even = $_i["even"]; if(isset($_i["last_on"])) $last_on = $_i["last_on"]; if(isset($_i["first"])) $first = $_i["first"]; if(isset($_i["first_on"])) $first_on = $_i["first_on"]; if(isset($_i["last"])) $last = $_i["last"]; if(isset($_i["on"])) $on = $_i["on"]; if(isset($_i["row_odd"])) $row_odd = $_i["row_odd"]; if(isset($_i["row_even"])) $row_even = $_i["row_even"]; if(isset($_i["last_of_line"])) $last_of_line = $_i["last_of_line"]; if($_p["nCols"] > 1) { $nColunas = $_p["nCols"]; $row = $_i["row"]; } if(isset($_p["headlinenchar"])) { $headlinenchar = $_p["headlinenchar"]; } if(isset($_i["record"])) $record = $_i["record"]; while($_vars = fd($r1)) { $_co2 = $_vars["_co"]; regCod($_tp, $_co2); $_vars["numreg"] = ++$totalcount; $text = $headline = $title = $text2 = ""; if($selecionaprimeiro && $totalcount == 1) { $_url["co"] = $_co2; } if($nColunas > 1 && $ncol == $nColunas && isset($_i["last_of_line"])) { $reg = $last_of_line; } elseif($first_on && $totalcount==1 && $_co2 == $_url["co"]){ $reg = $first_on; } elseif($first && $totalcount==1){ $reg = $first; } elseif($last_on && $totalreg == $totalcount && $_co2 == $_url["co"]){ $reg = $last_on; } elseif($last && $totalreg == $totalcount){ $reg = $last; } elseif($on && $_co2 == $_url["co"]){ $reg = $on; } elseif($parimpar && $even){ $reg = $even; } elseif(!$parimpar && $odd){ $reg = $odd; } elseif($parimparlinha && $row_even){ $reg = $row_even; } elseif(!$parimparlinha && $row_odd){ $reg = $row_odd; } else{ $reg = $record; } $parimpar = !$parimpar; $this->buildSons($reg, $_vars); if($record_url_f) { $url = getURL($_vars); repvar("RECORD_URL", $url, $reg); } if($text_f) { repvar("TEXT", $_vars["itext"], $reg); } if($title_f) { repvar("TITLE", $_vars["title"], $reg); } if($headline_f) { if($autoDest == 1) { $auxtexto = strip_tags($_vars["itext"]); repvar("HEADLINE", stripParagraph($auxtexto, $headlinenchar), $reg); } else { repvar("HEADLINE", $_vars["headline"], $reg); } } repvar("COD", $_co2, $reg); repvar("COP", $_vars["_cop"], $reg); $lst.= $reg; if($nColunas > 1) { $ncol++; if($ncol > $nColunas) { $subint = ($nlinha == 1 && $first?$first:$row); $colaux.= repvar("COLS", $lst, $subint); $lst = ""; $ncol = 1; $nlinha++; } } } if($ncol > 1){ $subint = ($nlinha == 1 && $first?$first:$row); $lstcolunas.= repvar("COLS", $lst, $subint); } if($nColunas <= 1) { repvar("LIST", $lst, $_html); } else { repvar("LIST", $lstcolunas, $_html); } } else { // Não tem registos nenhuns, verifica se tem a interface vazio definida if(isset($_i["empty"])) $_html = $_i["empty"]; elseif(isset($_i["empty_lst"])) //$_html = str_repvar("[[V:LST]]", $_int->i["vazio_lst"], $_html); repvar("LIST", $_i["empty_lst"], $_html); elseif(!$_mainint) $_html = ""; } fr($r1); repvar("TP", $_tp, $_html); $url = (isset($_p["url"])?$_p["url"]:""); if($url) { if($_cop) { repvar("COP", $_cop, $url); } } // Variáveis para filhos. Ex: cursor $_vars["totalreg"] = $totalreg; if($vpini) { $_vars["vpini"] = $vpini; } $_vars["totalregistos"] = $total-$_numlimit; $_vars["registospagina"] = (isset($_p["numreg"])?$_p["numreg"]:$totalreg); $_vars["cursorurl"] = $url; $_vars["_tp"] = $_tp; Data de publicação entre limites $pub = $_type->getParameter("pub"); if($pub == 1) { $where.= " and t1.pub = 2"; } elseif($pub == 2) { $where.= " and t1.datapi<=now() and t1.datapf>=now()"; } // Processa o $_cop if($_cop || $_flags & 8) { $where.= " and t1.codfth=$_cop"; } /* // Introduzir o campo codlingua se o módulo tiver multilingua $lgsuport = $_type->getParamter("lgsuport"); if($lgsuport) { $where.= " and t1.codlg=$_LG"; } */ // Variáveis que serão utilizadas dentro do ciclo e fora do ciclo, mais do que uma vez $autoDest = $_type->getParameter("autoDest"); $text_f = isset($_v["TEXT"]); $title_f = isset($_v["TITLE"]); $headline_f = isset($_v["HEADLINE"]); $text2_f = isset($_v["TEXT2"]); $record_url_f = isset($_v["RECORD_URL"]); $fields = getFields($_it); if(!$fields) { $fields =" t1.codinf as _co, t1.codtype as _tp, t1.codfth as _cop"; if($title_f) { $fields.= ",t1.title"; } if($text_f) { $fields.= ",t1.itext"; } if($text2_f) { $fields.= ",t1.itext2"; } if($headline_f) { if($autoDest && !$text_f) { $fields.= ",t1.itext"; } else { $fields.= ",t1.headline"; } } setFields($_it, $fields); } // destFlag = 2 - Destaque if($_flags & 2) { $where.= " and t1.destFlag = 2" ; } /** Processamento Final **/ //dia if($_d && $_d!="-1" && $_d!="") $where.= " and DAY(data)=$_d"; //mes if($_m && $_m!="-1" && $_m!="") $where.= " and MONTH(data)=$_m"; //ano if($_y && $_y!="-1" && $_y!="") $where.= " and YEAR(data)=$_y"; if($where) $where = substr($where, 5); // and // $sql = "select SQL_CALC_FOUND_ROWS ".$fields." from ".$from.($where?" where $where":""); $vpini = ""; if(isset($_p["pini"])) { $vpini = $_p["pini"]; repvar("COP", $_cop, $vpini); $_pini = prepData($vpini); } $numreg = $_p["numreg"]; if($numreg) { // Verifica se existe um valor de co, sem valor de pini. Pode acontecer que o valor de co está // numa página diferente da primeira. // Nesse caso, temos que calcular um valor para o pini, para que o cursor e a listagem surjam com // o registo selecionado activo. /* $auxordem = 0; if($_co) { $res = $bd->e("select ord from infrecord where codinf=$_co"); if(nr($res)) $auxordem = fc($res); fr($res); } if($_p["numlimit"]) { $_numlimit = $_p["numlimit"]; } if(!$vpini) { $vpini = "pini"; } if(!$_pini && $auxordem) { $auxWhere = "where ".($where?$where." and ":"")." t1.ord>=$auxordem"; $res = $bd->e("select count(t1.codnoticia) from $from $auxWhere $order"); $totRegAntes = fc($res); fr($res); if($totRegAntes > $_numreg) { $_pini = (divInt($totRegAntes, $_numreg) - 1) * $_numreg; if($totRegAntes % $_numreg) $_pini += $_numreg; $pini = $GLOBALS[$vpini] = $_pini; } } $_pini+=$_numlimit; */ //apenas estava esta linha $order.= " limit $_pini, ".$numreg; } $sql.= $order; $r1 = $bd->e($sql); $total = sql_total(); $totalreg = nr($r1); if($_debug) debug($this, "_TP:$_tp; _COP:$_cop; _CO: $_co; _CTD=$_ctd", $sql, $totalreg); $lst = $lstcolunas= ""; if($totalreg) { if($_p["colini"]) { $ncol = $_p["colini"]; } else { $ncol = 1; } $parimpar = $parimparlinha = 0; $totalcount = 0; $nlinha = $nColunas = 1; $record = $first = $first_on = $colaux = $row = $odd = $even = $last_on = $last = $on = $row_odd = $row_even = $last_of_line=""; if(isset($_i["odd"])) $odd = $_i["odd"]; if(isset($_i["even"])) $even = $_i["even"]; if(isset($_i["last_on"])) $last_on = $_i["last_on"]; if(isset($_i["first"])) $first = $_i["first"]; if(isset($_i["first_on"])) $first_on = $_i["first_on"]; if(isset($_i["last"])) $last = $_i["last"]; if(isset($_i["on"])) $on = $_i["on"]; if(isset($_i["row_odd"])) $row_odd = $_i["row_odd"]; if(isset($_i["row_even"])) $row_even = $_i["row_even"]; if(isset($_i["last_of_line"])) $last_of_line = $_i["last_of_line"]; if($_p["nCols"] > 1) { $nColunas = $_p["nCols"]; $row = $_i["row"]; } if(isset($_p["headlinenchar"])) { $headlinenchar = $_p["headlinenchar"]; } if(isset($_i["record"])) $record = $_i["record"]; while($_vars = fd($r1)) { $_co2 = $_vars["_co"]; regCod($_tp, $_co2); $_vars["numreg"] = ++$totalcount; $text = $headline = $title = $text2 = ""; if($selecionaprimeiro && $totalcount == 1) { $_url["co"] = $_co2; } if($nColunas > 1 && $ncol == $nColunas && isset($_i["last_of_line"])) { $reg = $last_of_line; } elseif($first_on && $totalcount==1 && $_co2 == $_url["co"]){ $reg = $first_on; } elseif($first && $totalcount==1){ $reg = $first; } elseif($last_on && $totalreg == $totalcount && $_co2 == $_url["co"]){ $reg = $last_on; } elseif($last && $totalreg == $totalcount){ $reg = $last; } elseif($on && $_co2 == $_url["co"]){ $reg = $on; } elseif($parimpar && $even){ $reg = $even; } elseif(!$parimpar && $odd){ $reg = $odd; } elseif($parimparlinha && $row_even){ $reg = $row_even; } elseif(!$parimparlinha && $row_odd){ $reg = $row_odd; } else{ $reg = $record; } $parimpar = !$parimpar; $this->buildSons($reg, $_vars); if($record_url_f) { $url = getURL($_vars); repvar("RECORD_URL", $url, $reg); } if($text_f) { repvar("TEXT", $_vars["itext"], $reg); } if($title_f) { repvar("TITLE", $_vars["title"], $reg); } if($headline_f) { if($autoDest == 1) { $auxtexto = strip_tags($_vars["itext"]); repvar("HEADLINE", stripParagraph($auxtexto, $headlinenchar), $reg); } else { repvar("HEADLINE", $_vars["headline"], $reg); } } repvar("COD", $_co2, $reg); repvar("COP", $_vars["_cop"], $reg); $lst.= $reg; if($nColunas > 1) { $ncol++; if($ncol > $nColunas) { $subint = ($nlinha == 1 && $first?$first:$row); $colaux.= repvar("COLS", $lst, $subint); $lst = ""; $ncol = 1; $nlinha++; } } } if($ncol > 1){ $subint = ($nlinha == 1 && $first?$first:$row); $lstcolunas.= repvar("COLS", $lst, $subint); } if($nColunas <= 1) { repvar("LIST", $lst, $_html); } else { repvar("LIST", $lstcolunas, $_html); } } else { // Não tem registos nenhuns, verifica se tem a interface vazio definida if(isset($_i["empty"])) $_html = $_i["empty"]; elseif(isset($_i["empty_lst"])) //$_html = str_repvar("[[V:LST]]", $_int->i["vazio_lst"], $_html); repvar("LIST", $_i["empty_lst"], $_html); elseif(!$_mainint) $_html = ""; } fr($r1); repvar("TP", $_tp, $_html); $url = (isset($_p["url"])?$_p["url"]:""); if($url) { if($_cop) { repvar("COP", $_cop, $url); } } // Variáveis para filhos. Ex: cursor $_vars["totalreg"] = $totalreg; if($vpini) { $_vars["vpini"] = $vpini; } $_vars["totalregistos"] = $total-$_numlimit; $_vars["registospagina"] = (isset($_p["numreg"])?$_p["numreg"]:$totalreg); $_vars["cursorurl"] = $url; $_vars["_tp"] = $_tp; Data de publicação entre limites $pub = $_type->getParameter("pub"); if($pub == 1) { $where.= " and t1.pub = 2"; } elseif($pub == 2) { $where.= " and t1.datapi<=now() and t1.datapf>=now()"; } // Processa o $_cop if($_cop || $_flags & 8) { $where.= " and t1.codfth=$_cop"; } /* // Introduzir o campo codlingua se o módulo tiver multilingua $lgsuport = $_type->getParamter("lgsuport"); if($lgsuport) { $where.= " and t1.codlg=$_LG"; } */ // Variáveis que serão utilizadas dentro do ciclo e fora do ciclo, mais do que uma vez $autoDest = $_type->getParameter("autoDest"); $text_f = isset($_v["TEXT"]); $title_f = isset($_v["TITLE"]); $headline_f = isset($_v["HEADLINE"]); $text2_f = isset($_v["TEXT2"]); $record_url_f = isset($_v["RECORD_URL"]); $fields = getFields($_it); if(!$fields) { $fields =" t1.codinf as _co, t1.codtype as _tp, t1.codfth as _cop"; if($title_f) { $fields.= ",t1.title"; } if($text_f) { $fields.= ",t1.itext"; } if($text2_f) { $fields.= ",t1.itext2"; } if($headline_f) { if($autoDest && !$text_f) { $fields.= ",t1.itext"; } else { $fields.= ",t1.headline"; } } setFields($_it, $fields); } // destFlag = 2 - Destaque if($_flags & 2) { $where.= " and t1.destFlag = 2" ; } /** Processamento Final **/ //dia if($_d && $_d!="-1" && $_d!="") $where.= " and DAY(data)=$_d"; //mes if($_m && $_m!="-1" && $_m!="") $where.= " and MONTH(data)=$_m"; //ano if($_y && $_y!="-1" && $_y!="") $where.= " and YEAR(data)=$_y"; if($where) $where = substr($where, 5); // and // $sql = "select SQL_CALC_FOUND_ROWS ".$fields." from ".$from.($where?" where $where":""); $vpini = ""; if(isset($_p["pini"])) { $vpini = $_p["pini"]; repvar("COP", $_cop, $vpini); $_pini = prepData($vpini); } $numreg = $_p["numreg"]; if($numreg) { // Verifica se existe um valor de co, sem valor de pini. Pode acontecer que o valor de co está // numa página diferente da primeira. // Nesse caso, temos que calcular um valor para o pini, para que o cursor e a listagem surjam com // o registo selecionado activo. /* $auxordem = 0; if($_co) { $res = $bd->e("select ord from infrecord where codinf=$_co"); if(nr($res)) $auxordem = fc($res); fr($res); } if($_p["numlimit"]) { $_numlimit = $_p["numlimit"]; } if(!$vpini) { $vpini = "pini"; } if(!$_pini && $auxordem) { $auxWhere = "where ".($where?$where." and ":"")." t1.ord>=$auxordem"; $res = $bd->e("select count(t1.codnoticia) from $from $auxWhere $order"); $totRegAntes = fc($res); fr($res); if($totRegAntes > $_numreg) { $_pini = (divInt($totRegAntes, $_numreg) - 1) * $_numreg; if($totRegAntes % $_numreg) $_pini += $_numreg; $pini = $GLOBALS[$vpini] = $_pini; } } $_pini+=$_numlimit; */ //apenas estava esta linha $order.= " limit $_pini, ".$numreg; } $sql.= $order; $r1 = $bd->e($sql); $total = sql_total(); $totalreg = nr($r1); if($_debug) debug($this, "_TP:$_tp; _COP:$_cop; _CO: $_co; _CTD=$_ctd", $sql, $totalreg); $lst = $lstcolunas= ""; if($totalreg) { if($_p["colini"]) { $ncol = $_p["colini"]; } else { $ncol = 1; } $parimpar = $parimparlinha = 0; $totalcount = 0; $nlinha = $nColunas = 1; $record = $first = $first_on = $colaux = $row = $odd = $even = $last_on = $last = $on = $row_odd = $row_even = $last_of_line=""; if(isset($_i["odd"])) $odd = $_i["odd"]; if(isset($_i["even"])) $even = $_i["even"]; if(isset($_i["last_on"])) $last_on = $_i["last_on"]; if(isset($_i["first"])) $first = $_i["first"]; if(isset($_i["first_on"])) $first_on = $_i["first_on"]; if(isset($_i["last"])) $last = $_i["last"]; if(isset($_i["on"])) $on = $_i["on"]; if(isset($_i["row_odd"])) $row_odd = $_i["row_odd"]; if(isset($_i["row_even"])) $row_even = $_i["row_even"]; if(isset($_i["last_of_line"])) $last_of_line = $_i["last_of_line"]; if($_p["nCols"] > 1) { $nColunas = $_p["nCols"]; $row = $_i["row"]; } if(isset($_p["headlinenchar"])) { $headlinenchar = $_p["headlinenchar"]; } if(isset($_i["record"])) $record = $_i["record"]; while($_vars = fd($r1)) { $_co2 = $_vars["_co"]; regCod($_tp, $_co2); $_vars["numreg"] = ++$totalcount; $text = $headline = $title = $text2 = ""; if($selecionaprimeiro && $totalcount == 1) { $_url["co"] = $_co2; } if($nColunas > 1 && $ncol == $nColunas && isset($_i["last_of_line"])) { $reg = $last_of_line; } elseif($first_on && $totalcount==1 && $_co2 == $_url["co"]){ $reg = $first_on; } elseif($first && $totalcount==1){ $reg = $first; } elseif($last_on && $totalreg == $totalcount && $_co2 == $_url["co"]){ $reg = $last_on; } elseif($last && $totalreg == $totalcount){ $reg = $last; } elseif($on && $_co2 == $_url["co"]){ $reg = $on; } elseif($parimpar && $even){ $reg = $even; } elseif(!$parimpar && $odd){ $reg = $odd; } elseif($parimparlinha && $row_even){ $reg = $row_even; } elseif(!$parimparlinha && $row_odd){ $reg = $row_odd; } else{ $reg = $record; } $parimpar = !$parimpar; $this->buildSons($reg, $_vars); if($record_url_f) { $url = getURL($_vars); repvar("RECORD_URL", $url, $reg); } if($text_f) { repvar("TEXT", $_vars["itext"], $reg); } if($title_f) { repvar("TITLE", $_vars["title"], $reg); } if($headline_f) { if($autoDest == 1) { $auxtexto = strip_tags($_vars["itext"]); repvar("HEADLINE", stripParagraph($auxtexto, $headlinenchar), $reg); } else { repvar("HEADLINE", $_vars["headline"], $reg); } } repvar("COD", $_co2, $reg); repvar("COP", $_vars["_cop"], $reg); $lst.= $reg; if($nColunas > 1) { $ncol++; if($ncol > $nColunas) { $subint = ($nlinha == 1 && $first?$first:$row); $colaux.= repvar("COLS", $lst, $subint); $lst = ""; $ncol = 1; $nlinha++; } } } if($ncol > 1){ $subint = ($nlinha == 1 && $first?$first:$row); $lstcolunas.= repvar("COLS", $lst, $subint); } if($nColunas <= 1) { repvar("LIST", $lst, $_html); } else { repvar("LIST", $lstcolunas, $_html); } } else { // Não tem registos nenhuns, verifica se tem a interface vazio definida if(isset($_i["empty"])) $_html = $_i["empty"]; elseif(isset($_i["empty_lst"])) //$_html = str_repvar("[[V:LST]]", $_int->i["vazio_lst"], $_html); repvar("LIST", $_i["empty_lst"], $_html); elseif(!$_mainint) $_html = ""; } fr($r1); repvar("TP", $_tp, $_html); $url = (isset($_p["url"])?$_p["url"]:""); if($url) { if($_cop) { repvar("COP", $_cop, $url); } } // Variáveis para filhos. Ex: cursor $_vars["totalreg"] = $totalreg; if($vpini) { $_vars["vpini"] = $vpini; } $_vars["totalregistos"] = $total-$_numlimit; $_vars["registospagina"] = (isset($_p["numreg"])?$_p["numreg"]:$totalreg); $_vars["cursorurl"] = $url; $_vars["_tp"] = $_tp; Data de publicação entre limites $pub = $_type->getParameter("pub"); if($pub == 1) { $where.= " and t1.pub = 2"; } elseif($pub == 2) { $where.= " and t1.datapi<=now() and t1.datapf>=now()"; } // Processa o $_cop if($_cop || $_flags & 8) { $where.= " and t1.codfth=$_cop"; } /* // Introduzir o campo codlingua se o módulo tiver multilingua $lgsuport = $_type->getParamter("lgsuport"); if($lgsuport) { $where.= " and t1.codlg=$_LG"; } */ // Variáveis que serão utilizadas dentro do ciclo e fora do ciclo, mais do que uma vez $autoDest = $_type->getParameter("autoDest"); $text_f = isset($_v["TEXT"]); $title_f = isset($_v["TITLE"]); $headline_f = isset($_v["HEADLINE"]); $text2_f = isset($_v["TEXT2"]); $record_url_f = isset($_v["RECORD_URL"]); $fields = getFields($_it); if(!$fields) { $fields =" t1.codinf as _co, t1.codtype as _tp, t1.codfth as _cop"; if($title_f) { $fields.= ",t1.title"; } if($text_f) { $fields.= ",t1.itext"; } if($text2_f) { $fields.= ",t1.itext2"; } if($headline_f) { if($autoDest && !$text_f) { $fields.= ",t1.itext"; } else { $fields.= ",t1.headline"; } } setFields($_it, $fields); } // destFlag = 2 - Destaque if($_flags & 2) { $where.= " and t1.destFlag = 2" ; } /** Processamento Final **/ //dia if($_d && $_d!="-1" && $_d!="") $where.= " and DAY(data)=$_d"; //mes if($_m && $_m!="-1" && $_m!="") $where.= " and MONTH(data)=$_m"; //ano if($_y && $_y!="-1" && $_y!="") $where.= " and YEAR(data)=$_y"; if($where) $where = substr($where, 5); // and // $sql = "select SQL_CALC_FOUND_ROWS ".$fields." from ".$from.($where?" where $where":""); $vpini = ""; if(isset($_p["pini"])) { $vpini = $_p["pini"]; repvar("COP", $_cop, $vpini); $_pini = prepData($vpini); } $numreg = $_p["numreg"]; if($numreg) { // Verifica se existe um valor de co, sem valor de pini. Pode acontecer que o valor de co está // numa página diferente da primeira. // Nesse caso, temos que calcular um valor para o pini, para que o cursor e a listagem surjam com // o registo selecionado activo. /* $auxordem = 0; if($_co) { $res = $bd->e("select ord from infrecord where codinf=$_co"); if(nr($res)) $auxordem = fc($res); fr($res); } if($_p["numlimit"]) { $_numlimit = $_p["numlimit"]; } if(!$vpini) { $vpini = "pini"; } if(!$_pini && $auxordem) { $auxWhere = "where ".($where?$where." and ":"")." t1.ord>=$auxordem"; $res = $bd->e("select count(t1.codnoticia) from $from $auxWhere $order"); $totRegAntes = fc($res); fr($res); if($totRegAntes > $_numreg) { $_pini = (divInt($totRegAntes, $_numreg) - 1) * $_numreg; if($totRegAntes % $_numreg) $_pini += $_numreg; $pini = $GLOBALS[$vpini] = $_pini; } } $_pini+=$_numlimit; */ //apenas estava esta linha $order.= " limit $_pini, ".$numreg; } $sql.= $order; $r1 = $bd->e($sql); $total = sql_total(); $totalreg = nr($r1); if($_debug) debug($this, "_TP:$_tp; _COP:$_cop; _CO: $_co; _CTD=$_ctd", $sql, $totalreg); $lst = $lstcolunas= ""; if($totalreg) { if($_p["colini"]) { $ncol = $_p["colini"]; } else { $ncol = 1; } $parimpar = $parimparlinha = 0; $totalcount = 0; $nlinha = $nColunas = 1; $record = $first = $first_on = $colaux = $row = $odd = $even = $last_on = $last = $on = $row_odd = $row_even = $last_of_line=""; if(isset($_i["odd"])) $odd = $_i["odd"]; if(isset($_i["even"])) $even = $_i["even"]; if(isset($_i["last_on"])) $last_on = $_i["last_on"]; if(isset($_i["first"])) $first = $_i["first"]; if(isset($_i["first_on"])) $first_on = $_i["first_on"]; if(isset($_i["last"])) $last = $_i["last"]; if(isset($_i["on"])) $on = $_i["on"]; if(isset($_i["row_odd"])) $row_odd = $_i["row_odd"]; if(isset($_i["row_even"])) $row_even = $_i["row_even"]; if(isset($_i["last_of_line"])) $last_of_line = $_i["last_of_line"]; if($_p["nCols"] > 1) { $nColunas = $_p["nCols"]; $row = $_i["row"]; } if(isset($_p["headlinenchar"])) { $headlinenchar = $_p["headlinenchar"]; } if(isset($_i["record"])) $record = $_i["record"]; while($_vars = fd($r1)) { $_co2 = $_vars["_co"]; regCod($_tp, $_co2); $_vars["numreg"] = ++$totalcount; $text = $headline = $title = $text2 = ""; if($selecionaprimeiro && $totalcount == 1) { $_url["co"] = $_co2; } if($nColunas > 1 && $ncol == $nColunas && isset($_i["last_of_line"])) { $reg = $last_of_line; } elseif($first_on && $totalcount==1 && $_co2 == $_url["co"]){ $reg = $first_on; } elseif($first && $totalcount==1){ $reg = $first; } elseif($last_on && $totalreg == $totalcount && $_co2 == $_url["co"]){ $reg = $last_on; } elseif($last && $totalreg == $totalcount){ $reg = $last; } elseif($on && $_co2 == $_url["co"]){ $reg = $on; } elseif($parimpar && $even){ $reg = $even; } elseif(!$parimpar && $odd){ $reg = $odd; } elseif($parimparlinha && $row_even){ $reg = $row_even; } elseif(!$parimparlinha && $row_odd){ $reg = $row_odd; } else{ $reg = $record; } $parimpar = !$parimpar; $this->buildSons($reg, $_vars); if($record_url_f) { $url = getURL($_vars); repvar("RECORD_URL", $url, $reg); } if($text_f) { repvar("TEXT", $_vars["itext"], $reg); } if($title_f) { repvar("TITLE", $_vars["title"], $reg); } if($headline_f) { if($autoDest == 1) { $auxtexto = strip_tags($_vars["itext"]); repvar("HEADLINE", stripParagraph($auxtexto, $headlinenchar), $reg); } else { repvar("HEADLINE", $_vars["headline"], $reg); } } repvar("COD", $_co2, $reg); repvar("COP", $_vars["_cop"], $reg); $lst.= $reg; if($nColunas > 1) { $ncol++; if($ncol > $nColunas) { $subint = ($nlinha == 1 && $first?$first:$row); $colaux.= repvar("COLS", $lst, $subint); $lst = ""; $ncol = 1; $nlinha++; } } } if($ncol > 1){ $subint = ($nlinha == 1 && $first?$first:$row); $lstcolunas.= repvar("COLS", $lst, $subint); } if($nColunas <= 1) { repvar("LIST", $lst, $_html); } else { repvar("LIST", $lstcolunas, $_html); } } else { // Não tem registos nenhuns, verifica se tem a interface vazio definida if(isset($_i["empty"])) $_html = $_i["empty"]; elseif(isset($_i["empty_lst"])) //$_html = str_repvar("[[V:LST]]", $_int->i["vazio_lst"], $_html); repvar("LIST", $_i["empty_lst"], $_html); elseif(!$_mainint) $_html = ""; } fr($r1); repvar("TP", $_tp, $_html); $url = (isset($_p["url"])?$_p["url"]:""); if($url) { if($_cop) { repvar("COP", $_cop, $url); } } // Variáveis para filhos. Ex: cursor $_vars["totalreg"] = $totalreg; if($vpini) { $_vars["vpini"] = $vpini; } $_vars["totalregistos"] = $total-$_numlimit; $_vars["registospagina"] = (isset($_p["numreg"])?$_p["numreg"]:$totalreg); $_vars["cursorurl"] = $url; $_vars["_tp"] = $_tp; Data de publicação entre limites $pub = $_type->getParameter("pub"); if($pub == 1) { $where.= " and t1.pub = 2"; } elseif($pub == 2) { $where.= " and t1.datapi<=now() and t1.datapf>=now()"; } // Processa o $_cop if($_cop || $_flags & 8) { $where.= " and t1.codfth=$_cop"; } /* // Introduzir o campo codlingua se o módulo tiver multilingua $lgsuport = $_type->getParamter("lgsuport"); if($lgsuport) { $where.= " and t1.codlg=$_LG"; } */ // Variáveis que serão utilizadas dentro do ciclo e fora do ciclo, mais do que uma vez $autoDest = $_type->getParameter("autoDest"); $text_f = isset($_v["TEXT"]); $title_f = isset($_v["TITLE"]); $headline_f = isset($_v["HEADLINE"]); $text2_f = isset($_v["TEXT2"]); $record_url_f = isset($_v["RECORD_URL"]); $fields = getFields($_it); if(!$fields) { $fields =" t1.codinf as _co, t1.codtype as _tp, t1.codfth as _cop"; if($title_f) { $fields.= ",t1.title"; } if($text_f) { $fields.= ",t1.itext"; } if($text2_f) { $fields.= ",t1.itext2"; } if($headline_f) { if($autoDest && !$text_f) { $fields.= ",t1.itext"; } else { $fields.= ",t1.headline"; } } setFields($_it, $fields); } // destFlag = 2 - Destaque if($_flags & 2) { $where.= " and t1.destFlag = 2" ; } /** Processamento Final **/ //dia if($_d && $_d!="-1" && $_d!="") $where.= " and DAY(data)=$_d"; //mes if($_m && $_m!="-1" && $_m!="") $where.= " and MONTH(data)=$_m"; //ano if($_y && $_y!="-1" && $_y!="") $where.= " and YEAR(data)=$_y"; if($where) $where = substr($where, 5); // and // $sql = "select SQL_CALC_FOUND_ROWS ".$fields." from ".$from.($where?" where $where":""); $vpini = ""; if(isset($_p["pini"])) { $vpini = $_p["pini"]; repvar("COP", $_cop, $vpini); $_pini = prepData($vpini); } $numreg = $_p["numreg"]; if($numreg) { // Verifica se existe um valor de co, sem valor de pini. Pode acontecer que o valor de co está // numa página diferente da primeira. // Nesse caso, temos que calcular um valor para o pini, para que o cursor e a listagem surjam com // o registo selecionado activo. /* $auxordem = 0; if($_co) { $res = $bd->e("select ord from infrecord where codinf=$_co"); if(nr($res)) $auxordem = fc($res); fr($res); } if($_p["numlimit"]) { $_numlimit = $_p["numlimit"]; } if(!$vpini) { $vpini = "pini"; } if(!$_pini && $auxordem) { $auxWhere = "where ".($where?$where." and ":"")." t1.ord>=$auxordem"; $res = $bd->e("select count(t1.codnoticia) from $from $auxWhere $order"); $totRegAntes = fc($res); fr($res); if($totRegAntes > $_numreg) { $_pini = (divInt($totRegAntes, $_numreg) - 1) * $_numreg; if($totRegAntes % $_numreg) $_pini += $_numreg; $pini = $GLOBALS[$vpini] = $_pini; } } $_pini+=$_numlimit; */ //apenas estava esta linha $order.= " limit $_pini, ".$numreg; } $sql.= $order; $r1 = $bd->e($sql); $total = sql_total(); $totalreg = nr($r1); if($_debug) debug($this, "_TP:$_tp; _COP:$_cop; _CO: $_co; _CTD=$_ctd", $sql, $totalreg); $lst = $lstcolunas= ""; if($totalreg) { if($_p["colini"]) { $ncol = $_p["colini"]; } else { $ncol = 1; } $parimpar = $parimparlinha = 0; $totalcount = 0; $nlinha = $nColunas = 1; $record = $first = $first_on = $colaux = $row = $odd = $even = $last_on = $last = $on = $row_odd = $row_even = $last_of_line=""; if(isset($_i["odd"])) $odd = $_i["odd"]; if(isset($_i["even"])) $even = $_i["even"]; if(isset($_i["last_on"])) $last_on = $_i["last_on"]; if(isset($_i["first"])) $first = $_i["first"]; if(isset($_i["first_on"])) $first_on = $_i["first_on"]; if(isset($_i["last"])) $last = $_i["last"]; if(isset($_i["on"])) $on = $_i["on"]; if(isset($_i["row_odd"])) $row_odd = $_i["row_odd"]; if(isset($_i["row_even"])) $row_even = $_i["row_even"]; if(isset($_i["last_of_line"])) $last_of_line = $_i["last_of_line"]; if($_p["nCols"] > 1) { $nColunas = $_p["nCols"]; $row = $_i["row"]; } if(isset($_p["headlinenchar"])) { $headlinenchar = $_p["headlinenchar"]; } if(isset($_i["record"])) $record = $_i["record"]; while($_vars = fd($r1)) { $_co2 = $_vars["_co"]; regCod($_tp, $_co2); $_vars["numreg"] = ++$totalcount; $text = $headline = $title = $text2 = ""; if($selecionaprimeiro && $totalcount == 1) { $_url["co"] = $_co2; } if($nColunas > 1 && $ncol == $nColunas && isset($_i["last_of_line"])) { $reg = $last_of_line; } elseif($first_on && $totalcount==1 && $_co2 == $_url["co"]){ $reg = $first_on; } elseif($first && $totalcount==1){ $reg = $first; } elseif($last_on && $totalreg == $totalcount && $_co2 == $_url["co"]){ $reg = $last_on; } elseif($last && $totalreg == $totalcount){ $reg = $last; } elseif($on && $_co2 == $_url["co"]){ $reg = $on; } elseif($parimpar && $even){ $reg = $even; } elseif(!$parimpar && $odd){ $reg = $odd; } elseif($parimparlinha && $row_even){ $reg = $row_even; } elseif(!$parimparlinha && $row_odd){ $reg = $row_odd; } else{ $reg = $record; } $parimpar = !$parimpar; $this->buildSons($reg, $_vars); if($record_url_f) { $url = getURL($_vars); repvar("RECORD_URL", $url, $reg); } if($text_f) { repvar("TEXT", $_vars["itext"], $reg); } if($title_f) { repvar("TITLE", $_vars["title"], $reg); } if($headline_f) { if($autoDest == 1) { $auxtexto = strip_tags($_vars["itext"]); repvar("HEADLINE", stripParagraph($auxtexto, $headlinenchar), $reg); } else { repvar("HEADLINE", $_vars["headline"], $reg); } } repvar("COD", $_co2, $reg); repvar("COP", $_vars["_cop"], $reg); $lst.= $reg; if($nColunas > 1) { $ncol++; if($ncol > $nColunas) { $subint = ($nlinha == 1 && $first?$first:$row); $colaux.= repvar("COLS", $lst, $subint); $lst = ""; $ncol = 1; $nlinha++; } } } if($ncol > 1){ $subint = ($nlinha == 1 && $first?$first:$row); $lstcolunas.= repvar("COLS", $lst, $subint); } if($nColunas <= 1) { repvar("LIST", $lst, $_html); } else { repvar("LIST", $lstcolunas, $_html); } } else { // Não tem registos nenhuns, verifica se tem a interface vazio definida if(isset($_i["empty"])) $_html = $_i["empty"]; elseif(isset($_i["empty_lst"])) //$_html = str_repvar("[[V:LST]]", $_int->i["vazio_lst"], $_html); repvar("LIST", $_i["empty_lst"], $_html); elseif(!$_mainint) $_html = ""; } fr($r1); repvar("TP", $_tp, $_html); $url = (isset($_p["url"])?$_p["url"]:""); if($url) { if($_cop) { repvar("COP", $_cop, $url); } } // Variáveis para filhos. Ex: cursor $_vars["totalreg"] = $totalreg; if($vpini) { $_vars["vpini"] = $vpini; } $_vars["totalregistos"] = $total-$_numlimit; $_vars["registospagina"] = (isset($_p["numreg"])?$_p["numreg"]:$totalreg); $_vars["cursorurl"] = $url; $_vars["_tp"] = $_tp; Data de publicação entre limites $pub = $_type->getParameter("pub"); if($pub == 1) { $where.= " and t1.pub = 2"; } elseif($pub == 2) { $where.= " and t1.datapi<=now() and t1.datapf>=now()"; } // Processa o $_cop if($_cop || $_flags & 8) { $where.= " and t1.codfth=$_cop"; } /* // Introduzir o campo codlingua se o módulo tiver multilingua $lgsuport = $_type->getParamter("lgsuport"); if($lgsuport) { $where.= " and t1.codlg=$_LG"; } */ // Variáveis que serão utilizadas dentro do ciclo e fora do ciclo, mais do que uma vez $autoDest = $_type->getParameter("autoDest"); $text_f = isset($_v["TEXT"]); $title_f = isset($_v["TITLE"]); $headline_f = isset($_v["HEADLINE"]); $text2_f = isset($_v["TEXT2"]); $record_url_f = isset($_v["RECORD_URL"]); $fields = getFields($_it); if(!$fields) { $fields =" t1.codinf as _co, t1.codtype as _tp, t1.codfth as _cop"; if($title_f) { $fields.= ",t1.title"; } if($text_f) { $fields.= ",t1.itext"; } if($text2_f) { $fields.= ",t1.itext2"; } if($headline_f) { if($autoDest && !$text_f) { $fields.= ",t1.itext"; } else { $fields.= ",t1.headline"; } } setFields($_it, $fields); } // destFlag = 2 - Destaque if($_flags & 2) { $where.= " and t1.destFlag = 2" ; } /** Processamento Final **/ //dia if($_d && $_d!="-1" && $_d!="") $where.= " and DAY(data)=$_d"; //mes if($_m && $_m!="-1" && $_m!="") $where.= " and MONTH(data)=$_m"; //ano if($_y && $_y!="-1" && $_y!="") $where.= " and YEAR(data)=$_y"; if($where) $where = substr($where, 5); // and // $sql = "select SQL_CALC_FOUND_ROWS ".$fields." from ".$from.($where?" where $where":""); $vpini = ""; if(isset($_p["pini"])) { $vpini = $_p["pini"]; repvar("COP", $_cop, $vpini); $_pini = prepData($vpini); } $numreg = $_p["numreg"]; if($numreg) { // Verifica se existe um valor de co, sem valor de pini. Pode acontecer que o valor de co está // numa página diferente da primeira. // Nesse caso, temos que calcular um valor para o pini, para que o cursor e a listagem surjam com // o registo selecionado activo. /* $auxordem = 0; if($_co) { $res = $bd->e("select ord from infrecord where codinf=$_co"); if(nr($res)) $auxordem = fc($res); fr($res); } if($_p["numlimit"]) { $_numlimit = $_p["numlimit"]; } if(!$vpini) { $vpini = "pini"; } if(!$_pini && $auxordem) { $auxWhere = "where ".($where?$where." and ":"")." t1.ord>=$auxordem"; $res = $bd->e("select count(t1.codnoticia) from $from $auxWhere $order"); $totRegAntes = fc($res); fr($res); if($totRegAntes > $_numreg) { $_pini = (divInt($totRegAntes, $_numreg) - 1) * $_numreg; if($totRegAntes % $_numreg) $_pini += $_numreg; $pini = $GLOBALS[$vpini] = $_pini; } } $_pini+=$_numlimit; */ //apenas estava esta linha $order.= " limit $_pini, ".$numreg; } $sql.= $order; $r1 = $bd->e($sql); $total = sql_total(); $totalreg = nr($r1); if($_debug) debug($this, "_TP:$_tp; _COP:$_cop; _CO: $_co; _CTD=$_ctd", $sql, $totalreg); $lst = $lstcolunas= ""; if($totalreg) { if($_p["colini"]) { $ncol = $_p["colini"]; } else { $ncol = 1; } $parimpar = $parimparlinha = 0; $totalcount = 0; $nlinha = $nColunas = 1; $record = $first = $first_on = $colaux = $row = $odd = $even = $last_on = $last = $on = $row_odd = $row_even = $last_of_line=""; if(isset($_i["odd"])) $odd = $_i["odd"]; if(isset($_i["even"])) $even = $_i["even"]; if(isset($_i["last_on"])) $last_on = $_i["last_on"]; if(isset($_i["first"])) $first = $_i["first"]; if(isset($_i["first_on"])) $first_on = $_i["first_on"]; if(isset($_i["last"])) $last = $_i["last"]; if(isset($_i["on"])) $on = $_i["on"]; if(isset($_i["row_odd"])) $row_odd = $_i["row_odd"]; if(isset($_i["row_even"])) $row_even = $_i["row_even"]; if(isset($_i["last_of_line"])) $last_of_line = $_i["last_of_line"]; if($_p["nCols"] > 1) { $nColunas = $_p["nCols"]; $row = $_i["row"]; } if(isset($_p["headlinenchar"])) { $headlinenchar = $_p["headlinenchar"]; } if(isset($_i["record"])) $record = $_i["record"]; while($_vars = fd($r1)) { $_co2 = $_vars["_co"]; regCod($_tp, $_co2); $_vars["numreg"] = ++$totalcount; $text = $headline = $title = $text2 = ""; if($selecionaprimeiro && $totalcount == 1) { $_url["co"] = $_co2; } if($nColunas > 1 && $ncol == $nColunas && isset($_i["last_of_line"])) { $reg = $last_of_line; } elseif($first_on && $totalcount==1 && $_co2 == $_url["co"]){ $reg = $first_on; } elseif($first && $totalcount==1){ $reg = $first; } elseif($last_on && $totalreg == $totalcount && $_co2 == $_url["co"]){ $reg = $last_on; } elseif($last && $totalreg == $totalcount){ $reg = $last; } elseif($on && $_co2 == $_url["co"]){ $reg = $on; } elseif($parimpar && $even){ $reg = $even; } elseif(!$parimpar && $odd){ $reg = $odd; } elseif($parimparlinha && $row_even){ $reg = $row_even; } elseif(!$parimparlinha && $row_odd){ $reg = $row_odd; } else{ $reg = $record; } $parimpar = !$parimpar; $this->buildSons($reg, $_vars); if($record_url_f) { $url = getURL($_vars); repvar("RECORD_URL", $url, $reg); } if($text_f) { repvar("TEXT", $_vars["itext"], $reg); } if($title_f) { repvar("TITLE", $_vars["title"], $reg); } if($headline_f) { if($autoDest == 1) { $auxtexto = strip_tags($_vars["itext"]); repvar("HEADLINE", stripParagraph($auxtexto, $headlinenchar), $reg); } else { repvar("HEADLINE", $_vars["headline"], $reg); } } repvar("COD", $_co2, $reg); repvar("COP", $_vars["_cop"], $reg); $lst.= $reg; if($nColunas > 1) { $ncol++; if($ncol > $nColunas) { $subint = ($nlinha == 1 && $first?$first:$row); $colaux.= repvar("COLS", $lst, $subint); $lst = ""; $ncol = 1; $nlinha++; } } } if($ncol > 1){ $subint = ($nlinha == 1 && $first?$first:$row); $lstcolunas.= repvar("COLS", $lst, $subint); } if($nColunas <= 1) { repvar("LIST", $lst, $_html); } else { repvar("LIST", $lstcolunas, $_html); } } else { // Não tem registos nenhuns, verifica se tem a interface vazio definida if(isset($_i["empty"])) $_html = $_i["empty"]; elseif(isset($_i["empty_lst"])) //$_html = str_repvar("[[V:LST]]", $_int->i["vazio_lst"], $_html); repvar("LIST", $_i["empty_lst"], $_html); elseif(!$_mainint) $_html = ""; } fr($r1); repvar("TP", $_tp, $_html); $url = (isset($_p["url"])?$_p["url"]:""); if($url) { if($_cop) { repvar("COP", $_cop, $url); } } // Variáveis para filhos. Ex: cursor $_vars["totalreg"] = $totalreg; if($vpini) { $_vars["vpini"] = $vpini; } $_vars["totalregistos"] = $total-$_numlimit; $_vars["registospagina"] = (isset($_p["numreg"])?$_p["numreg"]:$totalreg); $_vars["cursorurl"] = $url; $_vars["_tp"] = $_tp; Data de publicação entre limites $pub = $_type->getParameter("pub"); if($pub == 1) { $where.= " and t1.pub = 2"; } elseif($pub == 2) { $where.= " and t1.datapi<=now() and t1.datapf>=now()"; } // Processa o $_cop if($_cop || $_flags & 8) { $where.= " and t1.codfth=$_cop"; } /* // Introduzir o campo codlingua se o módulo tiver multilingua $lgsuport = $_type->getParamter("lgsuport"); if($lgsuport) { $where.= " and t1.codlg=$_LG"; } */ // Variáveis que serão utilizadas dentro do ciclo e fora do ciclo, mais do que uma vez $autoDest = $_type->getParameter("autoDest"); $text_f = isset($_v["TEXT"]); $title_f = isset($_v["TITLE"]); $headline_f = isset($_v["HEADLINE"]); $text2_f = isset($_v["TEXT2"]); $record_url_f = isset($_v["RECORD_URL"]); $fields = getFields($_it); if(!$fields) { $fields =" t1.codinf as _co, t1.codtype as _tp, t1.codfth as _cop"; if($title_f) { $fields.= ",t1.title"; } if($text_f) { $fields.= ",t1.itext"; } if($text2_f) { $fields.= ",t1.itext2"; } if($headline_f) { if($autoDest && !$text_f) { $fields.= ",t1.itext"; } else { $fields.= ",t1.headline"; } } setFields($_it, $fields); } // destFlag = 2 - Destaque if($_flags & 2) { $where.= " and t1.destFlag = 2" ; } /** Processamento Final **/ //dia if($_d && $_d!="-1" && $_d!="") $where.= " and DAY(data)=$_d"; //mes if($_m && $_m!="-1" && $_m!="") $where.= " and MONTH(data)=$_m"; //ano if($_y && $_y!="-1" && $_y!="") $where.= " and YEAR(data)=$_y"; if($where) $where = substr($where, 5); // and // $sql = "select SQL_CALC_FOUND_ROWS ".$fields." from ".$from.($where?" where $where":""); $vpini = ""; if(isset($_p["pini"])) { $vpini = $_p["pini"]; repvar("COP", $_cop, $vpini); $_pini = prepData($vpini); } $numreg = $_p["numreg"]; if($numreg) { // Verifica se existe um valor de co, sem valor de pini. Pode acontecer que o valor de co está // numa página diferente da primeira. // Nesse caso, temos que calcular um valor para o pini, para que o cursor e a listagem surjam com // o registo selecionado activo. /* $auxordem = 0; if($_co) { $res = $bd->e("select ord from infrecord where codinf=$_co"); if(nr($res)) $auxordem = fc($res); fr($res); } if($_p["numlimit"]) { $_numlimit = $_p["numlimit"]; } if(!$vpini) { $vpini = "pini"; } if(!$_pini && $auxordem) { $auxWhere = "where ".($where?$where." and ":"")." t1.ord>=$auxordem"; $res = $bd->e("select count(t1.codnoticia) from $from $auxWhere $order"); $totRegAntes = fc($res); fr($res); if($totRegAntes > $_numreg) { $_pini = (divInt($totRegAntes, $_numreg) - 1) * $_numreg; if($totRegAntes % $_numreg) $_pini += $_numreg; $pini = $GLOBALS[$vpini] = $_pini; } } $_pini+=$_numlimit; */ //apenas estava esta linha $order.= " limit $_pini, ".$numreg; } $sql.= $order; $r1 = $bd->e($sql); $total = sql_total(); $totalreg = nr($r1); if($_debug) debug($this, "_TP:$_tp; _COP:$_cop; _CO: $_co; _CTD=$_ctd", $sql, $totalreg); $lst = $lstcolunas= ""; if($totalreg) { if($_p["colini"]) { $ncol = $_p["colini"]; } else { $ncol = 1; } $parimpar = $parimparlinha = 0; $totalcount = 0; $nlinha = $nColunas = 1; $record = $first = $first_on = $colaux = $row = $odd = $even = $last_on = $last = $on = $row_odd = $row_even = $last_of_line=""; if(isset($_i["odd"])) $odd = $_i["odd"]; if(isset($_i["even"])) $even = $_i["even"]; if(isset($_i["last_on"])) $last_on = $_i["last_on"]; if(isset($_i["first"])) $first = $_i["first"]; if(isset($_i["first_on"])) $first_on = $_i["first_on"]; if(isset($_i["last"])) $last = $_i["last"]; if(isset($_i["on"])) $on = $_i["on"]; if(isset($_i["row_odd"])) $row_odd = $_i["row_odd"]; if(isset($_i["row_even"])) $row_even = $_i["row_even"]; if(isset($_i["last_of_line"])) $last_of_line = $_i["last_of_line"]; if($_p["nCols"] > 1) { $nColunas = $_p["nCols"]; $row = $_i["row"]; } if(isset($_p["headlinenchar"])) { $headlinenchar = $_p["headlinenchar"]; } if(isset($_i["record"])) $record = $_i["record"]; while($_vars = fd($r1)) { $_co2 = $_vars["_co"]; regCod($_tp, $_co2); $_vars["numreg"] = ++$totalcount; $text = $headline = $title = $text2 = ""; if($selecionaprimeiro && $totalcount == 1) { $_url["co"] = $_co2; } if($nColunas > 1 && $ncol == $nColunas && isset($_i["last_of_line"])) { $reg = $last_of_line; } elseif($first_on && $totalcount==1 && $_co2 == $_url["co"]){ $reg = $first_on; } elseif($first && $totalcount==1){ $reg = $first; } elseif($last_on && $totalreg == $totalcount && $_co2 == $_url["co"]){ $reg = $last_on; } elseif($last && $totalreg == $totalcount){ $reg = $last; } elseif($on && $_co2 == $_url["co"]){ $reg = $on; } elseif($parimpar && $even){ $reg = $even; } elseif(!$parimpar && $odd){ $reg = $odd; } elseif($parimparlinha && $row_even){ $reg = $row_even; } elseif(!$parimparlinha && $row_odd){ $reg = $row_odd; } else{ $reg = $record; } $parimpar = !$parimpar; $this->buildSons($reg, $_vars); if($record_url_f) { $url = getURL($_vars); repvar("RECORD_URL", $url, $reg); } if($text_f) { repvar("TEXT", $_vars["itext"], $reg); } if($title_f) { repvar("TITLE", $_vars["title"], $reg); } if($headline_f) { if($autoDest == 1) { $auxtexto = strip_tags($_vars["itext"]); repvar("HEADLINE", stripParagraph($auxtexto, $headlinenchar), $reg); } else { repvar("HEADLINE", $_vars["headline"], $reg); } } repvar("COD", $_co2, $reg); repvar("COP", $_vars["_cop"], $reg); $lst.= $reg; if($nColunas > 1) { $ncol++; if($ncol > $nColunas) { $subint = ($nlinha == 1 && $first?$first:$row); $colaux.= repvar("COLS", $lst, $subint); $lst = ""; $ncol = 1; $nlinha++; } } } if($ncol > 1){ $subint = ($nlinha == 1 && $first?$first:$row); $lstcolunas.= repvar("COLS", $lst, $subint); } if($nColunas <= 1) { repvar("LIST", $lst, $_html); } else { repvar("LIST", $lstcolunas, $_html); } } else { // Não tem registos nenhuns, verifica se tem a interface vazio definida if(isset($_i["empty"])) $_html = $_i["empty"]; elseif(isset($_i["empty_lst"])) //$_html = str_repvar("[[V:LST]]", $_int->i["vazio_lst"], $_html); repvar("LIST", $_i["empty_lst"], $_html); elseif(!$_mainint) $_html = ""; } fr($r1); repvar("TP", $_tp, $_html); $url = (isset($_p["url"])?$_p["url"]:""); if($url) { if($_cop) { repvar("COP", $_cop, $url); } } // Variáveis para filhos. Ex: cursor $_vars["totalreg"] = $totalreg; if($vpini) { $_vars["vpini"] = $vpini; } $_vars["totalregistos"] = $total-$_numlimit; $_vars["registospagina"] = (isset($_p["numreg"])?$_p["numreg"]:$totalreg); $_vars["cursorurl"] = $url; $_vars["_tp"] = $_tp; Acessibilidades - Portal do Município de Vila Nova de Famalicão - Portugal
O SEU LUGAR

Página Inicial / Sobre o Portal Acessibilidades

Acessibilidades

O Símbolo de Acessibilidade na Web foi criado pelo Estúdio Stormship de Boston, Massachusetts, trata-se de um globo inclinado, com uma grelha sobreposta. Na sua superfície está recortado um buraco de fechadura. Estão disponíveis várias versões deste símbolo.

A afixação do Símbolo de Acessibilidade não garante que este portal seja 100% acessível, no que respeita ao que se entende pela expressão utilizada neste âmbito. A utilização deste símbolo demonstra, unicamente, um esforço em aumentar a acessibilidade ao site da Câmara Municipal de Vila Nova de Famalicão em conformidade com a Resolução do Conselho de Ministros Nº 97/99, sobre acessibilidade dos sítios da administração pública na Internet pelos cidadãos com necessidades especiais.

Ligações de enquadramento sobre acessibilidade:

Acesso - Unidade de apoio para os Cidadãos com Necessidades Especiais na Sociedade de Informação
http://www.umic.pt

Documento da Resolução do Conselho de Ministros n.º 155/2007 sobre acessibilidade dos sítios da Administração Pública na Internet pelos Cidadãos com Necessidades Especias
http://www.dre.pt

Directrizes de Acessibilidade para o Conteúdo da Web (WCAG) 2.0
Recomendação W3C de 11 Dezembro de 2008
http://www.acesso.umic.pt