Ver Mensaje Individual
  #6 (permalink)  
Antiguo 26/11/2010, 08:55
alvaro0022
 
Fecha de Ingreso: octubre-2009
Ubicación: Santa Fe
Mensajes: 206
Antigüedad: 15 años, 2 meses
Puntos: 7
Respuesta: Cambiar tamaño de thumb en php

Para explicarme bien lo que quiero hacer es lo siguiente:

Tengo un codigo que crea una tabla con thum. lo que quiero es cambiar el tamaño de esos thum a 100x100. Pero como no se casi nada de php no tengo idea de como hacerlo.

Aqui dejo el codigo.

Código:
<?php

$cat_match_sql = ($cat_id && check_permission("auth_viewcat", $cat_id)) ? "AND i.cat_id = '$cat_id' " : "";
$register_array = array();

$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");

$lang_top_image_hits = $lang['top_image_hits'];

// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, i.image_thumb_file, i.image_media_file, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_hits DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$image_hits_thumb_[$i] = empty($top_list[$i]['image_thumb_file']) ? "<img src=\"".ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif".\">" : "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"".ROOT_PATH.THUMB_DIR."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\">";
$image_hits_[$i] = $register_array['image_hits_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
$image_hits_user_[$i] = $register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$image_hits_user_[$i] = $register_array['image_hits_user_'.$i] = $lang['userlevel_guest'];
}
$image_hits_cat_[$i] = $register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$image_hits_number_[$i] = $register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
}
else {
$image_hits_thumb_[$i] = $register_array['image_hits_thumb'.$i] = "--";
$image_hits_[$i] = $register_array['image_hits_'.$i] = "--";
$image_hits_user_[$i] = $register_array['image_hits_user_'.$i] = "--";
$image_hits_cat_[$i] = $register_array['image_hits_cat_'.$i] = "--";
$image_hits_number_[$i] = $register_array['image_hits_number_'.$i] = "--";
}
}
$top_hits_10 = " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
<tr>
<td class=\"bordercolor\">
<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\"><tr>
</tr>
<tr>

<td valign=\"top\" class=\"row1\">$image_hits_thumb_[1]</td>
<td valign=\"top\" class=\"row1\">$image_hits_[1] / $image_hits_cat_[1]</td>

<td valign=\"top\" class=\"row1\">$image_hits_cat_[1]</td>
<td valign=\"top\" class=\"row1\" nowrap>$image_hits_number_[1]</td>
</tr>
<tr>

<td valign=\"top\" class=\"row2\" width=\"48\" height=\"36\">$image_hits_thumb_[2]</td>
<td valign=\"top\" class=\"row2\">$image_hits_[2]</td>

<td valign=\"top\" class=\"row2\">$image_hits_cat_[2]</td>
<td valign=\"top\" class=\"row2\" nowrap>$image_hits_number_[2]</td>
</tr>
<tr>

<td valign=\"top\" class=\"row1\">$image_hits_thumb_[3]</td>
<td valign=\"top\" class=\"row1\">$image_hits_[3]</td>

<td valign=\"top\" class=\"row1\">$image_hits_cat_[3]</td>
<td valign=\"top\" class=\"row1\" nowrap>$image_hits_number_[3]</td>
</tr>
<tr>

<td valign=\"top\" class=\"row2\">$image_hits_thumb_[4]</td>
<td valign=\"top\" class=\"row2\">$image_hits_[4]</td>

<td valign=\"top\" class=\"row2\">$image_hits_cat_[4]</td>
<td valign=\"top\" class=\"row2\" nowrap>$image_hits_number_[4]</td>
</tr>
<tr>

<td valign=\"top\" class=\"row1\">$image_hits_thumb_[5]</td>
<td valign=\"top\" class=\"row1\">$image_hits_[5]</td>

<td valign=\"top\" class=\"row1\">$image_hits_cat_[5]</td>
<td valign=\"top\" class=\"row1\" nowrap>$image_hits_number_[5]</td>
</tr>
<tr>

<td valign=\"top\" class=\"row2\">$image_hits_thumb_[6]</td>
<td valign=\"top\" class=\"row2\">$image_hits_[6]</td>

<td valign=\"top\" class=\"row2\">$image_hits_cat_[6]</td>
<td valign=\"top\" class=\"row2\" nowrap>$image_hits_number_[6]</td>
</tr>
<tr>

<td valign=\"top\" class=\"row1\">$image_hits_thumb_[7]</td>
<td valign=\"top\" class=\"row1\">$image_hits_[7]</td>

<td valign=\"top\" class=\"row1\">$image_hits_cat_[7]</td>
<td valign=\"top\" class=\"row1\" nowrap>$image_hits_number_[7]</td>
</tr>
<tr>

<td valign=\"top\" class=\"row2\">$image_hits_thumb_[8]</td>
<td valign=\"top\" class=\"row2\">$image_hits_[8]</td>

<td valign=\"top\" class=\"row2\">$image_hits_cat_[8]</td>
<td valign=\"top\" class=\"row2\" nowrap>$image_hits_number_[8]</td>
</tr>
<tr>

<td valign=\"top\" class=\"row1\">$image_hits_thumb_[9]</td>
<td valign=\"top\" class=\"row1\">$image_hits_[9]</td>

<td valign=\"top\" class=\"row1\">$image_hits_cat_[9]</td>
<td valign=\"top\" class=\"row1\" nowrap>$image_hits_number_[9]</td>
</tr>
<tr>

<td valign=\"top\" class=\"row2\">$image_hits_thumb_[10]</td>
<td valign=\"top\" class=\"row2\">$image_hits_[10]</td>

<td valign=\"top\" class=\"row2\">$image_hits_cat_[10]</td>
<td valign=\"top\" class=\"row2\" nowrap>$image_hits_number_[10]</td>
</tr>
</table></table>";


?>
__________________
Fondos de pantalla
Juegos Gratis