Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vbBux / vbPlaza v1.5.8 (Points + Store System) Details »»
vbBux / vbPlaza v1.5.8 (Points + Store System)
Version: 1.5.8, by CMX_CMGSCCC CMX_CMGSCCC is offline
Developer Last Online: Sep 2014 Show Printable Version Email this Page

Category: Major Additions - Version: 3.5.4 Rating:
Released: 02-01-2006 Last Update: 07-13-2006 Installs: 771
DB Changes Uses Plugins Template Edits
Additional Files  
No support by the author.

vbBux / vbPlaza v1.5.8 by CMX (http://www.cmgsccc.com)
Official Homepage - http://www.vbplaza.com

v1.5.7 AND HIGHER are now compatible with vBulletin v3.5.x and v3.6.x

Welcome to the largest points/store system for vBulletin! READ THE ENTIRE POST AGAIN AS THERE HAVE BEEN CHANGES SINCE THE CONVERSION TO vbBux / vbPlaza!!

Credits: MrZeropage for ibProArcade Support, John for v3 Arcade Support, Caimakale for various additions including ribbons and his other addons for vbPlaza, defi for the addon for Paypal Subscriptions.

New Premium Modification Forum: https://vborg.vbsupport.ru/forumdisplay.php?f=171
If you post a new thread in there, it will be easier to track the answer to your thread folks!

Now with 135 Options for purchasing at your forums and this is still rising folks!

NOTE: As of this version, there is a Template Patcher helper inside the Admin CP. Admin CP -> vbPlaza Maintenance -> Auto Patch Templates, when you run this the first time, it will just list the changes that it has found/not found. If you press Attempt Auto Patches, it will modify the template changes it has found only. It will also modify all styles for your forums. I have tested this on all 3 of my licensed vBulletin production websites and the patches all worked great.

UPDATED MUST READ NOTES:
1) RE-READ THE UPGRADING OR NEW INSTALLATION INSTRUCTIONS AS THEY HAVE CHANGED FROM THE PREVIOUS VERSIONS!!
2) IF UPGRADING FROM A PREVIOUS VERSION OF eBux / eStore. YOU MUST INSTALL THIS ONE FIRST TO SAVE YOUR SETTINGS. (BUT YOU WOULD KNOW THIS IF YOU READ THE UPGRADING INSTRUCTIONS!! DONT SAY I DIDNT WARN YOU!!)

Branding Free Option
If you have donated in the past, you can get the Branding Free Option for Free by sending CMX a PM on the http://www.vbplaza.com/forums Message Board.
Otherwise, you will need to purchase it by signing up for an account at http://www.vbplaza.com/forums/register.php and then going to http://www.vbplaza.com/forums/payments.php

Features List:
This section has been moved due to its length. Look in the file included insize the zip named features.txt.

Release Notes:
This section will only show the most recent changes. For the rest of the changes, look in the file included inside the zip named changes.txt.

NOTE: If you want ibProArcade, v3 Arcade or vBookie integration now, you'll have to install the appropriate Addon included in the download. The reason for these parts being packaged as Addons, is to make the install a little smaller for users who do not have an Arcade, and because both Arcades cant be installed simultaneously as well. So it saves space only installing the one that you currently have.

v1.5.8 Updates:
1) Bugfix: Quick editing a post with BB Codes, modified the post directly instead of modifying a copy.
2) Bugfix: Some phrases fixed.
3) Bugfix: TABLEPREFIX bug has been fixed.
4) Bugfix: Addon Product XML sheets do not have executionorder in them anymore for vB 3.5 compatibility.

Database Backups Recommended!
Although I have upgraded 3 forums with this script already, it IS recommended that you backup your database before installing this product!!

Upgrading Instructions:
NOTE: THESE INSTRUCTIONS ARE FOR UPGRADING IF YOU HAD A PREVIOUS VERSION OF eBux / eStore INSTALLED!!
1) DO NOT UNINSTALL eBux / eStore (UNLESS YOU WANT TO LOSE ANY AND ALL SETTINGS.)
2) Reupload all of the files in the upload folder to your forum's root folder. Make sure that all files are being overwritten. Do not move on to the next step until all files are transferred successfully!
NOTE: It could take a long time to install if you have a lot of registered users, be PATIENT! It should display the messages as it goes along to let you know that it IS working.
3) After finished with step 2!! Reimport the product-vbbuxplaza.xml file via Admin CP -> Plugin System -> Manage Products -> Add/Import Product. Make sure that Allow Overwrite is set to YES.
4) Refresh the Admin CP and you will see all of the vbBux / vbPlaza Admin CP features at the top.
5) UNINSTALL THE OLD eBux / eStore NOW!! Go to Admin CP -> Plugin System -> Manage Products -> eBux / eStore -> Uninstall.
6) You can delete all files/folders that have the word estore or elottery in them from the FTP as well.
7) You will need to redo the template edits listed below as almost all of them have changed since the previous eBux / eStore.

If upgrading from a previous version of vbBux / vbPlaza follow these instructions:
1) Reupload all of the files in the upload folder to your forum's root folder. Make sure that all files are being overwritten. Do not move on to the next step until all files are transferred successfully!
2) After finished with step 2!! Reimport the product-vbbuxplaza.xml file via Admin CP -> Manage Products -> Add/Import Product. Make sure that Allow Overwrite is set to YES.
3) Refresh the Admin CP and get to checking your settings!
NOTE: You will be happy know that NO templates have been updated from v1.5.0 to v1.5.2!

New Installation Instructions:
1) Upload all of the files/folders in the UPLOAD folder to your forum's root folder.
2) Import the product-vbbuxplaza.xml via Admin CP -> Manage Products -> Add/Import Product.
NOTE: It could take a long time to install if you have a lot of registered users, be PATIENT! It should display the messages as it goes along to let you know that it IS working.
3) Refresh the Admin CP and start setting up your settings!
4) You will need to do all of the template edits listed below as well.

Template Edits:
A) Inside templates 'postbit' AND 'postbit_legacy':

Find:
Code:
<div id="postmenu_$post[postid]">
Replace With:
Code:
<!-- vbPlaza start -->
<div id="postmenu_$post[postid]" <if condition="$post['namestyle']">style="$post[namestyle]"</if>>
<!-- vbPlaza end -->
Next Find:
Code:
<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
Replace With:
Code:
<!-- vbPlaza start -->
<if condition="$post['usertitle']"><div class="smallfont" <if condition="$post['titlestyle']">style="$post[titlestyle]"</if>>$post[usertitle]</div></if>
<!-- vbPlaza end -->
Then Find:
Code:
$vbphrase[posts]: $post[posts]
Replace With:
Code:
$vbphrase[posts]: $post[posts]
<!-- vbPlaza start -->
<if condition="$show['pointsinpostbit']"><br />
$vbphrase[vbbux_points]: $post[points]<br />
$vbphrase[vbbux_bank]: $post[bank]<br />
<phrase 1="$vbphrase[vbbux_points]">$vbphrase[vbbux_total_points]</phrase>: $post[totalpoints]<br />
<a href="vbplaza.php?do=donate&amp;userid=$post[userid]">$vbphrase[vbplaza_donate]</a><br />
</if>
<!-- vbPlaza end -->
Then Find:
Code:
				<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
Add Below:
Code:
<!-- vbPlaza start -->
				<if condition="$post['giftsdisplay']"><div class="smallfont">$post[giftsdisplay]</div></if>
				<if condition="$post['ribbonsdisplay']"><div class="smallfont">$post[ribbonsdisplay]</div></if>
<!-- vbPlaza end -->
B) Inside template 'navbar':

Find:
Code:
		<td class="vbmenu_control"><a href="calendar.php$session[sessionurl_q]">$vbphrase[calendar]</a></td>
		<if condition="$show['popups']">
Add Below:
Code:
<!-- vbPlaza start -->
			<if condition="$show['member']">
				<if condition="$vboptions['vbplaza_enabled']"><td id="vbplazamenu" class="vbmenu_control"><a href="$show[nojs_link]#vbplazamenu">$vbphrase[vbplaza_name] $vbphrase[vbplaza_menu]</a> <script type="text/javascript"> vbmenu_register("vbplazamenu"); </script></td></if>
			</if>
<!-- vbPlaza end -->
Then Find:
Code:
<!-- / NAVBAR POPUP MENUS -->
Add Above:
Code:
<!-- vbPlaza start -->
	<if condition="$show['member']">
	<!-- vbplaza tools menu -->
	<div class="vbmenu_popup" id="vbplazamenu_menu" style="display:none">
		<table cellpadding="4" cellspacing="1" border="0">

		<tr><td class="thead"><a href="vbplaza.php?$session[sessionurl]">$vbphrase[vbplaza_name] $vbphrase[vbplaza_main]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="vbplaza.php?$session[sessionurl]do=action&amp;itemid=48">$vbphrase[vbplaza_lottery]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="vbplaza.php?$session[sessionurl]do=action&amp;itemid=27">$vbphrase[vbplaza_give_gifts]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="vbplaza.php?$session[sessionurl]do=action&amp;itemid=118">$vbphrase[vbplaza_give_ribbons]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="vbplaza.php?$session[sessionurl]do=action&amp;itemid=13">$vbphrase[vbbux_bank]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="vbplaza.php?$session[sessionurl]do=action&amp;itemid=7">$vbphrase[vbplaza_donate]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="vbplaza.php?$session[sessionurl]do=action&amp;itemid=16">$vbphrase[vbplaza_thief]</a></td></tr>

		<tr><td class="vbmenu_option"><a href="vbplaza.php?$session[sessionurl]do=richestusers">$vbphrase[vbbux_richest_users]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="vbplaza.php?$session[sessionurl]do=userhistory">$vbphrase[vbplaza_history]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="vbplaza.php?$session[sessionurl]do=mostsold">$vbphrase[vbplaza_most_sold]</a></td></tr>

		<if condition="is_member_of($vbulletin->userinfo, $vboptions['vbplaza_adminusergroups'])">
			<tr><td class="thead">$vbphrase[vbplaza_admin_only]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="vbplaza.php?$session[sessionurl]do=action&amp;itemid=12">$vbphrase[vbplaza_admin_donate]</a></td></tr>
		</if>

		</table>
	</div>
	<!-- / vbplaza tools menu -->
	</if>
<!-- vbPlaza end -->
C) Inside template 'MEMBERINFO':

Find:
Code:
				<div class="bigusername">$userinfo[musername] $userinfo[onlinestatus]</div>
Replace With:
Code:
<!-- vbPlaza start -->
				<div class="bigusername" <if condition="$userinfo['namestyle']">style="$userinfo[namestyle]"</if>>$userinfo[musername] $userinfo[onlinestatus]</div>
<!-- vbPlaza end -->
Next Find:
Code:
				<if condition="$userinfo['usertitle']"><div class="smallfont">$userinfo[usertitle]</div></if>
Replace With:
Code:
<!-- vbPlaza start -->
				<if condition="$userinfo['usertitle']"><div class="smallfont" <if condition="$userinfo['titlestyle']">style="$userinfo[titlestyle]"</if>>$userinfo[usertitle]</div></if>
<!-- vbPlaza end -->
Then Find:
Code:
			<if condition="$vboptions['usereferrer']">
Add Above:
Code:
<!-- vbPlaza start -->
			<if condition="$vboptions['vbbux_enabled']">$show[vbbuxuserinfo]</if>
			<if condition="$show['gifts']">$show[gifts]</if>
			<if condition="$show['ribbons']">$show[ribbons]</if>
<!-- vbPlaza end -->
D) Inside template 'forumrules':

Find:
Code:
		<div><phrase 1="$htmlcodeon">$vbphrase[html_code_is_x]</phrase></div>
Add Below:
Code:
<!-- vbPlaza start -->
		<if condition="$vboptions['vbbux_enabled']">
			<if condition="!$show['codeonly']">
			<hr />
			<div><phrase 1="$vbphrase[vbbux_points]" 2="$foruminfo[points_perview]">$vbphrase[vbbux_points_perview]</phrase></div>
			<div><phrase 1="$vbphrase[vbbux_points]" 2="$foruminfo[points_perthread]">$vbphrase[vbbux_points_perthread]</phrase></div>
			<div><phrase 1="$vbphrase[vbbux_points]" 2="$foruminfo[points_perreply]">$vbphrase[vbbux_points_perreply]</phrase></div>
			</if>
		</if>
<!-- vbPlaza end -->
E): Inside template 'USERCP_SHELL':

Find:
Code:
<if condition="$show['avatarlink']">
Add Above:
Code:
<!-- vbPlaza start -->
<if condition="$vboptions['vbplaza_enabled']">
	<tr>
		<td class="$navclass[vbplaza]" nowrap="nowrap"><a class="smallfont" href="vbplaza.php?$session[sessionurl]do=editvbpoptions"><phrase 1="$vbphrase[vbplaza_name]">$vbphrase[edit_vbplaza_options]</phrase></a></td>
	</tr>
</if>
<!-- vbPlaza end -->
F): Inside template 'threadbit':

Find:
Code:
		$thread[title_editable]
		<div>
Replace With:
Code:
<!-- vbPlaza start -->
		$thread[title_editable]
		<div <if condition="$thread['titlestyle']">style="$thread[titlestyle]"</if>>
<!-- vbPlaza end -->
vBulletin 3.5.x Only Edit:

Next Find:
Code:
			<if condition="$show['gotonewpost']">
				<strong><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a></strong>
			<else />
				<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a>
			</if>
Replace With:
Code:
<!-- vbPlaza start -->
			<if condition="$show['gotonewpost']">
				<strong><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]" <if condition="$thread['titlestyle']">style="$thread[titlestyle]"</if>>$thread[threadtitle]</a></strong>
			<else />
				<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]" <if condition="$thread['titlestyle']">style="$thread[titlestyle]"</if>>$thread[threadtitle]</a>
			</if>
<!-- vbPlaza end -->

vBulletin 3.6.x Only Edit:

Next Find:
Code:
			<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]"<if condition="$show['gotonewpost']"> style="font-weight:bold"</if>>$thread[threadtitle]</a>
Replace With:
Code:
			<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]"<if condition="$thread['titlestyle']">style="$thread[titlestyle]"</if>>$thread[threadtitle]</a>
G): Inside template 'memberlist_resultsbit':

Find:
Code:
		<a href="member.php?$session[sessionurl]u=$userinfo[userid]">$userinfo[musername]</a>
		<if condition="$show['usertitlecol']"><div class="smallfont">$userinfo[usertitle]</div></if>
Replace With:
Code:
<!-- vbPlaza start -->
		<div <if condition="$userinfo['namestyle']">style="$userinfo[namestyle]"</if>><a href="member.php?$session[sessionurl]u=$userinfo[userid]" <if condition="$userinfo['namestyle']">style="$userinfo[namestyle]"</if>>$userinfo[musername]</a></div>
		<if condition="$show['usertitlecol']"><div class="smallfont" <if condition="$userinfo['titlestyle']">style="$userinfo[titlestyle]"</if>>$userinfo[usertitle]</div></if>
<!-- vbPlaza end -->
-CMX

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #1662  
Old 02-16-2006, 11:34 PM
OAndrea OAndrea is offline
 
Join Date: Dec 2005
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #1663  
Old 02-17-2006, 12:30 AM
dai-kun dai-kun is offline
 
Join Date: Jul 2005
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #1664  
Old 02-17-2006, 01:33 AM
dan35's Avatar
dan35 dan35 is offline
 
Join Date: Jul 2004
Location: California
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #1665  
Old 02-17-2006, 02:33 AM
caimakale's Avatar
caimakale caimakale is offline
 
Join Date: Nov 2004
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #1666  
Old 02-17-2006, 03:03 AM
dai-kun dai-kun is offline
 
Join Date: Jul 2005
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nvm, i figure out the problem. since i use the plugin accelerator hack, i had to rebuild the plugins, now it works!
Reply With Quote
  #1667  
Old 02-17-2006, 03:15 AM
NoRespect NoRespect is offline
 
Join Date: Oct 2005
Location: Houston
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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; } ?>
Reply With Quote
  #1668  
Old 02-17-2006, 03:42 AM
caimakale's Avatar
caimakale caimakale is offline
 
Join Date: Nov 2004
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #1669  
Old 02-17-2006, 03:43 AM
NoRespect NoRespect is offline
 
Join Date: Oct 2005
Location: Houston
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #1670  
Old 02-17-2006, 03:55 AM
Rickie3's Avatar
Rickie3 Rickie3 is offline
 
Join Date: Nov 2004
Location: Australia/Tasmania
Posts: 770
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try uploading the XML again and set to over write "yes"
Reply With Quote
  #1671  
Old 02-17-2006, 04:12 AM
NoRespect NoRespect is offline
 
Join Date: Oct 2005
Location: Houston
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Rickie3
try uploading the XML again and set to over write "yes"
Same thing.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:00 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08134 seconds
  • Memory Usage 2,409KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (30)bbcode_code
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (6)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete