Jump to content


kboing's Content

There have been 7 items by kboing (Search limited from 30/03/2023)


Ordernar por                Order  

#960476 Existe Programa Para Agrupar Seletores (css)?

Posted by kboing on 12/03/2009, 10:17 in HTML, CSS e Metodologias

exemplo:

. texto {
font-family: Verdana, Helvetica, Arial, Sans-Serif;
font-size: 10px;
padding:10px;
}

.ul {
list-style:none;
margin:0px;
padding:10px;
}

algum programa que agrupa automaticamente e deixa mais ou menos assim:

. texto {
font-family: Verdana, Helvetica, Arial, Sans-Serif;
font-size: 10px;
}

ul {
list-style:none;
margin:0px;
}

.texto, ul {
padding:10px;
}

agrupando os dados que são iguais para economizar no tamanho do codigo.



#960465 Existe Programa Para Agrupar Seletores (css)?

Posted by kboing on 12/03/2009, 09:39 in HTML, CSS e Metodologias

Pessoal,

existe algum programa que agrupa seletores que tem as mesmas propriedades, para diminuir o código, ou tem que fazr tudo na mão mesmo?



#958718 Como Saber Quanto Um Script Php Gasta De Recurso?

Posted by kboing on 23/02/2009, 11:07 in PHP

Tem alguma forma de saber quanto um script php gasta de recurso, como quanto gasta de memoria, consumo de cpu, etc?



#957194 Buscar Mais Vistos E Ordernar Por Ordem Alfabetica

Posted by kboing on 09/02/2009, 16:21 in PHP

Como montar uma busca mysql em um script php da seguinte forma:

fazer uma busca para mostrar apenas os 5 topicos mais vistos e ordena-los em ordem alfabetica:

exemplo de tabela:

id | nome | vistos |
1 | a | 2 |
2 | b | 1 |
3 | c | 7 |
4 | d | 4 |
5 | e | 9 |
6 | f | 0 |
7 | g | 6 |
8 | h | 10 |
9 | i | 8 |
10 | j | 1 |

em ordem decrescente seria: h e i c g
mas depois de pegar os mais vistos, teria q coloca-los em ordem alfabetica
o resultado seria: c e g h i

como montar essa busca?



#917146 Xml_parse - Erro Na Leitura De 2 Urls

Posted by kboing on 03/06/2008, 21:14 in PHP

valeu,

agora funcionou



#917126 Xml_parse - Erro Na Leitura De 2 Urls

Posted by kboing on 03/06/2008, 18:33 in PHP

fiz um script utilizando "xml_parse" para ler 2 arquivos xml, mas apos ler o primeiro arquivo dá o erro "PHP Fatal error: Cannot redeclare startelement()" e não lê o segundo arquivo.

como fazer para ler os dois arquivos?

SCRIPT:


<?PHP

$xmlurls = array(
"file1.xml",
"file2.xml"
);

for($i = 0; $url = $xmlurls[$i]; $i++) {

$insideitem = false;
$item = array();
$tag = "";
$title = "";
$link = "";

function startElement($parser, $name, $attrs) {
global $insideitem, $tag, $title, $link, $item;
if ($insideitem) {
$tag = $name;
} elseif ($name == "ITEM") {
$insideitem = true;
}
}

function endElement($parser, $name) {
global $insideitem, $tag, $title, $link, $item, $attrs;
if ($name == "ITEM") {
echo "$title : $link";
}
}

function characterData($parser, $data) {
global $insideitem, $tag, $title, $link, $pubdate, $description, $item, $attrs;
if ($insideitem) {
switch ($tag) {
case "ITEM":
$id .= $item['ID'];
break;
case "TITLE":
$title .= $data;
break;
case "LINK":
$link .= $data;
}
}
}


$xml_parser = xml_parser_create("");
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
$fp = fopen("$url","r")
or die("Error reading data.");
while ($data = fread($fp, 4096))
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
fclose($fp);
xml_parser_free($xml_parser);

}

?>


se alguem puder ajudar, agradeço.



#906800 Simplexml_load_file

Posted by kboing on 03/04/2008, 18:28 in PHP

Como pegar os dados (como tilte ou keywords) deste exemplo de xml usando simplexml_load_file

<media:group>
<media:title type="plain">TITULO</media:title>
<media:description type="plain">AQUI DESCRICAO</media:description>
<media:keywords>PALAVRA1, PALAVRA2, PALAVRA3</media:keywords>
<yt:duration seconds="270" />
<media:category label="Test" scheme="http://teste.com.br"...media:category>
<media:player url="http://www.teste.com.br/teste1" />
<media:thumbnail url="http://www.teste.com...br/teste12.jpg" height="97" width="130" time="02:15" />
<media:thumbnail url="http://www.teste.com...br/teste11.jpg" height="97" width="130" time="01:07" />
<media:thumbnail url="http://www.teste.com...br/teste13.jpg" height="97" width="130" time="03:22" />
</media:group>


consigo pegar dados de xmls padrão, com namespaces não estou conseguindo. Se alguém puder ajudar, agradeço.




IPB Skin By Virteq