|
Re: Probleme install xoops 2.0.13 sur serveur php5/mysql5 |
|
Régulier
Inscrit: 16/04/2004 12:12
|
bonjour, alors apres test en local conseillé par christian ( merci ) cela semblait marcher j'ai donc contacté l'hebergeur et en fait cela ne venait qu'un manque de droit sur le compte utilisateur utilisé l'install ce passe bien ( un petit probleme sur l'ecriture des variable dans le fichier mainfile qui m'oblige a ecrasé le fichier par un qui est fait par mes soins ) apres l'install pas de souci par contre j'ai voulu installé le module contact => install ok => apres je vais dans le module du coté du site => message " XOOPS root path not defined " j'ai essayé cela sur d'autre modules et meme resultat en local pas de soucis mon root path resemble à ca :
define('XOOPS_ROOT_PATH', '/servers/apache/sites/test/fr/test.dom.fr');
serait'il possible que cela pose probleme ? @+ Ayou42 Ps mon mainfile ressemble à ca :
if ( !defined("XOOPS_MAINFILE_INCLUDED") ) {
define("XOOPS_MAINFILE_INCLUDED",1);
// XOOPS Physical Path
// Physical path to your main XOOPS directory WITHOUT trailing slash
// Example: define('XOOPS_ROOT_PATH', '/servers/apache/sites/test/fr/test.dom.fr');
define('XOOPS_ROOT_PATH', '/servers/apache/sites/test/fr/test.dom.fr');
// XOOPS Virtual Path (URL)
// Virtual path to your main XOOPS directory WITHOUT trailing slash
// Example: define('XOOPS_URL', 'http://test.dom.fr');
define('XOOPS_URL', 'http://test.dom.fr');
define('XOOPS_CHECK_PATH', 1);
// Protect against external scripts execution if safe mode is not enabled
if ( XOOPS_CHECK_PATH && !@ini_get('safe_mode') ) {
if ( function_exists('debug_backtrace') ) {
$xoopsScriptPath = debug_backtrace();
if ( !count($xoopsScriptPath) ) {
die("XOOPS path check: this file cannot be requested directly");
}
$xoopsScriptPath = $xoopsScriptPath[0]['file'];
} else {
$xoopsScriptPath = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] : $_SERVER['SCRIPT_FILENAME'];
}
if ( DIRECTORY_SEPARATOR != '/' ) {
// IIS6 may double the chars
$xoopsScriptPath = str_replace( strpos( $xoopsScriptPath, '\\', 2 ) ? '\\' : DIRECTORY_SEPARATOR, '/', $xoopsScriptPath);
}
if ( strcasecmp( substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace( DIRECTORY_SEPARATOR, '/', XOOPS_ROOT_PATH)) ) {
exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
}
}
// Database
// Choose the database to be used
define('XOOPS_DB_TYPE', 'mysql');
// Table Prefix
// This prefix will be added to all new tables created to avoid name conflict in the database. If you are unsure, just use the default 'xoops'.
define('XOOPS_DB_PREFIX', 'xoops');
// Database Hostname
// Hostname of the database server. If you are unsure, 'localhost' works in most cases.
define('XOOPS_DB_HOST', 'localhost');
// Database Username
// Your database user account on the host
define('XOOPS_DB_USER', 'test');
// Database Password
// Password for your database user account
define('XOOPS_DB_PASS', 'pass');
// Database Name
// The name of database on the host. The installer will attempt to create the database if not exist
define('XOOPS_DB_NAME', 'test');
// Use persistent connection? (Yes=1 No=0)
// Default is 'Yes'. Choose 'Yes' if you are unsure.
define('XOOPS_DB_PCONNECT', 0);
define('XOOPS_GROUP_ADMIN', '1');
define('XOOPS_GROUP_USERS', '2');
define('XOOPS_GROUP_ANONYMOUS', '3');
if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
include XOOPS_ROOT_PATH."/include/common.php";
}
}
?>
Posté le : 28/12/2005 14:49
|
|
|
Re: Probleme install xoops 2.0.13 sur serveur php5/mysql5 |
|
Régulier
Inscrit: 16/04/2004 12:12
|
Merci bien pour ta réponse je vais tester ca demain apres un petit dodo et je vous tiendrais au courant @++ Ayou42
Posté le : 28/12/2005 00:02
|
|
|
Probleme install xoops 2.0.13 sur serveur php5/mysql5 |
|
Régulier
Inscrit: 16/04/2004 12:12
|
Bonsoir ayant besoin de faire un autre site sur xoops ( j'en ai fait pour l'instant 3, 1 intranet et 2 sites ) pour une association j'ai demandé à mon hébergeur par lequel je passe pour le boulot de me fournir un espace web + base mysql ce qu'il a fait gentillement et gratuitement par contre je rencontre des probleme à l'installation lors de la tentative de création des tables dans la base de données =>
Echec de création de la table xoops_avatar.
Echec de création de la table xoops_avatar_user_link.
Echec de création de la table xoops_banner.
Echec de création de la table xoops_bannerclient.
Echec de création de la table xoops_bannerfinish.
Echec de création de la table xoops_block_module_link.
Echec de création de la table xoops_xoopscomments.
Echec de création de la table xoops_xoopsnotifications.
Echec de création de la table xoops_config.
Echec de création de la table xoops_configcategory.
Echec de création de la table xoops_configoption.
Echec de création de la table xoops_groups.
Echec de création de la table xoops_group_permission.
Echec de création de la table xoops_groups_users_link.
Echec de création de la table xoops_image.
Echec de création de la table xoops_imagebody.
Echec de création de la table xoops_imagecategory.
Echec de création de la table xoops_imgset.
Echec de création de la table xoops_imgset_tplset_link.
Echec de création de la table xoops_imgsetimg.
Echec de création de la table xoops_modules.
Echec de création de la table xoops_newblocks.
Echec de création de la table xoops_online.
Echec de création de la table xoops_priv_msgs.
Echec de création de la table xoops_ranks.
Echec de création de la table xoops_session.
Echec de création de la table xoops_smiles.
Echec de création de la table xoops_tplset.
Echec de création de la table xoops_tplfile.
Echec de création de la table xoops_tplsource.
Echec de création de la table xoops_users.
Tables de la base de données créées.
j'ai cherché sur le net sur le le site xoops.org et frxoops.org et je suis de plus en plus à me demandé si cela ne vient pas du couple php5/mysql_5 qui a réussi une install correct de xoops 2.0.13 avec un couple php5/mysql_5 ? pensez vous que je devrai tout simplement à mon hébergeur de me créer mon espace web sur un autre de ces serveurs avec un couple php/mysql antérieur ? si oui quoi choisir php4/mysql_4 ou php4/mysql_3 ? merci par avance pour vos lumiere @++ Ayou42
Posté le : 27/12/2005 21:31
Edité par ayou42 sur 30/12/2005 16:14:01
|
|
|
Re: Module wf-download |
|
Régulier
Inscrit: 16/04/2004 12:12
|
merci bien pour ta réponse je vais regardé ca @++ Ayou42
Posté le : 20/12/2005 10:58
|
|
|
Module wf-download |
|
Régulier
Inscrit: 16/04/2004 12:12
|
bonjour avant de poser ma requete j'ai fait des recherches sur google et sur different forum... sans résultat concluant je voudrait forcer le téléchargement des fichiers excel ... au lieu qu'il soit ouvert dans le navigateur je pense que pour cela il faut utiliser la fonction header : force-download j'ai regardé la structure de visit.php de wfdownload on récupère $url qui est l'url complete du lien qu'il faudrait si c'est possible découper en : le chemin, et le fichier à télécharger sous 2 variable : $chemin et $Fichier_a_telecharger il faudrait pouvoir également récupérer tout les types mimes qui sont renseigné dans wfdownload et récupéré une variable $type pour ensuite utiliser le script : http://www.destrucsaweb.com/ressources/phpmyannu/goto_45.phpje ne sait pas si quelqu'un pourra m'aider ou si cela a été deja fait @++ et si quelqun peut me répondre merci par avance Ayou42
Posté le : 20/12/2005 09:34
|
|
|
Re: modification de xoopsmembers |
|
Régulier
Inscrit: 16/04/2004 12:12
|
merci pour cette précision je pense que cela m'aidera dans bien des cas merci pour le cours particulier je te paye un coup .... champagne virtuellement loll mais le coeur y est @++ Ayou42
Posté le : 16/12/2005 14:54
|
|
|
Re: modification de xoopsmembers |
|
Régulier
Inscrit: 16/04/2004 12:12
|
:banane: merci super ca marche nickel j'ai mis comme tu a mis :
$criteria->add(new Criteria('bio', '%site1%', 'LIKE'));
je suis super content merci encore si quelqu'un pouvait m'expliquer pourquoi on met '%site1%' et pas 'site1' il doit bien avoir une raison ou c'est comme ca et faut pas réfléchir et utiliser les % quand on veut mettre la condition merci encore !!!!! ya pas a dire une réponse aussi rapide ca prouve bien que ya du monde pour aider les newbies sur frxoops !!!! @++ Ayou42
Posté le : 16/12/2005 14:30
|
|
|
Re: modification de xoopsmembers |
|
Régulier
Inscrit: 16/04/2004 12:12
|
Citation : blueteen a écrit: colle nous ici le contenu de ton fichier index.php (entre les balises code) je le testerai chez moi
merci encore pour ton aide alors voici le code de l'index.php :
<?php
// $Id: index.php,v 1.18 2004/12/26 19:12:10 onokazu Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <http://www.xoops.org/> ... nbsp; //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
include "../../mainfile.php";
$op = "form";
if ( isset($HTTP_POST_VARS['op']) && $HTTP_POST_VARS['op'] == "submit" ) {
$op = "submit";
}
if ( $op == "form" ) {
$xoopsOption['template_main'] = 'xoopsmembers_searchform.html';
include XOOPS_ROOT_PATH."/header.php";
$member_handler =& xoops_gethandler('member');
$total = $member_handler->getUserCount(new Criteria('level', 0, '>'));
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$uname_text = new XoopsFormText("", "user_uname", 30, 60);
$uname_match = new XoopsFormSelectMatchOption("", "user_uname_match", $value=3);
$uname_tray = new XoopsFormElementTray(_MM_UNAME, " ");
$uname_tray->addElement($uname_match);
$uname_tray->addElement($uname_text);
$name_text = new XoopsFormText("", "user_name", 30, 60);
$name_match = new XoopsFormSelectMatchOption("", "user_name_match", $value=3);
$name_tray = new XoopsFormElementTray(_MM_REALNAME, " ");
$name_tray->addElement($name_match);
$name_tray->addElement($name_text);
$email_text = new XoopsFormText("", "user_email", 30, 60);
$email_match = new XoopsFormSelectMatchOption("", "user_email_match", $value=3);
$email_tray = new XoopsFormElementTray(_MM_EMAIL, " ");
$email_tray->addElement($email_match);
$email_tray->addElement($email_text);
$url_text = new XoopsFormText(_MM_URLC, "user_url", 30, 100);
//$theme_select = new XoopsFormSelectTheme(_MM_THEME, "user_theme");
//$timezone_select = new XoopsFormSelectTimezone(_MM_TIMEZONE, "user_timezone_offset");
$icq_text = new XoopsFormText("", "user_icq", 30, 100);
$icq_match = new XoopsFormSelectMatchOption("", "user_icq_match", $value=3);
$icq_tray = new XoopsFormElementTray(_MM_ICQ, " ");
$icq_tray->addElement($icq_match);
$icq_tray->addElement($icq_text);
$aim_text = new XoopsFormText("", "user_aim", 30, 100);
$aim_match = new XoopsFormSelectMatchOption("", "user_aim_match", $value=3);
$aim_tray = new XoopsFormElementTray(_MM_AIM, " ");
$aim_tray->addElement($aim_match);
$aim_tray->addElement($aim_text);
$yim_text = new XoopsFormText("", "user_yim", 30, 100);
$yim_match = new XoopsFormSelectMatchOption("", "user_yim_match", $value=3);
$yim_tray = new XoopsFormElementTray(_MM_YIM, " ");
$yim_tray->addElement($yim_match);
$yim_tray->addElement($yim_text);
$msnm_text = new XoopsFormText("", "user_msnm", 30, 100);
$msnm_match = new XoopsFormSelectMatchOption("", "user_msnm_match", $value=3);
$msnm_tray = new XoopsFormElementTray(_MM_MSNM, " ");
$msnm_tray->addElement($msnm_match);
$msnm_tray->addElement($msnm_text);
$bio_text = new XoopsFormText("", "bio", 30, 100);
$bio_match = new XoopsFormSelectMatchOption("", "bio_match", $value=3);
$bio_tray = new XoopsFormElementTray(_MM_BIO, " ");
$bio_tray->addElement($bio_match);
$bio_tray->addElement($bio_text);
$location_text = new XoopsFormText(_MM_LOCATION, "user_from", 30, 100);
$occupation_text = new XoopsFormText(_MM_OCCUPATION, "user_occ", 30, 100);
$interest_text = new XoopsFormText(_MM_INTEREST, "user_intrest", 30, 100);
//$bio_text = new XoopsFormText(_MM_EXTRAINFO, "user_bio", 30, 100);
$lastlog_more = new XoopsFormText(_MM_LASTLOGMORE, "user_lastlog_more", 10, 5);
$lastlog_less = new XoopsFormText(_MM_LASTLOGLESS, "user_lastlog_less", 10, 5);
$reg_more = new XoopsFormText(_MM_REGMORE, "user_reg_more", 10, 5);
$reg_less = new XoopsFormText(_MM_REGLESS, "user_reg_less", 10, 5);
$posts_more = new XoopsFormText(_MM_POSTSMORE, "user_posts_more", 10, 5);
$posts_less = new XoopsFormText(_MM_POSTSLESS, "user_posts_less", 10, 5);
$sort_select = new XoopsFormSelect(_MM_SORT, "user_sort");
$sort_select->addOptionArray(array("uname"=>_MM_UNAME,"email"=>_MM_EMAIL,"last_login"=>_MM_LASTLOGIN,"user_regdate"=>_MM_REGDATE,"posts"=>_MM_POSTS));
$order_select = new XoopsFormSelect(_MM_ORDER, "user_order");
$order_select->addOptionArray(array("ASC"=>_MM_ASC,"DESC"=>_MM_DESC));
$limit_text = new XoopsFormText(_MM_LIMIT, "limit", 6, 2);
$op_hidden = new XoopsFormHidden("op", "submit");
$submit_button = new XoopsFormButton("", "user_submit", _SUBMIT, "submit");
$form = new XoopsThemeForm("", "searchform", "index.php");
$form->addElement($uname_tray);
$form->addElement($name_tray);
$form->addElement($email_tray);
//$form->addElement($theme_select);
//$form->addElement($timezone_select);
$form->addElement($icq_tray);
$form->addElement($aim_tray);
$form->addElement($yim_tray);
$form->addElement($msnm_tray);
$form->addElement($bio_tray);
$form->addElement($url_text);
$form->addElement($location_text);
$form->addElement($occupation_text);
$form->addElement($interest_text);
//$form->addElement($bio_text);
$form->addElement($lastlog_more);
$form->addElement($lastlog_less);
$form->addElement($reg_more);
$form->addElement($reg_less);
$form->addElement($posts_more);
$form->addElement($posts_less);
$form->addElement($sort_select);
$form->addElement($order_select);
$form->addElement($limit_text);
$form->addElement($op_hidden);
$form->addElement($submit_button);
$form->assign($xoopsTpl);
$xoopsTpl->assign('lang_search', _MM_SEARCH);
$xoopsTpl->assign('lang_totalusers', sprintf(_MM_TOTALUSERS, '<span style="color:#ff0000;">'.$total.'</span>'));
}
if ( $op == "submit" ) {
$xoopsOption['template_main'] = 'xoopsmembers_searchresults.html';
include XOOPS_ROOT_PATH."/header.php";
$iamadmin = $xoopsUserIsAdmin;
$myts =& MyTextSanitizer::getInstance();
$criteria = new CriteriaCompo();
if ( !empty($HTTP_POST_VARS['user_uname']) ) {
$match = (!empty($HTTP_POST_VARS['user_uname_match'])) ? intval($HTTP_POST_VARS['user_uname_match']) : XOOPS_MATCH_START;
switch ( $match ) {
case XOOPS_MATCH_START:
$criteria->add(new Criteria('uname', $myts->addSlashes(trim($HTTP_POST_VARS['user_uname'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_END:
$criteria->add(new Criteria('uname', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_uname'])), 'LIKE'));
break;
case XOOPS_MATCH_EQUAL:
$criteria->add(new Criteria('uname', $myts->addSlashes(trim($HTTP_POST_VARS['user_uname']))));
break;
case XOOPS_MATCH_CONTAIN:
$criteria->add(new Criteria('uname', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_uname'])).'%', 'LIKE'));
break;
}
}
if ( !empty($HTTP_POST_VARS['user_name']) ) {
$match = (!empty($HTTP_POST_VARS['user_name_match'])) ? intval($HTTP_POST_VARS['user_name_match']) : XOOPS_MATCH_START;
switch ($match) {
case XOOPS_MATCH_START:
$criteria->add(new Criteria('name', $myts->addSlashes(trim($HTTP_POST_VARS['user_name'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_END:
$criteria->add(new Criteria('name', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_name'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_EQUAL:
$criteria->add(new Criteria('name', $myts->addSlashes(trim($HTTP_POST_VARS['user_name']))));
break;
case XOOPS_MATCH_CONTAIN:
$criteria->add(new Criteria('name', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_name'])).'%', 'LIKE'));
break;
}
}
if ( !empty($HTTP_POST_VARS['user_email']) ) {
$match = (!empty($HTTP_POST_VARS['user_email_match'])) ? intval($HTTP_POST_VARS['user_email_match']) : XOOPS_MATCH_START;
switch ($match) {
case XOOPS_MATCH_START:
$criteria->add(new Criteria('email', $myts->addSlashes(trim($HTTP_POST_VARS['user_email'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_END:
$criteria->add(new Criteria('email', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_email'])), 'LIKE'));
break;
case XOOPS_MATCH_EQUAL:
$criteria->add(new Criteria('email', $myts->addSlashes(trim($HTTP_POST_VARS['user_email']))));
break;
case XOOPS_MATCH_CONTAIN:
$criteria->add(new Criteria('email', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_email'])).'%', 'LIKE'));
break;
}
if ( !$iamadmin ) {
$criteria->add(new Criteria('user_viewemail', 1));
}
}
if ( !empty($HTTP_POST_VARS['user_url']) ) {
$url = formatURL(trim($HTTP_POST_VARS['user_url']));
$criteria->add(new Criteria('url', $myts->addSlashes($url).'%', 'LIKE'));
}
if ( !empty($HTTP_POST_VARS['user_icq']) ) {
$match = (!empty($HTTP_POST_VARS['user_icq_match'])) ? intval($HTTP_POST_VARS['user_icq_match']) : XOOPS_MATCH_START;
switch ($match) {
case XOOPS_MATCH_START:
$criteria->add(new Criteria('user_icq', $myts->addSlashes(trim($HTTP_POST_VARS['user_icq'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_END:
$criteria->add(new Criteria('user_icq', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_icq'])), 'LIKE'));
break;
case XOOPS_MATCH_EQUAL:
$criteria->add(new Criteria('user_icq', $myts->addSlashes(trim($HTTP_POST_VARS['user_icq']))));
break;
case XOOPS_MATCH_CONTAIN:
$criteria->add(new Criteria('user_icq', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_icq'])).'%', 'LIKE'));
break;
}
}
if ( !empty($HTTP_POST_VARS['user_aim']) ) {
$match = (!empty($HTTP_POST_VARS['user_aim_match'])) ? intval($HTTP_POST_VARS['user_aim_match']) : XOOPS_MATCH_START;
switch ($match) {
case XOOPS_MATCH_START:
$criteria->add(new Criteria('user_aim', $myts->addSlashes(trim($HTTP_POST_VARS['user_aim'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_END:
$criteria->add(new Criteria('user_aim', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_aim'])), 'LIKE'));
break;
case XOOPS_MATCH_EQUAL:
$criteria->add(new Criteria('user_aim', $myts->addSlashes(trim($HTTP_POST_VARS['user_aim']))));
break;
case XOOPS_MATCH_CONTAIN:
$criteria->add(new Criteria('user_aim', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_aim'])).'%', 'LIKE'));
break;
}
}
if ( !empty($HTTP_POST_VARS['user_yim']) ) {
$match = (!empty($HTTP_POST_VARS['user_yim_match'])) ? intval($HTTP_POST_VARS['user_yim_match']) : XOOPS_MATCH_START;
switch ($match) {
case XOOPS_MATCH_START:
$criteria->add(new Criteria('user_yim', $myts->addSlashes(trim($HTTP_POST_VARS['user_yim'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_END:
$criteria->add(new Criteria('user_yim', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_yim'])), 'LIKE'));
break;
case XOOPS_MATCH_EQUAL:
$criteria->add(new Criteria('user_yim', $myts->addSlashes(trim($HTTP_POST_VARS['user_yim']))));
break;
case XOOPS_MATCH_CONTAIN:
$criteria->add(new Criteria('user_yim', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_yim'])).'%', 'LIKE'));
break;
}
}
if ( !empty($HTTP_POST_VARS['user_msnm']) ) {
$match = (!empty($HTTP_POST_VARS['user_msnm_match'])) ? intval($HTTP_POST_VARS['user_msnm_match']) : XOOPS_MATCH_START;
switch ($match) {
case XOOPS_MATCH_START:
$criteria->add(new Criteria('user_msnm', $myts->addSlashes(trim($HTTP_POST_VARS['user_msnm'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_END:
$criteria->add(new Criteria('user_msnm', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_msnm'])), 'LIKE'));
break;
case XOOPS_MATCH_EQUAL:
$criteria->add(new Criteria('user_msnm', $myts->addSlashes(trim($HTTP_POST_VARS['user_msnm']))));
break;
case XOOPS_MATCH_CONTAIN:
$criteria->add(new Criteria('user_msnm', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_msnm'])).'%', 'LIKE'));
break;
}
}
if ( !empty($HTTP_POST_VARS['bio']) ) {
$match = (!empty($HTTP_POST_VARS['bio'])) ? intval($HTTP_POST_VARS['bio_match']) : XOOPS_MATCH_START;
switch ($match) {
case XOOPS_MATCH_START:
$criteria->add(new Criteria('bio', $myts->addSlashes(trim($HTTP_POST_VARS['bio'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_END:
$criteria->add(new Criteria('bio', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['bio'])), 'LIKE'));
break;
case XOOPS_MATCH_EQUAL:
$criteria->add(new Criteria('bio', $myts->addSlashes(trim($HTTP_POST_VARS['bio']))));
break;
case XOOPS_MATCH_CONTAIN:
$criteria->add(new Criteria('bio', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['bio'])).'%', 'LIKE'));
break;
}
}
if ( !empty($HTTP_POST_VARS['user_from']) ) {
$criteria->add(new Criteria('user_from', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_from'])).'%', 'LIKE'));
}
if ( !empty($HTTP_POST_VARS['user_intrest']) ) {
$criteria->add(new Criteria('user_intrest', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_intrest'])).'%', 'LIKE'));
}
if ( !empty($HTTP_POST_VARS['user_occ']) ) {
$criteria->add(new Criteria('user_occ', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_occ'])).'%', 'LIKE'));
}
if ( !empty($HTTP_POST_VARS['user_lastlog_more']) && is_numeric($HTTP_POST_VARS['user_lastlog_more']) ) {
$f_user_lastlog_more = intval(trim($HTTP_POST_VARS['user_lastlog_more']));
$time = time() - (60 * 60 * 24 * $f_user_lastlog_more);
if ( $time > 0 ) {
$criteria->add(new Criteria('last_login', $time, '<'));
}
}
if ( !empty($HTTP_POST_VARS['user_lastlog_less']) && is_numeric($HTTP_POST_VARS['user_lastlog_less']) ) {
$f_user_lastlog_less = intval(trim($HTTP_POST_VARS['user_lastlog_less']));
$time = time() - (60 * 60 * 24 * $f_user_lastlog_less);
if ( $time > 0 ) {
$criteria->add(new Criteria('last_login', $time, '>'));
}
}
if ( !empty($HTTP_POST_VARS['user_reg_more']) && is_numeric($HTTP_POST_VARS['user_reg_more']) ) {
$f_user_reg_more = intval(trim($HTTP_POST_VARS['user_reg_more']));
$time = time() - (60 * 60 * 24 * $f_user_reg_more);
if ( $time > 0 ) {
$criteria->add(new Criteria('user_regdate', $time, '<'));
}
}
if ( !empty($HTTP_POST_VARS['user_reg_less']) && is_numeric($HTTP_POST_VARS['user_reg_less']) ) {
$f_user_reg_less = intval($HTTP_POST_VARS['user_reg_less']);
$time = time() - (60 * 60 * 24 * $f_user_reg_less);
if ( $time > 0 ) {
$criteria->add(new Criteria('user_regdate', $time, '>'));
}
}
if ( isset($HTTP_POST_VARS['user_posts_more']) && is_numeric($HTTP_POST_VARS['user_posts_more']) ) {
$criteria->add(new Criteria('posts', intval($HTTP_POST_VARS['user_posts_more']), '>'));
}
if ( !empty($HTTP_POST_VARS['user_posts_less']) && is_numeric($HTTP_POST_VARS['user_posts_less']) ) {
$criteria->add(new Criteria('posts', intval($HTTP_POST_VARS['user_posts_less']), '<'));
}
$criteria->add(new Criteria('level', 0, '>'));
$validsort = array("uname", "email", "last_login", "user_regdate", "posts");
$sort = (!in_array($HTTP_POST_VARS['user_sort'], $validsort)) ? "uname" : $HTTP_POST_VARS['user_sort'];
$order = "ASC";
if ( isset($HTTP_POST_VARS['user_order']) && $HTTP_POST_VARS['user_order'] == "DESC") {
$order = "DESC";
}
$limit = (!empty($HTTP_POST_VARS['limit'])) ? intval($HTTP_POST_VARS['limit']) : 20;
if ( $limit == 0 || $limit > 50 ) {
$limit = 50;
}
$start = (!empty($HTTP_POST_VARS['start'])) ? intval($HTTP_POST_VARS['start']) : 0;
$member_handler =& xoops_gethandler('member');
$total = $member_handler->getUserCount($criteria);
$xoopsTpl->assign('lang_search', _MM_SEARCH);
$xoopsTpl->assign('lang_results', _MM_RESULTS);
$xoopsTpl->assign('total_found', $total);
if ( $total == 0 ) {
$xoopsTpl->assign('lang_nonefound', _MM_NOFOUND);
} elseif ( $start < $total ) {
$xoopsTpl->assign('lang_username', _MM_UNAME);
$xoopsTpl->assign('lang_realname', _MM_REALNAME);
$xoopsTpl->assign('lang_avatar', _MM_AVATAR);
$xoopsTpl->assign('lang_email', _MM_EMAIL);
$xoopsTpl->assign('lang_bio', _MM_BIO);
$xoopsTpl->assign('lang_privmsg', _MM_PM);
$xoopsTpl->assign('lang_regdate', _MM_REGDATE);
$xoopsTpl->assign('lang_lastlogin', _MM_LASTLOGIN);
$xoopsTpl->assign('lang_posts', _MM_POSTS);
$xoopsTpl->assign('lang_url', _MM_URL);
$xoopsTpl->assign('lang_admin', _MM_ADMIN);
if ( $iamadmin ) {
$xoopsTpl->assign('is_admin', true);
}
$criteria->setSort($sort);
$criteria->setOrder($order);
$criteria->setStart($start);
$criteria->setLimit($limit);
$foundusers =& $member_handler->getUsers($criteria, true);
foreach (array_keys($foundusers) as $j) {
$userdata['avatar'] = $foundusers[$j]->getVar("user_avatar") ? "<img src='".XOOPS_UPLOAD_URL."/".$foundusers[$j]->getVar("user_avatar")."' alt='' />" : " ";
$userdata['realname'] = $foundusers[$j]->getVar("name") ? $foundusers[$j]->getVar("name") : " ";
$userdata['name'] = $foundusers[$j]->getVar("uname");
$userdata['bio'] = $foundusers[$j]->getVar("bio");
$userdata['id'] = $foundusers[$j]->getVar("uid");
if ( $foundusers[$j]->getVar("user_viewemail") == 1 || $iamadmin ) {
$userdata['email'] = "<a href='mailto:".$foundusers[$j]->getVar("email")."'><img src='".XOOPS_URL."/images/icons/email.gif' border='0' alt='".sprintf(_SENDEMAILTO,$foundusers[$j]->getVar("uname", "E"))."' /></a>";
} else {
$userdata['email'] = " ";
}
if ( $xoopsUser ) {
$userdata['pmlink'] = "<a href='javascript:openWithSelfMain("".XOOPS_URL."/pmlite.php?send2=1&to_userid=".$foundusers[$j]->getVar("uid")."","pmlite",450,370);'><img src='".XOOPS_URL."/images/icons/pm.gif' border='0' alt='".sprintf(_SENDPMTO,$foundusers[$j]->getVar("uname", "E"))."' /></a>";
} else {
$userdata['pmlink'] = " ";
}
if ( $foundusers[$j]->getVar("url","E") != "" ) {
$userdata['website'] = "<a href='".$foundusers[$j]->getVar("url","E")."' target='_blank'><img src='".XOOPS_URL."/images/icons/www.gif' border='0' alt='"._VISITWEBSITE."' /></a>";
} else {
$userdata['website'] = " ";
}
$userdata['registerdate'] = formatTimeStamp($foundusers[$j]->getVar("user_regdate"),"s");
if ( $foundusers[$j]->getVar("last_login") != 0 ) {
$userdata['lastlogin'] = formatTimeStamp($foundusers[$j]->getVar("last_login"),"m");
} else {
$userdata['lastlogin'] = " ";
}
$userdata['posts'] = $foundusers[$j]->getVar("posts");
if ( $iamadmin ) {
$userdata['adminlink'] = "<a href='".XOOPS_URL."/modules/system/admin.php?fct=users&uid=".$foundusers[$j]->getVar("uid")."&op=modifyUser'>"._EDIT."</a> | <a href='".XOOPS_URL."/modules/system/admin.php?fct=users&op=delUser&uid=".$foundusers[$j]->getVar("uid")."'>"._DELETE."</a>";
}
$xoopsTpl->append('users', $userdata);
}
$totalpages = ceil($total / $limit);
if ( $totalpages > 1 ) {
$hiddenform = "<form name='findnext' action='index.php' method='post'>";
foreach ( $HTTP_POST_VARS as $k => $v ) {
$hiddenform .= "<input type='hidden' name='".$myts->oopsHtmlSpecialChars($k)."' value='".$myts->makeTboxData4PreviewInForm($v)."' />n";
}
if (!isset($HTTP_POST_VARS['limit'])) {
$hiddenform .= "<input type='hidden' name='limit' value='".$limit."' />n";
}
if (!isset($HTTP_POST_VARS['start'])) {
$hiddenform .= "<input type='hidden' name='start' value='".$start."' />n";
}
$prev = $start - $limit;
if ( $start - $limit >= 0 ) {
$hiddenform .= "<a href='#0' onclick='javascript:document.findnext.start.value=".$prev.";document.findnext.submit();'>"._MM_PREVIOUS."</a> n";
}
$counter = 1;
$currentpage = ($start+$limit) / $limit;
while ( $counter <= $totalpages ) {
if ( $counter == $currentpage ) {
$hiddenform .= "<b>".$counter."</b> ";
} elseif ( ($counter > $currentpage-4 && $counter < $currentpage+4) || $counter == 1 || $counter == $totalpages ) {
if ( $counter == $totalpages && $currentpage < $totalpages-4 ) {
$hiddenform .= "... ";
}
$hiddenform .= "<a href='#".$counter."' onclick='javascript:document.findnext.start.value=".($counter-1)*$limit.";document.findnext.submit();'>".$counter."</a> ";
if ( $counter == 1 && $currentpage > 5 ) {
$hiddenform .= "... ";
}
}
$counter++;
}
$next = $start+$limit;
if ( $total > $next ) {
$hiddenform .= " <a href='#".$total."' onclick='javascript:document.findnext.start.value=".$next.";document.findnext.submit();'>"._MM_NEXT."</a>n";
}
$hiddenform .= "</form>";
$xoopsTpl->assign('pagenav', $hiddenform);
$xoopsTpl->assign('lang_numfound', sprintf(_MM_USERSFOUND, $total));
}
}
}
include_once XOOPS_ROOT_PATH."/footer.php";
?>
Posté le : 16/12/2005 12:48
|
|
|
Re: modification de xoopsmembers |
|
Régulier
Inscrit: 16/04/2004 12:12
|
alors pour l'instant j'essaye de mettre ca au debut :
$op = "submit";
plus loin :
if ( $op == "submit" ) {
$xoopsOption['template_main'] = 'xoopsmembers_searchresults.html';
include XOOPS_ROOT_PATH."/header.php";
$iamadmin = $xoopsUserIsAdmin;
$myts =& MyTextSanitizer::getInstance();
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('bio', 'site1', 'LIKE'));
$criteria->add(new Criteria('level', 0, '>'));
j'essaye d'utiliser la fonction "new criteria" avec :
$criteria->add(new Criteria('bio', 'site1', 'LIKE'));
mais je doit mal l'utilisé car je n'est aucun membre en résultat je voudrait en clair que l'élement bio ( commentaire ... ) contienne "site1" mais la je bloque si quelqu'un à une idée ?? @++ Ayou42
Posté le : 16/12/2005 09:30
|
|
|
Re: modification de xoopsmembers |
|
Régulier
Inscrit: 16/04/2004 12:12
|
bon ben je doit etre mal réveillé mais je ne trouve pas dans mon index.php de xoopsmembers la section
min = $pagesize * ($page - 1);
$max = $pagesize;
$count = "SELECT COUNT(uid) AS total FROM ".$xoopsDB->prefix("users")." "; // Count all the users in the db..
$select = "SELECT uid, name, uname, email, url, user_avatar, user_regdate, user_icq, user_from, user_aim, user_yim, user_msnm, user_viewemail, last_login FROM ".$xoopsDB->prefix("users")." ";
if ( ( $letter != _ML_OTHER ) AND ( $letter != _ML_ALL ) ) {
$where = "WHERE level>0 AND uname LIKE '".$letter."%' AND user_from="site1" ";
} else if ( ( $letter == _ML_OTHER ) AND ( $letter != _ML_ALL ) ) {
$where = "WHERE level>0 AND uname REGEXP '^[1-9]' AND user_from="site1" ";
} else {
$where = "WHERE level>0 AND user_from="site1" ";
}
$sort = "order by $sortby $orderby";
je n'est pas du tout la meme structure de plus lorsque je clique sur l'index.php j'arrive de base sur sur un formulaire ou je peut définir des critères de choix merci quand meme pour ce debut d'aide blueteen je vais essayer de me replonger dans la xoopsses pour voir si ce matin je suis plus inspiré si quelqu'un à une idée... @++ Ayou42
Posté le : 16/12/2005 09:01
|
|
|