Fork me on GitHub






Augmenter la taille de la signature
Aspirant
Inscrit: 30/04/2015 15:27
Messages: 22
Bonjour,

J'aimerais faire suite à ce post

Quand on clique sur FAQ, il y a un message qui me dis que je n'est pas les droits d'accès ...

Je post car j'aimerai augmenter le nombre de police maximum.
et éventuellement comprendre pourquoi l'image se redimensionne toutes seule.

Merci d'avance.

Posté le : 07/05/2015 09:08
Partager Twitter Partagez cette article sur GG+
Re: Augmenter la taille de la signature
Admin Frxoops
Inscrit: 16/03/2009 16:40
De Tende (06)
Messages: 3528
En attendant que le problème de droits d'accès vers la Faq soit réglé, je colle le texte de la page de la Faq donné par Christian (c'est en anglais) :

Yes, by changing the field type in your XOOPS database and (if needed) tweaking a couple .php files you can have a larger signature or field contents.

Basics

XOOPS stores content and all sorts of information in a MySQL database. As database fields have size limits and sometimes the default field size isn’t the best choice for a given site, here are the basics of changing field sizes.

The main change to make is the field’s (column’s) type. You must have access to your XOOPS database (usually using phpMyAdmin) and be able to edit column types. Please refer to the MySQL Manual for a complete explanation on string types and type storage requirements.

Here’s a summary of storage limits per type of field:
CHAR, VARCHAR = 255 bytes
TINYTEXT = 256 bytes
TEXT = 65538 bytes (64KB)
MEDIUMTEXT = 16777219 bytes (16MB)
LONGTEXT = 4294967300 bytes (4GB)



Signatures

Sometimes, like with the signature field, simply changing the MySQL column type will be enough. Since 64kb is too large for a signature and there’s no intermediate type size, you can use the PHP substr() function in edituser.php:

Change:
$edituser->setVar(’user_sig’, $user_sig);

To:
$edituser->setVar(’user_sig’, substr($user_sig, 0, 1000));

This will impose a 1000 characters size limit to signatures.


Hacking .php files

Just as you can overcome the lack of granularity in MySQL size limits changing the way XOOPS inputs (or retrieves) data in the table, in some instances you’ll find field size limits hardcoded in .php files. To change this kind of field size, you’ll have to do as suggested above and then find the PHP files that deal with the field you want to change and edit them accordingly. As with all hacks, this will make future upgrades harder, so ponder carefully whether you really have to change .php files or not.

As an example of hacking hardcoded size limits, here’s what is necessary to edit to have larger RSS url fields in XOOPS Headlines module:

First thing to do is change the field type in MySQL: it’s set as VARCHAR(255) (255 characters) and you should set it to TEXT, which allows 65535 chars (unfortunatelly, there’s no intermediate value).

Then you have to change two module’s files:

Open /modules/xoopsheadline/admin/index.php and find and replace
form->addElement(new XoopsFormText?(_AM_URLEDFXML, ’headline_rssurl’, 50, 255, ’http:’), true);

(which appears, and has to be replaced, twice) with
$form->addElement(new XoopsFormText?(_AM_URLEDFXML, ’headline_rssurl’, 50, XYZ, ’http:’), true);
, ";XYZ"; being the new size in bytes for your RSS url field.

In /modules/xoopsheadline/class/headline.php, find
$this->initVar(’headline_rssurl’, XOBJ_DTYPE_TXTBOX, null, true, 255);

and replace ";255"; with the same value used before. This might be handy if you want to display customized Amazon RSS feeds.


Client-side textarea limits

If you need to post more than 65535 characters in a textarea you’ll have to edit a client-side limit implemented in /include/xoops.js (and perhaps /include/xoopsjs.php): find the line var maxchars = 65535; and change that value to fit your needs.

Posté le : 07/05/2015 12:22

Open in new window

Xoopseuse Mai 2012 | Responsable équipe internationale | Recherche avancée en bas de page !
Partager Twitter Partagez cette article sur GG+
Re: Augmenter la taille de la signature
Aspirant
Inscrit: 30/04/2015 15:27
Messages: 22
Niquel, merci !

Posté le : 07/05/2015 15:49
Partager Twitter Partagez cette article sur GG+

 Haut   Précédent   Suivant



Vous pouvez voir les sujets.
Vous ne pouvez pas débuter de nouveaux sujets.
Vous ne pouvez pas répondre aux contributions.
Vous ne pouvez pas éditer vos contributions.
Vous ne pouvez pas effacez vos contributions.
Vous ne pouvez pas ajouter de nouveaux sondages.
Vous ne pouvez pas voter en sondage.
Vous ne pouvez pas attacher des fichiers à vos contributions.
Vous ne pouvez pas poster sans approbation.

Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

46 Personne(s) en ligne (35 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 46 | Plus ...