1
Hi all!
I'm currently developing a "Country mod" for XOOPS. I changed some files, but it's not working anymore... I backed up the old files, and now my site is running again.
This mod should add the "Country:" element in the user details page and show the flag of the country. The part showing the flags is still "under developing"... I'm thinking on how to implement it.
The files I changed are (from the XOOPS root path):
/include/registerform.php
/language/*/user.php (* = english in my case)
/register.php
/userinfo.php
in
registerform.php I added:
Quote:
// Country Mod Begin //
$reg_form->addElement(new XoopsFormSelectCountry("Select your country...", "country", $country)
// Country Mod End //
after
Quote:
$reg_form->addElement(new XoopsFormSelectTimezone(_US_TIMEZONE, "timezone_offset", $tzselected));
and before
Quote:
//$reg_form->addElement($avatar_tray);
$reg_form->addElement(new XoopsFormPassword(_US_PASSWORD, "pass", 10, 20), true);
then in
user.php I put:
Quote:
define('_US_NOCOUNTRY',"You haven't chosen a country."); // Country Mod
where it's written
Quote:
//%%%%%% File Name register.php %%%%%
then I added
Quote:
define('_US_COUNTRY','Country'); // Country Mod
in the userinfo.php "section".
Then in
register.php I put:
Quote:
// Country Mod Begin
if ( !isset($country) || $country == '' ) {
$stop .= _US_NOCOUNTRY."<br />";
}
// Country Mod End
at line 116, then at line 142 I put
Quote:
$country = trim($country); // Country Mod
$stop = userCheck($uname, $email, $pass, $vpass, $country); // Country Mod
then at line 158 I added
Quote:
// Country Mod
echo _US_COUNTRY.":<select name='country'>
<option value='".$country."' selected>".$country."</option>
<option value=''>----------------</option></select>";
and then at line 381:
Quote:
$country=trim($country);
$stop = userCheck($uname, $email, $pass, $vpass, $country);
and finally in
userinfo.php, at line 104:
Quote:
// Country Mod Begin //
$xoopsTpl->assign('lang_country', _US_COUNTRY);
$xoopsTpl->assign('user_country', $thisUser->getVar('country')); (don't know how this getVar() works...)
// Country Mod End //
All the modded files are available for download
here.
I already said that the flags section is still to do. At the moment, loading these files, at register.php I get a blank page. If I restore the old files everything works perfectly... Do I need to edit something else? Have I done something wrong? Please help me if you can...
Thank you.
P.S.: I hope not to have been too confusionary...