Author |
Message |
vaudevillian
Worker


Joined: Jan 18, 2008
Posts: 143
|
Posted:
Sat Jan 03, 2009 11:01 am |
|
I am looking at a module that said it worked with 2.1 ravennuke. But I thought I reead somewhere in here about a db structure change.
In the module here is the global db calls
Code:
global $module_name, $admin, $admin_file, $user, $userinfo, $name;
|
But from what I can see is that user changed to username. Is that correct?
The module I speak of is Nuke Address Book 2.0.0 by Paul Brennan
I also was wondering if there is a db structure change can I get a list of the values that were changed then I dont need to ask this question ever again.  |
|
|
|
 |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Sat Jan 03, 2009 11:32 am |
|
What you posted has nothing to do with the db. They are just global variables. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
 |
jakec
Site Admin

Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom
|
Posted:
Sat Jan 03, 2009 12:56 pm |
|
|
|
 |
vaudevillian

|
Posted:
Sun Jan 04, 2009 11:28 am |
|
Ok I switched everything over in the module But I got a litte confused about something.
Old code
Code:
$result = sql_query("select company,role,area,city,state,country,author,access from ".$prefix."_address_book where author='$userinfo[0]' OR access='public'", $dbi);
|
new code
Code:
$result = $db->sql_query("select company,role,area,city,state,country,author,access from ".$prefix."_address_book where author='$userinfo[0]' OR access='public'", $db);
|
My question lays at the end of the statment.
Palbin said:
sql_query($sql,$dbi) to $db->sql_query($sql)
In my code there is no $sql at the end of the statment and only a $db, do I remove the $db and leave it or do I change it to $sql? |
|
|
|
 |
jakec

|
Posted:
Sun Jan 04, 2009 1:25 pm |
|
You should remove the $db because it is at the start of your query.
The $sql is just an example the variable might be called something else. |
|
|
|
 |
vaudevillian

|
Posted:
Sun Jan 04, 2009 2:03 pm |
|
|
|
 |
jestrella
Moderator

Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic
|
Posted:
Sun Jan 04, 2009 3:51 pm |
|
vaudevillian wrote: | In the module here is the global db calls
Code:
global $module_name, $admin, $admin_file, $user, $userinfo, $name;
|
But from what I can see is that user changed to username. Is that correct?
|
This global variable is set to identify whether the user have login or not. For example is_user($user) determines if the user have login to the system. cookie_decode($user) get some basic info about the user. |
_________________ "For those whom have not reach the sky... Every mountain seems high"
Best Regards
Jonathan Estrella
http://about.me/jestrella04 |
|
|
 |
|