Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12403
Latest: HenryLilley
New This Month: 9
New This Week: 4
New Today: 2
Stats
Total Posts: 39916
Total Topics: 7026
Most Online Today: 98
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 46
Total: 46

Author Topic: About Layout Options  (Read 1004 times)

0 Members and 1 Guest are viewing this topic.

Offline ajac63

  • SMF Classifieds Customer
  • Jr. Member
  • *****
  • Posts: 66
    • View Profile
    • "blag-it" Forum
About Layout Options
« on: May 16, 2019, 10:20:54 am »
What do I have to do in Layout Settings to enable three rows of four categories?  So, as follows:
Category 01  Category 02  Category 03  Category 04
Category 05  Category 06  Category 07  Category 08
Category 09  Category 10  Category 11  Category 12

The set-up option I went with is where you have the 'Classifieds' link at the top of the forum enabling visitors to get to the classifieds section that way.

Thanks if anyone can help.
« Last Edit: May 16, 2019, 10:24:16 am by ajac63 »

Offline ajac63

  • SMF Classifieds Customer
  • Jr. Member
  • *****
  • Posts: 66
    • View Profile
    • "blag-it" Forum
Re: About Layout Options
« Reply #1 on: May 17, 2019, 12:31:50 am »
Can someone please answer the thread.  Layout Options isn't allowing me to do what I expected.  I've paid for this...

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14965
    • View Profile
Re: About Layout Options
« Reply #2 on: May 17, 2019, 11:09:22 am »
There are currently two layout options.
The default option is the categories are vertical rows the description, number of listings, image of classifieds category

The second option is found admin -> layout settings -> “Use simple main layout with recent listings as the focus”  which focuses on listings and puts classifieds categories as a small list on the left side.

For the changes you need would require you to make edits to themes/default/classfieds2.template.php function template_classifiedsmain  You would need to change the loop structure to make each category title inside a td in the table tag then stop after x amount of and add the closing tr tag. I do that in a few spots in the code as reference.

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 ajac63

  • SMF Classifieds Customer
  • Jr. Member
  • *****
  • Posts: 66
    • View Profile
    • "blag-it" Forum
Re: About Layout Options
« Reply #3 on: May 18, 2019, 07:22:19 am »
Many thanks for your help and sorry for late reply...  I think I was expecting some sort of wysiwyg layout editor - I guess that was wishful thinking ::). But I'm sure I'll work it out.

Offline ajac63

  • SMF Classifieds Customer
  • Jr. Member
  • *****
  • Posts: 66
    • View Profile
    • "blag-it" Forum
Re: About Layout Options
« Reply #4 on: May 20, 2019, 04:11:22 pm »
Right, I'm getting there, but I now have one long column of 12 categories on the let-hand side, so I'm thinking I will have to go with your suggestion of - 'You would need to change the loop structure to make each category title inside a td in the table tag then stop after x amount of and add the closing tr tag.'

Thing is my html knowhow is not great, so if someone could show me the actual lines of html code, that would be great.  Thanks.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14965
    • View Profile
Re: About Layout Options
« Reply #5 on: May 20, 2019, 05:00:15 pm »
Which layout setting are you using right now?
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 ajac63

  • SMF Classifieds Customer
  • Jr. Member
  • *****
  • Posts: 66
    • View Profile
    • "blag-it" Forum
Re: About Layout Options
« Reply #6 on: May 21, 2019, 03:14:56 pm »
Many thanks.  I have 'simple layout settings...' deselected and then after that I also deselected any option to do with auctions as I only want straight listings.
See attached image showing one large column on the left. [ Guests cannot view attachments ]
-
BTW - why am I not authorised to view attachments? [ Guests cannot view attachments ]
« Last Edit: May 21, 2019, 06:42:45 pm by ajac63 »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14965
    • View Profile
Re: About Layout Options
« Reply #7 on: May 21, 2019, 04:33:45 pm »
To access downloads/attachments enter your license key under https://www.smfhacks.com/index.php?action=license
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 ajac63

  • SMF Classifieds Customer
  • Jr. Member
  • *****
  • Posts: 66
    • View Profile
    • "blag-it" Forum
Re: About Layout Options
« Reply #8 on: May 21, 2019, 06:41:50 pm »
Thanks, that seemed to work.  After a browser refresh anyway...  So, what are the lines of html I need to use.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14965
    • View Profile
Re: About Layout Options
« Reply #9 on: May 21, 2019, 09:21:59 pm »
Change these in classifieds2.template.php
Find
Code: [Select]

while($row = $smcFunc['db_fetch_assoc']($dbresult))
{

$totallistings  = Classifieds_GetListingTotals($row['ID_CAT']);

echo '<tr>';

if($row['imageurl'] == '' && $row['imagefilename'] == '')
echo '<td colspan="2" class="windowbg"><a href="' . $scripturl . '?action=classifieds;cat=' . $row['ID_CAT'] . '">' . parse_bbc($row['title']) . '</a> ' . (!empty($modSettings['class_showrss_bycat']) ? '<a href="' . $scripturl . '?action=classifieds;sa=rss;cat=' . $row['ID_CAT'] . ';type=recent"><img src="' . $modSettings['class_url'] . 'rss.png" alt="rss" /></a>' : '') . '</td>
<td class="windowbg2">' . parse_bbc($row['description']) . '</td>';
else
{
if($row['imagefilename'] == '')
echo '<td class="windowbg2"><a href="' . $scripturl . '?action=classifieds;cat=' . $row['ID_CAT'] . '"><img src="' . $row['imageurl'] . '" border="0" alt=""  /></a></td>';
else
echo '<td class="windowbg2"><a href="' . $scripturl . '?action=classifieds;cat=' . $row['ID_CAT'] . '"><img src="' . $modSettings['class_url'] . 'catimgs/' . $row['imagefilename'] . '" border="0" alt=""  /></a></td>';


echo '<td class="windowbg"><a href="' . $scripturl . '?action=classifieds;cat=' . $row['ID_CAT'] . '">' . parse_bbc($row['title']) . '</a> ' . (!empty($modSettings['class_showrss_bycat']) ? '<a href="' . $scripturl . '?action=classifieds;sa=rss;cat=' . $row['ID_CAT'] . ';type=recent"><img src="' . $modSettings['class_url'] . 'rss.png" alt="rss" /></a>' : '') . '</td>
<td class="windowbg2">' . parse_bbc($row['description']) . '</td>';
}



// Show total listings in the category
echo '<td align="center" class="windowbg">', $totallistings, '</td>';

// Show Last Post
if (!empty($modSettings['class_set_show_cat_latest_listings']))
{
echo '<td class="windowbg">';
if (!empty($row['ID_LISTING']))
{

echo '<span class="smalltext">' .  $txt['class_last_post'], ' <a href="',$scripturl,'?action=profile;u=',$row['ID_MEMBER'],'"' . (!empty($row['online_color']) ? ' style="color: ' . $row['online_color'] . ';" ' :'' ) . '>',$row['real_name'],'</a><br />',

'<a href="' . $scripturl . '?action=classifieds;sa=view;id=',$row['ID_LISTING'],'">',shorten_subject($row['listingtitle'], 24) . '</a><br />',$txt['class_txt_on'],timeformat($row['datelisted']) . '</span>';
}

echo '</td>';
}


// Show Edit Delete and Order category
if ($g_manage)
{
echo '
<td class="windowbg2"><a href="' . $scripturl . '?action=classifieds;sa=catup;cat=' . $row['ID_CAT'] . '">' . $txt['class_text_up'] . '</a>&nbsp;<a href="' . $scripturl . '?action=classifieds;sa=catdown;cat=' . $row['ID_CAT'] . '">' . $txt['class_text_down'] . '</a></td>
<td class="windowbg"><a href="' . $scripturl . '?action=classifieds;sa=editcat;cat=' . $row['ID_CAT'] . '">' . $txt['class_text_edit'] . '</a>&nbsp;<a href="' . $scripturl . '?action=classifieds;sa=deletecat;cat=' . $row['ID_CAT'] . '">' . $txt['class_text_delete'] . '</a>
<br />
<a href="' . $scripturl . '?action=classifieds;sa=catperm;cat=' . $row['ID_CAT'] . '">',$txt['class_text_cat_permisisons'],'</a>

</td>';

}


echo '</tr>';

if ($subcats_linktree != '')
{
echo '
<tr class="windowbg3">
<td colspan="',$num_cols , '">&nbsp;<span class="smalltext">',($subcats_linktree != '' ? '<b>' . $txt['class_sub_cats'] . '</b>' . $subcats_linktree : ''),'</span></td>
</tr>';
}


}

change to
Code: [Select]
$maxrowlevel = 4;

$rowlevel = 0;
while($row = $smcFunc['db_fetch_assoc']($dbresult))
{

$totallistings  = Classifieds_GetListingTotals($row['ID_CAT']);
if ($rowlevel == 0)
echo '<tr>';


echo '<td class="windowbg"><a href="' . $scripturl . '?action=classifieds;cat=' . $row['ID_CAT'] . '">' . parse_bbc($row['title']) . '</a></td>';


if($rowlevel < ($maxrowlevel-1))
$rowlevel++;
else
{
echo '</tr>';
$rowlevel = 0;
}
}

if($rowlevel !=0)
{
echo '</tr>';
}
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 ajac63

  • SMF Classifieds Customer
  • Jr. Member
  • *****
  • Posts: 66
    • View Profile
    • "blag-it" Forum
Re: About Layout Options
« Reply #10 on: May 22, 2019, 03:05:15 am »
Once again many thanks for your help.  Thing is I can find a section of code beginning with:

while($row = $smcFunc['db_fetch_assoc']($dbresult))
      {

         $totallistings  = Classifieds_GetListingTotals($row['ID_CAT']);
but not ending with:
<tr class="windowbg3">
            <td colspan="',$num_cols , '">&nbsp;<span class="smalltext">',($subcats_linktree != '' ? '<b>' . $txt['class_sub_cats'] . '</b>' . $subcats_linktree : ''),'</span></td>
         </tr>';
         }


      }

So, I didn't replace it just inn case.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14965
    • View Profile
Re: About Layout Options
« Reply #11 on: May 22, 2019, 07:33:47 am »
It starts on line 569 in that 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 ajac63

  • SMF Classifieds Customer
  • Jr. Member
  • *****
  • Posts: 66
    • View Profile
    • "blag-it" Forum
Re: About Layout Options
« Reply #12 on: May 22, 2019, 01:27:48 pm »
OK, it works. I now have the 12 categories arranged in 4 columns by 3 rows, but without the category images.  I know you told me already, but is there no way of showing the images?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14965
    • View Profile
Re: About Layout Options
« Reply #13 on: May 22, 2019, 01:32:14 pm »
Well you could. Just depends on how you want it to show up.
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 ajac63

  • SMF Classifieds Customer
  • Jr. Member
  • *****
  • Posts: 66
    • View Profile
    • "blag-it" Forum
Re: About Layout Options
« Reply #14 on: May 22, 2019, 06:02:51 pm »
I was thinking of having them to the left of category names.

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
3794 Views
Last post May 09, 2009, 02:28:47 am
by jacci
6 Replies
4779 Views
Last post May 18, 2009, 07:19:48 am
by propyl
8 Replies
5173 Views
Last post February 25, 2010, 01:45:37 pm
by SMFHacks
5 Replies
4997 Views
Last post August 30, 2013, 08:44:22 am
by SMFHacks
1 Replies
2580 Views
Last post June 25, 2014, 12:06:25 pm
by SMFHacks

+- Recent Topics

PHP error by davejo
November 12, 2019, 12:09:47 pm

Message Editor Pro Issues by SMFHacks
November 06, 2019, 09:58:33 pm

most popular categories doesnt work by fussilet
November 02, 2019, 02:51:42 pm

Change colors of Halloween theme by SMFHacks
October 24, 2019, 11:44:59 am

prettyurls - TroubleShooting.wiki by Rock Lee
October 10, 2019, 11:37:09 am

Some issues with adding and editing a listing by ajac63
October 07, 2019, 04:16:40 am

Problem update 1.1.21 to 2.0.15 by Rock Lee
October 06, 2019, 06:09:16 pm

[Mod]SMF 2.0.x PHP 7.2 Support by sah62
October 04, 2019, 01:46:00 pm

Ideas by shuban
October 03, 2019, 10:19:06 pm

How to space icons and multiple reacts? by shadav
October 03, 2019, 04:20:07 pm

Powered by EzPortal