61
mjoel
Re: Dummy block in Dummy module
  • 2018/3/24 5:30

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Maybe a new release of the new dummy module by trabis

just some suggestion to add

- dummy block with block template
- add two three pages..
- function add/edit delete
- able to find the pages through search.php
- submenus
- simple admin page

etc

it will be much easier for user



62
mjoel
Re: mysql_error - help with mysql query code in xoops
  • 2018/3/24 5:22

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Thank You Very Much Mamba for the long explanation



63
mjoel
mysql_error - help with mysql query code in xoops
  • 2018/3/24 1:08

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Hi

How do i correct this code below using XOOPS standard ?
what do i replace the mysql error with

sorry im a newbie in coding

$employee_id $xoopsDB->escape($_GET['id']);
$check$xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("employee")." WHERE id='$employee_id' ") or die(mysql_error());



64
mjoel
Re: TDMDownloads 1.65 RC 1
  • 2017/3/10 5:37

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


bump

how do i solved the problem above ?



65
mjoel
Re: Bulk user registration with xoops 2.5.8.1
  • 2017/3/3 1:47

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Thank you very much sir...it works perfectly

it will be more complete if it will check in the current db to prevent same username and email


<?php
/**
 * modified from script by christian@frxoops.org
 * Import users from a csv file into xoops 2.5.8
 *
 * Put this file and your users.cvs file in the root of your site
 * go to http://yoursite/import_users.php in your browser
 * click the button to rn the import
 *
 * Don't forget to DELETE it after you run it!
 */
/* Example users.csv file:
Bill;Barra;bill.barra@yahoo.com;changeme
Mark;Knopfler;mark@knopfler.com;changeme
Jim;Morrison;jim.morrison@gmail.com;changeme
Roger;Daltrey;roger@daltrey.com;changeme
*/
// assuming this is in the web root
include 'mainfile.php';
// make sure we run as a POST transaction, so database operations do not need "force"
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
    echo 
'<form action="" method="POST"><input type="submit" value="Click to import"></form>';
    exit();
}
$fichier 'users.csv'// data file as : first name(pseudo);last name;email;password
// remove line break on last record
/** @var XoopsMemberHandler $memberHandler */
$memberHandler xoops_getHandler('member');
if (
false === $memberHandler) die("Unable to create member handler");
$time time();
// Open file for read
if (file_exists($fichier))
    
$fp fopen("$fichier""r");
else{ 
// unknown file
    
echo "File not found !Import stopped.n";
    exit();
}
echo 
'<pre>Begin file import '.$fichier."n";
// import line by line
while (!feof($fp)) {
    
$ligne fgets($fp4096);
    if (
'' === trim($ligne)) {
        continue; 
// blank line
    
}
    
$liste explode(";"$ligne); // create array
    
foreach ($liste as $index => $value) {
        
$liste[$index] = trim($value);
    }
    
/** @var XoopsUser $user */
    
$user $memberHandler->createUser();
    
$user->setVar('uname'$liste[0]);
    
$user->setVar('name'$liste[1]);
    
$user->setVar('email'$liste[2]);
    
$user->setVar('pass'md5($liste[3]));
    
$user->setVar('user_regdate'$time);
    
$user->setVar('user_level'1); // activated
    
$user->setVar('user_viewemail'1);
    
$user->setVar('user_avatar''avatars/blank.gif');
    
$uid $memberHandler->insertUser($user);
    if (
false === $uid) {
        echo 
sprintf("Failed to insert user %s n"$liste[0]);
        echo 
"Importation stoppée.n</pre>";
        
fclose($fp);
        exit();
    }
    
$memberHandler->addUserToGroup(XOOPS_GROUP_USERS$uid);
    echo 
sprintf("Record %d - %s addedn"$uid$user->uname());
}
echo 
"Import finished successfully.n</pre>";
fclose($fp);



66
mjoel
Re: TDMDownloads 1.65 RC 1
  • 2017/3/3 1:20

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


hi im currestly testing upgrading my site in in localhost


XOOPS Version XOOPS 2.5.9-Beta2
PHP Version 5.6.25
mySQL Version 5.7.14
TDM Downloads 1.65 Final

In admin
TDMDownloads/admin/downloads.php?op=new_downloads

i can only see two buttons download list and waiting for validation button..and the rest is white page..turning on debug i received this error


Unknowncall_user_func() expects parameter 1 to be a valid callbacknon-static method DefacerCorePreload::eventSystemClassGuiHeader() should not be called statically in file /class/preload.php line 139
Unknown
Non-static method DefacerCorePreload::eventCoreHeaderAddmeta() should not be called statically in file /modules/defacer/preloads/core.php line 85
Unknown
Non-static method DefacerCorePreload::isActive() should not be called statically in file /modules/defacer/preloads/core.php line 60
Unknown
Only variables should be assigned by reference in file /modules/defacer/preloads/core.php line 196
Unknown
Non-static method DefacerCorePreload::isRedirectActive() should not be called statically in file /modules/defacer/preloads/core.php line 60
Unknown
Only variables should be assigned by reference in file /modules/defacer/class/defacer.php line 156
Unknown
Only variables should be assigned by reference in file /modules/defacer/class/defacer.php line 142
Unknown
Only variables should be assigned by reference in file /modules/defacer/class/defacer.php line 143
Unknown
Only variables should be assigned by reference in file /modules/mylinks/xoops_version.php line 119
Unknown
Only variables should be assigned by reference in file /modules/mylinks/xoops_version.php line 120
Unknown
Only variables should be assigned by reference in file /modules/mylinks/xoops_version.php line 121
Unknown
Only variables should be assigned by reference in file /modules/xoopstube/xoops_version.php line 193
Unknown
Only variables should be assigned by reference in file /modules/xoopstube/xoops_version.php line 194
Unknown
Only variables should be assigned by reference in file /modules/xoopstube/xoops_version.php line 199
Unknown
Only variables should be assigned by reference in file /modules/tag/admin/menu.php line 25
Unknown
Only variables should be assigned by reference in file /modules/tag/admin/menu.php line 26
Unknown
Only variables should be assigned by reference in file /modules/tag/admin/menu.php line 27
Unknown
Only variables should be assigned by reference in file /modules/xoopspoll/admin/menu.php line 39
Unknown
Only variables should be assigned by reference in file /modules/xoopspoll/admin/menu.php line 40
Unknown
Only variables should be assigned by reference in file /modules/xoopspoll/admin/menu.php line 41
Unknown
Only variables should be assigned by reference in file /modules/xforms/admin/menu.php line 30
Unknown
Only variables should be assigned by reference in file /modules/xforms/admin/menu.php line 31
Unknown
Only variables should be assigned by reference in file /modules/xforms/admin/menu.php line 32
Unknown
Only variables should be assigned by reference in file /modules/isearch/xoops_version.php line 95
Notice
: Use of undefined constant _PROFILE_MI_HOME assumed '_PROFILE_MI_HOME' in file /modules/profile/admin/menu.php line 42
Notice
: Use of undefined constant _PROFILE_MI_ABOUT assumed '_PROFILE_MI_ABOUT' in file /modules/profile/admin/menu.php line 66


i have disable all the modules above..but i still have blank page with two button with no error

in the deprecated i have this message XoopsFormTag is deprecated use TagFormTag instead.



67
mjoel
Re: Bulk user registration with xoops 2.5.8.1
  • 2017/3/2 7:33

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


nevermind the code from here workshttp://dev.xoops.org/modules/xfmod/project/showfiles.php?group_id=1061&release_id=786&dl=2160

import_users.php
<?php
// christian@frxoops.org - http://www.frxoops.org
// Import users from a csv file into xoops 2.0.x
// 26 january 2006 : add trim() for encrypt password

// variables
$bdd"x20132";
$host"localhost";
$user"root";
$pass"";
$fichier "users.csv"// data file as : first name(pseudo);last name;email;password    
// remove line break on last record

mysql_connect($host,$user,$pass) or die("Unable to connect Database");
mysql_select_db($bdd);

// Open file for read
if (file_exists($fichier))
    
$fp fopen("$fichier""r");
else{ 
// unknown file
    
echo "File not found !Import stopped.";
    exit();
}
echo 
'Begin file import '.$fichier.'';
// import line by line
while (!feof($fp)){
    
$ligne fgets($fp,4096);
    
$liste explode(";",$ligne); // create array 
    
$user $liste[0]; //first field 
    
$name $liste[1]; //second field
    
$email$liste[2];
    
$passmd5(trim($liste[3]));    


    
// Add user in xoops_users table
     
$query "insert into xoops_users  (uname, name, email, pass) VALUES ('$user', '$name','$email','$pass')";

     
     
$resultmysql_query($query);
     
$uid mysql_insert_id();
    
    
//Add user in group : users registered 
    
$numgroup ='2';
     
$query "INSERT INTO xoops_groups_users_link  (groupid, uid) VALUES('$numgroup', '$uid')";
     
$resultmysql_query($query);

     if (
mysql_error()){
      echo 
"Error in database : ".mysql_error();
      echo 
"Importation stoppée.";
      
fclose($fp);
      exit();
}else{
  echo 
"Record ".$uid." - ".$user." added ";
 }
}

echo 
"Import finished successfully.";

fclose($fp);



users.csv
Bill;Barra;bill.barra@yahoo.com;245AVB
Mark
;Knopfler;mark@knopfler.com;AVB245
Jim
;Morrison;jim.morrison@gmail.com;bngh123
Roger
;Daltrey;roger@daltrey.com;XXD23


edit db prefix and it works although it can be improved with adding other field such as user_regdate



68
mjoel
Bulk user registration with xoops 2.5.8.1
  • 2017/3/2 0:03

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Hi

I would like to setup an intranet site with 400 plus users

i found a script here
https://xoops.org/modules/newbb/viewtopic.php?post_id=222145#222145
but its not working

<?php 
// christian@frxoops.org - http://www.frxoops.org 
// Import users from a csv file into XOOPS 2.0.x 
// variables 
$db"test"
$host"localhost"
$user"root"
$pass""
$fichier "users.csv"// data file as : user name;real name;email;password    
// remove line break on last record 

mysql_connect($host,$user,$pass) or die("Unable to connect Database"); 
mysql_select_db($db); 

// Open file for read 
if (file_exists($fichier)) 
    
$fp fopen("$fichier""r"); 
else{ 
// unknown file 
    
echo "File not found !Import stopped."
    exit(); 

echo 
'Begin file import '.$fichier.''
// import line by line 
while (!feof($fp)){ 
    
$ligne fgets($fp,4096); 
    
$liste explode(";",$ligne); // create array  
    
$user $liste[0]; //first field  
    
$name $liste[1]; //second field 
    
$email$liste[2]; 
    
$passmd5($liste[3]);     


    
// Add user in xoops_users table 
     
$query "insert into x536_users  (uname, name, email, pass) VALUES ('$user', '$name','$email','$pass')";

      
     
$resultmysql_query($query); 
     
$uid mysql_insert_id(); 
     
    
//Add user in group : users registered  
    
$numgroup ='2'
     
$query "INSERT INTO x536_groups_users_link  (groupid, uid) VALUES('$numgroup', '$uid')";
     
$resultmysql_query($query); 

     if (
mysql_error()){ 
      echo 
"Error in database : ".mysql_error(); 
      echo 
"Importation stoppée."
      
fclose($fp); 
      exit(); 
}else{ 
  echo 
"Record ".$uid." - ".$user." added "
 } 


echo 
"Import finished successfully."

fclose($fp);




anyone can help me so i can add user manually and give them a default password and they will change themsel



69
mjoel
Re: mysql_real_escape_string XOOPS replacement ?
  • 2017/2/23 14:34

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Thank you geekwright..this is working for me

Quote:

geekwright wrote:
The BEST way is to do this:
$employee_id $xoopsDB->escape($_GET['id']);


That will continue to work no matter what the underlying database driver is in the future.

Quote:

mjoel wrote:
since mysql_real_escape_string is deprecated

if i have this code
$employee_id mysql_real_escape_string($_GET['id']);

what should i replace it with



70
mjoel
Re: http to https
  • 2017/2/23 14:31

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


if we dont have https://

arent we suppose can't access it..and receive the message can't find server ?

i notice all XOOPS site can be access using https://

but with no styling

example:
https://www.xoops.org/




TopTop
« 1 ... 4 5 6 (7) 8 9 10 ... 28 »



Login

Who's Online

259 user(s) are online (168 user(s) are browsing Support Forums)


Members: 0


Guests: 259


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits