Esta es una discusión para el tema Ayuda con Image resize en PHP en el foro vBulletin 3 - Preguntas, Problemas y Soluciones, bajo la categoría Soporte vBulletin; Resulta que estoy haciendo el nuevo diseño para nforo pero tengo un problemita, arme todo para que en el header se puedan ver los datos de usuarios y tambien el avatar, pero resulta que como ...
Página:
Resulta que estoy haciendo el nuevo diseño para nforo pero tengo un problemita, arme todo para que en el header se puedan ver los datos de usuarios y tambien el avatar, pero resulta que como el limite de tamaño del avatar es 150 x 150 pix deforma el header:
lo que tendria que logar es un Image resize para que cuando la imagen del avatar es superior a los 80x80 pix los deje en ese tamaño, actualmente tengo un PHP que llama a la imagen del avatar:
y luego en el header llamo al $navbaravatar con esto:Código:if ($vbulletin->userinfo['avatarid']) { // using a predefined avatar $avatar = $db->query_first("SELECT avatarpath FROM " . TABLE_PREFIX . "avatar WHERE avatarid = " . $vbulletin->userinfo[avatarid] . ""); $avatarid = $avatar['avatarid']; $navbaravatar = "<img src=\"" . $vbulletin->options[bburl] . "/$avatar[avatarpath]\" alt=\"Your Avatar\" border=\"0\" />"; } else { // not using a predefined avatar, check for custom if ($avatar = $db->query_first("SELECT dateline, userid FROM " . TABLE_PREFIX . "customavatar WHERE userid = " . $vbulletin->userinfo[userid] . "")) { // using a custom avatar $navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" . $vbulletin->options[avatarurl] . "/avatar$avatar[userid]_" . $vbulletin->userinfo[avatarrevision] . ".gif" : "" . $vbulletin->options[bburl] . "/image.php?u=" . $vbulletin->userinfo['userid'] . "&dateline=" . $avatar['dateline'] . ""; $navbaravatar = "<img src=\"$navbaravatarurl\" alt=\"Your Avatar\" border=\"0\" />"; } else { // no avatar specified $nouseavatarchecked = HTML_CHECKED; $avatarchecked[0] = ''; $navbaravatar = "<img src=\"" . $vbulletin->options[bburl] . "/$stylevar[imgdir_misc]/noavatar.gif\" alt=\"Your Avatar\" border=\"0\" />"; // "<span class=\"smallfont\">No Avatar<br/ >Specified</span>"; } }
El tema es que las imagenes de los avatars no quedan con extension (ejemplo GIF o JPG) sino que tienen este formato:Código:<td class="header"> <a href="$vboptions[bburl]/profile.php?do=editavatar">$navbaravatar</a> </td>
"foro/image.php?u=1&dateline=1190574191"
Por otro lado... tengo un CSS que puedo llegar a utilizar pero no encuentro la forma de llamarlo desde el PHP y funcione como Image resize
alguna idea?Código:#posts IMG { max-width: 95%; height: expression(this.height > 1024 ? "1024px" : true); width: expression(this.width > 768 ? "768px" : true); } #collapseobj_threadreview IMG { max-width: 95%; height: expression(this.height > 1024 ? "1024px" : true); width: expression(this.width > 768 ? "768px" : true); }