redimensionnement automatique des images sur forum phpbb

Statut
N'est pas ouverte pour d'autres réponses.

DeScH

AstaLaVista
Voila tout est dans le titre, je voudrai donc que toutes les images mises entre balises
soient redimensionner en 640*480 automatiquement comme sur gamerz par exemple... Comment faire?
 
1er
OP
DeScH

DeScH

AstaLaVista
C'est bon j'ai trouvé ^^
Il suffisait d'ouvrir bbcode.tpl et modifier une ligne en

<!-- BEGIN img -->
<img src="{URL}" border="0" OnLoad="if (this.width > 800 || this.height > 600) if ((this.width / this.height) > (800/600)) {this.width=800} else {this.height=600}" />
<!-- END img -->
 

La Poubelle

Pou'r allé Danché
Ca c'est rare et serviable. Tu recherches un problème et lorsque tu trouves la solution, tu la donnes pour faire partager aux autres :wink:
 
excellent ca, ca m'interressait auyssi !
merci.
 
T

ttt3566

ex membre
iep merci, ça tombe bien ça :D
 

Jereck

Α & Ω
Staff
sinon, pour faire comme ici, il faut créer un script PHP qui utilise la librairie GD pour créer une miniature (comme ça, une petite connection ne devra charger qu'une image réduite, et non pas l'image complète).
Malheureusement, suite à un petit probllème de FTP, le site où j'avais créé un tel script a été supprimé, et je n'avais pas de backup de mon script. désolé.
 

Jereck

Α & Ω
Staff
modifie ton TPL :
Code:
<!-- BEGIN img --> 
<a href="{URL"} parent="_blank"><img src="{URL}" border="0" OnLoad="if (this.width > 800 || this.height > 600) if ((this.width / this.height) > (800/600)) {this.width=800} else {this.height=600}" border="0" /></a>
<!-- END img -->
 
R

RedCross

ex membre
Tu rajoutes juste un tag lien autour de l'image.
Un peu genre :
Code:
<a href="{URL}" target="_blank">
<img src="{URL}" border="0" OnLoad="if (this.width > 800 || this.height > 600) if ((this.width / this.height) > (800/600)) {this.width=800} else {this.height=600}" /> 
</a>
 
1er
OP
DeScH

DeScH

AstaLaVista
Ca marche :p

Code:
<!-- BEGIN img -->
<a href="{URL}" target="_blank">
<img src="{URL}" border="0" OnLoad="if (this.width > 640 || this.height > 480) if ((this.width / this.height) > (640/480)) {this.width=640} else {this.height=480}" />
</a> <!-- END img -->
Merci :)
 
T

ttt3566

ex membre
parfait ça :mrgreen: merci!
 

CpR@Be

Touriste
cool comme truc, je vais le mettre sur mon forum :)
 
T

ttt3566

ex membre
une bétise, mais faut y penser : ça redimensionne aussi les images des signatures :)
 

LeTho

RedCap
merci pour l'info... je cherchais ça aussi
 
Statut
N'est pas ouverte pour d'autres réponses.
Haut