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)

Jacko 10-22-2002 05:43 PM

i tried that but i get nothing there.. same with the items.

Jacko 10-22-2002 05:55 PM

ok i fixed the items not showing on the postbit.. but i still can get my points to show up..

Frank-kun 10-26-2002 06:18 PM

Hello everyone,

Well, this one's been a much-traveled hack. I installed this on version 2.2.8, even knowing there were problems, because I wanted to see if I could find out some way of helping with a couple of the problems - this is a very cool hack and I hate to see it go to waste.

One of the main concerns appears to be the query load. Because of the way the hack works, even with Link's fix, there is an insane amount of queries -per post- to process the display of items.

Vivi actually saw that this was a problem and posted a fix wayyy back in the early pages of the thread. However, the fix missed a step, and I wasn't able to properly get a good display going without the load until recently.

Basically, I applied Vivi's fix, and included the one step he missed when he first posted it. I believe this should help on the server load and reduce the queries to nil.

Since I have limited experience with php and mySQL, try this out at your own risk. Be sure to backup the files you're hacking.

1. showthread.php edits (do this step TWICE since there are two instances in the code)

In showthread.php, find the following:

Quote:

post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,".iif($forum[allowicons],'icon.title as icontitle,icon.iconpath,','')."
replace it with:

Quote:

post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,items_user.*,".iif($forum[allowicons],'icon.title as icontitle,icon.iconpath,','')."
find:

Quote:

LEFT JOIN userfield ON userfield.userid=user.userid
add this BELOW:

Quote:

LEFT JOIN items_user ON items_user.userid=user.userid
2. admin/functions.php edits

find the original hack of functions.php for the item shop, as instructed by the installer. It should be something like this (link's fix is similar-looking):

Quote:

global $DB_site;
$nr=1;
while ($nr <= 50) {
$catstuff=$DB_site->query_first("SELECT * FROM items_cats WHERE id=$nr");
$its=$DB_site->query("SELECT * FROM items WHERE cat=$nr ORDER BY name $asds");
if(sizeof($catstuff)==16) {
if($catstuff[type]==1) {
$uid=$DB_site->query_first("SELECT item0,points0,description0,icon0,itid0 FROM items_user WHERE userid=$post[userid]");
if($uid[0]!='No Item') {
$post[items] .= "<a href=\"itemshop.php?action=view&id=$uid[4]\"><img src=\"https://vborg.vbsupport.ru/greentek/itemshop/prs.gif\" border=\"0\"></a> ";
} else {
$post[items] .= "<img src=\"https://vborg.vbsupport.ru/greentek/itemshop/No Item.gif\" border=\"0\"> ";
}
} else {
$uid=$DB_site->query_first("SELECT item$nr,points$nr,description$nr,icon$nr,itid$nr FROM items_user WHERE userid=$post[userid]");
if($uid[0]!='No Item') {
if(empty($uid[3])) {
$post[items] .= "<a href=\"itemshop.php?action=view&id=$uid[4]\"><img src=\"https://vborg.vbsupport.ru/greentek/itemshop/$uid[0].gif\" border=\"0\"></a> ";
} else {
$post[items] .= "<a href=\"itemshop.php?action=view&id=$uid[4]\"><img src=\"https://vborg.vbsupport.ru/greentek/itemshop/$uid[3].gif\" border=\"0\"></a> ";
}
} else {
$post[items] .= "<img src=\"https://vborg.vbsupport.ru/greentek/itemshop/No Item.gif\" border=\"0\"> ";
}
}
} else {
break;
}

$nr++;
}
replace it with:

Quote:

if($post[item0]!='No Item') {
$post[items] .= "<a href=\"itemshop.php?action=view&id=$post[itid0]\"><img src=\"https://vborg.vbsupport.ru/greentek/itemshop/prs.gif\" border=\"0\"></a> ";
} else {
$post[items] .= "<img src=\"https://vborg.vbsupport.ru/greentek/itemshop/No Item.gif\" border=\"0\"> ";
}


$nr=1;
while ($nr <= 3) {
$xc="item$nr";
if($post[$xc]!='No Item') {
$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=\"https://vborg.vbsupport.ru/greentek/itemshop/$post[$xvv].gif\" border=\"0\"></a> ";
} else {
$post[items] .= "<a href=\"itemshop.php?action=view&id=$post[$xv]\"><img src=\"https://vborg.vbsupport.ru/greentek/itemshop/$post[$xvvv].gif\" border=\"0\"></a> ";
}
} else {
$post[items] .= "<img src=\"https://vborg.vbsupport.ru/greentek/itemshop/No Item.gif\" border=\"0\"> ";
}
$nr++;
}
(NOTE: be sure to change https://vborg.vbsupport.ru/greentek to imagesfolder, i.e. the word "imagesfolder" enclosed in curly braces, when you cut and paste this!)

You should now have a less bloated bunch of code to process the images and items for each poster in a thread. As an added bonus, since the items_user is now LEFT JOIN'd to the $post array, you can individually call items by fieldname in the array. I do this because I don't like to see icons, but names. It varies depending on your categories and such, but if you use

$post[item1]

When editing your postbit, you should get the text name for the item in that category in your postbit, if you want a different one, try [item2], [item3], etc.

I hope this works and that it helps some of you out. :)

Jacko 10-27-2002 11:58 PM

is it possible to show the users items in a seperate page with no other PHP at all???

will use a button then to pop up a window displaying the items...

any help would be appreciated...

and wont this lower the amount of query loads on the showthread????

and if this can go into a new page what can i delete of the old hacked php code to gt rid or reduce the query load??

all thanks :)

mewgood 10-28-2002 10:14 PM

can anyone make an add on to this hack
like when a memner is opening a store, he can upload mini images his self which will put beside the item he wants it to be.

mewgood 10-29-2002 05:34 AM

anyone?

Jacko 10-29-2002 08:20 AM

i think this thread is dead mate... try posting a new topic??

Jacko 10-29-2002 08:37 PM

can i not mod this hack so that all the users items can be viewable in a pop up page??

if anyone can please tell me,

Thanx

LOD-squa 11-05-2002 11:46 PM

question how can I reset the money on the bank?

Ninth Dimension 11-05-2002 11:52 PM

Quote:

Originally posted by Jacko
can i not mod this hack so that all the users items can be viewable in a pop up page??

if anyone can please tell me,

Thanx

Do you mean insted of the postbit??? I'm sure that this can be done, but would require some coding of your own, unless you can somehow grab the function that generates the items and use it in a diffrent file for the pop-up.

so basicly, in theory, yes, but it would need some work on your behalf.


All times are GMT. The time now is 07:43 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.04312 seconds
  • Memory Usage 1,753KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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