function generateCloud($arr, $min_size, $max_size) { // Obtenemos maximos y minimos $min_n = 0; $max_n = 0; foreach ($arr as $desc) { $min_n = $min_n > $desc['N'] ? $desc['N'] : $min_n; $max_n = $max_n < $desc['N'] ? $desc['N'] : $max_n; } // Una vez obtenemos calculamos la proporcion $prop = ($max_size - $min_size) / ($max_n - $min_n); echo "\n\t<div id='nube'>\n\t<div id='etiquetas'>\n\t"; // A escribir! $i = 0; $script = "var item,x;\n"; foreach ($arr as $desc) { $id = "desc{$i}"; echo "<span style='font-size:" . ($min_size + round($desc['N'] * $prop, 2)) . "px;color:" . random_color() . ";' id='{$id}'>" . $desc['descriptor'] . "</span>"; // Intercambia ancho y alto if (!rand(0, 4) && !ae_detect_opera()) { if (ae_detect_ie()) { $script .= "item = document.getElementById('{$id}');\n"; $script .= "x = item.clientWidth;\n"; $script .= "if (x<=70) {\n"; $script .= "document.getElementById('{$id}').className += 'vertical';\n"; $script .= "}\n"; } else { $script .= "item = document.getElementById('{$id}');\n"; $script .= "x = item.clientWidth;\n"; $script .= "if (x<=70) {\n"; $script .= "item.style.width=item.clientHeight;\n"; $script .= "item.style.height=x;\n"; $script .= "document.getElementById('{$id}').className += 'vertical';\n"; $script .= "item.style.marginLeft=item.style.width;\n"; $script .= "item.style.width=0;\n"; $script .= "item.style.whiteSpace='nowrap';\n"; $script .= "}\n"; } } $i++; } /*$script .= "x = document.getElementById('nube').offsetWidth;\n"; $script .= "for (var i=0;i<$i;i++){\n"; $script .= "item=document.getElementById('desc'+i);\n"; $script .= "while (item.clientWidth>x){\n"; $script .= "item.style.fontSize=parseInt(item.style.fontSize.replace('px',''))-1;}}\n";*/ echo "\n\t<div style='clear:both'></div>\n\t</div>\n\t</div>\n\t"; echo "<script type='text/javascript'>\n{$script}</script>\n"; }
<body> <?php if (ae_detect_ie()) { ?> <iframe id="yui-history-iframe" src="files/empty.html"></iframe> <?php } ?> <fieldset style="display:none"><input id="yui-history-field" type="hidden" /></fieldset> <?php jflush(); ?> <div id="nav"> <ul> <?php if (ae_detect_ie() || detect_safari()) { printNavig("<li><a href='#%s'>%s</a></li>"); } else { printNavig("<li><a href='{$PATH}%s/'>%s</a></li>"); } ?> </ul> </div> <?php jflush(); ?> <div id="content"> <?php printContent(); ?> </div>
$rows = count($grplist) + 1; $rows < 5 ? 5 : ($rows > 20 ? 20 : $rows); if (count($grplist) == 1) { $rows = "4"; } ?> <textarea id="grplist" cols="20" rows="<?php echo $rows; ?> " name="grplist"><?php echo implode("\n", $grplist); ?> </textarea><br> <?php if (ae_detect_ie()) { ?> <input type="submit" width="160" style="width:160px" style="font-size:10px;" value="<?php echo _("Clean & Remove duplicates"); ?> " /> <?php } else { ?> <input type="submit" width="186" style="width:186px" style="font-size:10px;" value="<?php echo _("Clean & Remove duplicates"); ?> " /><?php }
} } header('Content-Type: text/css; charset=UTF-8'); require_once "./connect.php"; $ini = parse_ini_file('config.ini', false); if (!mysql_select_db($ini['dbName'])) { exit; } $q = "select * from fontfile"; //$q = "select * from fillings ORDER BY id limit " . (($pageNum - 1) * 6) . ",6"; //testing $r = mysql_query($q); //$num_rows = mysql_num_rows($r); //echo $num_rows; $count = 0; while ($row = mysql_fetch_array($r)) { $displayName = $row['displayName']; $ttfFile = $row['ttfFile']; $eotFile = $row['eotFile']; echo "@font-face" . "\n" . "{" . "\n" . "font-family: \"{$displayName}\";" . "\n" . "src: url('" . $eotFile . "');" . "\n"; if (!ae_detect_ie()) { echo "src: local(\"{$displayName}\"),url('" . $ttfFile . "') format('truetype');" . "\n"; } else { echo "src: local(\"{$displayName}\"),url('" . $ttfFile . "') format('truetype') format('embedded-opentype');" . "\n"; } echo "font-weight:normal;" . "\nfont-style:normal;" . "\n}\n"; $count++; } /* * To change this template, choose Tools | Templates * and open the template in the editor. */