Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues
Author Message
jaded
Theme Guru



Joined: Nov 01, 2003
Posts: 1006

PostPosted: Sun Feb 08, 2009 3:13 pm Reply with quote

I upgraded a website that was running nuke 7.0 to RN 2.3.

There are a few errors with addon modules.

Your help would be greatly appreciated. Razz


This is the Profiles module with can be seen working on my website here, http://www.jaded-designs.com/modules.php?name=Profiles

This module is very important to this woman's website and I would like to get it functional without errors again.

Code:


Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home2/***/public_html/modules/Profiles/index.php on line 479



Code:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home2/****/public_html/modules/Profiles/index.php on line 215



Here are lines 454-481 of the modules/Profiles/index.php file

Code:
#########################################################

# Submit Review                                         #
#########################################################
 function submit_proview($username, $comment, $rank, $rpid, $id) {
    global $prefix, $dbi, $username, $rank, $comment;
   
     $date = date("m-d-Y h:i a");
    
    mysql_query("insert into ".$prefix."_tri_proview values ('$id','$username','$rank','$comment','$date','delkey')", $dbi);
   
   header("Location: modules.php?name=Profiles&id=$id");
    }
   
   
   
    switch($op) {

    default:
    index($prid);
   break;
   
   case "submit_proview":
    submit_proview($username, $comment, $rank, $rpid, $id);
    break;
}
mysql_close($dbi);
include("footer.php");
?>



Here are lines 211-220

Code:
   $limitvalue = $page * $limit - ($limit); 

    $sql2  = "SELECT * FROM ".$prefix."_tri_profiles where category='$cid' ORDER by common LIMIT $limitvalue, $limit";         
    $query2 = mysql_query($sql2) or die("Error: " . mysql_error());

    if(mysql_num_rows($result) == 0){
        echo("Nothing to Display!");
    }

              //$sql2="select * from ".$prefix."_tri_profiles where category='$cid' ORDER BY common";
       //$query2 = mysql_query($sql2);

_________________
Themes BB Skins
http://www.jaded-designs.com
Graphic Tees
http://www.cafepress.com/jadeddesigns
Paranormal Tees
http://www.cafepress.com/HauntedTees
Ghost Stories & More
http://www.hauntingtales.net

Last edited by jaded on Sun Feb 08, 2009 4:37 pm; edited 1 time in total 
View user's profile Send private message Visit poster's website
Palbin
Site Admin



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

PostPosted: Sun Feb 08, 2009 3:28 pm Reply with quote

It uses the old $dbi layer as stated in one of your other issues. You need to convert it to the $db layer or enable the $dbi layer again. Both are located here in the forums.

_________________
"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
jaded







PostPosted: Sun Feb 08, 2009 3:30 pm Reply with quote

I have done that and it did not fix the error. It corrected it with the Contact Plus module, but not with this Profiles module.
 
Palbin







PostPosted: Sun Feb 08, 2009 4:04 pm Reply with quote

I think you can just comment out the mysql_close($dbi);.

Try changing:
Code:


if(mysql_num_rows($result) == 0){


To:
Code:


if(sql_num_rows($result, $dbi) == 0){
 
Palbin







PostPosted: Sun Feb 08, 2009 4:06 pm Reply with quote

jaded wrote:
I have done that and it did not fix the error. It corrected it with the Contact Plus module, but not with this Profiles module.


I guess I should have asked. When you said that it corrected it did you change the $dbi to $db or uncomment the stuff in mainfile.php.
 
dad7732
RavenNuke(tm) Development Team



Joined: Mar 18, 2007
Posts: 1242

PostPosted: Sun Feb 08, 2009 4:06 pm Reply with quote

Try these:

I assume the first two you posted were just the error messages.

Code:
######################################################### 

# Submit Review                                         #
#########################################################
 function submit_proview($username, $comment, $rank, $rpid, $id) {
    global $prefix, $db, $username, $rank, $comment;
   
     $date = date("m-d-Y h:i a");
     
    $db->sql_query("insert into ".$prefix."_tri_proview values ('$id','$username','$rank','$comment','$date','delkey')");
   
   header("Location: modules.php?name=Profiles&id=$id");
    }
   
   
   
    switch($op) {

    default:
    index($prid);
   break;
   
   case "submit_proview":
    submit_proview($username, $comment, $rank, $rpid, $id);
    break;
}
$db->sql_close($db);
include("footer.php");
?>


Code:
   $limitvalue = $page * $limit - ($limit); 

    $sql2  = "SELECT * FROM ".$prefix."_tri_profiles where category='$cid' ORDER by common LIMIT $limitvalue, $limit";         
    $query2 = $db->sql_query($sql2) or die("Error: " . $db->sql_error());

    if($db->sql_numrows($result) == 0){
        echo("Nothing to Display!");
    }

              //$sql2="select * from ".$prefix."_tri_profiles where category='$cid' ORDER BY common";
       //$query2 = $db->sql_query($sql2);



Hope so ...

Cheers
 
View user's profile Send private message
jaded







PostPosted: Sun Feb 08, 2009 4:36 pm Reply with quote

Hello,

These changes from Dad7732 removed the notices in this module. I have not found any additonal ones within the module as of now. I truly appreciate your help with this. Thank you both!
 
dad7732







PostPosted: Sun Feb 08, 2009 4:55 pm Reply with quote

My info and help is solely dependant on the crew here. I went through the same thing a while back and it's easy to miss a step or two just when you KNOW you modified everything. Smile

Cheers
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues

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 ©