Author Topic: [SOLVED] "Voucher Code" Item  (Read 21761 times)

Offline feildmaster

Re: [SOLVED] "Voucher Code" Item
« Reply #15 on: July 29, 2007, 03:42:17 am »
no

after index.php put ?action=redeemShop

looks like this
Code: [Select]
http://mywebsite.com/forum(if you have that..)/index.php?action=redeemShop
the admin is at the redeemShop page...

Offline Joker Grafix

Re: [SOLVED] "Voucher Code" Item
« Reply #16 on: July 29, 2007, 04:07:56 am »
Ah okay. So for me to use the admin settings or for a player to redeem they have to type in

http//www.yourforum.com/forum/index.php?action=redeemShop

Each time? Is there a way to perhaps add a button or something in the shop (Where it says Inventory, Buy Stuff, Bank, etc) that says something along the lines of "Redeem Voucher"?

Offline feildmaster

Re: [SOLVED] "Voucher Code" Item
« Reply #17 on: July 29, 2007, 06:26:15 am »
Yes... Which version u using? 2.X or 3.X

heres code
Code: [Select]
echo '
'<a href="' . $scripturl . '?action=redeemShop">Redeem Voucher</a>';

place it in the shop.template... o.o
« Last Edit: July 29, 2007, 06:31:52 am by feildmaster »

Offline Joker Grafix

Re: [SOLVED] "Voucher Code" Item
« Reply #18 on: July 29, 2007, 06:30:32 am »
Shop 3.0

Offline feildmaster

Re: [SOLVED] "Voucher Code" Item
« Reply #19 on: July 29, 2007, 06:33:03 am »
i edited code into post

Offline Joker Grafix

Re: [SOLVED] "Voucher Code" Item
« Reply #20 on: July 29, 2007, 06:41:52 am »
<a href="' . $scripturl . '?action=redeemShop">Redeem Voucher</a>';


Where it says <a href=

Do I add the redeem shop URL here?

Offline feildmaster

Re: [SOLVED] "Voucher Code" Item
« Reply #21 on: July 29, 2007, 01:49:04 pm »
no

you place that code in shop.template.php exactly the way it is...

search for something like... "// Allowed to access the bank?" then put it before or after that

Offline Joker Grafix

Re: [SOLVED] "Voucher Code" Item
« Reply #22 on: July 29, 2007, 02:15:18 pm »
For some reason I can't find this. What is a normal path for this?

Offline feildmaster

Re: [SOLVED] "Voucher Code" Item
« Reply #23 on: July 29, 2007, 02:49:02 pm »
in the themes folder, default theme... there is Shop.template.php...

does that help?

Offline Joker Grafix

Re: [SOLVED] "Voucher Code" Item
« Reply #24 on: July 29, 2007, 03:12:51 pm »
yes...but

Quote
Template Parse Error!
There was a problem loading the /Themes/default/Shop.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
syntax error, unexpected T_STRING, expecting ',' or ';'

I got this after doing that, and when I removed it.

*edit* forgot to remove it echo' when removing it. Going to try to put it before.
« Last Edit: July 29, 2007, 03:15:00 pm by Joker Grafix »

Offline feildmaster

Re: [SOLVED] "Voucher Code" Item
« Reply #25 on: July 30, 2007, 12:49:49 am »
where are you putting it? -_-

it should look like this..
Quote
// Allowed to buy stuff?
   if (allowedTo('shop_buy'))
      echo '
                     ', ($context['shop_do'] == 'buy' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=buy">' . $txt['shop_buy'] . '</a>' . ($context['shop_do'] == 'buy' ? '</b>' : '') . '<br />';
   // The inventory - Everyone can access this!
   echo '
                     ', ($context['shop_do'] == 'inv' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=inv">' . $txt['shop_yourinv'] . '</a>' . ($context['shop_do'] == 'inv' ? '</b>' : ''), '<br />';
   // Allowed to send money to other people
   if (allowedTo('shop_sendmoney'))
      echo '
                     ', ($context['shop_do'] == 'sendmoney' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=sendmoney">' . $txt['shop_send_money'] . '</a>' . ($context['shop_do'] == 'sendmoney' ? '</b>' : '') . '<br />';
   
   // Allowed to send items to other people?
   if (allowedTo('shop_senditems'))
      echo '
                     ', ($context['shop_do'] == 'senditems' ? '<b>' : ''), '<a href="' . $scripturl . '?action=shop;do=senditems">' . $txt['shop_send_item'] . '</a>' . ($context['shop_do'] == 'senditems' ? '</b>' : ''), '<br />';
   
   // Allowed to view inventory of others?
   if (allowedTo('shop_invother'))
      echo '
                     ', ($context['shop_do'] == 'invother' ? '<b>' : ''), '<a href="' . $scripturl . '?action=shop;do=invother">' . $txt['shop_invother'] . '</a>' . ($context['shop_do'] == 'invother' ? '</b>' : ''), '<br />';
   //Voucher Code
      echo '
                     '<a href="' . $scripturl . '?action=redeemShop">Redeem Voucher</a>';

   // Allowed to access the bank?
   if (allowedTo('shop_bank'))
      echo '
                     ', ($context['shop_do'] == 'bank' ? '<b>' : '') . ($modSettings['shopBankEnabled']) ? '<a href="' . $scripturl . '?action=shop;do=bank">' . $txt['shop_bank'] . '</a><br />' : '' . ($context['shop_do'] == 'bank' ? '</b>' : '');

   // Allowed to access the trade centre?
   if (allowedTo('shop_trade'))
      echo '
                     ', ($context['shop_do'] == 'trade' ? '<b>' : '') . ($modSettings['shopTradeEnabled']) ? '<a href="' . $scripturl . '?action=shop;do=trade">' . $txt['shop_trade'] . '</a><br />' : '', ($context['shop_do'] == 'trade' ? '</b>' : '');

Offline Joker Grafix

Re: [SOLVED] "Voucher Code" Item
« Reply #26 on: July 30, 2007, 01:31:53 am »
That's where I have it.

Offline feildmaster

Re: [SOLVED] "Voucher Code" Item
« Reply #27 on: July 30, 2007, 11:44:55 am »
AH! My fault!

Code: [Select]
echo '
<a href="' . $scripturl . '?action=redeemShop">Redeem Voucher</a>';

Offline Joker Grafix

Re: [SOLVED] "Voucher Code" Item
« Reply #28 on: July 30, 2007, 05:08:23 pm »
Awesome! Works great now, thanks a lot fieldmaster.  O0

Offline feildmaster

Re: [SOLVED] "Voucher Code" Item
« Reply #29 on: July 31, 2007, 12:52:17 am »
Np, n its Feildmaster... ^^ ;)