21
TheFinni
Re: turn ON debug in guest mode?
  • 2007/1/27 20:01

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


I just want to make sure there are no errors in database queries, functions, or classes for when a guest browses the site. I want to get rid of all notices too for maximum performance. Sometimes these are affected when the user (guest) has no profile id...

I'm not planning on using this on a live server. Just on my local machine for testing purposes.

I tried to follow your instructions on allowing guests all system admin privileges and turning on debug...BUT I don't get the debug inline info showing.

Perhaps this info is hardcoded somewhere?

Thanks!



22
TheFinni
Re: Custom Function Req.
  • 2007/1/27 1:49

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


krewl,

Try this link:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=32938&forum=5

Cool BMX page you have created!



23
TheFinni
Re: Theme Changer, specify theme by URL
  • 2007/1/27 1:42

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


yes, it should be possible appending:

?xoops_theme_select=yourtheme

to the URL.



24
TheFinni
turn ON debug in guest mode?
  • 2007/1/27 1:39

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


How can one turn on debug mode when browsing as guest or anonymous?

I just need this during developement.

Thanks!



25
TheFinni
Re: Registration Extra fields?
  • 2007/1/22 19:44

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


I couldn't get any fields showing in the registration form either...So I had to try come up with a fix.

I'm using the PHP 4 adapted version found on xoobs.net

What I did to get the fields to work is the following:

In the modules/smartprofile/register.php assign() function it seemed like the "$tpl" var wasn't passed forward as "$xoopsTpl" (don't know the technical language).

So what I did in the function was simply to add "global $xoopsTpl;" and then change the $tpl->assign to $xoopsTpl->assign

The function now looks as following:

function assign($form$tpl) {
global 
$xoopsTpl;
    
$i 0;
    
$elements = array();
    foreach ( 
$form->getElements() as $ele ) {
        if (
is_a($ele,'XoopsFormElement')) {
            
$n = ($ele->getName() != "") ? $ele->getName() : $i;
            
$elements[$n]['name']      = $ele->getName();
            
$elements[$n]['caption']  = $ele->getCaption();
            
$elements[$n]['body']      = $ele->render();
            
$elements[$n]['hidden']      = $ele->isHidden();
            if (
$ele->getDescription() != '') {
                
$elements[$n]['description']  = $ele->getDescription();
            }
        }
        
$i++;
    }
    
$js $form->renderValidationJS();
    
$xoopsTpl->assign($form->getName(), array('title' => $form->getTitle(), 'name' => $form->getName(), 'action' => $form->getAction(),  'method' => $form->getMethod(), 'extra' => 'onsubmit="return xoopsFormValidate_'.$form->getName().'();"'.$form->getExtra(), 'javascript' => $js'elements' => $elements));
}


and now the fields are showing up properly in the registration form.



26
TheFinni
Re: CREATE TABLE IF NOT EXISTS on module install?
  • 2007/1/22 15:51

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Hey that's perfect!

I have used the onUpdate function before but wasn't aware of the onInstall feature. This will work out great as I have 4 tables that are shared.

Yeah, I just had realized the $modversion['tables'][1] was used for uninstall...

Thanks for the info and the direct links to the XOOPS dev site!



27
TheFinni
CREATE TABLE IF NOT EXISTS on module install?
  • 2007/1/22 15:07

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Why am I not able to use the "CREATE TABLE IF NOT EXISTS" in my MySQL file for a module installation?

The module installation stops saying I have: "You have an error in your SQL syntax". This same file is inserted properly using phpMyAdmin.

Another question of mine is why the $modversion['tables'][1] is needed in xoopsversion.php if the module install still installs every table that is within the MySQL install file?

The reason I would like to add a table depending on IF EXIST is that I have two modules that will share tables...but I want to be able to independently install each module without getting an installation errror from Xoops.

Any help would be greatly appreciated!



28
TheFinni
Re: xoopsform validation for select and tray
  • 2006/2/15 23:05

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Nevermind, I figured it out on my own. Here's what I did:

You can set a required field by:

$reg_form->setRequired($your_required_field);

For the state field I did:

$state_select = new XoopsFormSelect("State""entry_state"$set_state);
    
$state_select->addOption('''Please Select');
        while (list(
$zone_id$zone_name) = $xoopsDB->fetchRow($zones_query) ) {
             
$state_select->addOption($zone_id$zone_name);
        }

    
$reg_form->addElement($state_select);
    
$reg_form->setRequired($state_select);


and the password was slightly trickier. But I think it's worth to show the user in advance how many characters is required:
$pass_item1 = new XoopsFormPassword('''pass'1032'');
    
$pass_item2 = new XoopsFormLabel(''$xoopsModuleConfig['minpass'].' characters minimum');
    
$pass_tray = new XoopsFormElementTray(_PROFILE_MA_PASSWORD,' ','pass');
    
$pass_tray->addElement($pass_item1);
    
$pass_tray->addElement($pass_item2);
    
$reg_form->addElement($pass_tray);
    
$reg_form->setRequired($pass_tray);



29
TheFinni
xoopsform validation for select and tray
  • 2006/2/15 19:43

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Hello,
I have a couple of questions on xoopsform classes.

I'm in the process of editing the Extended Profiles registration form (with some hacks). I am adding the form elements manually instead through the Administration panel (this is required in my hack).

However I can't figure out how to make XoopsFormElementTray and XoopsFormSelect reuired items. I.e. included in the javascript validation.

For instance in XoopsFormText I would add the (,true); to make it required:
$reg_form->addElement(new XoopsFormText("First Name"'firstname'5080$firstname), true);


However how would I do it in a XoopsFormSelect?

I have:
$state_select = new XoopsFormSelect("State""entry_state"$set_state);
    
$state_select->addOption('''Please Select');
        while (list(
$zone_id$zone_name) = $xoopsDB->fetchRow($zones_query) ) {
             
$state_select->addOption($zone_id$zone_name);
        }

    
$reg_form->addElement($state_select);


I would also like to know how to make the XoopsFormElementTray required. For instance I would like to conver the password field:
$reg_form->addElement(new XoopsFormPassword(_PROFILE_MA_PASSWORD"pass"1032""), true);

so that I could display to the user how many characters are needed in the password:
$pass_tray = new XoopsFormElementTray(_PROFILE_MA_PASSWORD);
    
$pass_tray->addElement(new XoopsFormPassword(''"pass"1032""), true);
    
$pass_tray->addElement(new XoopsFormLabel(''$xoopsModuleConfig['minpass'].' characters minimum'));
    
$reg_form->addElement($pass_tray);


If anyone has an idea I would appreciate it. I am also looking at being able to add server-side validation for some of my fields.

Thank you!



30
TheFinni
Re: SSL??
  • 2006/1/23 17:18

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Hi,
Yes it's possible.

I have modified my mainfile.php as following:

//define('XOOPS_URL', 'http: //www.yourdomain.com');
// to the following
$port = $HTTP_SERVER_VARS['SERVER_PORT'];
if($port == "443"){
define('XOOPS_URL', 'https: //www.yourdomain.com');
} else {
define('XOOPS_URL', 'http: //www.yourdomain.com');
}

Furthermore, I have added these to mainfile.php either force https or normal http:

define('XOOPS_URL_SSL', 'https: //www.yourdomain.com');
define('XOOPS_URL_NON_SSL', 'http: //www.yourdomain.com');

and then you will need to add to the class/template.php file the above mentioned defines. Example:

//added: xoops_url_ssl and xoops_url_non_ssl
$this->assign(array('xoops_url' => XOOPS_URL, 'xoops_url_ssl' => XOOPS_URL_SSL, 'xoops_url_non_ssl' => XOOPS_URL_NON_SSL, 'xoops_rootpath' => XOOPS_ROOT_PATH, 'xoops_langcode' => _LANGCODE, 'xoops_charset' => _CHARSET, 'xoops_version' => XOOPS_VERSION, 'xoops_upload_url' => XOOPS_UPLOAD_URL));
}

In XOOPS 2.2.x it's class/theme.php in which you can edit like following:

function loadGlobalVars($loadConfig = true) {
global $xoopsConfig, $xoopsModule;
//added SSL and NONSSL to array below:
$this->tplEngine->assign(array('xoops_url' => XOOPS_URL, 'xoops_url_ssl' => XOOPS_URL_SSL, 'xoops_url_non_ssl' => XOOPS_URL_NON_SSL,
'xoops_rootpath' => XOOPS_ROOT_PATH,

Hope that helps

Now you can freely make the URL either http or https and images and such should all download securly.

Additonally, if you want to refer to links within the site you can always use : XOOPS_URL_NON_SSL or in Smarty:

<{$xoops_url_non_ssl}> OR <{$xoops_url_ssl}>

Hope that helps!




TopTop
« 1 2 (3) 4 5 6 7 »



Login

Who's Online

270 user(s) are online (82 user(s) are browsing Support Forums)


Members: 0


Guests: 270


more...

Donat-O-Meter

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

Latest GitHub Commits