Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4268
Latest: Butiks
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43566
Total Topics: 7565
Most Online Today: 106
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 40
Total: 40

Author Topic: How to edit image column on index page?  (Read 6621 times)

0 Members and 1 Guest are viewing this topic.

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
How to edit image column on index page?
« on: January 21, 2013, 09:57:31 am »
When I don't have a image for a store category the column on the index page shows a wide blank column to the left of the titles.

http://appliancejunk.com/forums/index.php?action=store

When I don't have a image for a category in our download index page the column to the left of the titles is a lot smaller.

http://appliancejunk.com/forums/index.php?action=downloads

How can I edit the store index so the column is not so wide when there are no images like on our download index page?

What would be even better is if I could remove that column altogether on both index pages.

Thanks,

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: How to edit image column on index page?
« Reply #1 on: January 21, 2013, 10:43:08 am »
Making the columns on the store and download index pages the same as the forum index page would look good too.

Just looking for someway to make them all look more like each other.

Thanks again,


Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16573
    • View Profile
Re: How to edit image column on index page?
« Reply #2 on: January 21, 2013, 01:56:29 pm »
For Downloads
To remove the icon remove the following

Line 305
Find
Code: [Select]
<th colspan="2" scope="col" class="smalltext first_th"><span class="left"></span>', $txt['downloads_text_categoryname'], '</th>
Change to
Code: [Select]
<th  scope="col" class="smalltext first_th"><span class="left"></span>', $txt['downloads_text_categoryname'], '</th>

Around line 331
Find
Code: [Select]
if ($cat_info['image'] == '' && $cat_info['filename'] == '')
echo '<td class="windowbg"></td><td  class="windowbg2"><b><a href="' . $cat_url . '">' . parse_bbc($cat_info['title']) . '</a></b>' . ((!empty($downloadSettings['down_enable_rss']) && ($cat_info['redirect'] == 0)) ? ' <a href="' . $scripturl . '?action=downloads;sa=rss;cat=' . $cat_info['ID_CAT'] . '"><img src="' . $modSettings['down_url'] . '/rss.png" alt="rss" /></a>' : '') . '<br />' . parse_bbc($cat_info['description']) . '</td>';
else
{
if ($cat_info['filename'] == '')
echo '<td class="windowbg" width="10%"><a href="' . $cat_url . '"><img src="' . $cat_info['image'] . '" /></a></td>';
else
echo '<td class="windowbg" width="10%"><a href="' . $cat_url . '"><img src="' . $modSettings['down_url'] . 'catimgs/' . $cat_info['filename'] . '" /></a></td>';


echo '<td class="windowbg2"><b><a href="' . $cat_url . '">' . parse_bbc($cat_info['title']) . '</a></b>' . ((!empty($downloadSettings['down_enable_rss']) && ($cat_info['redirect'] == 0)) ? ' <a href="' . $scripturl . '?action=downloads;sa=rss;cat=' . $cat_info['ID_CAT'] . '"><img src="' . $modSettings['down_url'] . '/rss.png" alt="rss" /></a>' : '') . '<br />' . parse_bbc($cat_info['description']) . '</td>';
}
Change to
Code: [Select]
echo '<td class="windowbg"></td><td  class="windowbg2"><b><a href="' . $cat_url . '">' . parse_bbc($cat_info['title']) . '</a></b>' . ((!empty($downloadSettings['down_enable_rss']) && ($cat_info['redirect'] == 0)) ? ' <a href="' . $scripturl . '?action=downloads;sa=rss;cat=' . $cat_info['ID_CAT'] . '"><img src="' . $modSettings['down_url'] . '/rss.png" alt="rss" /></a>' : '') . '<br />' . parse_bbc($cat_info['description']) . '</td>';




Now for Downloads if you just want the icon add after
Code: [Select]
// Check permission to show this category
if ($cat_info['view'] == '0')
continue;


$totalfiles  = Downloads_GetFileTotals($cat_info['ID_CAT']);
$cat_url = $scripturl . '?action=downloads;cat=' . $cat_info['ID_CAT'];

Add
Code: [Select]
global $settings;
$cat_info['image'] =  $settings['images_url'], '/' "off.png";

For SMF Store
store2.template.php
Find
Code: [Select]
<th scope="col" class="smalltext first_th" colspan="2">', $txt['store_text_storename'], '</th>
Change to
Code: [Select]
<th scope="col" class="smalltext first_th">', $txt['store_text_storename'], '</th>

Find
Code: [Select]
if ($row['imageurl'] == '' && $row['imagefilename'] == '')
echo '<td class="windowbg" width="10%"></td><td class="windowbg2"><b><a href="' . $scripturl . '?action=store;cat=' . $row['ID_CAT'] . '">' . parse_bbc($row['title']) . '</a></b><br />' . parse_bbc($row['description']) . '</td>';
else
{
if ($row['imagefilename'] == '')
echo '<td class="windowbg"><a href="' . $scripturl . '?action=store;cat=' . $row['ID_CAT'] . '"><img src="' . $row['imageurl'] . '" border="0" alt=""  /></a></td>';
else
echo '<td class="windowbg"><a href="' . $scripturl . '?action=store;cat=' . $row['ID_CAT'] . '"><img src="' . $modSettings['store_url'] . 'catimgs/' . $row['imagefilename'] . '" border="0" alt="" /></a></td>';


echo '<td class="windowbg2"><b><a href="' . $scripturl . '?action=store;cat=' . $row['ID_CAT'] . '">' . parse_bbc($row['title']) . '</a></b><br />' . parse_bbc($row['description']) . '</td>';
}
Change to
Code: [Select]
echo '<td class="windowbg" width="10%"></td><td class="windowbg2"><b><a href="' . $scripturl . '?action=store;cat=' . $row['ID_CAT'] . '">' . parse_bbc($row['title']) . '</a></b><br />' . parse_bbc($row['description']) . '</td>';



Now for Store if you just want the icon add after
Code: [Select]
if ($row['view'] == '0')
continue;

$totalitems  = GetProductTotals($row['ID_CAT']);

Add
Code: [Select]
global $settings;
$row['imageurl'] =  $settings['images_url'], '/' "off.png";

If you need help just attach your downloads2.template.php and store2.template.php and let me know what you want to do.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: How to edit image column on index page?
« Reply #3 on: January 21, 2013, 02:29:38 pm »
Hmm, ok I tried the edits and did not have any luck.

Instead of going into detail about the results I got from each edit I tried I will simply attach the files here for you to look at.

After thinking things over some more this is what I would like.

I like how the download template looks when I don't have any category images.
http://appliancejunk.com/forums/index.php?action=downloads

If you could edit the store2.template.php so it gives me the same look when there are no category images that would be great.
http://appliancejunk.com/forums/index.php?action=store

Thank you,

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16573
    • View Profile
Re: How to edit image column on index page?
« Reply #4 on: January 21, 2013, 02:34:07 pm »
Try this store template.php

Did you want me to do anything to the downloads template file?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: How to edit image column on index page?
« Reply #5 on: January 21, 2013, 02:40:24 pm »
Ok, the store template looks great now, thanks!
http://appliancejunk.com/forums/index.php?action=store

I was thinking I wanted the download template left alone as it just leaves a small column on the left when I don't have any catagory icons in place, but I really like how you made the store template look now.

So yes, please do the same with the download template as you did with the store template.

Thanks,

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16573
    • View Profile
Re: How to edit image column on index page?
« Reply #6 on: January 21, 2013, 02:43:21 pm »
Done file attached
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: How to edit image column on index page?
« Reply #7 on: January 21, 2013, 02:46:22 pm »
Looks great, thanks!
http://appliancejunk.com/forums/index.php?action=downloads

Now I'm going to compare my old template files to the ones you edited to see if I can learn anything. :)

Thanks again,

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16573
    • View Profile
Re: How to edit image column on index page?
« Reply #8 on: January 21, 2013, 02:49:07 pm »
Yeah What i will probably do in future releases is checked if there is an image in any of those columns before hand if not then remove the column form the page.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: How to edit image column on index page?
« Reply #9 on: January 21, 2013, 02:53:01 pm »
That sounds like it would be a nice way to do it.

Just out of curiosity with the edits you did to my files now what would happen if I try and add a image?

Would it add the column back, not do anything or break something, lol...

Either way it's not a big deal for me as I saved the unedited files so I could easily change it back, but was just wondering.

Thanks again,

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16573
    • View Profile
Re: How to edit image column on index page?
« Reply #10 on: January 21, 2013, 02:57:17 pm »
If you adding an image now it would not show on the main categories page when you open the store or downloads
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: How to edit image column on index page?
« Reply #11 on: January 21, 2013, 02:58:59 pm »
If you adding an image now it would not show on the main categories page when you open the store or downloads

ok, good to know.

Thanks,

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
6173 Views
Last post May 24, 2007, 06:38:01 am
by CRONUS
3 Replies
4965 Views
Last post December 08, 2006, 11:17:39 am
by TheWrks
4 Replies
5786 Views
Last post July 24, 2007, 02:03:57 am
by lexi_be
3 Replies
5550 Views
Last post March 13, 2008, 09:04:59 pm
by Weathernut
13 Replies
12962 Views
Last post January 07, 2013, 09:16:09 am
by SMFHacks

+- Recent Topics

Restoring a deleted photo by Monocero
Today at 04:23:56 am

Gallery Pro reinstalation by Lirorobert
October 14, 2024, 01:43:43 am

Move picture from main gallery to user gallery by SMFHacks
October 11, 2024, 09:11:00 pm

quoting part of message by Lirorobert
October 04, 2024, 03:21:40 pm

Does SMF Gallery support by SMFHacks
October 02, 2024, 06:14:26 am

Item count on Gallery Tab shows double by SMFHacks
September 26, 2024, 12:59:20 pm

Forum post missing when image over 4000x pixels is uploaded to gallery by Michel68
September 24, 2024, 01:37:17 pm

Setting a photo as invisible by Monocero
September 17, 2024, 02:11:56 pm

Two gallery names by SMFHacks
September 15, 2024, 02:17:49 pm

Bar during the regeneration of miniatures by Monocero
September 15, 2024, 12:35:08 pm

Powered by EzPortal