81
iHackCode
Re: user insertion

something like this. i didnt test it though

$member_handler =& xoops_gethandler('member');
//User Object. our new user that we want to insert to xoops
$newuser =& $member_handler->createUser();

//Set some variables
$newuser->setVar('user_viewemail'$user_viewemailtrue);
$newuser->setVar('uname'$unametrue);                 //username
$newuser->setVar('email'$emailtrue);                 //email address
if ($url != '') {
   
$newuser->setVar('url'formatURL($url), true);       //url
}

$newuser->setVar('user_avatar''blank.gif'true);      //avatar

$newuser->setVar('pass'md5($pass), true);              //password

$newuser->setVar('timezone_offset'$timezone_offsettrue);   //timezone offset ex: -8
$newuser->setVar('user_regdate'time(), true);
$newuser->setVar('uorder'$xoopsConfig['com_order'], true);
$newuser->setVar('umode'$xoopsConfig['com_mode'], true);

// 1 is yes, 0 is no. (Receive occasional email notices...option)
$newuser->setVar('user_mailok'$user_mailoktrue);

//0 is for the user to activate
//1 is for automatic activation
//2 is for admin activation.
//but 0 and 2 need more code for it to work
$newuser->setVar('level'1true);

//Insert the user
if (!$member_handler->insertUser($newuser)) {
   echo 
_US_REGISTERNG//an error message if we cannot add the user.
   
exit();
}

$newid $newuser->getVar('uid');
//add our new user to the Users group, which is actually the number 2
if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS$newid)) {
   echo 
_US_REGISTERNG//a message to show that the user was registered succesfully
   
exit();
}


i believe you can also pass an array for the fields and an array for the values in that setVar( method . but i havent tried that before.
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧



82
iHackCode
Re: user insertion

the user also needs to be added to a group.

you should use the memberhandler to create a new user though.
ex: the register.php file.http://dev.xoofoo.org/xoopsphpxref/20182/nav.html?register.php.source.html#l166
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧



83
iHackCode
Re: Blank admin page due upgrade 'stuck'

was this the guide you used? (from the release notes)

Quote:

Upgrading from previous versions older than 2.5.0:
The upgrade scripts from older versions to 2.5.3 are not complete, however it won't affect your XOOPS site. The scripts will be improved in next release.

Following is an instruction for upgrading from XOOPS 2.4.5 to 2.5 provided by John Healy:
0. Verify the system requirements, in particular the version of PHP. Backup your XOOPS database and site directory. (There are several ways to do these actions, which are discussed elsewhere.) Turning your site off is optional.
Change the permissions on mainfile.php and /include/license.php to be writable, for example:
File Normal For upgrade
mainfile.php 400 700
/include/license.php 444 777
Get the correct update package from the SourceForge file repository.
1. In the upgrade package folder, move the "upgrade" folder inside the "htdocs" folder, if it's not already there. Remove the install folder from the "htdocs" folder, if it's there. Remove the mainfile.php file from the "htdocs" folder, if it's there.
If you've moved the xoops_data and xoops_lib folders outside your site's root directory, move these folders out of the "htdocs" folder in the upgrade package folder.
2. Delete the /modules/system directory on your current XOOPS site (to get rid of any old unnecessary files).
3. Overwrite the files in the XOOPS directory on your current XOOPS site with the content of "htdocs" folder of the upgrade package. (There are several ways to do this action, which are discussed elsewhere.)
As noted above, if relocated, overwrite the files in your current xoops_data and xoops_lib with the content of those in the upgrade package.
4. If you have Protector previously installed, open the "mainfile.php" file , and remove the Pre-check and Post-check lines (if they exist):
include XOOPS_TRUST_PATH.'/modules/protector/include/precheck.inc.php' ;
include XOOPS_TRUST_PATH.'/modules/protector/include/postcheck.inc.php' ;
5. At your site's address (URL), login as administrator. Access <your.site.url>/upgrade/ with a browser, and follow the instructions (and any for updating your XOOPS database). After all updates have been applied (green checkmarks), note the link in the Updater to update the "system" module, and do so.
6. Delete the "upgrade" folder from your site's "htdocs" directory.
7. Update (reload) other modules, especially "Profile", "PM", and "Protector," if necessary.
8. Change permissions on the files noted above back to their normal state.
9. Turn your site back on, if you turned it off earlier.
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧



84
iHackCode
Re: Good News from Mowaffaq

Good to know, thanks!
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧



85
iHackCode
Re: Good News from Mowaffaq

any new news on him?
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧



86
iHackCode
Re: theme name in custom block

i will have to try that one day
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧



87
iHackCode
Re: theme name in custom block

are smarty variables supported in those blocks?
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧



88
iHackCode
Re: "recent Posts" Block? I cant get it.

first download the xoops 2.5.1a package (the full package)

extract the files:
checksum.md5
checksum.php

upload those two files to the same directory as your index.php of your xoops installation. then goto the checksum.php with your browser.

edit:
page 7 on the xoops 2.5 installation guide talks about this a little too
https://xoops.org/modules/mediawiki/index.php/Installation_Guide
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧



89
iHackCode
Re: Registration / captcha problems

the lost password link, also send activation emails.

ex:
https://xoops.org/user.php#lost

there could be many reasons on why its not sending emails, what are your settings set at?
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧



90
iHackCode
Re: theme name in custom block

in a xoops custom php block try to do a


echo $xoopsConfig['theme_set'];

or

echo $GLOBALS['xoopsConfig']['theme_set'];

i think one of those should work.
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧




TopTop
« 1 ... 6 7 8 (9) 10 11 12 ... 93 »



Login

Who's Online

167 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 167


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