Fork me on GitHub




(1) 2 »


Variables XOOPS
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
Bonjour,

Imaginons que j'installe un site XOOPS sous :

- /var/www/htdocs/xoops1
- Que le Virtual path soit /var/www/htdocs

on a donc la racine de XOOPS qui pointe vers htt://monsiteweb.fr/xoops1


Je veux trouver la variable XOOPS (ou smarty ? )à utiliser dans un fichier Php qui m'affiche :

- La racine du domaine (htt://monsiteweb.fr) sans le slash
- La racine de l'installation de XOOPS (htt://monsiteweb.fr/xoops1) = XOOPS_URL ?
- Le chemin de XOOPS relatif à la racine (/xoops1)

Merci !

Posté le : 19/10/2013 00:31

Open in new window
Partager Twitter Partagez cette article sur GG+
Re: Variables XOOPS
Admin Frxoops
Inscrit: 05/03/2005 05:20
De Vaucluse
Messages: 960
Salut Alain,

Citation :
La racine de l'installation de XOOPS (htt://monsiteweb.fr/xoops1) = XOOPS_URL ?
Oui

Pour le reste, avec un petit parse_url tu devrais trouver ton bonheur:
$test_array=parse_url(XOOPS_URL);

Ensuite:
$test_array["scheme"] retourne 'http'
$test_array["host"] retourne 'monsiteweb.fr'
$test_array["path"] retourne '/xoops1'

A mixer éventuellement pour construire les variables que tu désires

Un peu de lecture...

Posté le : 19/10/2013 10:05

Open in new window

Xoops 2.5.7.2 - Debian 8.2 - Apache 2.4.10 - MySQL 5.5.47 - Php 5.6.17
Partager Twitter Partagez cette article sur GG+
Re: Variables XOOPS
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
Bon,
ben merci !
Je vais pourvoir enlever mes codages en dur dans TinyMCE V4, tester et proposer ce nouvel éditeur avec le responsivefilemanager

Posté le : 19/10/2013 14:56

Open in new window
Partager Twitter Partagez cette article sur GG+
Re: Variables XOOPS
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
Humm,
ben, il doit me manquer quelque chose car il ne connait pas XOOPS_URL

Rappel :
j'ai un fichier config.php (indépendant de XOOPS) pour lequel je dois renseigner des variables :
Citation :
//********************** //Path configuration //********************** //
In this configuration the folder tree is
// root
// |- source <- upload folder
// |- thumbs <- thumbnail folder [must have write permission (755)]
// |- filemanager
// |- js
// | |- tinymce
// | | |- plugins
// | | | |- responsivefilemanager
// | | | | |- plugin.min.js

//$base_url="http://www.site.com";
// base url (only domain) of site (without final /). If you prefer relative urls leave empty
//$base_url="http://localhost";
// $base_url=XOOPS_URL; NON
// $base_url = <{$xoops_url}>; NON
$base_url = $xoops_url;
// NON

//$upload_dir = '/source/'; // path from base_url to base of upload folder (with start and final /)
$upload_dir = '/uploads/filemanager/media/'; // path from base_url to base of upload folder (with start and final /)

//$current_path = '../source/'; // relative path from filemanager folder to upload folder (with final /)
$current_path = '../../../../../uploads/filemanager/media/'; // relative path from filemanager folder to upload folder (with final /)

//thumbs folder can't put inside upload folder
// $thumbs_base_path = '../thumbs/'; // relative path from filemanager folder to thumbs folder (with final /)
$thumbs_base_path = '../../../../../uploads/filemanager/thumbs/'; // relative path from filemanager folder to thumbs folder (with final /)

mais $xoops_url, XOOPS_URL me renvoit Undefined variable*/

Posté le : 15/11/2013 12:23

Open in new window
Partager Twitter Partagez cette article sur GG+
Re: Variables XOOPS
Admin Frxoops
Inscrit: 05/03/2005 05:20
De Vaucluse
Messages: 960
Salut Alain,
Citation :
ben, il doit me manquer quelque chose car il ne connait pas XOOPS_URL
Avec un petit include de mainfile.php, cela devrai aller mieux

Posté le : 15/11/2013 12:45

Open in new window

Xoops 2.5.7.2 - Debian 8.2 - Apache 2.4.10 - MySQL 5.5.47 - Php 5.6.17
Partager Twitter Partagez cette article sur GG+
Re: Variables XOOPS
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
ok mais le "include mainfile.php" doit contenir le chemin en dur de mainfile.php.

Bien souvent, c'est /mainfile.php

mais ça pourrait être /monsiteweb1/mainfile.php

or je souhaite que le webmaster n'ai pas a modifier le fichier config.php.

Tu vois le problème ?

PS : je vais déjà essayer en dur le include... mais il me faudra régler ce problème.

Posté le : 15/11/2013 12:48

Open in new window
Partager Twitter Partagez cette article sur GG+
Re: Variables XOOPS
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
ha, j'ai trouvé ça :

// load mainfile.php
$current_path dirname(__FILE__);
if ( 
DIRECTORY_SEPARATOR != "/" ) {
    
$current_path str_replaceDIRECTORY_SEPARATOR"/"$current_path);
}
$xoops_root_path substr($current_path0strpos(strtolower($current_path), "/class/xoopseditor/tinymce4/"));
include_once 
$xoops_root_path "/mainfile.php";


ça te semble correcte, sachant que le fichier config.php se trouve sous :

/class/xoopseditor/tinymce4/external_plugins/filemanager/config ?

Posté le : 15/11/2013 12:59

Open in new window
Partager Twitter Partagez cette article sur GG+
Re: Variables XOOPS
Admin Frxoops
Inscrit: 05/03/2005 05:20
De Vaucluse
Messages: 960
Pourquoi pas en chemin relatif ?
include_once  "../../../../../../mainfile.php";

Posté le : 15/11/2013 14:37

Open in new window

Xoops 2.5.7.2 - Debian 8.2 - Apache 2.4.10 - MySQL 5.5.47 - Php 5.6.17
Partager Twitter Partagez cette article sur GG+
Re: Variables XOOPS
Admin Frxoops
Inscrit: 04/03/2011 09:10
De Lot
Messages: 2837
les chemins relatifs sont a éviter le plus souvent possible.
Suivant la configuration du serveur, sa peut fonctionner ou pas.

Posté le : 21/11/2013 23:49
Partager Twitter Partagez cette article sur GG+
Re: Variables XOOPS
Admin Frxoops
Inscrit: 16/05/2003 18:10
De Rhone-Alpes
Messages: 4051
Effectivement, Cédric,
cette proposition, de slider n'a pas fonctionné sur mon serveur de test,
mais je n'ai pas compris pourquoi,
je suis pourtant sur du nombre de "../"
d'autant que j'ai ensuite essayé avec + puis moins de "../"

Posté le : 21/11/2013 23:54

Open in new window
Partager Twitter Partagez cette article sur GG+

 Haut   Précédent   Suivant
(1) 2 »



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

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