Facebook 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4291
Latest: Robertqt
New This Month: 5
New This Week: 1
New Today: 0
Stats
Total Posts: 43728
Total Topics: 7587
Most Online Today: 67
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 61
Total: 62

Author Topic: How to edit image column on index page?  (Read 6757 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: 16645
    • 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: 16645
    • 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: 16645
    • 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: 16645
    • 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: 16645
    • 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
6295 Views
Last post May 24, 2007, 06:38:01 am
by CRONUS
3 Replies
5133 Views
Last post December 08, 2006, 11:17:39 am
by TheWrks
4 Replies
5921 Views
Last post July 24, 2007, 02:03:57 am
by lexi_be
3 Replies
5654 Views
Last post March 13, 2008, 09:04:59 pm
by Weathernut
13 Replies
13293 Views
Last post January 07, 2013, 09:16:09 am
by SMFHacks

+- Recent Topics

Mod for compare gallery.text with board.text by Michel68
Today at 04:16:39 am

ST Shop integration by Senkusha
March 18, 2025, 07:33:13 pm

Contact Us by SMFHacks
March 16, 2025, 07:49:23 pm

HTTP 500 error during install by SMFHacks
March 13, 2025, 10:44:31 am

Site upgrade to 2.1 by SMFHacks
March 12, 2025, 09:29:43 pm

[Mod]WebP and AVIF File Support for SMF 2.1 by SMFHacks
March 10, 2025, 04:32:57 pm

Pretty URL's Pro support/help by [chrisB]
March 03, 2025, 10:18:09 am

More RSS feeds by melon
February 28, 2025, 08:23:21 am

SMF Shop / ST Shop Credits? by SMFHacks
February 22, 2025, 06:13:10 pm

Down_sendpm Error by Senkusha
February 22, 2025, 07:49:24 am

Powered by EzPortal