wowhead fr links for wowroster 2.0

Requests, feedback, and general discussion about WoWRoster
DO NOT post topics about WoWRoster AddOns here!

wowhead fr links for wowroster 2.0

Postby glacian » Sat Aug 02, 2008 7:34 am

Hi!
I try to add a link to wowhead fr database for quest.
I succeeded to add this by modifying localization file but I have a problem with quests which have accentuate characters.
I think it comes from wowhead's encoding method:
it looks like this: http://fr.wowhead.com/?quests&filter=na ... +%C3%A2mes

and not like this: http://fr.wowhead.com/?quests&filter=na ... %E0+%E2mes

So is there somewhere something I can modify to change url encoding? and is it possible to do that only for sites which require this change?

Thanks

ps: sorry for my english^^
Last edited by glacian on Sat Aug 02, 2008 6:03 pm, edited 2 times in total.
glacian
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Mon Jul 28, 2008 9:17 pm

Re: wowhead frlinks for wowroster 2.0

Postby MattM » Sat Aug 02, 2008 9:49 am

Very nice! WH was willing to work with us, but nothing had happened AFAIK.
MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

wowhead frlinks for wowroster 2.0

Postby zanix » Sat Aug 02, 2008 9:51 am

There are only 3 places that use the quest links

addons\questlist\realm\index.php (Line 79)
addons\questlist\realm\index.php (Line 148)
addons\info\inc\char.lib.php (Line 317)
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: wowhead frlinks for wowroster 2.0

Postby glacian » Sat Aug 02, 2008 7:03 pm

Thank you for answers. I succeeded. If someone is interested , here are changes I did:

localization\frFR.php line 617: add
Code: Select all
// quest link to wowhead FR
$lang['questlinks'][] = array(
   'name'=>'Wowhead FR',
   'url1'=>'http://fr.wowhead.com/?quests&filter=na=',
   'url2'=>';minle=',
   'url3'=>';maxle='
);


localization\frFR.php line 643: add
Code: Select all
//item link to wowhead FR
$lang['itemlinks']['WoWHead FR'] = 'http://fr.wowhead.com/?item=';



addons\questlist\realm\index.php (Line 79) replace
Code: Select all
foreach( $roster->locale->act['questlinks'] as $link )
      {
         $linktip .= '<a href="' . $link['url1'] . urlencode(utf8_decode($qrow['quest_name'])) . '" target="_blank">' . $link['name'] . '</a><br />';
      }

by
Code: Select all
foreach( $roster->locale->act['questlinks'] as $link )
      {
         switch($link['name']){
            case "Wowhead FR":
            $linktip .= '<a href="' . $link['url1'] . rawurlencode($qrow['quest_name']) . '" target="_blank">' . $link['name'] . '</a><br />';
            break;
            
            default:
            $linktip .= '<a href="' . $link['url1'] . urlencode(utf8_decode($qrow['quest_name'])) . '" target="_blank">' . $link['name'] . '</a><br />';
         }
      }


addons\questlist\realm\index.php (Line 148) replace
Code: Select all
foreach( $roster->locale->act['questlinks'] as $link )
   {
      $linktip .= '<a href="' . $link['url1'] . urlencode(utf8_decode($qnrow['quest_name'])) . '" target="_blank">' . $link['name'] . '</a><br />';
   }

by
Code: Select all
foreach( $roster->locale->act['questlinks'] as $link )
   {
      switch($link['name']){
         case "Wowhead FR":
         $linktip .= '<a href="' . $link['url1'] . rawurlencode($qnrow['quest_name']) . '" target="_blank">' . $link['name'] . '</a><br />';
         break;
         
         default:
         $linktip .= '<a href="' . $link['url1'] . urlencode(utf8_decode($qnrow['quest_name'])) . '" target="_blank">' . $link['name'] . '</a><br />';
      }
   }


addons\info\inc\char.lib.php (Line 317) replace
Code: Select all
foreach( $roster->locale->act['questlinks'] as $link )
               {
                  $roster->tpl->assign_block_vars('zone.quest.links',array(
                     'NAME' => $link['name'],
                     'LINK' => $link['url1'] . urlencode(utf8_decode($quest_name)) . (isset($link['url2']) ? $link['url2'] . $quest_level : '') . (isset($link['url3']) ? $link['url3'] . $quest_level : ''),
                     )
                  );
               }

by
Code: Select all
foreach( $roster->locale->act['questlinks'] as $link )
               {
                  switch($link['name']){
                     case "Wowhead FR":
                     $roster->tpl->assign_block_vars('zone.quest.links',array(
                        'NAME' => $link['name'],
                        'LINK' => $link['url1'] . rawurlencode($quest_name) . (isset($link['url2']) ? $link['url2'] . $quest_level : '') . (isset($link['url3']) ? $link['url3'] . $quest_level : ''),
                     )
                     );
                     break;
                  
                     default:
                     $roster->tpl->assign_block_vars('zone.quest.links',array(
                     'NAME' => $link['name'],
                     'LINK' => $link['url1'] . urlencode(utf8_decode($quest_name)) . (isset($link['url2']) ? $link['url2'] . $quest_level : '') . (isset($link['url3']) ? $link['url3'] . $quest_level : ''),
                     )
                     );
                  }
               }
glacian
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Mon Jul 28, 2008 9:17 pm

wowhead fr links for wowroster 2.0

Postby zanix » Sun Aug 03, 2008 12:20 am

You night be able to just use rawurlencode()

I can't for the life of me remember why utf8_decode() was in there
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

wowhead fr links for wowroster 2.0

Postby glacian » Sun Aug 03, 2008 3:47 am

Nop, some other sites like judgehype have correct links only with urlencode(utf8_decode()). I don't know exactly why, but it's again a story of accents.
glacian
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Mon Jul 28, 2008 9:17 pm

wowhead fr links for wowroster 2.0

Postby zanix » Sun Aug 03, 2008 6:49 am

Ah well, that sucks

The quest id is available in the WoW API now.
CP can be made to get the quest id and then we can use that instead of the names, that is, if the site supports the quest id
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

wowhead fr links for wowroster 2.0

Postby glacian » Sun Aug 03, 2008 7:11 pm

After few tests, I decided to delete judgehype, even with good character encoding, their search system is inefficient with quest name. so I remove utf8_decode part too (no need any more^^)

Get quests id from the game ike it already is the case for items? Yes it would be more pratical (no accent problem, no language problem). I think it will need changes in database structure and character profiler wow addon? It's a little too much for me for the moment^^
I'll see this later or if you have the time to do this yourself.

Thank you for informations
glacian
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Mon Jul 28, 2008 9:17 pm

wowhead fr links for wowroster 2.0

Postby zanix » Mon Aug 04, 2008 12:16 am

You are correct
CP would need to be changed to get the id and Roster would need to be changed to store and use the id
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US


Return to General Support & Feedback

Who is online

Users browsing this forum: No registered users and 1 guest

cron