TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,021
  • Total Topics: 21,332
  • Online today: 496
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 253
  • Total: 253

error message

Started by jozeta, January 19, 2008, 09:14:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jozeta

hi
i got this strange error message in the logs. does anyone know what this is?


Använder filter: Felmeddelande '2: Missing argument 3 for db_query(), called in /customers/bulleforum.se/bulleforum.se/httpd.www/smf/Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 7 and defined
Fil: /customers/bulleforum.se/bulleforum.se/httpd.www/smf/Sources/Subs.php
Rad: 238'

i have the following mods installed:

1. TinyPortal 0.983
2. FlashChat Integration 1.0
3. Custom Profile Field Mod 3.17
4. SMF Links 1.6.5

Dragooon

This doesn't looks like a TP problem but anyway, can you post code from line 228-248 in Subs.php?

jozeta

here is line 237-263. everything before line 237 is comments

// Do a query.  Takes care of errors too.
function db_query($db_string, $file, $line)
{
global $db_cache, $db_count, $db_connection, $db_show_debug, $modSettings;

// One more query....
$db_count = !isset($db_count) ? 1 : $db_count + 1;

// Debugging.
if (isset($db_show_debug) && $db_show_debug === true)
{
// Initialize $db_cache if not already initialized.
if (!isset($db_cache))
$db_cache = array();

if (!empty($_SESSION['debug_redirect']))
{
$db_cache = array_merge($_SESSION['debug_redirect'], $db_cache);
$db_count = count($db_cache) + 1;
$_SESSION['debug_redirect'] = array();
}

$db_cache[$db_count]['q'] = $db_string;
$db_cache[$db_count]['f'] = $file;
$db_cache[$db_count]['l'] = $line;
$st = microtime();
}

G6Cad

What theme are you using ?
Make sure all the template code from your mod is applied correctly.
Especially the custom profile mod

Dragooon

I am having a feeling it is a block, do you got any custom block which uses db_query?

jozeta

yes i have two custom php blocks, that i made my self.
------------
first code displays the latest updated wordpress mu blog:
global $db_prefix, $scripturl;


$query = db_query(
    "SELECT *
     FROM wp_blogs
     ORDER BY last_updated DESC LIMIT 4");

while ($row = mysql_fetch_array( $query ))
     {
     // skriver ut innehÃ¥llet radvis
echo "<a href='http://www.bulleforum.se";
echo $row['path']."' target='blank'>";     

$title = $row['path'];
$title = substr($title, 6);
$title = str_replace("/", "", $title);
echo $title;
echo "</a> <i>";
$day = $row['last_updated'];
$day = substr($day, 8, 2);
echo $day;

echo "/";

$mon = $row['last_updated'];
$mon = substr($mon, 5, 2);
echo $mon;

echo " ";

$time = $row['last_updated'];
$time = substr($time, 11, 5);
echo $time;

echo "</i><br> ";
          }


second code displays a random link from the db:

global $db_prefix, $scripturl;


$query = db_query(
    "SELECT *
     FROM smf_links
     ORDER BY RAND() LIMIT 5");

while ($row = mysql_fetch_array( $query ))
     {
     // skriver ut innehÃ¥llet radvis
echo "<a href='";
echo $row['url']."' target='blank'>";     
echo $row['title']."</a><br>";
          }



Dragooon

That explains it, in the first block replace the query with
$query = db_query(
    "SELECT *
     FROM wp_blogs
     ORDER BY last_updated DESC LIMIT 4",__FILE__,__LINE__);

And replace the query in second block with
$query = db_query(
    "SELECT *
     FROM smf_links
     ORDER BY RAND() LIMIT 5",__FILE__,__LINE__);


jozeta

Maybe a stupid question.

but what does the extra: "__FILE__,__LINE__);" do?

jozeta

that seems to clear up alot of the errors. now i only get this error msg:



store   idag kl. 01:07:28 
xx.xxx.xx.xxx     d5d5785fd5c7619f4e2aee4a5c0558d0 
http://www.bulleforum.se/smf/index.php?action=search2 
8: Undefined index: brd
Fil: /customers/bulleforum.se/bulleforum.se/httpd.www/smf/Sources/Search.php
Rad: 407


IchBin

__FILE__ outputs what file PHP is in, __LINE__ outputs what line its on.

Undefined index: brd is probably something to do with another mod you've installed.

This website is proudly hosted on Crocweb Cloud Website Hosting.