vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   The Itemshop v5 (Original) (https://vborg.vbsupport.ru/showthread.php?t=38090)

Ninth Dimension 11-05-2002 11:53 PM

Quote:

Originally posted by gohanssj2
question how can I reset the money on the bank?
what do you mean by this? in any case it should be nothing more than a simple SQL query string :)

LOD-squa 11-06-2002 01:16 AM

I know but what's the code? I don't know it >_<

Ninth Dimension 11-06-2002 02:18 AM

you still have not answered my question, what do you mean reset the money? are you talking about bring everyones credits back down to zero? do you mean change the interest rate?? what?

you tell me this and i'll do my best to give you ans answer (out of the kindness of my heart :))

NuclioN 11-06-2002 01:24 PM

Frank, your fix reduces the query's and that's great but it seems to bring back the nasty 1064 error in the postbit.

LOD-squa 11-06-2002 08:44 PM

well the bank has money(gil) and I want to get the banks money up to 0 how can I do that?

Ninth Dimension 11-06-2002 10:06 PM

i'm really sorry but i'm sure that the bank does not have any money of it's own - if someone tries to sell something back to the system, they get money generated for them, but not from a specific source.

I've looked in the database and can't find anything like this, but I might be wrong.

mewgood 11-10-2002 01:31 AM

how do I reset the money in the bank?

rake 11-17-2002 05:32 PM

I never thought i would ever update the itemshop again, but here it is. This update fixes the problem with the huge amounts of queries the itemshop produces. Items are now correctly displayed in the postbit. Estimated Installation Time: 3 minutes.

ULTIMATESSJ 11-21-2002 04:06 PM

Quote:

Originally posted by rake
I never thought i would ever update the itemshop again, but here it is. This update fixes the problem with the huge amounts of queries the itemshop produces. Items are now correctly displayed in the postbit. Estimated Installation Time: 3 minutes.
excuse the n00b question, but would this still work if i tried to use the store hack points for the itemshop

Alchemyst 11-21-2002 09:52 PM

Bah, having trouble with the itemshop, apparently it won't get peoples points up (and I did everything the same.. grr) in version my updated 2.2.9, yes all the settings are correct....

Jitway 11-22-2002 12:29 AM

Ok I got a couple questions.

First how do I show my points in the postbit template and second I get a red x for the items and I have no items but the url is this http://www.jitway.com/forums/images/itemshop/.gif and by reading the hack it should be prg.gif or No Item.gif since I have no items.

mli 11-23-2002 03:35 PM

Yea, same thing happens to me. The red X's. Could someone help out?

ULTIMATESSJ 11-23-2002 05:18 PM

Quote:

Originally posted by Jitway1
Ok I got a couple questions.

First how do I show my points in the postbit template and second I get a red x for the items and I have no items but the url is this http://www.jitway.com/forums/images/itemshop/.gif and by reading the hack it should be prg.gif or No Item.gif since I have no items.

use an ftp program and get rid of the name, so the ending file is called

.gif

it works with WS_FTP and should work with others, as long as your not using the browser for FTP Uploading

mli 11-23-2002 05:30 PM

No, that's not the problem. The problem is that there is no filename. There is just .gif as the file name....

Jitway 11-23-2002 05:41 PM

I used a ftp program flashfxp to be exact and as stated above the file names are uploaded correctly but the url for the item is showing up as just .gif and since there is no file just called .gif you get a red x. By reading the hack in the admin functions.php the file should be either prg.gif or No Item.gif if you have no items and not just .gif. So that is the problem. Does anyone have a suggested fix? :banana:

Bitsys 11-23-2002 06:09 PM

Comment out the following code, assuming you used rake's fix above:

PHP Code:

global $totalcats;
for (
$i 1$i <= $totalcats[0]; $i++) {
    if(
$post['item$i']!='No Item') {
        if(empty(
$post['icon$i'])) {
            
$itemid "itid$i";
            
$iconid "icon$i";
            
$itemname "item$i";
            
$post[items] .= "<a href=\"itemshop.php?action=view&id=$post[$itemid]\"><img src=\"{ imagesfolder}/itemshop/$post[$iconid].gif\" border=\"0\"></a> ";
        } else {
            
$post[items] .= "<a href=\"itemshop.php?action=view&id=$post[$itemid]\"><img src=\"{ imagesfolder}/itemshop/$post[$itemname].gif\" border=\"0\"></a> ";
        }
    } else {
        
$post[items] .= "<img src=\"{ imagesfolder}/itemshop/No Item.gif\" border=\"0\"> ";
    }


To comment, just put the characters " /* " in front of it and the characters " */ " at the end of it (without the quotes, of course).

Now, once the above is commented out, put the following code below it:

PHP Code:

global $totalcats;
$nr=1;
$count=1;
while (
$count <= $totalcats[0]) {
        
$xc="item$nr";
        
$xv "itid$nr";
        if(!isset(
$post[$xv])) {
                
$nr++;
                continue;
        }
        if(
$post[$xc]!='No Item' AND isset($post[$xc])) {
                
$xvv "item$nr";
                
$xv "itid$nr";
                
$xvvv "icon$nr";
                if(empty(
$post[$xvvv])) {
                        
$post[items] .= "<a href=\"itemshop.php?action=view&id=$post[$xv]\"><img src=\"{ imagesfolder}/itemshop/$post[$xvv].gif\" border=\"0\"></a> ";
                } else {
                        
$post[items] .= "<a href=\"itemshop.php?action=view&id=$post[$xv]\"><img src=\"{ imagesfolder}/itemshop/$post[$xvvv].gif\" border=\"0\"></a> ";
                }
        } else {
                
//$post[items] .= "<img src=\"{ imagesfolder}/itemshop/No Item.gif\" border=\"0\"> ";
        
}
        
$nr++;
        
$count++;


Don't forget to remove the space from { imagesfolder} (there are several instances of it). The space is there so that vBulletin.org doens't replace it with it's own url.

Also, if you remove the " // " from the line
PHP Code:

//$post[items] .= "<img src=\"{ imagesfolder}/itemshop/No Item.gif\" border=\"0\"> "; 

then it will try to display the No Item grahpic. I commented this out on my board because it added extra space that was not necessary.
This works on my server, but it may or may not work on yours. If it doesn't work, then just delete the code you inserted and remove the comment tags from rake's fix and you will be back to square one.

Jitway 11-23-2002 09:09 PM

Thanks for the help it worked...or at least it got rid of the red x's...won't know if it really works till I buy some items :cool: .

Mijae 11-25-2002 01:26 AM

Quote:

Originally posted by girlzclan
this happens everytime i try to donate, iv'e installed this hack on 4 different forums and im getting the same thing everytime :(

Database error in vBulletin 2.2.8:

Invalid SQL: SELECT field5 FROM userfield WHERE userid=Array
mysql error: Unknown column 'Array' in 'where clause'

mysql error number: 1054

Date: Monday 21st of October 2002 09:06:06 PM
Script: http://www.girlzclan.com/forums/forums/itemshop.php
Referer: http://www.girlzclan.com/forums/item...donate&user=11

same with me, anyone help?

Mijae 11-25-2002 02:58 PM

Also, the fix above to reduce queries doesnt work, neither your fix of the fix. I dont get red X, nothing shows up. When I view the source code it says img src=No Item.gif

Bitsys 11-25-2002 09:19 PM

Quote:

Originally posted by v0id
Also, the fix above to reduce queries doesnt work, neither your fix of the fix. I dont get red X, nothing shows up. When I view the source code it says img src=No Item.gif
How many items are in your inventory? Also, what are the item names and IDs?

Mijae 11-26-2002 12:02 AM

http://www.invoid.net/forum/itemshop.php

Everything is default from the install file. I'd say, 50 items total?

Also, does anyone know how to solve Post #378? Can anyone send me the install file they used so I can compare? Or an older version to admin@invoid.net?

Bitsys 11-26-2002 12:21 PM

Sorry, I wasn't very clear with my question. What I meant was, which items has your RPG character bought from the itemshop?

Mijae 11-27-2002 12:19 AM

Lightning Staff
Diamond Gloves
Ore

Bitsys 12-02-2002 06:32 PM

My mistake. I accidentally had you comment out the line
PHP Code:

global $totalcats

Just add
PHP Code:

global $totalcats

above my code, as seen in my edited post above. That should fix it.

Mijae 12-02-2002 06:51 PM

One more problem, now it doesnt show "Ore" or anything from the 3rd category.

Bitsys 12-02-2002 08:08 PM

Quote:

Originally posted by v0id
One more problem, now it doesnt show "Ore" or anything from the 3rd category.
That is caused by a typo from the original installation of the Itemshop. The field name in the table `items_user` says "Item3" when it should say "item3" with a lower case "i". An easy way to fix this is to go into phpmyadmin and manually change the field name to make it lowercase. If you don't have phpmyadmin, and you don't know how to change it with a database query, then let me know.

Mijae 12-02-2002 08:11 PM

I have phpMyAdmin, but I dont know the query string.

Bitsys 12-02-2002 08:25 PM

In phpmyadmin v2.2.2, here is the manual way of changing the field name:
  • Click on your vBulletin Database so that the list of tables drops down.
  • Click on the table called `items_user`
  • In the far left column, look for a field called "Item3". Click on the "Change" link across from this field. It should bring you to a screen that lets you change the name of the field.
  • Change the name of the field from "Item3" to "item3".
  • Click "Save". The field name should now be correct.

If you are running a different version, or can't figure it out, then here is another way to change it:

In your vBulletin database, run the following query:

Code:

ALTER TABLE `items_user` CHANGE `Item3` `item3` CHAR(250) DEFAULT 'No Item' NOT NULL
One of those two methods should work.

Mijae 12-02-2002 08:28 PM

Works perfectly. Thanks a lot! Since you seem to be familiar with this stuff, do you know why I get this when donating?

Invalid SQL: SELECT field5 FROM userfield WHERE userid=Array
mysql error: Unknown column 'Array' in 'where clause'

mysql error number: 1054

Its the only bug I have on the board >_<

Bitsys 12-02-2002 09:03 PM

Sorry, but I can't help ya on that one. I have never had that error before, nor have any of my members. I looked over the files, and there wasn't anything that looked out of place. :ermm:

Sorry. :(

tdphillipsjr 12-04-2002 03:48 PM

Quote:

Invalid SQL: SELECT field5 FROM userfield WHERE userid=Array
Looks like you declared an array and didn't give it any values. Whatever variable your using (userid = '$myarray'), you're probably not defining an index for it to look at.

Try, before that query doing something like:

$temp = $arrayname[userid]

where $arrayname is the name of the array that is being returned by mysql_fetch_array() and replacing your query with:

SELECT field5 FROM userfield WHERE userid = '$temp'

Just a quick guess without actually seeing any of the files.

Mijae 12-04-2002 09:54 PM

Code:

Database error in vBulletin 2.2.6:

Invalid SQL: SELECT field5 FROM userfield WHERE userid=Array
mysql error: Unknown column 'Array' in 'where clause'

mysql error number: 1054

Date: Wednesday 04th of December 2002 04:57:07 PM
Script: http://www.invoid.net/forum/forum/itemshop.php
Referer: http://www.invoid.net/forum/itemshop.php?action=donate

PHP Code:

if($action==donate && isset($user)) {
    if (
$bbuserinfo['userid']==0) {
    eval(
"dooutput(\"".gettemplate("error_notreg")."\");");
    } else {
        if(
$user == $bbuserinfo[userid]) {
        eval(
"dooutput(\"".gettemplate("itemshop_donate-self")."\");");
        exit;
        } else {
            if(
$points 0) {
            eval(
"dooutput(\"".gettemplate("itemshop_donate")."\");");
            exit;
            } else {
            eval(
"dooutput(\"".gettemplate("itemshop_donate-error")."\");");
            exit;
            }
        }
    }
}
if (isset(
$iddonate)) {
    if(
$points >= $amount) {
    
$dpointss=$DB_site->query_first("SELECT $pointfield FROM userfield WHERE userid=$iddonate");
    
$dpoints = (int) $dpointss[$pointfield];
    
$donated = ($dpoints $amount);
    
$substr = ($points $amount);
    
$DB_site->query("UPDATE userfield SET $pointfield='$donated' WHERE userid=$iddonate");
    
$DB_site->query("UPDATE userfield SET $pointfield='$substr' WHERE userid=$bbuserinfo[userid]");
    eval(
"dooutput(\"".gettemplate("itemshop_donate-thanks")."\");");
    exit;
    } else {
    eval(
"dooutput(\"".gettemplate("itemshop_donate-more")."\");");
    exit;
    }


Something has to be wrong there, but since I am a newbie I have no idea what it can be.

tdphillipsjr 12-05-2002 03:07 AM

is $iddonate set somewhere in this file? That looks to be the problem in the query.

Mijae 12-05-2002 07:51 AM

Nope, thats the only part.

tdphillipsjr 12-05-2002 02:50 PM

Void, on the form where you enter the donations... the one where there's a text field to enter how much you are donating and a submit botton that says "Donate!"

Do a view source on that. There shoudl be a hidden field in the form that looks like

<input type="hidden" name="iddonate" value="something">

Can you tell me what the Value is?

Bitsys 12-05-2002 07:31 PM

tdphillipsjr, here is the view source on my forums:

Code:

<input type="hidden" name="iddonate" value="23">
Here is the code from the itemshop_donate template that corresponds to the above code:

Code:

<input type="hidden" name="iddonate" value="$user">
As you can see, "iddonate" comes from yet another variable. Here is the code from postbit that sets the "$user" variable:

Code:

<a href="#" onclick="javascript:window.open('itemshop.php?action=donate&user=$post[userid]', '', 'toolbar=no,scrollbars=no,resizable=no,width=200,height=50');">Donate</a>
I am not having the "Array" problem on my forum with any of the above code, and that's why I don't know how to solve the problem. Let me know if you figure it out for v0id! :cool:

Mijae 12-05-2002 08:39 PM

Code:

{htmldoctype}
<html>
<head>
$metarefresh
<title>$bbtitle - Itemshop</title>
$headinclude
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
  <tr>
    <td valign="middle" align="center">
<form action="$PHP_SELF" method=post>
<input type="hidden" name="iddonate" value="$user">
<input type="text" class="bginput" name="amount" value="0">
<input type="submit" class="bginput" value="Donate!"></form></td>
  </tr>
</table>

that is my itemshop_donate template, looks fine to me.

Mijae 12-05-2002 08:41 PM

Oh, I did a view source and I have this:

Code:

<input type="hidden" name="iddonate" value="Array">

tdphillipsjr 12-05-2002 11:55 PM

OK, we are tracking it down. The value in your view source should be a digit, as in the code chunk bitsys posted.

which means the problem is further back in the postbit code. $post[userid] is not being set correctly. When it pops open the window, $post[userid] should have a userid, and instead it's still returning it's object... which means it never gets the userid it's supposed to.

window.open('itemshop.php?action=donate&user=$post[userid]

Mijae 12-06-2002 08:44 AM

Doesnt matter where I enter the ID, I even typed the url manually, I still get "Array"


All times are GMT. The time now is 09:44 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02538 seconds
  • Memory Usage 1,873KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (6)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete