301
McNaz
Re: Getting the user IP Address
  • 2005/7/7 15:05

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


In php, the following function call will get your visitor's IP address.

$ipAddress getenv("REMOTE_ADDR");



302
McNaz
Re: shameless plug: sign my guestbook :-)
  • 2005/7/7 10:13

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Excellent!! Many congratulations to you Herko on this joyous day! Get ready for a long and awesome day!!



303
McNaz
Re: Criteria, SQL and using "is not null"
  • 2005/7/7 9:44

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


No... unless you want your numerics to be quoted. Numeric fields filter down (unquoted) to

$clause .= {$this->operator} $value";



304
McNaz
Re: Criteria, SQL and using "is not null"
  • 2005/7/7 9:00

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Hi Mith.

Here is the proposed modification to criteria.php class to support extar SQL syntax (ie

$crit =& new Criteria('column',null,'','','%s is not null');

should support "where column is not null" SQL clauses.


Original function render() in class Criteria (line 341) from the nightly 2.1 CVS
function render() {
        if ( 
strtoupper($this->operator) == 'IN' || strtoupper($this->operator) == "NOT IN") {
            
$value $this->value;
        } else {
            if ( 
'' === ($value trim($this->value)) ) {
                return 
'';
            }
            if ( (
substr($value01) != '`') && (substr($value, -1) != '`') ) {
                
$value "'".addslashes(stripslashes($value))."'";
                
//$value = "'".$value."'";
            
}
        }
        
$clause = (!empty($this->prefix) ? "{$this->prefix}." "") . $this->column;
        if ( !empty(
$this->function) ) {
            
$clause sprintf($this->function$clause);
        }
        
$clause .= {$this->operator} $value";
        return 
$clause;
    }


Modified

function render() {
        if ( 
strtoupper($this->operator) == 'IN' || strtoupper($this->operator) == "NOT IN") {
            
$value $this->value;
        } else {
            if ( 
'' === ($value trim($this->value)) ) { 
                
$value null
            }
            if ( (
substr($value01) != '`') && (substr($value, -1) != '`') && (!is_numeric($value)) ) {
                
$value "'".addslashes(stripslashes($value))."'";
                
//$value = "'".$value."'";
            
}
        }
        
$clause = (!empty($this->prefix) ? "{$this->prefix}." "") . $this->column;
        if ( !empty(
$this->function) ) {
            
$clause sprintf($this->function$clause);
        }
        if (isset(
$value)) {
          
$clause .= {$this->operator} $value";
        }
        return 
$clause;
}



305
McNaz
Re: Criteria, SQL and using "is not null"
  • 2005/7/5 14:13

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Thanks Mith.

I'll get the latest version of this file from the CVS and have a look at it. I'll post a marked up version after I've tested it.

Cheers.

McNaz.



306
McNaz
Re: Criteria, SQL and using "is not null"
  • 2005/7/5 12:26

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Quote:
uid column in users table cannot be null...


Its just an example.



307
McNaz
Criteria, SQL and using "is not null"
  • 2005/7/5 10:42

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Hi there.

I'm trying to use the Criteria class to construct a "is not null" condition in SQL but with little luck.

i.e

select from xoops_users where uid is not null


Doing the above using Criteria

$crit =& new Criteria('uid','0','','%s is not null');


produces

select from xoops_users where uid is not null 0


While

$crit =& new Criteria('uid','','','%s is not null');


produces

select from xoops_users where


because no value is specified in the Criteria constructor.

The only way I have managed to do this is by hacking the criteria.php XOOPS class to the following:

function render() {
        if ( 
is_numeric($this->value) || strtoupper($this->operator) == 'IN') {
            
$value $this->value;
        } else {
            if ( 
'' === ($value trim($this->value)) ) {
                
$value null;
            }
            if ( (
substr($value01) != '`') && (substr($value, -1) != '`') ) {
                
$value "'$value'";
            }
        }
        
$clause = (!empty($this->prefix) ? "{$this->prefix}." "") . $this->column;
        if ( !empty(
$this->function) ) {
            
$clause sprintf($this->function$clause);
        } else {
                
$clause .= {$this->operator} $value";
            }
            return 
$clause;
        }


Is this the only way of doing this? Am I missing something obvious? If not, can the above changes be incorporated into the core?

Cheers.

McNaz.



308
McNaz
Re: WF-Channel and Tables
  • 2005/7/5 8:33

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


This might be a CSS issue. Check if wf-channel has its own css file (maybe under the style folder if there is one). There might be a table style there (just guessing).



309
McNaz
Re: Creating a DHTML Menu with XOOPS?
  • 2005/7/1 12:34

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Quote:
as i did at my site www.smkbandaraya.com


Wow. I love the menu. My favourite is the popup seach and login poups. It does wonders to the actual layout of the site not having the left column dedicated to the user and mainmenu.

Excellent work.



310
McNaz
Re: Xoops Spyware?
  • 2005/6/30 9:47

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Quote:
Is like a spyware


Hardly. Spyware is software installed on your machine which monitors your surfing habits, installed software + anything else it wants to.

I can't see how looking up an RSS feed on the XOOPS admin pages amounts to spyware...

... anyway... is that you Mikhail?




TopTop
« 1 ... 28 29 30 (31) 32 33 34 ... 37 »



Login

Who's Online

133 user(s) are online (83 user(s) are browsing Support Forums)


Members: 1


Guests: 132


Bleekk,

more...

Donat-O-Meter

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

Latest GitHub Commits