Author |
Message |
viper155
Regular
Joined: Feb 18, 2006
Posts: 99
|
Posted:
Mon Feb 06, 2012 12:53 pm |
|
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...
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. |
|
|
|
|
spasticdonkey
RavenNuke(tm) Development Team
Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Mon Feb 06, 2012 1:35 pm |
|
|
|
|
viper155
|
Posted:
Mon Feb 06, 2012 1:54 pm |
|
thanks, I was able to fix my block using that post. Do those changes also apply to modules? |
|
|
|
|
spasticdonkey
|
Posted:
Mon Feb 06, 2012 1:57 pm |
|
yes, if you see $dbi in the code it will need to be updated using the same method. |
|
|
|
|
viper155
|
Posted:
Mon Feb 06, 2012 3:13 pm |
|
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
|
Posted:
Mon Feb 06, 2012 3:36 pm |
|
Try
Code:
mysqli_data_seek ($result, 0);
|
|
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
|
viper155
|
Posted:
Mon Feb 06, 2012 3:41 pm |
|
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
|
Posted:
Tue Feb 07, 2012 7:31 am |
|
What code is related to line 543.
It sounds like the sql call is not working.
Dawg |
|
|
|
|
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Tue Feb 07, 2012 6:24 pm |
|
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 |
|
|
|
Palbin
Site Admin
Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Thu Feb 09, 2012 11:25 pm |
|
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. |
|
|
|
|