Problem with url syntax to ajax.php

Posts from previous Beta sessions

Problem with url syntax to ajax.php

Postby poetter » Wed Oct 10, 2007 3:52 pm

Hi,

look at this:
Code: Select all
$method = (isset($roster->pages[1]) ? $roster->pages[1] : '');

$cont = (isset($_GET['cont']) ? $_GET['cont'] : '');

$errmsg = $result = '';


if( $roster->pages[1] == 'addon' )


Allright, so first parameter in url needs to be ajax to load ajax.php in /pages. Then the first line wants the method name, but some lines later the same line is taken as an indicator that roster has to load a addon.

So where to put my method call?
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Problem with url syntax to ajax.php

Postby PleegWat » Wed Oct 10, 2007 4:21 pm

K, sorry.

/me slaps himself for committing code that hasn't been properly tested. Again.

0='ajax'
1='addon'
2=addonname
3=method

I'll fix it when I get home.
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

Problem with url syntax to ajax.php

Postby poetter » Thu Oct 11, 2007 12:38 am

Can you publish a new release of roster afterwards? otherwise i have to wait for response till then.
Last edited by poetter on Thu Oct 11, 2007 12:39 am, edited 1 time in total.
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Problem with url syntax to ajax.php

Postby PleegWat » Thu Oct 11, 2007 2:02 am

poetter, you do know that, as an addon dev, you have read access to the roster1 repository (which contains roster 2.0)?

I can't push a nightly build myself, since only zanix can update the rosterdiag reference dir.
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

Problem with url syntax to ajax.php

Postby poetter » Thu Oct 11, 2007 2:09 am

Yes i know. I can get the new file. But no one else that can give me response if ArmorySyncs Ajax functions are working.

BTW. Just changing the array index in line 21 won't do the trick. This way menuconf.js won't work anymore.

How about doing this?
Code: Select all
$method = (isset($roster->pages[3]) ? $roster->pages[3] : ( isset($roster->pages[2]) ? $roster->pages[2] : '' ) );
Last edited by poetter on Thu Oct 11, 2007 2:10 am, edited 1 time in total.
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Problem with url syntax to ajax.php

Postby PleegWat » Thu Oct 11, 2007 2:16 am

Fixed it for now. It uses index 1 by default, but index 3 if index 1 is equal to 'addon'.

I'm also moving the ajax.php to addons/AddonName/inc/ajax.php, to remain consistent and have all files in the addon root dir be util scope files.
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

Problem with url syntax to ajax.php

Postby poetter » Thu Oct 11, 2007 2:17 am

Hmm found another bug:

try this:
Code: Select all
--- D:/xampp/roster.com/htdocs/pages/ajax.php.org   Sat Oct 06 22:29:44 2007
+++ D:/xampp/roster.com/htdocs/pages/ajax.php   Wed Oct 10 20:14:11 2007
@@ -18,7 +18,7 @@
 
 include(ROSTER_AJAX . 'functions.php');
 
-$method = (isset($roster->pages[1]) ? $roster->pages[1] : '');
+$method = (isset($roster->pages[3]) ? $roster->pages[3] : ( isset($roster->pages[2]) ? $roster->pages[2] : '' ) );
 
 $cont = (isset($_GET['cont']) ? $_GET['cont'] : '');
 
@@ -27,7 +27,7 @@
 
 if( $roster->pages[1] == 'addon' )
 {
-   $addon = getaddon($pages[2]);
+   $addon = getaddon($roster->pages[2]);
    // Check if addon is active
    if( $addon['active'] == '1' )
    {
@@ -89,4 +89,3 @@
    '  <status>'.(int)$status.'</status>'."\n".
    '  <errmsg>'.$errmsg.'</errmsg>'."\n".
    '</response>'."\n";
-
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Problem with url syntax to ajax.php

Postby poetter » Thu Oct 11, 2007 2:38 am

What about this?
Code: Select all
      $status = 2;
      include_once( $addon['ajax_file'] );
      if( $status == 2 )


Another bug or do you want me to set status != 2 in my ajax.php?
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Problem with url syntax to ajax.php

Postby zanix » Thu Oct 11, 2007 9:18 am

Yeah, just don't set status = 2
These are roster ajax error codes :)

I fixed the $pages thing too svn[1394]
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

Problem with url syntax to ajax.php

Postby poetter » Thu Oct 11, 2007 3:31 pm

OK, it just was'nt in 1377. Will this stay in ajax.php? And to make this clear. We#re talking about line 47 - 52. The call to the addons ajax.php with the method definitions.
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Problem with url syntax to ajax.php

Postby PleegWat » Thu Oct 11, 2007 3:56 pm

THat construction somehow turned up for the native ajax usage, and got copy/pasted for the addons part. Set status back to 0 for now, i'll take a look and may change it tonight.
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


Return to Archived

Who is online

Users browsing this forum: No registered users and 1 guest

cron