vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Major Additions - vbBux / vbPlaza v1.5.8 (Points + Store System) (https://vborg.vbsupport.ru/showthread.php?t=106953)

Lyricsmama 02-16-2006 06:25 PM

Yay I upgraded from 1.1.3 to 1.1.5 and problem is gone!
THank you sooooooooooooo much

adielsh 02-16-2006 06:25 PM

Quote:

Originally Posted by CMX_CMGSCCC
It's viewable when you goto the member.php?u=userid link on your forums.

You must enable which usergroups can delete the gifts by going to the Admin CP -> Usergroups -> Usergroup Manager -> whatever user group -> eBS Settings -> Can Delete Own Gifts/Can Delete Any Gifts.

-CMX

tanx :squareeyed:

Lyricsmama 02-16-2006 06:26 PM

Ok another dumbo question: now I can delete the ucash thingy right? I did the integration and all.

CMX_CMGSCCC 02-16-2006 06:28 PM

Quote:

Originally Posted by Lyricsmama
Ok another dumbo question: now I can delete the ucash thingy right? I did the integration and all.

Yes, if you wish you can uninstall it, or you could simply disable it too in the Manage Plugins as well, its entirely up to you.

-CMX

TTG 02-16-2006 06:33 PM

Quote:

Originally Posted by CMX_CMGSCCC

Did you enable the setting in eBux Options --> Points For Attachments Enabled?

You must enable this to use the Points For Attachments now.

had already done that and still no joy

lairnoc 02-16-2006 07:08 PM

where can i set usergoup options i upgraded from 1.3 to 1.5 and now i am not allowed in estore anymore?

ImportPassion 02-16-2006 07:16 PM

Quote:

Originally Posted by lairnoc
where can i set usergoup options i upgraded from 1.3 to 1.5 and now i am not allowed in estore anymore?

in the vb usergroup editor

lordofgun 02-16-2006 07:50 PM

Awesome stuff, CMX!

I guess next on my list would be the ability for everyone to see who wins the lottery. (forgive me if this is already possible, but I can't find it.)

EDIT: I'd really like a PM to be sent to everyone who vought a loittery ticket at the conclusion of each lottery telling them the winner, and inviting them to buy a lottery ticket for the next lottery.

inspiration100 02-16-2006 08:01 PM

Thanks CMX, would love to see the confirm page on the attachment. Good stuff!

creedmaniac 02-16-2006 08:14 PM

with each update...how do i know if templates need to be updated?

CMX_CMGSCCC 02-16-2006 08:49 PM

Quote:

Originally Posted by TTG
had already done that and still no joy

What type of attachments do you have, Inline, or displayed as links?

Quote:

Originally Posted by lordofgun
Awesome stuff, CMX!

I guess next on my list would be the ability for everyone to see who wins the lottery. (forgive me if this is already possible, but I can't find it.)

EDIT: I'd really like a PM to be sent to everyone who vought a loittery ticket at the conclusion of each lottery telling them the winner, and inviting them to buy a lottery ticket for the next lottery.

I keep telling everyone that this is a 'coming soon' feature ... please wait :)

As far as your other request, I think a task like that is TOO big for a cron job task as it could take a while to run.

Quote:

Originally Posted by creedmaniac
with each update...how do i know if templates need to be updated?

Just need to compare the template edits to do it. As far as the templates that are included, I should start a changelog file I guess like someone mentioned a while back and state each and every modification done to the hack between versions. Guess I can start that with the next version.

-CMX

jojo77 02-16-2006 08:54 PM

I don't understand the bank part of this mod. What is the benefit of having a bank? Like interest and all that?

jojo77 02-16-2006 09:02 PM

is there a quick way I can change all the labels from "Estore" to my own name for the store? Or do I have to manually edit every file?

VBUsers 02-16-2006 09:20 PM

Quote:

Originally Posted by jojo77
I don't understand the bank part of this mod. What is the benefit of having a bank? Like interest and all that?


yes that and if your members dont want theyre points stolen by the thief hack , they can put them in the bank and will protected.

jojo77 02-16-2006 09:36 PM

oh so if they put money in the bank, only they can touch it? in that case why would anyone hold any money? The thief option would be useless if everyone stuck their money in the bank.

Any way to turn off the bank all together?

VBUsers 02-16-2006 09:40 PM

Quote:

Originally Posted by jojo77
oh so if they put money in the bank, only they can touch it? in that case why would anyone hold any money? The thief option would be useless if everyone stuck their money in the bank.

Any way to turn off the bank all together?

its part of the game. a bank for a cash hack. think about it , its a great idea and if you dont like it just disable it and thats that.

and not everyone puts theyre money away.

VBUsers 02-16-2006 09:53 PM

ok cmx i have an issue.

i like the part of the download attachments cost but i have a forum with Wallpapers that show up as thumbnails in the thread.

now when i click to go into a thread of lets say 80 wallpapers in total of all the posts together , it takes 80 points away just to view the thread. it doesnt do it on the click of the thumbnail. is there something i can do to turn it off in just my wallpapers section or is there a way to make it on the click only. i know this is a hastle but i know how good you are and it seems you can do what ever you want with your hack. so let me know thanks alot.

jojo77 02-16-2006 10:03 PM

Quote:

Originally Posted by lowandloudinc
its part of the game. a bank for a cash hack. think about it , its a great idea and if you dont like it just disable it and thats that.

and not everyone puts theyre money away.


No need to get defensive, just asking a question. Btw how do you disable the bank? I couldn't find the option.

Connector 02-16-2006 10:14 PM

Can We have feature

-User can buy signature
-User Can buy to use more Style in the site
- User Can buy to View Profile
- User Can buy to View Memberlist

Thankyou and installing :)

VBUsers 02-16-2006 10:22 PM

Quote:

Originally Posted by jojo77
No need to get defensive, just asking a question. Btw how do you disable the bank? I couldn't find the option.


not getting defensive at all just letting you know why and what you can do.

you can disable it in the

admincp ---> eStore Options --->Manage Settings

where it says active click no

OAndrea 02-16-2006 11:34 PM

Quote:

Originally Posted by CMX_CMGSCCC
You can manually hack out the setting for now, I have setup all scripts so they can not change userid = 1, or administrators information due to someone might change the owner's title/avatar to one thats really bad and the website owner would look bad and maybe cause bad business, etc...

I guess in the future, I can check the SUPER ADMINISTRATORS list and only protect those users, and/or add a setting if you are aware that someone could change your ADMIN title to "dumbass" or something as ludacris at that...



yikes... I am not sure I can do that...I have no clue where to look and what to delete.. Thanks though. Maybe you can add it in later as an option? like how the theft of points thing is an option?

dai-kun 02-17-2006 12:30 AM

I've went to my usergroup and enable delete own/others hack but i still cannot see the X to delete the gifts.. also, i've made the memberinfo template changes.

dan35 02-17-2006 01:33 AM

Quote:

Originally Posted by lowandloudinc
ok cmx i have an issue.


i like the part of the download attachments cost but i have a forum with Wallpapers that show up as thumbnails in the thread.

now when i click to go into a thread of lets say 80 wallpapers in total of all the posts together , it takes 80 points away just to view the thread. it doesnt do it on the click of the thumbnail. is there something i can do to turn it off in just my wallpapers section or is there a way to make it on the click only. i know this is a hastle but i know how good you are and it seems you can do what ever you want with your hack. so let me know thanks alot.


I got the same problem, except 5 points per attachment.

Can we set it to ignore thumbnails, CMX_CMGSCCC?

caimakale 02-17-2006 02:33 AM

Quote:

Originally Posted by dai-kun
I've went to my usergroup and enable delete own/others hack but i still cannot see the X to delete the gifts.. also, i've made the memberinfo template changes.

I've checked this out as well. I made the proper changes to the MEMBERINFO template, but I can't see the X to remove the gift.

Turns out, that the settings aren't being saved in the AdminCP >> Usergroup area. I set it to let the Administrator usergroup delete their own and others gifts as well as delete history items and then click update and it won't save it.

Looks like it might be a bug.

***EDIT***
I re-imported the product file and it fixed the problem. All is well that ends well. :)

dai-kun 02-17-2006 03:03 AM

nvm, i figure out the problem. since i use the plugin accelerator hack, i had to rebuild the plugins, now it works! :D

NoRespect 02-17-2006 03:15 AM

Tried to install this tonite, uploaded everything, and get the following...no idea....

Quote:

Importing Product, Please Wait...

[:]
db->query_read(" SELECT items.*, category.name AS categoryname, category.allowedgroups AS categoryallowedgroups, category.deniedgroups AS categorydeniedgroups FROM " . TABLE_PREFIX . "estoreitems AS items LEFT JOIN " . TABLE_PREFIX . "estorecategory AS category ON (category.categoryid = items.category) WHERE items.active = 1 " . $wherestr . " ORDER BY displayorder ")) { // start caching the items while ($item = $vbulletin->db->fetch_array($items)) { // cache this item $founditems[$item[itemid]] = $item; } } // return the found items return $founditems; } // function to check if the user has enough points to cover the cost of the item // $xfertype = 0 means that the user is trying to remove an option // $xfertype = 1 means that the user is trying to purchase an option function estore_calculate_total_cost($action) { global $vbulletin; // force cost to be 0 if its empty if (empty($action['cost'])) { $action['cost'] = 0; } // set the current userpoints $action['finalpoints'] = $vbulletin->userinfo[$vbulletin->options['ebux_pointsfield']]; $action['userpoints'] = vb_number_format($action['finalpoints'], $vbulletin->options['estore_decimalplaces']); // set the current bankpoints $action['finalbankpoints'] = $vbulletin->userinfo[$vbulletin->options['ebux_bankfield']]; $action['bankpoints'] = vb_number_format($action['finalbankpoints'], $vbulletin->options['estore_decimalplaces']); // check if the items quantity needs to be updated if ($action['defquantity'] && (!$action['refilldateline'] || ($action['refilldateline'] < TIMENOW))) { // refill the item stock $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "estoreitems SET quantity = defquantity, refilldateline = " . (TIMENOW + $vbulletin->options['estore_defaultrefillrate']) . " WHERE itemid = '" . $action['itemid'] . "' "); // update the item quantity $action['quantity'] = $action['defquantity']; } // check if this usergroup gets a discount (discount is on the base price, not the taxed price) if ($vbulletin->userinfo['permissions']['estorediscountrate'] > 0) { // verify the discountrate is < 100 if ($vbulletin->userinfo['permissions']['estorediscountrate'] <= 100) { // generate the overall discount rate $action['discountrate'] = ((100 - $vbulletin->userinfo['permissions']['estorediscountrate']) / 100); // calculate the item cost with the discounted rate $action['cost'] = $action['cost'] * $action['discountrate']; } } // check if this user gets a senior member discount if (($vbulletin->options['estore_seniordiscountrate'] != 0) && !empty($vbulletin->userinfo['birthday'])) { // get the current variables properly $curyear = date('Y'); $curmonth = date('m'); $curday = date('d'); // get the birthday variables properly list($usermonth, $userday, $useryear) = explode("-", $vbulletin->userinfo['birthday']); // verify that the $useryear is valid if (($useryear >= 1900) && ($useryear < $curyear)) { // verify that the $useryear is < $curyear found $userage = 0; if ($useryear < $curyear) { // start calculating the $userage $userage = $curyear - $useryear; // check if the $curmonth is <= $usermonth if ($curmonth < $usermonth) { // user has not had a birthday this year yet $userage--; } else if ($curmonth == $usermonth) { // check if the $userday is < $curday if ($curday < $userday) { // user has not had a birthday this year yet $userage--; } } } // check if the user gets a senior discount or not if ($userage && ($userage >= $vbulletin->options['estore_seniordiscountage'])) { // generate the overall discount rate $action['discountrate'] = ((100 - $vbulletin->options['estore_seniordiscountrate']) / 100); // calculate the item cost with the discounted rate $action['cost'] = $action['cost'] * $action['discountrate']; } } } // check if this user gets a loyal member discount if ($vbulletin->options['estore_loyalmemberdiscountrate'] != 0) { // check if this user has been registered for more than x days if ((TIMENOW - $vbulletin->userinfo['joindate']) > ($vbulletin->options['estore_loyalmembertimeframe'] * 86400)) { // generate the overall discount rate $action['discountrate'] = ((100 - $vbulletin->options['estore_loyalmemberdiscountrate']) / 100); // calculate the item cost with the discounted rate $action['cost'] = $action['cost'] * $action['discountrate']; } } // generate the item cost with the item tax percentage $action['itemcost'] = $action['cost']; if ($action['tax'] > 0) { // generate the item taxes $action['itemtax'] = (($action['tax'] / 100) + 1.00); // calculate the itemcost with the item tax too $action['itemcost'] = $action['itemcost'] * $action['itemtax']; } // now generate the final item cost with the overall tax percentage $action['finalcost'] = $action['itemcost']; if ($vbulletin->options['estore_federaltaxpercent'] > 0) { // generate the federal taxes $action['federaltax'] = (($vbulletin->options['estore_federaltaxpercent'] / 100) + 1.00); // calculate the finalcost with the federal tax too $action['finalcost'] = $action['finalcost'] * $action['federaltax']; } // round off the 'finalcost' $action['finalcost'] = round($action['finalcost'], 5); // format all of the numbers properly $action['cost'] = vb_number_format($action['cost'], $vbulletin->options['estore_decimalplaces']); $action['totalcost'] = vb_number_format($action['finalcost'], $vbulletin->options['estore_decimalplaces']); $action['tax'] = vb_number_format($action['tax'], $vbulletin->options['estore_decimalplaces']); // check if the user has enough points if ($action['finalpoints'] >= $action['finalcost']) { // set that this action should not be allowed $action['isallowed'] = 0; return $action; } // check if there are some items left if (($action['cost'] != 0) && ($action['quantity'] == 0)) { // set that this action should not be allowed $action['isallowed'] = 0; return $action; } // set that this action seems to be allowable $action['isallowed'] = 1; return $action; } // function to validate the costs function estore_validate_cost($action) { // check if the user has enough points if ($action['finalpoints'] < $action['finalcost']) { // display error, not enough points eval(standard_error(fetch_error('estore_not_enough _points'))); } // check if there are some items left if (($action['defquantity'] != 0) && ($action['quantity'] == 0)) { // display error, no items left eval(standard_error(fetch_error('estore_item_out_o f_stock'))); } } // build the proper $allowedusergroups & $deniedusergroups function estore_build_proper_usergroups($action, $estorecategories) { // get the category's allowedgroups $categoryallowedgroups = $estorecategories[$action['category']]['allowedgroups']; // check if the categoryallowedgroups is empty $allowedgroups = array(); if (!$action['overridepermissions'] && !empty($categoryallowedgroups)) { // explode these into an array $usergroups = explode(",", $categoryallowedgroups); // process each usergroup foreach($usergroups AS $usergroupid) { // add this to the allowedgroups $allowedgroups[$usergroupid] = $usergroupid; } } // now check if it has any addition option allowedgroups to merge in if (!empty($action['allowedgroups'])) { // explode these into an array $usergroups = explode(",", $action['allowedgroups']); // process each usergroup foreach($usergroups AS $usergroupid) { // add this to the allowedgroups $allowedgroups[$usergroupid] = $usergroupid; } } // get the category's denied usergroups$categorydeniedgroups = $estorecategories[$action['category']]['deniedgroups']; // check if the categorydeniedgroups is empty $deniedgroups = array(); if (!$action['overridepermissions'] && !empty($categorydeniedgroups)) { // explode these into an array $usergroups = explode(",", $categorydeniedgroups); // process each usergroup foreach($usergroups AS $usergroupid) { // add this to the deniedgroups $deniedgroups[$usergroupid] = $usergroupid; } } // now check if it has any addition option deniedgroups to merge in if (!empty($action['deniedgroups'])) { // explode these into an array $usergroups = explode(",", $action['deniedgroups']); // process each usergroup foreach($usergroups AS $usergroupid) { // add this to the deniedgroups $deniedgroups[$usergroupid] = $usergroupid; } } // rebuild the final allowedgroups $action['allowedgroups'] = ''; foreach($allowedgroups AS $usergroupid) { // check if it needs a comma separation if (!empty($action['allowedgroups'])) { $action['allowedgroups'] .= ","; } $action['allowedgroups'] .= $usergroupid; } // rebuild the final deniedgroups $action['deniedgroups'] = ''; foreach($deniedgroups AS $usergroupid) { // check if it needs a comma separation if (!empty($action['deniedgroups'])) { $action['deniedgroups'] .= ","; } $action['deniedgroups'] .= $usergroupid; } // return the new action fields return $action; } // function to check if the user is in the allowed usergroups function estore_check_allowed($userinfo, $allowedgroups, $deniedgroups) { // set it to return disabled by default $isallowed = 0; // convert the groups to an array $allowed = explode(",", $allowedgroups); $denied = explode(",", $deniedgroups); // check if the user is in the allowedgroups if (is_member_of($userinfo, $allowed)) { $isallowed = 1; } // check if the user is in the deniedgroups if (is_member_of($userinfo, $denied)) { $isallowed = 0; } // return if they are allowed or not return $isallowed; } // function to add an action to the history function estore_add_history($userinfo, $action) { // calculate the expired time if ($action['expirydate']) { // calculate the $expirydate $expirydate = TIMENOW + ($action['expirydate'] * 86400); } else { // set the $expirydate to 0 $expirydate = '0'; } // clear out the $newhistory array $newhistory = array(); // always add some things into the array $newhistory['itemid'] = $action['itemid']; $newhistory['finalcost'] = $action['finalcost']; $newhistory['dateline'] = TIMENOW; $newhistory['expires'] = $expirydate; if (!empty($action['threadid'])) { $newhistory['threadid'] = $action['threadid']; } if (!empty($action['forumid'])) { $newhistory['forumid'] = $action['forumid']; } if (!empty($action['usergroupid'])) { $newhistory['usergroupid'] = $action['usergroupid']; } if (!empty($action['touserid'])) { $newhistory['touserid'] = $action['touserid']; } if (!empty($action['tousername'])) { $newhistory['tousername'] = $action['tousername']; } if (!empty($action['fromuserid'])) { $newhistory['fromuserid'] = $action['fromuserid']; } if (!empty($action['fromusername'])) { $newhistory['fromusername'] = $action['fromusername']; } if (!empty($action['reason'])) { $newhistory['reason'] = $action['reason']; } // keep the old history $userhistory = $userinfo['estore_history']; if (!empty($userhistory)) { // try to unserialize it $userhistory = unserialize($userhistory); } // add this current history to the finalhistory $userhistory[] = $newhistory; // try to serialize it $userhistory = serialize($userhistory); // return the $userhistory return $userhistory; } // function to remove an action from the history function estore_remove_history($userinfo, $action) { // get the old history $userhistory = $userinfo['estore_history']; if (!empty($userhistory)) { // try to unserialize it $userhistory = unserialize($userhistory); // process each user history foreach($userhistory AS $key => $history) { // check if this option is expired if ($histor y['itemid'] == $action['itemid']) { // attempt to unset this from the userhistory unset($userhistory[$key]); } } } // try to serialize it $userhistory = serialize($userhistory); // return the $userhistory return $userhistory; } // function to handle specific cases for expired options function estore_expire_special_options($userinfo, $history, $tablename, $fieldname, $fieldvalue) { // check if this is an option we have to expire in a different way switch($history['itemid']) { // change others user title back case(15): { // check if this is for the user if ($userinfo['userid'] == $history['userid']) { // return the string to remove this option return "usertitle = '" . addslashes($userinfo['displayusertitle']) . "'"; } else { // return '1' to mean skip processing return '1'; } break; } } // return '0' to mean keep processing return '0'; } // function to verify the set name function estore_verify_set_name($action, $setname) { // verify that the $action['setname'] is valid if (empty($setname) || !is_string($setname)) { // display error, option set name is invalid eval(standard_error(fetch_error('estore_option_set _name_invalid'))); } // return the setname return $setname; } // function to verify the set value function estore_verify_set_value($action, $setvalue) { global $vbulletin; // verify that the $setvalue is valid if (empty($setvalue)) { // display error, option set value is invalid eval(standard_error(fetch_error('estore_option_set _value_invalid'))); } // it needs to be evalulated if (!eval('$setvalue = ' . $setvalue . '; return true;')) { // display error, option set value is invalid eval(standard_error(fetch_error('estore_option_set _value_invalid'))); } // check if $setvalue is a string if (is_string($setvalue)) { // add the slashes to $setvalue $setvalue = $vbulletin->db->escape_string($setvalue); } // return the setvalue return $setvalue; } // function to verify the where name function estore_verify_where_name($action, $wherename) { // verify that the wherename is valid if its set if (empty($wherename)) { // we are going to assume where name should be userid $wherename = 'userid'; } else if (!is_string($wherename)) { // display error, option where name is invalid eval(standard_error(fetch_error('estore_option_whe re_name_invalid'))); } // return the wherename return $wherename; } // function to verify the where value function estore_verify_where_value($action, $wherevalue) { global $vbulletin; // verify that the where value is valid if its set if (empty($wherevalue)) { // we are going to assume it wants the purchasers userid $wherevalue = $vbulletin->userinfo['userid']; } else { // try to evalute it as php if (!eval('$wherevalue = ' . $wherevalue . '; return true;')) { // display error, option where value is invalid eval(standard_error(fetch_error('estore_option_whe re_value_invalid'))); } // check if $wherevalue is a string if (is_string($wherevalue)) { // add the slashes to the $wherevalue $wherevalue = $vbulletin->db->escape_string($wherevalue); } } // return the wherevalue return $wherevalue; } // function to update this purchase to the user function estore_user_purchase_update($userinfo, $action, $extrafields = '') { global $vbulletin; // clear out the queryfields $queryfields = array(); // check if this item is one that can changealways if (!$action['changealways']) { // check if its doing a purchase or a refund if ($action['removal'] == true) { // add to the query field to increase this user's points $queryfields[] = $vbulletin->options['ebux_pointsfield'] . " = " . $vbulletin->options['ebux_pointsfield'] . " + " . $action['finalcost']; } else { // add to the query field to decrease this user's points $queryfields[] = $vbulletin->options['ebux_pointsfield'] . " = " . $vbulletin->options['ebux_pointsfield'] . " - " . $action['finalcost']; } } else { // check if this user has any changealways features $changealways = explode(",", $userinfo['changealwaysitems']); // check if this is an array if (empty($changealways) || !in_array($action['itemid'], $changealways)) { // add this to the $changealways array $changealways[] = $action['itemid']; } // check if it should be removed from the array else if ($action['removal'] == true) { // check if it should give the user the points back if ($vbulletin->options['estore_removeablerefunds']) { // add to the query field to increase this user's points $queryfields[] = $vbulletin->options['ebux_pointsfield'] . " = " . $vbulletin->options['ebux_pointsfield'] . " + " . $action['finalcost']; } // process each part of the array to remove the proper one foreach($changealways AS $key => $itemid) { // check if this is the one we want to remove if ($itemid == $action['itemid']) { // remove this item from the $changealways unset($changealways[$key]); } } } // now rebuild the changealways field $changestr = ''; foreach($changealways AS $itemid) { // add this to the $changestr if (!empty($changestr)) { $changestr .= ","; } $changestr .= $itemid; } // add this to the queryfields $queryfields[] = "changealwaysitems = '" . $changestr . "'"; } // check if it should log this transaction if ($action['loghistory']) { // check if it is removing the history or not if ($action['removal'] == true) { // remove this purchase from the user's history $userhistory = estore_remove_history($userinfo, $action); } else { // add this purchase to the user's history $userhistory = estore_add_history($userinfo, $action); } // add this to the query fields $queryfields[] = "estore_history = '" . $vbulletin->db->escape_string($userhistory) . "'"; } // check if it has any $extrafields to add to the query if (!empty($extrafields) && is_array($extrafields)) { // process each $extrafields foreach($extrafields AS $field) { // verify that the field is not empty as well if (!empty($field)) { // add this to the queryfields $queryfields[] = $field; } } } // build the querystr from the queryfields $querystr = ''; foreach($queryfields AS $field) { // verify that $field is not empty as well if (!empty($field)) { // check if it needs to add a comma if (!empty($querystr)) { $querystr .= ", "; } // add this field to the querystr $querystr .= $field; } } // lastly, verify that $querystr is not empty and it should send the query if (!empty($querystr)) { // send off the query to update this user $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . $vbulletin->options['ebux_pointstable'] . " SET " . $querystr . " WHERE userid = '" . $userinfo['userid'] . "' "); } } // function to handle updating the quantity sold function estore_update_quantity_sold($action) { global $vbulletin; // check if it should update the quantity too $updatequantity = ''; if ($action['defquantity'] > 0) { // update the quantity $updatequantity = ", quantity = quantity - 1"; } // send the query to update the estoreitem $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "estoreitems SET sold = sold + 1 " . $updatequantity . " WHERE itemid = '" . $action['itemid'] . "' "); // verify that the finalcost is set if (!is_numeric($action['finalcost'])) { $action['finalcost'] = 0; } // add this this purchase into the history $vbulletin->db->query_write(" INSERT INTO " . TABLE_PREFIX . "estoreitemhistory (historyid, itemid, itemname, userid, username, dateline, finalcost, extrainfo) VALUES ( 0, '" . $action['itemid'] . "', '" . $vbulletin->db->escape_string($action['name']) . "', '" . $vbulletin->userinfo['userid'] . "', '" . $vbulletin->db->escape_string($vbulletin->userinfo['username']) . "', '" . TIMENOW . "', '" . $action['finalcost'] . "', '" . $vbulletin->db->escape_string($action['extrainfo']) . "' ) "); } // function to handle updating the category / option cache function estore_update_datastore($forceupdate = false, $estorecategory, $estoreoptions) { global $vbulletin; // check if it should query the data first if ($forceupdate) { // build the estorecategorycache $estorecategory = array(); $categories = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "estorecategory WHERE active = 1"); while ($category = $vbulletin->db->fetch_array($categories)) { // cache this category $estorecategory[$category['categoryid']] = $category; } // build the estoreoptioncache $estoreoptions = array(); $items = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "estoreitems WHERE active = 1"); while ($item = $vbulletin->db->fetch_array($items)) { // cache this item $estoreoptions[$item['itemid']] = $item; } } // reserialize the data $estorecategory = serialize($estorecategory); $estoreoptions = serialize($estoreoptions); // dump the data into the database $vbulletin->db->query_write(" REPLACE INTO " . TABLE_PREFIX . "datastore (title, data) VALUES ('estorecategory', '" . $vbulletin->db->escape_string($estorecategory) . "'), ('estoreoptions', '" . $vbulletin->db->escape_string($estoreoptions) . "') "); } // function to quickly add points function estore_quick_add_points($userinfo, $givepoints, $extrafields) { global $vbulletin; // add these points into the user's info $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . $vbulletin->options['ebux_pointstable'] . " SET " . $vbulletin->options['ebux_pointsfield'] . " = " . $vbulletin->options['ebux_pointsfield'] . " + " . $givepoints . " " . $extrafields . " WHERE userid = '" . $vbulletin->userinfo['userid'] . "' "); } // function to quickly subtract points function estore_quick_subtract_points($userinfo, $givepoints, $extrafields) { global $vbulletin; // add these points into the user's info $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . $vbulletin->options['ebux_pointstable'] . " SET " . $vbulletin->options['ebux_pointsfield'] . " = " . $vbulletin->options['ebux_pointsfield'] . " - " . $givepoints . " " . $extrafields . " WHERE userid = '" . $vbulletin->userinfo['userid'] . "' "); } // function to sort an array by fieldname function estore_sort_internal($array1, $array2) { // return the result return strnatcmp($array1['displayorder'], $array2['displayorder']); } // function that will sort by display order function estore_sort_by_display_order($data) { // call the usort function usort($data, 'estore_sort_internal'); // return the data return $data; } // function to construct the breadcrumbs function estore_construct_navbits($navitems) { global $vbphrase; // add the default $navbits first $navbits = array('estore.php?' . $vbulletin->session->vars['sessionurl'] => $vbphrase['estore_title']); // add the rest of the navitems if (is_array($navitems)) { // process each navitem foreach($navitems AS $key => $item) { // verify its not empty if (!empty($item)) { // insert this into $navbits $navbits[$key] = $item; } } } // return the $navbits return $navbits; } ?>

caimakale 02-17-2006 03:42 AM

Quote:

Originally Posted by NoRespect
Tried to install this tonite, uploaded everything, and get the following...no idea....

Did you import the product.xml in the plugin manager in your admincp?

NoRespect 02-17-2006 03:43 AM

Quote:

Originally Posted by caimakale
Did you import the product.xml in the plugin manager in your admincp?

Yes.

Uploaded the files, then went to add product, inserted the XML file...

Then that's what I get.

Rickie3 02-17-2006 03:55 AM

try uploading the XML again and set to over write "yes"

NoRespect 02-17-2006 04:12 AM

Quote:

Originally Posted by Rickie3
try uploading the XML again and set to over write "yes"

Same thing. :(

NoRespect 02-17-2006 04:14 AM

Just some specifics...

Apache v2.0.52
PHP 5.1.1
PHP Maximum Upload Size 2.00 MB
PHP Memory Limit 8.00 MB
MySQL Version 4.1.12
MySQL Packet Size 64.00 MB

vB 3.5.3

jojo77 02-17-2006 04:42 AM

So the change someone's avatar or change someone's profile picture is not really useful unless you disable members from being able to change those things themselves in the first place right?

Because if I changed someone's avatar and they was able to change the avatar right back, it wouldn't be worth the purchase.

I just wanna make sure that's how it works.

VBUsers 02-17-2006 04:45 AM

Quote:

Originally Posted by jojo77
So the change someone's avatar or change someone's profile picture is not really useful unless you disable members from being able to change those things themselves in the first place right?

Because if I changed someone's avatar and they was able to change the avatar right back, it wouldn't be worth the purchase.

I just wanna make sure that's how it works.


yes it would play as a joke if they can change it back. but if you have it set to only selected avi's like my forum. then they would have to pay to change it back and so on.

most forums do not give theyre regular users custom avi's. to many member. can you imagine having 5000 members and all custom avis uploaded? so thatswhat this hack is for. any more Q?

leakmob 02-17-2006 05:00 AM

Hey. Great job on the hack. It installed fine, but the eBux section in the admin didn't turn up. I've tried reimporting the Product, but no luck. Any ideas?

jojo77 02-17-2006 05:02 AM

thanks for the quick answer. I do have another question. On the estore page, I'm trying to get the "Ebux" out of the header that says "(My username) Ebux Estore Information"

I searched in phrase manage for the word Ebux but that line doesn't show up for me to edit

VBUsers 02-17-2006 05:11 AM

Quote:

Originally Posted by jojo77
thanks for the quick answer. I do have another question. On the estore page, I'm trying to get the "Ebux" out of the header that says "(My username) Ebux Estore Information"

I searched in phrase manage for the word Ebux but that line doesn't show up for me to edit


thats prob in the estore.php i havent looked for that. if i had more time right now i would but search in the php file for it since you looked in the phrase manager already.

jojo77 02-17-2006 05:15 AM

I found a bug. If you give points for everytime views your thread. You can have someone refresh unlimited times in your thread and give you all the money you want.

caimakale 02-17-2006 05:30 AM

Quote:

Originally Posted by jojo77
thanks for the quick answer. I do have another question. On the estore page, I'm trying to get the "Ebux" out of the header that says "(My username) Ebux Estore Information"

I searched in phrase manage for the word Ebux but that line doesn't show up for me to edit

You can change it in your AdminCP >> Styles & Templates >> Style Manager >> estore_main template.

Look for:
Code:

<span class="smallfont"><strong><a href="member.php?u=$userinfo[userid]">$userinfo[username] $vbphrase[ebux_name] $vbphrase[estore_name] $vbphrase[estore_information]</a></strong></span>
and remove the:
Code:

$vbphrase[ebux_name]
So it looks like:
Code:

<span class="smallfont"><strong><a href="member.php?u=$userinfo[userid]">$userinfo[username]'s $vbphrase[estore_name] $vbphrase[estore_information]</a></strong></span>
Also notice on the above code how I changed:
Code:

$userinfo[username]
to:
Code:

$userinfo[username]'s
So it says "Usernames' eStore Information" now.

Hope this helps.

lordofgun 02-17-2006 05:30 AM

Quote:

Originally Posted by jojo77
I found a bug. If you give points for everytime views your thread. You can have someone refresh unlimited times in your thread and give you all the money you want.

That's why I wish it was based on replies instead of views. At least we can use flood control to limit it that way. :D

007 02-17-2006 05:55 AM

This is AWESOME! Great work! Thank you very much!

One suggestion. It would be very cool if you could add points for when people that your members refer make posts and other things.

Maybe add:

Points for thread views, creation, replies, and characters posted by people that you refer add points to the member's points?

So, Member A referrs Member B. Member B makes a post. Member B gets points, and Member A also gets whatever the value is set as the person who referred Member B. Does that make sense? It would help encourage referrals and would be a great feature. Thanks in advance if you add it.


All times are GMT. The time now is 08:14 AM.

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.05356 seconds
  • Memory Usage 1,965KB
  • 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
  • (5)bbcode_code_printable
  • (22)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (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