Page 24 of 26

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 09 Jan 2009 23:14
by kama
Hi Fish
The last version of the widgets is great... very nice work to the crew!
A little truble: On my scoreboard, for the top winners, it shows the list starting backwards, so I see the ones who have 0 victories.....
A way to correct that?¿
btw, my server is stunt maybe there is something there. We also have pthers servers without any problem, and same fufi configuration (we duplicate from the original server). Any explanation ?¿

Thanks in advance and keep up the good work :thumbsup:

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 12 Jan 2009 15:21
by Zogug
Hey Fufi!
Great widgets you make, we love them on my server... :)
But since I installed ver. 0.80b, there is a strange little bug. I have a resident player who is a member of the &-team. They use & as tag. But somehow the & disapears in the record-widgets... I investigatet and found out that if I write a / message (/me /msg /admin say...) the & always disapears??
Which means if I write /me & Fufi are having fun, it displays TomTurbo Fufi are having fun... It does not matter where in the sentence the & is, it always disapers...
Any ideas why?? It work with the old fufi 0.7something. I have Aseco 220c... The only thing I updated was fufi...

Thanx
Tom

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 13 Jan 2009 16:20
by kama
kama wrote:Hi Fish
The last version of the widgets is great... very nice work to the crew!
A little truble: On my scoreboard, for the top winners, it shows the list starting backwards, so I see the ones who have 0 victories.....
A way to correct that?¿
btw, my server is stunt maybe there is something there. We also have pthers servers without any problem, and same fufi configuration (we duplicate from the original server). Any explanation ?¿

Thanks in advance and keep up the good work :thumbsup:

Any help?¿

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 13 Jan 2009 20:02
by f*ckfish
I'll have a look at it soon =)

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 16 Jan 2009 19:05
by kama
Tx man!

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 21 Jan 2009 22:44
by gpetkov
tcq wrote:
cri cri wrote:hello, what does this message please?

[RASP Karma Error] Failed to select karma. Error text = You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near''at line 1
sql = Select goodkarma, challenges from badkarma WHERE ID =

all functions are activated fufi, record management works perfectly, the plugin is loaded, I turs the message that I can not solve

php version that I should use to avoid this error?
As you see it goes to the columns goodkarma and challenges WHERE ID = ...

Now,i don't know how the database is build up, but this sql query is wrong.

Ok i will show u the code and if u can help me cos' i have the same error.

Here we select the ID (the error says that WHERE ID= .. i mean it remains empty)

Code: Select all

	$query = 'select GoodKarma, BadKarma from challenges WHERE ID=' . $challenge->data['DB_ID'];
and the $challenge->data['DB_ID']; value comes from here

Code: Select all

	$challenge->data['DB_ID'] = $this->getChallengeId($challenge->uid);
and the $this->getChallengeId($challenge->uid); from here:

Code: Select all

function getChallengeId($uid)
		{
		$query = 'SELECT Id FROM challenges WHERE Uid=\'' . mysql_real_escape_string($uid) . '\'';
		$res = mysql_query($query);
		if (mysql_num_rows($res) > 0)
			{
			$row = mysql_fetch_row($res);
			$rtnval = $row[0];
			}
		else
			{
			$rtnval = 0;
			}
		mysql_free_result($res);
		return $rtnval;
		}
I am newbie in the PHP but i cant find an error.. if some1 can help to resolve this bug.. Im using aseco 2.2.0c and fufi 0.8b

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 22 Jan 2009 00:10
by Assembler Maniac
Add a the following right after the mysql_query in getChallengeId:

echo "getChallengeId debug info\r\n";
echo "Query: " . $query . "\r\nNumber of rows: " . mysql_num_rows($res) . "\r\n";
print_r($res);

It's possible the $res is false, which indicates an error in the query. The query will be printed so you can see what's up. Neither of these debug items will go to the log, but they'll be in the console window so you can read them.
gpetkov wrote:Ok i will show u the code and if u can help me cos' i have the same error.

Here we select the ID (the error says that WHERE ID= .. i mean it remains empty)

Code: Select all

	$query = 'select GoodKarma, BadKarma from challenges WHERE ID=' . $challenge->data['DB_ID'];
and the $challenge->data['DB_ID']; value comes from here

Code: Select all

	$challenge->data['DB_ID'] = $this->getChallengeId($challenge->uid);
and the $this->getChallengeId($challenge->uid); from here:

Code: Select all

function getChallengeId($uid)
		{
		$query = 'SELECT Id FROM challenges WHERE Uid=\'' . mysql_real_escape_string($uid) . '\'';
		$res = mysql_query($query);
		if (mysql_num_rows($res) > 0)
			{
			$row = mysql_fetch_row($res);
			$rtnval = $row[0];
			}
		else
			{
			$rtnval = 0;
			}
		mysql_free_result($res);
		return $rtnval;
		}
I am newbie in the PHP but i cant find an error.. if some1 can help to resolve this bug.. Im using aseco 2.2.0c and fufi 0.8b

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 22 Jan 2009 10:10
by gpetkov
Assembler Maniac wrote:Add a the following right after the mysql_query in getChallengeId:

echo "getChallengeId debug info\r\n";
echo "Query: " . $query . "\r\nNumber of rows: " . mysql_num_rows($res) . "\r\n";
print_r($res);

It's possible the $res is false, which indicates an error in the query. The query will be printed so you can see what's up. Neither of these debug items will go to the log, but they'll be in the console window so you can read them.
gpetkov wrote:Ok i will show u the code and if u can help me cos' i have the same error.

Here we select the ID (the error says that WHERE ID= .. i mean it remains empty)

Code: Select all

	$query = 'select GoodKarma, BadKarma from challenges WHERE ID=' . $challenge->data['DB_ID'];
and the $challenge->data['DB_ID']; value comes from here

Code: Select all

	$challenge->data['DB_ID'] = $this->getChallengeId($challenge->uid);
and the $this->getChallengeId($challenge->uid); from here:

Code: Select all

function getChallengeId($uid)
		{
		$query = 'SELECT Id FROM challenges WHERE Uid=\'' . mysql_real_escape_string($uid) . '\'';
		$res = mysql_query($query);
		if (mysql_num_rows($res) > 0)
			{
			$row = mysql_fetch_row($res);
			$rtnval = $row[0];
			}
		else
			{
			$rtnval = 0;
			}
		mysql_free_result($res);
		return $rtnval;
		}
I am newbie in the PHP but i cant find an error.. if some1 can help to resolve this bug.. Im using aseco 2.2.0c and fufi 0.8b
But it doesn't prints anything ;(

Code: Select all

[01/22,12:07:20] map changed [none] >> [Moving Power]
[RASP Karma Error] Failed to select karma.  Error text=You have an error in your
 SQL syntax; check the manual that corresponds to your MySQL server version for
the right syntax to use near '' at line 1
sql=select GoodKarma, BadKarma from challenges WHERE ID=
[01/22,12:07:20] currently no record on Moving Power
Webaccess (dedimania.net:8013): send: deflate, receive: deflate

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 22 Jan 2009 13:40
by Assembler Maniac
gpetkov wrote:
Assembler Maniac wrote:Add a the following right after the mysql_query in getChallengeId:

echo "getChallengeId debug info\r\n";
echo "Query: " . $query . "\r\nNumber of rows: " . mysql_num_rows($res) . "\r\n";
print_r($res);

It's possible the $res is false, which indicates an error in the query. The query will be printed so you can see what's up. Neither of these debug items will go to the log, but they'll be in the console window so you can read them.
gpetkov wrote:Ok i will show u the code and if u can help me cos' i have the same error.

Here we select the ID (the error says that WHERE ID= .. i mean it remains empty)

Code: Select all

	$query = 'select GoodKarma, BadKarma from challenges WHERE ID=' . $challenge->data['DB_ID'];
and the $challenge->data['DB_ID']; value comes from here

Code: Select all

	$challenge->data['DB_ID'] = $this->getChallengeId($challenge->uid);
and the $this->getChallengeId($challenge->uid); from here:

Code: Select all

function getChallengeId($uid)
		{
		$query = 'SELECT Id FROM challenges WHERE Uid=\'' . mysql_real_escape_string($uid) . '\'';
		$res = mysql_query($query);
		if (mysql_num_rows($res) > 0)
			{
			$row = mysql_fetch_row($res);
			$rtnval = $row[0];
			}
		else
			{
			$rtnval = 0;
			}
		mysql_free_result($res);
		return $rtnval;
		}
I am newbie in the PHP but i cant find an error.. if some1 can help to resolve this bug.. Im using aseco 2.2.0c and fufi 0.8b
But it doesn't prints anything ;(

Code: Select all

[01/22,12:07:20] map changed [none] >> [Moving Power]
[RASP Karma Error] Failed to select karma.  Error text=You have an error in your
 SQL syntax; check the manual that corresponds to your MySQL server version for
the right syntax to use near '' at line 1
sql=select GoodKarma, BadKarma from challenges WHERE ID=
[01/22,12:07:20] currently no record on Moving Power
Webaccess (dedimania.net:8013): send: deflate, receive: deflate
Like I said before, it won't put anything in the log file, it can only display it to the console. You can change the Echo lines to this:
$this->console_text('getChallengeId debug info');
$this->console_text("Query: " . $query . "\r\nNumber of rows: " . mysql_num_rows($res) );
But that won't help me see what's in $res.

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 22 Jan 2009 14:04
by Xymph
Assembler Maniac wrote:Like I said before, it won't put anything in the log file, it can only display it to the console. You can change the Echo lines to this:
$this->console_text('getChallengeId debug info');
$this->console_text("Query: " . $query . "\r\nNumber of rows: " . mysql_num_rows($res) );
But that won't help me see what's in $res.
You can print that to the logfile too. Try this:

Code: Select all

$this->console_text("Query: " . $query . CRLF . "Number of rows: " . mysql_num_rows($res) . CRLF . print_r($res, true));
Using hard-coded "\r\n" is a bad idea as well, hence my use of CRLF (which should be defined as just "\n" on Linux).

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 22 Jan 2009 14:21
by Assembler Maniac
Xymph wrote:
Assembler Maniac wrote:Like I said before, it won't put anything in the log file, it can only display it to the console. You can change the Echo lines to this:
$this->console_text('getChallengeId debug info');
$this->console_text("Query: " . $query . "\r\nNumber of rows: " . mysql_num_rows($res) );
But that won't help me see what's in $res.
You can print that to the logfile too. Try this:

Code: Select all

$this->console_text("Query: " . $query . CRLF . "Number of rows: " . mysql_num_rows($res) . CRLF . print_r($res, true));
Using hard-coded "\r\n" is a bad idea as well, hence my use of CRLF (which should be defined as just "\n" on Linux).
Never knew you could re-direct print_r, thanks.

In XAseco I didn't know if CFLF was coded or not, so I used hard code. I agree that using the defined items makes it much more portable and readable.

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 22 Jan 2009 14:29
by Xymph
Assembler Maniac wrote:Never knew you could re-direct print_r, thanks.
YW, it's very handy indeed.
Assembler Maniac wrote:In XAseco I didn't know if CRLF was coded or not, so I used hard code. I agree that using the defined items makes it much more portable and readable.
It's derived from and expanded upon the original Aseco, after all. I use this:

Code: Select all

// check current operating system
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
  // on Win32/NT use:
  define('CRLF', "\r\n");
} else {
  // on Unix use:
  define('CRLF', "\n");
}
if (!defined('LF')) {
  define('LF', "\n");
}
This prevents those unnecessary carriage returns in Linux logfiles (the logging functions are the only code using CRLF, everything sent to the server can use LF).
(Sorry for hijacking the Widgets thread with this. :wink: )

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 22 Jan 2009 14:42
by Assembler Maniac
Xymph wrote:
Assembler Maniac wrote:Never knew you could re-direct print_r, thanks.
YW, it's very handy indeed.
Assembler Maniac wrote:In XAseco I didn't know if CRLF was coded or not, so I used hard code. I agree that using the defined items makes it much more portable and readable.
It's derived from and expanded upon the original Aseco, after all. I use this:

Code: Select all

// check current operating system
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
  // on Win32/NT use:
  define('CRLF', "\r\n");
} else {
  // on Unix use:
  define('CRLF', "\n");
}
if (!defined('LF')) {
  define('LF', "\n");
}
This prevents those unnecessary carriage returns in Linux logfiles (the logging functions are the only code using CRLF, everything sent to the server can use LF).
(Sorry for hijacking the Widgets thread with this. :wink: )
That's ok, I hijacked your code snippet too, so we're even.

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 22 Jan 2009 15:59
by Xymph
Assembler Maniac wrote:That's ok, I hijacked your code snippet too, so we're even.
Heh, ok. :) Note that I removed the CR constant definition, because it isn't used anywhere.

Re: [(X)Aseco] Fufi Widgets (v0.80b)

Posted: 23 Jan 2009 13:15
by kama
Any chance somebody could help me with my most winners widget issue? It shows the lesser winners and not the most :( (0 victories...)
My server is a Stunt server, that would be the only explanation I can come up with, since others servers running same config but different modes run OK.....
Any ideas ?
Tx in advance.