Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Problems Modding IVPB2.0
Old 06-01-2005, 08:34 PM Problems Modding IVPB2.0
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
okay i am trying to mod IVPB 2.0 and i currently have one stubbern error that i can not figure out

the line of error

LINES 1206-1242
PHP Code:
        
                $subres 
mysql_query("SELECT * FROM users WHERE username='".$member['name']."'") ;
$CURUSER=mysql_fetch_array($subres);


if (
$CURUSER["downloaded"])
                {
                  
$ratio $CURUSER["uploaded"] / $CURUSER["downloaded"];
                  if (
$ratio 0.1)
                    
$s "<font color=#ff0000>" number_format($ratio2) . "</font>";
                  else if (
$ratio 0.2)
                    
$s "<font color=#ee0000>" number_format($ratio2) . "</font>";
                  else if (
$ratio 0.3)
                    
$s "<font color=#dd0000>" number_format($ratio2) . "</font>";
                  else if (
$ratio 0.4)
                    
$s "<font color=#cc0000>" number_format($ratio2) . "</font>";
                  else if (
$ratio 0.5)
                    
$s "<font color=#bb0000>" number_format($ratio2) . "</font>";
                  else if (
$ratio 0.6)
                    
$s "<font color=#aa0000>" number_format($ratio2) . "</font>";
                  else if (
$ratio 0.7)
                    
$s "<font color=#990000>" number_format($ratio2) . "</font>";
                  else if (
$ratio 0.8)
                    
$s "<font color=#880000>" number_format($ratio2) . "</font>";
                  else if (
$ratio 0.9)
                    
$s "<font color=#770000>" number_format($ratio2) . "</font>";
                  else if (
$ratio 1)
                    
$s "<font color=#660000>" number_format($ratio2) . "</font>";
                  else
                    
$s =  number_format($ratio2) ;
                }
                else
                  if (
$CURUSER["uploaded"])
                    
$s "Inf.";
                  else
                    
$s "---"
error
Code:
IPB WARNING [2] mysql_fetch_array(): supplied argument is not a valid MySQL result resource (Line: 1208 of /sources/topics.php)
if you want the entire script please let me know and i'll post the page in a zip file
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
 
Register now for full access!
Old 06-01-2005, 09:10 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
It means the query failed, and since the query failed, it is not a valid result resource, and thus, you cannot fetch from it You probably need to call on the user table with the database prefix you used when installing, I believe it is 'ibf_' by default.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 06-01-2005, 09:15 PM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
so it would be ibf_user?


of course i am trying to mod it here... here are the install instruction it tells me to do
Used to be

Code:
$member['member_joined'] = $this->html->member_joined( $std->get_date( $member['joined'], 'JOINED' ) );
$member['member_group']  = $this->html->member_group( $ibforums->cache['group_cache'][ $member['mgroup'] ]['g_title'] );
$member['member_posts']  = $this->html->member_posts( $std->do_number_format($member['posts']) );
Replaced With
Code:
        $subres = mysql_query("SELECT * FROM users WHERE username='".$member['name']."'") ;
$CURUSER=mysql_fetch_array($subres);


if ($CURUSER["downloaded"])
                {
                  $ratio = $CURUSER["uploaded"] / $CURUSER["downloaded"];
                  if ($ratio < 0.1)
                    $s = "<font color=#ff0000>" . number_format($ratio, 2) . "</font>";
                  else if ($ratio < 0.2)
                    $s = "<font color=#ee0000>" . number_format($ratio, 2) . "</font>";
                  else if ($ratio < 0.3)
                    $s = "<font color=#dd0000>" . number_format($ratio, 2) . "</font>";
                  else if ($ratio < 0.4)
                    $s = "<font color=#cc0000>" . number_format($ratio, 2) . "</font>";
                  else if ($ratio < 0.5)
                    $s = "<font color=#bb0000>" . number_format($ratio, 2) . "</font>";
                  else if ($ratio < 0.6)
                    $s = "<font color=#aa0000>" . number_format($ratio, 2) . "</font>";
                  else if ($ratio < 0.7)
                    $s = "<font color=#990000>" . number_format($ratio, 2) . "</font>";
                  else if ($ratio < 0.8)
                    $s = "<font color=#880000>" . number_format($ratio, 2) . "</font>";
                  else if ($ratio < 0.9)
                    $s = "<font color=#770000>" . number_format($ratio, 2) . "</font>";
                  else if ($ratio < 1)
                    $s = "<font color=#660000>" . number_format($ratio, 2) . "</font>";
                  else
                    $s =  number_format($ratio, 2) ;
                }
                else
                  if ($CURUSER["uploaded"])
                    $s = "Inf.";
                  else
                    $s = "---";

$torrentinfo = "<br>Downloaded:<font color='blue'> ".mksize($CURUSER["downloaded"])."</font><br>Uploaded:<font color='green'> ".mksize($CURUSER["uploaded"])."</font></b><br>Ratio: ".$s."<br>";

		$member['member_joined'] = $this->html->member_joined( $std->get_date( $member['joined'], 'JOINED' ) );
		$member['member_group']  = $this->html->member_group( $ibforums->cache['group_cache'][ $member['mgroup'] ]['g_title'] );
		$member['member_posts']  = $this->html->member_posts( $std->do_number_format($member['posts']) ).$torrentinfo;
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 06-01-2005, 09:22 PM
Zeal's Avatar
Average Talker

Posts: 17
Location: Texas
Trades: 0
I have a small question...What does the "->" do exactly..?
Zeal is offline
Reply With Quote
View Public Profile Visit Zeal's homepage!
 
Old 06-01-2005, 09:57 PM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
your asking me.... i start the fourm software... this is by ivision power board. the hack is at phpsoft.com under IPB TT or something like that.

i could never write something this complitcated right now..

so your guess would be as good as mine. i am goin to try and get in contact with the writer tomarrow to find out why i am having issues. i might ask some friends at another forum to help me get mine setup. as i am basing some on my current setup off of theirs.
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 06-01-2005, 10:23 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
Quote:
Originally Posted by amw_drizz
so it would be ibf_user?
Yes, I believe so. Go into phpMyAdmin and check if it does not work. Unless you specifically cleared the 'table prefix' field on install, it will be something.


Quote:
Originally Posted by Zeal
I have a small question...What does the "->" do exactly..?
It is how you must access an objects methods or properties (when an instance is created). For example, you might have a car instance with a $max_speed property, to access it, you would do something like $car->max_speed. Within a class, the special $this reference points to the instance itself. See the manual for more examples.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 06-02-2005, 08:44 AM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
the mod i am adding is a front end tracker. and i belive that the information is require a connect to the tracker db which is not the same db as the forums. so that may be what is needing to be. as it is only parsing the error after inculding 2 files which length double the scripts legnth.

....... problems..... argh
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 06-02-2005, 01:01 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
Add an error message to see specifically what the problem is:
PHP Code:
 $subres mysql_query("SELECT * FROM users WHERE username='".$member['name']."'");

if(!
$subres)
    
trigger_error('Error with mySQL query: ' mysql_error()); 
That way we can get a better idea of what the error actually is.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 06-02-2005, 03:49 PM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
This is the entire topics file..... the entire THING
<mod edit>

This is 2336 lines of code. PROBLOMATIC AREAS ARE MARKED WITH --->
Lines 767, 775, 793

All have invalid MySQL arrarys. Chroder when i applied your code the error disapered so that fixed it but look through it those are the problomatic lines
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 06-02-2005, 04:37 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
You can't show the source file here, IPB is not free software

My code should have given you a mySQL error. IPB might be using some kind of output buffering, try using a 'die' just once to see if you can catch the error
Code:
if(!$subres)
    die('Error with mySQL query: ' . mysql_error());
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 06-02-2005, 04:52 PM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
no thats not the source.... that may be part of it. alls that does is shows tells how to displays the topics.

trust me the kernal in the IPB folder is the core. and that is only one file

Will try the die command to see if i can catch the error
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 06-02-2005, 05:11 PM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
I AM SO DUMB

when i installed the tracker i forgot to install it into the same db as the forums. so thats why i got all the errors...

__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Reply     « Reply to Problems Modding IVPB2.0
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.42868 seconds with 12 queries