Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules
Author Message
vaudevillian
Worker
Worker



Joined: Jan 18, 2008
Posts: 143

PostPosted: Sat Jan 03, 2009 11:01 am Reply with quote

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. Wink
 
View user's profile Send private message Send e-mail
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Jan 03, 2009 11:32 am Reply with quote

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. 
View user's profile Send private message
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Sat Jan 03, 2009 12:56 pm Reply with quote

There's a Sticky here to help convert older modules and blocks.

http://www.ravenphpscripts.com/posts16627-highlight-dbi.html
 
View user's profile Send private message
vaudevillian







PostPosted: Sun Jan 04, 2009 11:28 am Reply with quote

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







PostPosted: Sun Jan 04, 2009 1:25 pm Reply with quote

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







PostPosted: Sun Jan 04, 2009 2:03 pm Reply with quote

ty jake
 
jestrella
Moderator



Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic

PostPosted: Sun Jan 04, 2009 3:51 pm Reply with quote

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 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©