Google

NukeCoder


View next topic
View previous topic
Post new topic   Reply to topic
Author Message
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Thu May 07, 2009 7:13 am
Reply with quote

First off I would like to congratulate you on an excellent shop, the installation was a breeze and it is extremely easy to use.

OK so now for the question. Wink

Is it possible to alter the number of columns displayed. At the moment it shows the items on the homepage and within the categories in 2 columns, I would like if possible to alter this to 5 columns.

...and if I could slip another one in, is it possible to alter the title "Digital Shop" to something else?

Thanks in advance

Jakec Very Happy
 
View user's profile Send private message
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 921

PostPosted: Thu May 07, 2009 8:46 am
Reply with quote

Hi, welcome to the site and thanks for purchasing the shop.

To change the number of columns displayed this post should explain how...
The file to edit is modules/Digital_Shop/templates/XXX/shop/main.tpl
http://nukecoder.com/ftopicp-3207-Theme_Tweaks.html#3207

You will just need to tweak the number a bit to suit your needs.(don't forget to change the width% on the td's)


To change the title, I would suggest using dynamic titles. Here is the snippet of code to add to includes/dynamic_titles.php

Code:
// shop
if ($name == "Digital_Shop")
{
  $spr = '-';
  if ($_GET['act'] == 'showItem' && $_GET['item'])
  {
    $item = intval($_GET['item']);
    $sql = "SELECT i.item_name, c.title FROM shop_items i, shop_categories c WHERE i.item_id='$item' AND c.id=i.item_cat";
    $result = $db->sql_query($sql);
    list($item_title, $cat_title) = $db->sql_fetchrow($result);
    $newpagetitle= "Viewing Item: $item_title $spr Category: $cat_title $spr $sitename";
    $newpagetitle = check_html($newpagetitle, 'nohtml');
  }
  elseif ($_GET['cat'])
  {
    $cat = intval($_GET['cat']);
    $sql = "SELECT title FROM shop_categories WHERE id='$cat'";
    $result = $db->sql_query($sql);
    list($cat_title) = $db->sql_fetchrow($result);
    $newpagetitle= "Digital Goods Shop Category: $cat_title $spr $sitename";
    $newpagetitle = check_html($newpagetitle, nohtml);
  }
  elseif ($_GET['act'] == 'categories')
  {
    $newpagetitle= "Digital Goods Shop Category List $spr $sitename";
  }
 
}


Note, the dynamic titles code needs updated, but it will still work fine.
 
View user's profile Send private message Visit poster's website
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Thu May 07, 2009 11:30 am
Reply with quote

How did I miss that post! I did a search, but didn't find it, I should know better.

Thanks for the quick reply I'll have a look and let you know how I get on.
 
View user's profile Send private message
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 921

PostPosted: Thu May 07, 2009 12:14 pm
Reply with quote

I searched too and couldn't find it, but I remembered posting it. It took me a few tries to find that one lol.
 
View user's profile Send private message Visit poster's website
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Fri May 08, 2009 2:26 am
Reply with quote

I'm glad it is not just me then. Laughing
 
View user's profile Send private message
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Sun May 10, 2009 1:53 pm
Reply with quote

That seemed to do the trick, although to help it fit better with my theme (Ravenice) I added an extra row in so the Download button is below the Extra Images text.

The code looks like this:
Code:
<tr>
          <td>
          {if $item.item_cost == "0.00"}
            <input>
          {else}
            {if $single_item_mode == 1}
                <a><img></a>
            {else}
              <form>
                <input>
                <input>
                <input>
                <input>
              </form>
            {/if}
          {/if}
          </td>
      </tr>


This works but the first column is too wide. Confused
 
View user's profile Send private message
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Sun May 10, 2009 2:16 pm
Reply with quote

OK just realised that I got that wrong.

Should of closed the previous row before starting the next row, which I've done now but still having the same problem. Confused
 
View user's profile Send private message
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Sun May 10, 2009 3:52 pm
Reply with quote

OK it was my fault I missed changing a 50% to 25%. Doh!
 
View user's profile Send private message
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Sun May 24, 2009 10:29 am
Reply with quote

I'm still trying to get my head around the Smarty templates and tried to apply the same logic to the category list on the main page. I got close, but couldn't get it to work. Sad

How would I change the display to four columns?

Thanks in advance

jakec
 
View user's profile Send private message
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 921

PostPosted: Mon May 25, 2009 9:10 am
Reply with quote

Ok, this one is a little different I guess Laughing

So first thing is to open up templates/xxx/shop/main.tpl and find

Code:
{if $cat_array != ''}
  {include file="$current_theme/blocks/block1-open.tpl"}


That is where the category display starts. Directly under that, the table width needs changed from 80% to 100%

Then there are 3 td's that need the width changed from 50% to 25%

So now that that is done, we move to the fun stuff... Find
Code:
{if $smarty.foreach.catlist.iteration is even}


And change to
Code:
{if $smarty.foreach.catlist.iteration is not div by 4}


Next find....
Code:
{elseif $smarty.foreach.catlist.iteration is odd && $smarty.foreach.catlist.iteration != 1}


And Change to...
Code:
{elseif $smarty.foreach.catlist.iteration is div by 4 && $smarty.foreach.catlist.iteration != 4}


And finally, delete the following code...
Code:
{if $smarty.foreach.catlist.iteration is odd}
      </td><td> 
  {/if}


Save & Upload

Note: This code is untested so please let me know how it goes.
 
View user's profile Send private message Visit poster's website
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Tue May 26, 2009 7:18 am
Reply with quote

Thanks Gotcha I will give this a go tonight when I get home. Very Happy
 
View user's profile Send private message
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Tue May 26, 2009 3:47 pm
Reply with quote

Something is not quite right with this at the moment. This is what the section of code currently looks like:

Code:
{if $cat_array != ''}
  {include file="$current_theme/blocks/block1-open.tpl"}
  <table>
    <tr>
      <td>
  {foreach from=$cat_array item=cat name=catlist}
    {if $smarty.foreach.catlist.iteration is not div by 4}
      </td>
      <td>
    {elseif $smarty.foreach.catlist.iteration is div by 4 && $smarty.foreach.catlist.iteration != 4}
      </td>
    </tr>
    <tr>
      <td>
    {/if}
    <a>{if $cat.image != ''}<img><br>{/if}{$cat.title}</a> ({$cat.item_count})
    {if $cat.details != ''}<br> {$cat.details} {/if}<br>
  {/foreach}

      </td>
    </tr>
  </table>
  {include file="$current_theme/blocks/block1-close.tpl"}
  <br>
{/if}
 
View user's profile Send private message
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Wed Jun 03, 2009 7:24 am
Reply with quote

I hope everything is OK Gotcha, it's gone a bit quiet. Sad
 
View user's profile Send private message
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 921

PostPosted: Wed Jun 03, 2009 3:15 pm
Reply with quote

Yeah, I know, I wanted to be able to sit down and come up with something that will for sure work and be able to test it to make sure it does. Here is what I came up with.
 
View user's profile Send private message Visit poster's website
jakec




Joined: May 02, 2009
Posts: 21

PostPosted: Wed Jun 03, 2009 4:27 pm
Reply with quote

Once again thanks, it is greatly appreciated. Very Happy

I'll give it a go now and let you know how it goes.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 5 Hours
Forums ©