Reputation [v2.0.2.0002] for WoWRoster 2.0.2

List faction reputation for members

Moderator: ds

FactReputation [v2.0.0.6] for Beta 2

Postby Blueleaf » Thu Nov 01, 2007 1:01 pm

WOW not sure what happened, maybe an operator error but I upgraded from 2.0.0.0 to 2.0.0.6 and it no longer displays any information. Any Ideas on what went wrong?
User avatar
Blueleaf
WR.net Apprentice
WR.net Apprentice
 
Posts: 50
Joined: Thu Apr 26, 2007 12:06 am
Location: Minot, ND

FactReputation [v2.0.0.6] for Beta 2

Postby foreseit » Thu Nov 01, 2007 2:25 pm

I just installed 2.0.06, and the only reputations that will display are the hostile ones.
http://www.thehateguild.com/anetheronBe ... rs&guild=1
<a href="thehateguild.com"><img src="/anetheron/addons/siggen/sig.php?name=Foreseit"></a>
User avatar
foreseit
WR.net Journeyman
WR.net Journeyman
 
Posts: 139
Joined: Tue Jul 25, 2006 10:03 pm

Re: FactReputation [v2.0.0.6] for Beta 2

Postby tuigii » Fri Nov 02, 2007 3:14 am

Blueleaf wrote:WOW not sure what happened, maybe an operator error but I upgraded from 2.0.0.0 to 2.0.0.6 and it no longer displays any information. Any Ideas on what went wrong?

Dono : Gime you site and ou language used ...
[Still gota clue... see next reply]

foreseit wrote:I just installed 2.0.06, and the only reputations that will display are the hostile ones.
www.thehateguild.com/a...rs&guild=1

Now this is what helps me realy a lot.
Thanks.

Got it also, I had to take out of the reputation table ONLY the reps from members that concnern the actual selected Guild.
This blows out of the water the languages issues and makes the Addon really working on a Guild level - as it is intended.

My is what you can call "the solution":
Code: Select all
"SELECT distinct(r.name) faction FROM ".
"`".$roster->db->table('reputation')."` r, `".$roster->db->table('players')."` p ".
"WHERE ".
"r.member_id = p.member_id AND p.guild_id = '".$roster->data['guild_id']."' ". // Only get dinsctint reps for guild 'guild_id'
"ORDER BY r.name";


Foreseit, I stole your Guild roster from the Armory.

You can test you Guild reputaion info here :
http://www.les-grands-croises.fr/roster ... on&guild=4
Two French guilds are also selectable in this roster.

Test-drive it, and say me what you think !
Last edited by tuigii on Fri Nov 02, 2007 10:52 pm, edited 2 times in total.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

FactReputation [v2.0.0.7] for Beta 2

Postby Blueleaf » Fri Nov 02, 2007 10:41 pm

2.0.0.7 took care of it, thank you
User avatar
Blueleaf
WR.net Apprentice
WR.net Apprentice
 
Posts: 50
Joined: Thu Apr 26, 2007 12:06 am
Location: Minot, ND

Re: FactReputation [v2.0.0.1] for Beta 2

Postby ntex » Sat Nov 03, 2007 10:16 am

tuigii wrote:
ntex wrote:I found two bugs :)

What ??? [ :lol: ]

ntex wrote:There is an issue with Ogri'la on SQL statement and makes some sense, since this faction have an apostrophe ' so for sure it ends prematurely the SQL statement on the code.

Yep, saw the one, it a cousin of Shen'draler, I think.
I'm 'neutral = 0 / 3000 with them - so I really don't know.

But what really interest you (and me) is : Go overhere : http://www.papy-team.fr/roster/index.ph ... on&guild=1
and I can tell you that these are working (on my server tm).
Between you and I, only the database could be different : is yours interclassement uft8_unicode_ci ?

ntex wrote:The other bug it's after u browse other factions if u re-select "Select a faction" it gives an error that can't find a file:
"The requested URL /modules/roster/roster/none was not found on this server."

I acknowledge - didn't saw that before....
Needed half on hour to find out that I should met the services of a function called stripslashes(), and that should "love and care" makelink(...).

Anyway, test drive with the link mentionned above , and if you say ok, i'll up it, ok ?

Btw : Thanks :wink:


Sry for answering only now... RL stuff 8)

U welcome glad to help. I have tested your new version 2.0.0.7 and the 2nd bug was solved...

The 1st bug, okay u r right isn't really a bug I forgot to check that on my laptop I can change it since it's were i test/maintain the website of my guild, but I can't do it on my host provider :( So it's affirmative it's on uft8_unicode_ci (utf8)

Code: Select all
1064: 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 'la' ORDER BY max_rep desc, r.standing DESC, curr_rep DESC' at line 1
SQL:
SELECT m.clientLocale locale, m.name member, r.faction, r.name fct_name, curr_rep AS value, curr_rep, max_rep, r.standing FROM `roster_reputation` r, `roster_players` m WHERE r.member_id = m.member_id AND m.guild_id = '1' AND r.name='Ogri'la' ORDER BY max_rep desc, r.standing DESC, curr_rep DESC
File: lib\dbal\mysql.php
Line: 203
Backtrace (most recent call last):

    * lib\functions.lib.php
          o Line: 240
          o Function Called: backtrace
    * lib\dbal\mysql.php
          o Line: 203
          o Function Called: die_quietly
          o Arguments:
                + 1064: 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 'la' ORDER BY max_rep desc, r.standing DESC, curr_rep DESC' at line 1
                + Database Error
                + C:\Apache\htdocs\modules\Roster\roster\lib\dbal\mysql.php
                + 203
                + SELECT m.clientLocale locale, m.name member, r.faction, r.name fct_name, curr_rep AS value, curr_rep, max_rep, r.standing FROM `roster_reputation` r, `roster_players` m WHERE r.member_id = m.member_id AND m.guild_id = '1' AND r.name='Ogri'la' ORDER BY max_rep desc, r.standing DESC, curr_rep DESC
    * addons\FactReputation\guild\index.php
          o Line: 70
          o Function Called: query
          o Arguments:
                + SELECT m.clientLocale locale, m.name member, r.faction, r.name fct_name, curr_rep AS value, curr_rep, max_rep, r.standing FROM `roster_reputation` r, `roster_players` m WHERE r.member_id = m.member_id AND m.guild_id = '1' AND r.name='Ogri'la' ORDER BY max_rep desc, r.standing DESC, curr_rep DESC
    * index.php
          o Line: 128
          o Function Called: require
          o Arguments:
                + C:\Apache\htdocs\modules\Roster\roster\addons\FactReputation\guild\index.php


I tried one thing that normally works instead of:
Code: Select all
"' AND r.name='".$_REQUEST['factionfilter']."' "
 


I edited to:
Code: Select all
"' AND r.name="".$_REQUEST['factionfilter']."" "
 


And it works 8) so I was wonder if this can be a "fix" that could with all collation sets? I'm asking this 'cos I started recently developing in php/mySQL, my area of expertise is VB/MSSQL.

So I tried auto-escaping approach and also worked:
Code: Select all
"' AND r.name='".addslashes($_REQUEST['factionfilter'])."' ".
 



So for matter of coding we could addslashes to get escaped the apostrophe, but then if the magic_quotes = on we can get double escaping so the use of get_magic_quotes_gpc() is a must?

So perhaps this next is the more correct approach:
Code: Select all

  
if (get_magic_quotes_gpc() == "1") {
      
$factionstr addslashes($_REQUEST['factionfilter']);
  } else {
      
$factionstr $_REQUEST['factionfilter'];
  }

    
$query "SELECT m.clientLocale locale, m.name member, r.faction, r.name fct_name, curr_rep AS value, ".
        
"curr_rep, ".
        
"max_rep, ".
        
"r.standing ".
        
"FROM `".$roster->db->table('reputation')."` r, `".$roster->db->table('players')."` m ".
        
"WHERE r.member_id = m.member_id AND m.guild_id = '".$roster->data['guild_id']."' AND r.name='".$factionstr."' ".
        
"ORDER BY max_rep desc, r.standing DESC, curr_rep DESC";
 


Or perhaps I must check how is setup the magic quotes, my host provider have that option that we can setup.

Sry for long posting ;)
Last edited by ntex on Sun Nov 04, 2007 5:33 am, edited 5 times in total.
User avatar
ntex
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Fri Aug 17, 2007 9:58 pm

Re: FactReputation [v2.0.0.7] for Beta 2

Postby tuigii » Sat Nov 03, 2007 11:26 am

I get it.

Look carefull at the (your) offending line,
Code: Select all
...AND r.name='Ogri'la'..

The quote-in-quote problem.

THis is what happens when I select Ogri'la on my Roster :
Code: Select all
...AND r.name='Ogri\'la'...

My quotes-in-qoutes are protected by a backslash.

Btw: this is a line on my webservers .htaccess file
Code: Select all
..
SetEnv MAGIC_QUOTES 1
..

Meaning that magic-quotes is ON on my site.

Anyway, your \" arround ".$_REQUEST['factionfilter']." works for me also - so I'll adopt it right away.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Re: FactReputation [v2.0.0.7] for Beta 2

Postby ntex » Sat Nov 03, 2007 11:42 am

tuigii wrote:I get it.

...

Anyway, your " arround ".$_REQUEST['factionfilter']." works for me also - so I'll adopt it right away.


Hey check again my post... I have editing in the last hour with more tests I made I think the last fix is nice 8) or shall we say more bulletproof code.

Once more glad to help, altough as I told before I'm new to PHP developing.

Code: Select all
if (get_magic_quotes_gpc() == "1") {
      
$factionstr addslashes($_REQUEST['factionfilter']);
  } else {
      
$factionstr $_REQUEST['factionfilter'];
  }

    
$query "SELECT m.clientLocale locale, m.name member, r.faction, r.name fct_name, curr_rep AS value, ".
        
"curr_rep, ".
        
"max_rep, ".
        
"r.standing ".
        
"FROM `".$roster->db->table('reputation')."` r, `".$roster->db->table('players')."` m ".
        
"WHERE r.member_id = m.member_id AND m.guild_id = '".$roster->data['guild_id']."' AND r.name='".$factionstr."' ".
        
"ORDER BY max_rep desc, r.standing DESC, curr_rep DESC";
 


Will still using the standard ' instead of " in the SQL statement, and by using function addslashes() to auto-escape in case of the get_magic_quotes() is True.

http://pt2.php.net/manual/en/function.g ... es-gpc.php
Last edited by ntex on Sun Nov 04, 2007 5:34 am, edited 4 times in total.
User avatar
ntex
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Fri Aug 17, 2007 9:58 pm

FactReputation [v2.0.0.7] for Beta 2

Postby PleegWat » Sat Nov 03, 2007 7:29 pm

This is strange. You shouldn't be needing to do this - settings.php fixes these up so get/post/cookie/request are always slashed.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

FactReputation [v2.0.0.7] for Beta 2

Postby Subxero » Sat Nov 03, 2007 8:43 pm

Hi tuigii

esES.php
Code: Select all
<?php

$lang['reputationinfo'] = 'Reputación';
$lang['reputation_desc'] = 'Mostrar la reputación de todas las facciones';
$lang['reputationinfobutton'] = 'Reputación|Mostrar la reputación de todas las facciones';

$lang['SelectFaction'] = 'Elige una facción';
$lang['reputation_addon'] = 'Reputación';
$lang['faction_filter']= 'Filtro facción: ';
$lang['rep_name'] = 'Nombre';
$lang['rep_group'] = 'Grupo';
$lang['rep_faction'] = 'Facción';
$lang['rep_status'] = 'Estatus';
$lang['rep_value'] = 'Valor';
$lang['rep_max'] = 'Max';

?>
Subxero - Priest 70 Holy - Asphelt Knight Officer - Zul'jin Horde.
User avatar
Subxero
WR.net Artisan
WR.net Artisan
 
Posts: 234
Joined: Thu Jul 06, 2006 4:08 pm
Realm: Zul'jin (PvE) - US

Re: FactReputation [v2.0.0.7] for Beta 2

Postby tuigii » Sat Nov 03, 2007 10:46 pm

PleegWat wrote:This is strange. You shouldn't be needing to do this - settings.php fixes these up so get/post/cookie/request are always slashed.

Right, ntex, have a look at settings.php, line 130-136 and the function used there, escape_array(..) (in functions.lib.php line 905).
It does exactly the same thing as you proposed !!?!
So, you shouldn't have to use addslashes(..) - as it already has been done.
My question : why isn't this being done for you in the first place ?

Subxero wrote:Hi tuigii

esES.php

Thanks !
I'll put it in place.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Re: FactReputation [v2.0.0.7] for Beta 2

Postby ntex » Sun Nov 04, 2007 3:39 am

Code: Select all
/**
 * Set magic quotes runtime off
 */
set_magic_quotes_runtime(0);
 

This is what I have in settings.php altough when I use that function to get status of magic quotes in runtime it returns 1?!

Perhaps I should mention that this is a "module" that runs on PHP-nuke, ok not rly a module, because it's using iFrame only, but simulates a behavior module to "wrap" Roster :)

Code: Select all

<?php

if (!defined('MODULE_FILE')) {
   die (
"You can't access this file directly...");
}
require_once(
"mainfile.php");
$module_name basename(dirname(__FILE__));
get_lang($module_name);

$index=0;
$go_to_address1="/modules/roster/roster/index.php";
$go_to_address=rawurldecode($go_to_address1);

include(
"header.php");
define('INDEX_FILE'true);
OpenTable();

/* ----> iframe code to load above URL                                      */
echo "<iframe id=\"myframe\" SRC=\"".$go_to_address."\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\" vspace=\"0\" hspace=\"0\" style=\"overflow:visible; width:100%; display:none\"></iframe>";

CloseTable();
include(
"footer.php");

?>


Also I use a javascript to resize dynamically the contents of the Roster.

But if I don't have this tested fixes don't know why doesn't work, I say I don't know 'cos I have noticed that I use another SQL statements using apostrophes between and none of them works wrong... This is the only code that I'm having issues odd :(
Last edited by ntex on Sun Nov 04, 2007 5:28 am, edited 1 time in total.
User avatar
ntex
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Fri Aug 17, 2007 9:58 pm

Re: FactReputation [v2.0.0.7] for Beta 2

Postby tuigii » Sun Nov 04, 2007 4:11 am

Iframe or not, magic_quotes should be off, otherwise you would be having a local problem to solve.

I use/maintain your initial solution:
Code: Select all
"' AND r.name=\"".$_REQUEST['factionfilter']."\" "

because 'factionfilter' is still backshashed, and if it isn't, it still works also.

I updated this, with the esES.php update.

It rather 'non-logic' for me to test (your latest solution) for someting that should have been done several lines before...

I do appreciate that you try to find solution that not only work for you, but also the 'others', because that's the way code is written.
The nasty thing is that no-one can test every possible case.

I looked into the entire roster, and only found that they all uses quotes when using text in SQL statements from the database.
This text is in my case the faction title - and it can have a single quote ' in it. True, this is a rare case.

Normally, when you replace all the double quotes " for ' (when building the entire $query string) you would be fine also. Is this true ?
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Re: FactReputation [v2.0.0.7] for Beta 2

Postby ntex » Sun Nov 04, 2007 5:23 am

I tested the newest version and it's working fine.

Although I'm one those guys that like to understand the "why" of things, so I checked my php.ini on my laptop, my magic_quotes are on, altough I have other parts of home-made code for my php-nuke and it's working fine when I have ' inside the ' ' in SQL statements and settings.php of Roster turned them off supposedly, although when I tested the value they're on inside Roster pages weird uhm?

Anyway once more, glad to help or at least try ;)

I'm somehow new at coding in PHP, as said before, just learning also with u guys 8)
User avatar
ntex
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Fri Aug 17, 2007 9:58 pm

FactReputation [v2.0.0.8] for Beta 2

Postby foreseit » Tue Nov 06, 2007 4:16 am

You're more than welcome to use my guild to test. :)

It looks like everything is working now, too. Thanks!
<a href="thehateguild.com"><img src="/anetheron/addons/siggen/sig.php?name=Foreseit"></a>
User avatar
foreseit
WR.net Journeyman
WR.net Journeyman
 
Posts: 139
Joined: Tue Jul 25, 2006 10:03 pm

FactReputation [v1.9.9.1485] for Roster Beta 2

Postby benv666 » Mon Dec 03, 2007 5:31 pm

Just tried installing version 2.0.0.8 (which went fine), but I get the same error as daddelkopp:
http://roster2.handofhades.eu/guild/rep ... a=g:1.html

Any ideas on it yet? :)
benv666
WR.net Apprentice
WR.net Apprentice
 
Posts: 42
Joined: Wed May 09, 2007 5:04 pm
Location: The Netherlands

PreviousNext

Return to Reputation

Who is online

Users browsing this forum: No registered users and 0 guests

cron