361
McNaz
Re: The problem continues
  • 2004/12/16 12:51

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


I'd suggest trying to switch PHP Debug on. But if you can't login then thats a problem. Try accessing the admin section viahttp://yourdomain.com/modules/system/admin.php or login viahttp://yourdomain.com/user.php

If the above two fail then a more drastic solution is required: setting debug on from php.ini... hacking the common.php file etc...

Without knowing what the PHP error message is, its very difficult to pin down what is the cause of your problem.


Another though, check out XOOPS FAQ HERE for more solutions.

Cheers.

McNaz.



362
McNaz
Re: Any software programmers here (windows)???
  • 2004/12/13 7:42

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Doing a little app that lives in the icon tray area of the screen that looks for a set idle time then does a post to a webpage shouldn't be a big problem.

I have 10 years Delphi experience and should be able to build this little app for you in a couple of days. Please PM me if interested with details and any rates you had in mind.

Cheers.

McNaz.



363
McNaz
Re: Feature Requests : My 2 Cents
  • 2004/12/10 9:39

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Quote:

ewonline wrote:
I intend to do both (Improve Performance + Warn of XOOPS Slowness)

There is simply no getting around it, XOOPS isnt that fast.
Prove me wrong?
Stick a page gen time on xoops.org!


Sheesh! Who let the frakking troll in?

ewonline, Members of this community have gone out of their way to be kind and respond in detail to your problems and also do so when yo started your childish whining.

My advice to you: get lost and grow up. If you don't like XOOPS then I recommend you go for PHP-Nuke and go whine on their forums.



364
McNaz
Re:Xoops Hosting Forum Launched
  • 2004/11/10 7:15

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


I'll have to plug Pantherhost. We offer competitive hosting plans and also do XOOPS modding and installations on request.

Drop by and check us out



365
McNaz
Re: Form Validation
  • 2004/11/5 16:21

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Hi all again.

I've had some luck in integrating SmartyValidation into Xoops. What follows is a modified template.php file from the XOOPS class directory:

You can get SmartyValidation from here.

<?php
// $Id: template.php,v 1.20 2003/07/08 12:38:08 okazu Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  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 //
//  ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, https://xoops.org/, http://www.xoopscube.jp/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //

if (!defined('SMARTY_DIR')) {
    exit();
}
/**
 * Base class: Smarty template engine
 */
require_once SMARTY_DIR.'Smarty.class.php';
require_once 
SMARTY_DIR.'SmartyValidate.class.php';

/**
 * Template engine
 *
 * @package        kernel
 * @subpackage    core
 *
 * @author        Kazumi Ono     <onokazu@xoops.org>
 * @copyright    (c) 2000-2003 The XOOPS Project - www.xoops.org
 */
class XoopsTpl extends Smarty
{

    
/**
     * Allow update of template files from the themes/ directory?
     * This should be set to false on an active site to increase performance
     */
    
var $_canUpdateFromFile false;

    
/**
     * Constructor
     **/
    
function XoopsTpl()
    {
        global 
$xoopsConfig;
        
$this->Smarty();
        
$this->compile_id null;
        if (
$xoopsConfig['theme_fromfile'] == 1) {
            
$this->_canUpdateFromFile true;
            
$this->compile_check true;
        } else {
            
$this->_canUpdateFromFile false;
            
$this->compile_check false;
        }
        
$this->left_delimiter =  '<{';
        
$this->right_delimiter =  '}>';
        
$this->template_dir XOOPS_THEME_PATH;
        
$this->cache_dir XOOPS_CACHE_PATH;
        
$this->compile_dir XOOPS_COMPILE_PATH;
        
$this->plugins_dir = array(XOOPS_ROOT_PATH.'/class/smarty/plugins');
        
$this->default_template_handler_func 'xoops_template_create';
        
        
// Added by goghs on 11-26 to deal with safe mode
        //if (ini_get('safe_mode') == "1") {
            
$this->use_sub_dirs false;
        
//} else {
        //    $this->use_sub_dirs = true;
        //}
        // END

        
$this->assign(array('xoops_url' => XOOPS_URL'xoops_rootpath' => XOOPS_ROOT_PATH'xoops_langcode' => _LANGCODE'xoops_charset' => _CHARSET'xoops_version' => XOOPS_VERSION'xoops_upload_url' => XOOPS_UPLOAD_URL));
    }

    
/**
     * Set the directory for templates
     * 
     * @param   string  $dirname    Directory path without a trailing slash
     **/
    
function xoops_setTemplateDir($dirname)
    {
        
$this->template_dir $dirname;
    }

    
/**
     * Get the active template directory
     * 
     * @return  string
     **/
    
function xoops_getTemplateDir()
    {
        return 
$this->template_dir;
    }

    
/**
     * Set debugging mode
     * 
     * @param   boolean     $flag
     **/
    
function xoops_setDebugging($flag=false)
    {
        
$this->debugging is_bool($flag) ? $flag false;
    }

    
/**
     * Set caching
     * 
     * @param   integer     $num
     **/
    
function xoops_setCaching($num=0)
    {
        
$this->caching = (int)$num;
    }

    
/**
     * Set cache lifetime
     * 
     * @param   integer     $num    Cache lifetime
     **/
    
function xoops_setCacheTime($num=0)
    {
        
$num = (int)$num;
        if (
$num <= 0) {
            
$this->caching 0;
        } else {
            
$this->cache_lifetime $num;
        }
    }

    
/**
     * Set directory for compiled template files
     * 
     * @param   string  $dirname    Full directory path without a trailing slash
     **/
    
function xoops_setCompileDir($dirname)
    {
        
$this->compile_dir $dirname;
    }

    
/**
     * Set the directory for cached template files
     * 
     * @param   string  $dirname    Full directory path without a trailing slash
     **/
    
function xoops_setCacheDir($dirname)
    {
        
$this->cache_dir $dirname;
    }

    
/**
     * Render output from template data
     * 
     * @param   string  $data
     * @return  string  Rendered output  
     **/
    
function xoops_fetchFromData(&$data)
    {
        
$dummyfile XOOPS_CACHE_PATH.'/dummy_'.time();
        
$fp fopen($dummyfile'w');
        
fwrite($fp$data);
        
fclose($fp);
        
$fetched $this->fetch('file:'.$dummyfile);
        
unlink($dummyfile);
        
$this->clear_compiled_tpl('file:'.$dummyfile);
        return 
$fetched;
    }

    
/**
     * 
     **/
    
function xoops_canUpdateFromFile()
    {
        return 
$this->_canUpdateFromFile;
    }
  
//
  
function validConnect()
  {
    
SmartyValidate::connect($this);   
  }
  
//
  
function validDisconnect()
  {
    
SmartyValidate::disconnect($this);
  }
  
//
  
function validate($post)
  {
    return 
SmartyValidate::is_valid($post);
  }
  
//
  
function redisplay($post)
  {
    
$this->assign($post);
    
//$this->display
  
}

}

/**
 * Smarty default template handler function
 * 
 * @param $resource_type
 * @param $resource_name
 * @param $template_source
 * @param $template_timestamp
 * @param $smarty_obj
 * @return  bool
 **/
function xoops_template_create ($resource_type$resource_name, &$template_source, &$template_timestamp, &$smarty_obj)
{
    if ( 
$resource_type == 'db' ) {
        
$file_handler =& xoops_gethandler('tplfile');
        
$tpl =& $file_handler->find('default'nullnullnull$resource_nametrue);
        if (
count($tpl) > && is_object($tpl[0])) {
            
$template_source $tpl[0]->getSource();
            
$template_timestamp $tpl[0]->getLastModified();
            return 
true;
        }
    } else {
    }
    return 
false;
}

/**
 * function to update compiled template file in templates_c folder
 * 
 * @param   string  $tpl_id
 * @param   boolean $clear_old
 * @return  boolean
 **/
function xoops_template_touch($tpl_id$clear_old true)
{
    
$tpl = new XoopsTpl();
    
$tpl->force_compile true;
    
$tplfile_handler =& xoops_gethandler('tplfile');
    
$tplfile =& $tplfile_handler->get($tpl_id);
    if ( 
is_object($tplfile) ) {
        
$file $tplfile->getVar('tpl_file');
        if (
$clear_old) {
            
$tpl->clear_cache('db:'.$file);
            
$tpl->clear_compiled_tpl('db:'.$file);
        }
        
$tpl->fetch('db:'.$file);
        return 
true;
    }
    return 
false;
}

/**
 * Clear the module cache
 * 
 * @param   int $mid    Module ID
 * @return 
 **/
function xoops_template_clear_module_cache($mid)
{
    
$block_arr =& XoopsBlock::getByModule($mid);
    
$count count($block_arr);
    if (
$count 0) {
        
$xoopsTpl = new XoopsTpl();    
        
$xoopsTpl->xoops_setCaching(2);
        for (
$i 0$i $count$i++) {
            if (
$block_arr[$i]->getVar('template') != '') {
                
$xoopsTpl->clear_cache('db:'.$block_arr[$i]->getVar('template'));
            }
        }
    }
}
?>



Usage code would be:

case 'showform':
  
//header include code
  
$xoopsOption['template_main'] = 'module_data_entry.html';
  
$xoopsTpl->calidConnect();
  
$xoopsTpl->assign('value',$somevalue);
  
//footer include code
  
break;

case 
'savedata'//comes in from a post from module_data_entry.html
  //header include code
  
$xoopsTpl->ValidConnect();
  if (
$xoopsTpl->validate($_POST)){
    
$xoopsTpl->validDisconnect();
    
redirect_header('index.php',3,'data saved';}
  else {
    
$xoopsTpl->assign($_POST); 
    
//footer include code}}
  
break;


Read the included README file in SmartyValidate for an example of the Smarty validation markup to have in the template file. Best of all, the validation is compiled into the template cache!!!

The XOOPS integration is still rough and is working great at the moment.

Cheers.

McNaz



366
McNaz
Form Validation
  • 2004/11/4 14:05

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Hi everyone.

I'm getting to the stage where my only issue with PHP and XOOPS is form validation. It is such a pain to do form validation in code so I've started looking into a possible solution.

One that did catch my attention is SmartyValidate. This works by adding validation in the html itself as Smarty markup.

More information can be found here. So an example html page would be :

<form method="POST" action="index.php">
    
    {
validate field="FullName" criteria="notEmpty" message="Full Name cannot be empty"}
    
Full Name: <input type="text" name="FullName">
    
    {
validate field="Date" criteria="isDate" message="Date is not valid"}
    
Date: <input type="text" name="Date">
    
    <
input type="submit">
    </
form>


The validation works by :

session_start();
    require(
'Smarty.class.php');
    require(
'SmartyValidate.class.php');
    
    
$smarty =& new Smarty;
    
    
// required initialization
    
SmartyValidate::connect($smarty);
    
    if(empty(
$_POST)) {
       
$smarty->display('form.tpl');
    } else {    
       
// validate after a POST
       
if(SmartyValidate::is_valid($_POST)) {
           
// no errors, done with SmartyValidate
           
SmartyValidate::disconnect();
           
$smarty->display('success.tpl');
       } else {
           
// error, redraw the form
           
$smarty->assign($_POST);
           
$smarty->display('form.tpl');
       }
    }


I know that $XoopsTpl is extended from the Smarty class so the above example code can be tweaked to work (in theory anyway). I've had a very brief play with this (30 mins) without any luck.

Another interesting website with a solution can be found here.

Personally I prefer the SartValidate solution but that would involve uploading the smarty plugin files and SmartyValidate into class/smarty. Although not difficult itself it can becomre tedious when updating several sites etc.

So the quaestion is: has anyone implemented a good validation scheme that is reusable? Is one planned for Xoops? Would anyone be interested if I attempted to integrate either of the above two solutions into Xoops? I know XoopsForms has simple required tags that can be added but that is as far as it goes :(

Thoughts, suggestions and ideas are most welcome.

Cheers.

McNaz.



367
McNaz
Re: PASSWORD DECODED
  • 2004/9/9 12:30

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Hi there.

AFAIK, passwords are stored in MD5 format in the DB. MD5 is a one way encoding system, which means that once something is encoded in MD5 it cannot be decoded. The way XOOPS works is by encoding a supplied password, MD5ing it and comoparing that with the MD5ed password in the database.

HTH.



368
McNaz
Re: Xoops Module Development and Hosting
  • 2004/8/27 5:39

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Is that 10 posts or more than 10 posts?

To be honest I have almost started a project or two at dev.xoops.org but decided that my modules didn't realy qualify as they were too specific to my needs.

The only one I've done a while ago was the UT2003 stats modules for XOOPS (wrapper code) but that was becoming a time consuming excerise to maintain so I had to bow out . I believe that one can still be seen on sourceforge.

As for the number of my posts... well, I'm more of a lurker than a poster

Lastly, thanks for the best wishes.

Cheers.



369
McNaz
Xoops Module Development and Hosting
  • 2004/8/26 16:59

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Hi all.

<shamelessplug>

Just wanted to drop in, say hi and plug my new website,http://panthersoftware.com. Before I continue I must apologise for the plug , but I am new at this.

Quick background info. I’ve been developing client/server apps for the last ten years and stumbled onto PHP about a year ago. Shortly after that I stumbled onto XOOPS and well…. Fell in love!!!...sighhh..

I’ve used XOOPS in a few personal websites and recently installed it at one of my client’s sites. After doing a few custom modules (helpdesk and LDAP phone book lookups) I couldn’t help but feel that I should offer my services as a XOOPS developer, XOOPS host etc..

So here I am. If anyone needs any custom module work doing then I’d hope you’d consider my services. Same goes for hosting.

Thanks for giving me the time to say hi and again, sorry for the plug .

PS. Love the work you do XOOPS team.

</shamelessplug>



370
McNaz
Re: Xoops Authentication Service hack
  • 2004/8/3 9:29

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Excellent piece of code!!

I have tested this and got it working using Exchange 5.5 as the LDAP server with the following mods:

1. ldap.php

Line 14 =
var $uid_attr "cn";


Line ~249
$searchid "uid=".$criteria->criteriaElements[0]->value;
ldap_search($ds,$this->base_dn,$searchid,Array($this->mail_attr,$this->name_attr,$this->sernum_attr,$this->office_attr,$this->location_attr,$this->surname_attr,$this->givenname_attr));

The "cn" and "uid" might be particular to the way our Exchange server was setup but these work for me very well.

Again, many thanks for sharing this with us and look forward to it being in an upcoming XOOPS update.

Cheers.

Naz.




TopTop
« 1 ... 34 35 36 (37)



Login

Who's Online

233 user(s) are online (159 user(s) are browsing Support Forums)


Members: 0


Guests: 233


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