Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
viper155
Regular
Regular



Joined: Feb 18, 2006
Posts: 99

PostPosted: Mon Feb 06, 2012 12:53 pm Reply with quote

A while back I had someone on my team that made a few custom blocks and modules for my site.

Since upgrading they no longer seem to work at all. Dawg and Nuken changed 1 block for me and it worked perfectly however when comparing the changes I am still unable to understand what it takes to get the rest working.

Here is the last block i've been trying to get to work for a little while now with no such luck. Its very little code but obviously I have no idea what i'm doing... Sad

Code:



<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2001 by Francisco Burzi (fbc@mandrakesoft.com)         */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (eregi("block-Yapom_Quote.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}

/***************************************************************/
/* This block was created by YaPoMpIoW as webmaster for the    */
/* Terengganu Webnet Community                                 */
/* Homepage : http://trgwebnet.org                             */
/***************************************************************/
/* This block was modified by Maximillian de Dragonard         */
/* as webmaster for Dragonard.com                              */
/* Homepage : http://www.dragonard.com                         */
/* Removed fade script to create purely random on reload effect*/
/***************************************************************/
global $prefix,$dbi,$nukeurl;
$result = sql_query("select author,quote, image from ".$prefix."_yapom_quote order by RAND() Limit 1",$dbi);

list($author,$quote, $image) = sql_fetch_row($result,$dbi);
$content .= "<center><img src=\"$image\"></center><br>\"$quote\"<br><br>~ $author<br><br><a href=\"quotes.html\">Click here for more quotes</a>";
?>


I also have two modules that I need to get working but I do not want to zip them up and link it here as they are custom made. Perhaps someone would be willing to take a look at them through a private message.

I sound like i'm making a requests from you all and that's not what i'm intending to do, I really just want to understand what needs to change but I think its outside of my knowledge.
 
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Mon Feb 06, 2012 1:35 pm Reply with quote

that is particularly old code, try the steps listed here: [ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message Visit poster's website
viper155







PostPosted: Mon Feb 06, 2012 1:54 pm Reply with quote

thanks, I was able to fix my block using that post. Do those changes also apply to modules?
 
spasticdonkey







PostPosted: Mon Feb 06, 2012 1:57 pm Reply with quote

yes, if you see $dbi in the code it will need to be updated using the same method.
 
viper155







PostPosted: Mon Feb 06, 2012 3:13 pm Reply with quote

I have been able to get my module to work to a certain extent using that post as a guide but now im stuck on this part.

Warning:
Quote:

Warning: mysql_data_seek(): supplied argument is not a valid MySQL result resource in /home/***/public_html/modules/TTBO/index.php on line 543

Warning: mysqli_result::fetch_array() [mysqli-result.fetch-array]: Couldn't fetch mysqli_result in /home/***/public_html/db/mysqli.php on line 309


And on line 543 I have this code:
Code:


mysql_data_seek  ($result, 0);


Any suggestions?
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Mon Feb 06, 2012 3:36 pm Reply with quote

Try

Code:



mysqli_data_seek  ($result, 0);


_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
viper155







PostPosted: Mon Feb 06, 2012 3:41 pm Reply with quote

Now its showing:

Quote:

Warning: mysqli_data_seek() [function.mysqli-data-seek]: Couldn't fetch mysqli_result in /home/***/public_html/modules/TTBO/index.php on line 543
 
Dawg
RavenNuke(tm) Development Team



Joined: Nov 07, 2003
Posts: 928

PostPosted: Tue Feb 07, 2012 7:31 am Reply with quote

What code is related to line 543.

It sounds like the sql call is not working.

Dawg
 
View user's profile Send private message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Tue Feb 07, 2012 6:24 pm Reply with quote

Try this

Code:
<?php


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2001 by Francisco Burzi (fbc@mandrakesoft.com)         */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}

/***************************************************************/
/* This block was created by YaPoMpIoW as webmaster for the    */
/* Terengganu Webnet Community                                 */
/* Homepage : http://trgwebnet.org                             */
/***************************************************************/
/* This block was modified by Maximillian de Dragonard         */
/* as webmaster for Dragonard.com                              */
/* Homepage : http://www.dragonard.com                         */
/* Removed fade script to create purely random on reload effect*/
/***************************************************************/
global $prefix,$db,$nukeurl;
$result = $db->sql_query("select author,quote, image from ".$prefix."_yapom_quote order by RAND() Limit 1");

list($author,$quote, $image) = $db->sql_fetchrow($result);
$content .= "<center><img src=\"$image\"></center><br>\"$quote\"<br /><br />~ $author<br /><br /`><a href=\"quotes.html\">Click here for more quotes</a>";
?>


Last edited by hicuxunicorniobestbuildpc on Thu Jul 26, 2012 6:35 am; edited 1 time in total 
View user's profile Send private message
Palbin
Site Admin



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

PostPosted: Thu Feb 09, 2012 11:25 pm Reply with quote

viper155, if you could pm me the code in question I could take a look at it.

_________________
"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
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

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 ©