Can Make

Download, Present, and receive support for third party WoWRoster AddOns and modifications
WoWRoster AddOns and Mods are supported by the author only
Please understand that some AddOns and Mods may require advanced skills to employ

Can Make

Postby Ulminia » Fri Sep 08, 2006 10:03 am

ok after scripting for a cuple of days i came up with this its just a function to insert and all it does is add a colem in the recipe page to tell hoe many of a recipe the player can make with a query of items in the players invintory and bank see my screenshoot

and for an example see here

if there is intrest i will post a install how too for you all
Attachments
canmake.jpg
screenshoot
canmake.jpg (53.12 KiB) Viewed 869 times
Last edited by Ulminia on Fri Sep 08, 2006 10:06 am, edited 2 times in total.
User avatar
Ulminia
WoWRoster.net Dev Team
WoWRoster.net Dev Team
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 1223
Joined: Tue Jul 04, 2006 4:41 pm
Location: New Brunswick, Canada
Realm: Zangarmarsh (PvE) - US
gmail/gtalk: ulminia@gmail.com

Can Make

Postby Averen » Fri Sep 08, 2006 11:08 am

Looks cool, would love to get the addon :)
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Can Make

Postby Ulminia » Fri Sep 08, 2006 12:55 pm

not an addon have to past code in to the origional files ial post later how to do for now must sleep
User avatar
Ulminia
WoWRoster.net Dev Team
WoWRoster.net Dev Team
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 1223
Joined: Tue Jul 04, 2006 4:41 pm
Location: New Brunswick, Canada
Realm: Zangarmarsh (PvE) - US
gmail/gtalk: ulminia@gmail.com

Can Make

Postby PleegWat » Fri Sep 08, 2006 2:04 pm

Should be possible to code this as an addon. Copy the relevant code from what you've modded if needed.
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

Can Make

Postby Ulminia » Fri Sep 08, 2006 8:24 pm

the coding for this feature in in the char.php file and commonfunc.php to make it an addon people will still have to mod these files..
User avatar
Ulminia
WoWRoster.net Dev Team
WoWRoster.net Dev Team
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 1223
Joined: Tue Jul 04, 2006 4:41 pm
Location: New Brunswick, Canada
Realm: Zangarmarsh (PvE) - US
gmail/gtalk: ulminia@gmail.com

Re: Can Make

Postby Ulminia » Mon Sep 11, 2006 4:28 pm

ok here we go to have this work follow these instructions...


open commonfunctions.lib.php go to the end and add this code

Code: Select all
function can_make($recipe){

$result mysql_query("SELECT * FROM `".ROSTER_RECIPESTABLE."` WHERE `recipe_name` = '".$recipe."'");

$recipes mysql_fetch_array($result);
      
$reag1 explode("<br>"$recipes['reagents']);
      
$c count($reag1);

        
$c1 $c;

        
$i 0;
$reag1 explode("<br>"$recipes['reagents']);

       
$comp = array();
       
//$recipes['recipe_name']
        
while($i $c){

      list(
$r$num) = explode(" x"$reag1[$i]);

      
$resulta mysql_query("SELECT * FROM `".ROSTER_ITEMSTABLE."` WHERE `item_name` = '".$r."'");
      
$quantity mysql_fetch_array($resulta);
      if (
$quantity['item_quantity'] == ''){
      
$quant '0';
      }
      else
      {
      
$quant $quantity['item_quantity'];
      }

      
$av = ($quant $num);
      
$avl number_format($av0'''');
      
$comp[''.$r.''] = ''.$avl.'';
        
$i++;
      }
      return 
min($comp);



then open char.php in the lib folder

find
Code: Select all
<th class="membersHeader">'.$url.'&action=recipes&s=type">'.$wordings[$lang]['type'].'</a></th>


add this after
Code: Select all
<th class="membersHeader">Can Make</th


then find this
Code: Select all
<td class="membersRow'.$stripe.'"> '.$recipe->data['recipe_type'].' </td>


add this after
Code: Select all
<td class="membersRow'.$stripe.'">'.can_make($recipe->data['recipe_name']).'</td>


thats it all done enjoy :)
User avatar
Ulminia
WoWRoster.net Dev Team
WoWRoster.net Dev Team
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 1223
Joined: Tue Jul 04, 2006 4:41 pm
Location: New Brunswick, Canada
Realm: Zangarmarsh (PvE) - US
gmail/gtalk: ulminia@gmail.com

Can Make

Postby IslandStyle » Mon Oct 30, 2006 12:26 pm

I get error messages when trying to do this saying

Code: Select all
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 705

Warning: Division by zero in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 730

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 705

Warning: Division by zero in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 730

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 705

Warning: Division by zero in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 730

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 705

Warning: Division by zero in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 730

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 705

Warning: Division by zero in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 730

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 705

Warning: Division by zero in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 730

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 705

Warning: Division by zero in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 730

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/kalimdor/kalimdortribe.com/roster/lib/commonfunctions.lib.php on line 721
Recipe List 


not sure what is causing it.
site is at Kalimdor Tribe

any ideas would be great.
Image
Image
User avatar
IslandStyle
WR.net Apprentice
WR.net Apprentice
 
Posts: 41
Joined: Tue Jul 11, 2006 8:57 am


Return to AddOns and Mods

Who is online

Users browsing this forum: No registered users and 0 guests

cron