[DEV] Item Shop

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
theanimewizard
Registered User
Posts: 646
Joined: Tue Jul 08, 2003 9:24 pm
Contact:

Post by theanimewizard »

in shop type.. put admin_only

it exists but users cant see it =P
fateorfantasy
Registered User
Posts: 318
Joined: Tue Jul 01, 2003 6:54 pm
Location: Canada
Contact:

Post by fateorfantasy »

theanimewizard wrote: in shop type.. put admin_only

it exists but users cant see it =P

k thanx, because i'm trying to make an ugly attempt at a sort of class thing, but its ornamental... (serves no purpose) i used moogie's unidentified sword one as a base... does anybody know how to make it so that checks to see if any of the items (classes) from a list are in that person's inventory, and so it deletes any existing classes, and puts in the new class instead? and also inserts the items in the beginning? and how could i make it work with a gender mod? this is what i have so far:

Code: Select all

<?php 
/*************************************************************************** 
*                                Wizard.php 
*                            ------------------- 
*   Version              : 0.0.1 
*   began                : Sunday, February 9th, 2003 
*   released             : Sunday, February 9th, 2003 
*   email                : fateorfantasy@hotmail.com 
* 
***************************************************************************/ 

/*************************************************************************** 
* 
*   Use Item copyright (C) 2002/2003  fateorfantasy -based on idea by Moogie (Unidentified Sword.php)
* 
*   This program is free software; you can redistribute it and/or 
*   modify it under the terms of the GNU General Public License 
*   as published by the Free Software Foundation; either version 2 
*   of the License, or (at your option) any later version. 
* 
*   This program is distributed in the hope that it will be useful, 
*   but WITHOUT ANY WARRANTY; without even the implied warranty of 
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
*   GNU General Public License for more details. 
* 
*   http://www.gnu.org/copyleft/gpl.html 
* 
***************************************************************************/ 

define('IN_PHPBB', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.' . $phpEx); 

// 
// Start session management 
// 
$userdata = session_pagestart($user_ip, PAGE_INDEX); 
init_userprefs($userdata); 
// 
// End session management 

$user_id = ( isset($HTTP_GET_VARS['user_id']) ) ? intval($HTTP_GET_VARS['user_id']) : 0; 

$username = $userdata[username]; 
$itemname = 'Book of Wizardry'; 
$requireditem = 'Wizard/'s Staff'; 
$itemfound = 'Wizard'; 
$itemsreplace = $itemfound.'Þß'.$requireditem; 

//start of user item listing. 
   $template->set_filenames(array( 
      'body' => 'use_body.tpl') 
   ); 

   if ( !$userdata['session_logged_in'] ) 
   { 
      $redirect = $itemname.".php"; 
      header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true)); 
   } 
    
//make sure user has item 
      $sql = "select user_items from " . USERS_TABLE . " where username='$username'"; 
      if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Getting Items!'); } 
      $row = mysql_fetch_array($result); 
      if (substr_count($row['user_items'],"ß".$itemname."Þ") < 1) 
      { 
         message_die(GENERAL_MESSAGE, 'You don\'t have a '.$itemname.'!'); 
      } 

//make sure user has required item 
      $sql2 = "select user_items from " . USERS_TABLE . " where username='$username'"; 
      if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Getting Items!'); } 
      $row = mysql_fetch_array($result); 
      if (substr_count($row['user_items'],"ß".$requireditem."Þ") < 1) 
      { 
         message_die(GENERAL_MESSAGE, 'You can\'t learn to be a '.$itemfound.' with just the '.$itemname.'!'); 
      } 

//   global $db; 


//discard the required item & replace with figure 
      $useritems = substr_replace($row['user_items'], "ß".$itemsreplace."Þ", strpos($row['user_items'],  

"ß".$requireditem."Þ"), strlen("ß".$requireditem."Þ")); 
      $newuseritems = substr_replace(strpos($useritems, "ß".$itemname."Þ"), $useritems, "", strlen("ß".$itemname."Þ")); 
      $sql="update phpbb_users set user_items='$newuseritems' where username='$username'"; 
      if ( !($db->sql_query($sql)) ) 
      { 
         message_die(GENERAL_MESSAGE, 'Fatal Error discarding '.$requireditem.' and '.$itemname.'.'); 
   } 


   $useaction = "<tr><td class=\"row1\" align=\"center\"><BR><span class=\"size2\"><b>".$username."</b> picked up the 

<b>".$requireditem."</b> and read the book, <b>".$itemname."</b>!<P><img 

src=\"/fateorfantasy/phpBB2/shop/images/".$itemfound.".gif\" border=\"0\"><P><b><i>".$username."</b> has become an 

$itemfound!</i></span><P></td></tr>"; 


   $uselocation = "Use the ".$itemname; 
   $title = "Use the ". $itemname; 
   $page_title = "Use the ".$itemname; 

   $template->assign_vars(array( 
      'USELOCATION' => $uselocation, 
      'USEACTION' => $useaction, 
      'L_USE_TITLE' => $title, 
   )); 
   $template->assign_block_vars('', array()); 

// 
// Start output of page 
// 
include($phpbb_root_path . 'includes/page_header.' . $phpEx); 

// 
// Generate the page 
// 
$template->pparse('body'); 

include($phpbb_root_path . 'includes/page_tail.' . $phpEx); 

?>
Last edited by fateorfantasy on Thu Jul 24, 2003 1:18 am, edited 1 time in total.
cinder
Registered User
Posts: 63
Joined: Sat Mar 01, 2003 9:23 pm
Location: Canada
Contact:

Post by cinder »

Wowie! I actually got Moogie's treasure chest mod working!!

Thankyouthankyouthankyouthankyouthankyouthankyouthankyou for making all these wonderful things.

This question here is gonna sound weird. Is it possible to make it so that specific usergroups have the ability to use the Treasure Chest.php? I'm experimenting with Treasure Chest.php, and using it as a blacksmith thingie. I have a group called Blacksmiths, but then the ability to use an item is available to everyone.
OverlordQ
Registered User
Posts: 1
Joined: Wed Jul 23, 2003 11:33 pm

Post by OverlordQ »

Can I get this to work with the Cash Mod?

Edit: ignore this I found the readme in the Cash Mod
User avatar
Moogie
Registered User
Posts: 363
Joined: Thu Aug 22, 2002 11:39 am
Location: UK
Contact:

Post by Moogie »

fateorfantasy: My latest mod will be coming out in the next few days and has a fully working class system :) You can try it out at my forums if you want to, as I've just released it there for final testing. I'm getting the instructions and scripts etc together today and hope to release it by the end of tomorrow, sooner if possible!

cinder: Sorry, usergroups aren't something I use very much, so I'm not sure how to work that in :(
Moogie
cornnuts2
Registered User
Posts: 37
Joined: Wed Jun 04, 2003 7:25 pm

Post by cornnuts2 »

When I set the "Viewtopic Display Limit" to 3, it still shows all the items I have in my inventory. Is there a fix for this?
Q-Zar
Registered User
Posts: 779
Joined: Sun Nov 17, 2002 8:30 pm
Location: Brussels
Contact:

Post by Q-Zar »

Moogie, I just signed up at your board (as "Q-Zar", I'm consistent :p)
I'd like to test out your improved mods, battle mod, etc... But I saw the Arena Ticket was removed ?
In any case, could you explain again in short how it works, with the stats, battle, shop ? Thanks :)
Traductions : Cash Mod v2.2.2 (Getting Started) / Dice Mod v1.2.3 / Activity Mod Plus 1.0.8
Remember this. Please read the F.A.Q/Troubleshooting of a mod before asking questions.
Image
xmulder
Registered User
Posts: 429
Joined: Thu Jun 27, 2002 8:37 pm

Post by xmulder »

help! Just installed this mod on 2.0.4 and some of the name colours and title colours as well as some glows and some shadows don't work! they just make the name turn grey instead of purple or whatever. I have had a look around the files and tried re-running the install + disabling and enabling the shop but it still won't work with some of the colours shadows and glows!

Somebody please help!

Also the Items link appears straight after the points on the same line and does not display item graphics when specified in the ACP =/

thanks in advance
Alienz
Registered User
Posts: 53
Joined: Thu Mar 13, 2003 12:16 am

Post by Alienz »

Where can I download the lastest Item Shop? The link at the first page had been removed.
theanimewizard
Registered User
Posts: 646
Joined: Tue Jul 08, 2003 9:24 pm
Contact:

Post by theanimewizard »

xmulder wrote: help! Just installed this mod on 2.0.4 and some of the name colours and title colours as well as some glows and some shadows don't work! they just make the name turn grey instead of purple or whatever. I have had a look around the files and tried re-running the install + disabling and enabling the shop but it still won't work with some of the colours shadows and glows!

Somebody please help!

Also the Items link appears straight after the points on the same line and does not display item graphics when specified in the ACP =/

thanks in advance


The Effects shop might not be compatible with your layout.

To put the items link on a seperate line, go to view_body_post.tpl or something, search for the item link, put a <br \> before it
theanimewizard
Registered User
Posts: 646
Joined: Tue Jul 08, 2003 9:24 pm
Contact:

Post by theanimewizard »

xmulder wrote: help! Just installed this mod on 2.0.4 and some of the name colours and title colours as well as some glows and some shadows don't work! they just make the name turn grey instead of purple or whatever. I have had a look around the files and tried re-running the install + disabling and enabling the shop but it still won't work with some of the colours shadows and glows!

Somebody please help!

Also the Items link appears straight after the points on the same line and does not display item graphics when specified in the ACP =/

thanks in advance


The Effects shop might not be compatible with your template.

To put the items link on a seperate line, go to view_body_post.tpl or something, search for the item link, put a <br \> before it
xmulder
Registered User
Posts: 429
Joined: Thu Jun 27, 2002 8:37 pm

Post by xmulder »

theanimewizard wrote:
xmulder wrote:help! Just installed this mod on 2.0.4 and some of the name colours and title colours as well as some glows and some shadows don't work! they just make the name turn grey instead of purple or whatever. I have had a look around the files and tried re-running the install + disabling and enabling the shop but it still won't work with some of the colours shadows and glows!

Somebody please help!

Also the Items link appears straight after the points on the same line and does not display item graphics when specified in the ACP =/

thanks in advance


The Effects shop might not be compatible with your template.

To put the items link on a seperate line, go to view_body_post.tpl or something, search for the item link, put a <br \> before it


i had it running on the very same template a few months back - however i had fewer mods on it than i do now so i could be down to that =/ hey ho :p If anybody can think up a possiable solution would would be very happy :p

Thanks for the link fix btw - ill get that on ASAP :D
teste87
Registered User
Posts: 74
Joined: Tue Mar 18, 2003 11:30 pm

Post by teste87 »

Well, I tried to enable avatar buying and not disabling avatar upload. So it didn't work. So I disabel avatar uupload and remote avatars and "buyed an avatar" but it didn't show up. What I did wrong?
Zarath
Registered User
Posts: 736
Joined: Fri Dec 06, 2002 9:01 am
Contact:

Post by Zarath »

If you have advanced quick reply, that's one mod that will screw with the name colours/effects. Anything that changes the name will probably ruin it.
xmulder
Registered User
Posts: 429
Joined: Thu Jun 27, 2002 8:37 pm

Post by xmulder »

Zarath wrote: If you have advanced quick reply, that's one mod that will screw with the name colours/effects. Anything that changes the name will probably ruin it.


nope - i dont have anything like that =/ no mods on my forum change the users name at all and i dont have quick reply either =/
Locked

Return to “[2.0.x] MODs in Development”