Advertisement:

Author Topic: [Evil Production] Boxed Latest Topics  (Read 1175 times)

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 9,122
  • Gender: Male
  • Black cat rulz!
    • XinYenFon on GitHub
    • merta on LinkedIn
    • @XinYenFon on Twitter
    • wowsnips
[Evil Production] Boxed Latest Topics
« on: April 25, 2020, 12:47:58 PM »
Paste this func. to the end of the BoardIndex.template file
Code: [Select]
function template_evil_latest_topics($settings) {
// Topics with header images and ugly text within...
// If this triggers any back-end developer, I won...
require_once('./SSI.php');
$quack = ssi_recentTopics($num_recent = 5, $exclude_boards = null, $include_boards = null, $output_method = 'array');
if (!empty($quack)) {
echo '<div id="topic_container">';
foreach ($quack as $quack_quack) {
$bg_img = $settings['theme_dir'] . '/images/' . $quack_quack['board']['id'] . '.jpg';
echo '
<div class="ph_topic_upper_holder">
<div class="topic_container" ' . (file_exists($bg_img) ? 'style="background-image: url(' . $settings['images_url'] . '/' . $quack_quack['board']['id'] . '.jpg)"' : '') . '>
<div class="ph_flex_end">
<div class="span_posted_board">' . $quack_quack['board']['link'] . '</div>
<div class="span_poster_link">' . $quack_quack['link'] . '</div>
</div>
</div>
<div class="poster_container">
<span class="grid_poster_user">
' . $quack_quack['poster']['link'] . '<br>
' . $quack_quack['time'] . '
</span>
</div>
</div>';
}
echo '</div>';
}
}
Code: (Index.css) [Select]
/* CSS Part of the thingy I wrote */
#topic_container {
margin: 5px 0 10px 0;
display: flex;
flex-flow: row wrap;
justify-content: space-between;
}
.ph_topic_upper_holder {
flex: 0 19.5%;
display: inline-block;
}
.topic_container {
height: 200px;
background-size: contain;
display: flex;
flex-flow: row wrap;
border-radius: 3px 3px 0 0;
background-color: #534bca;
}
.topic_container .ph_flex_end {
flex: 1 100%;
align-self: flex-end;
padding: 0 0 5% 5%;
}
.span_posted_board {
margin: 0 0 10px 0;
}
.span_posted_board a, .span_poster_link a {
color: #FFF;
font-size: 1.25em;
padding: 4px;
}
.span_posted_board a {
background: orange;
border-radius: 3px;
}
.poster_container {
height: 50px;
background: #FFF;
border: 1px solid #CCC;
border-radius: 0 0 3px 3px;
padding: 2% 0 0 5%;
}

Now you can use template_evil_latest_topics($settings) somewhere you like... inside the BoardIndex.template : )

Remember if something is broken, its not my fault it was working last I checked... if its working good...

This Snip licensed under: MIT

Edit: license change per mod report:
« Last Edit: May 02, 2020, 10:49:34 PM by vbgamer45 »
You can support me via Prime Gaming* or Patreon.

SMF Coding & Talks

* Prime Gaming is an extra perk of your amazon prime subscription -no extra payment required-.

Offline Diego Andrés

  • Customizer
  • SMF Hero
  • *
  • Posts: 3,639
  • Gender: Male
    • DiegoAndresCortes on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: [Evil Production] Boxed Latest Topics
« Reply #1 on: April 27, 2020, 02:59:37 PM »
Really nice

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 9,122
  • Gender: Male
  • Black cat rulz!
    • XinYenFon on GitHub
    • merta on LinkedIn
    • @XinYenFon on Twitter
    • wowsnips
Re: [Evil Production] Boxed Latest Topics
« Reply #2 on: April 27, 2020, 03:02:09 PM »
oh I forgot to mention, you need to put <board-id>.jpg (don't ask why I coded as JPG, you can always change to PNG) into theme's /images/ folder, otherwise it will show -purplish- background...
You can support me via Prime Gaming* or Patreon.

SMF Coding & Talks

* Prime Gaming is an extra perk of your amazon prime subscription -no extra payment required-.

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,977
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: [Evil Production] Boxed Latest Topics
« Reply #3 on: April 27, 2020, 03:10:07 PM »
Nice. Would tie well into the custom board icons mods out there. Ever fancy to package it up as a mod? Just a couple tweaks.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro


Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 9,122
  • Gender: Male
  • Black cat rulz!
    • XinYenFon on GitHub
    • merta on LinkedIn
    • @XinYenFon on Twitter
    • wowsnips
Re: [Evil Production] Boxed Latest Topics
« Reply #5 on: April 27, 2020, 04:50:14 PM »
Nice. Would tie well into the custom board icons mods out there. Ever fancy to package it up as a mod? Just a couple tweaks.

Probably later, once I'm done with SMF 2.1 / smfCurve (MW Theme) and some other things.
You can support me via Prime Gaming* or Patreon.

SMF Coding & Talks

* Prime Gaming is an extra perk of your amazon prime subscription -no extra payment required-.

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,977
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: [Evil Production] Boxed Latest Topics
« Reply #6 on: April 27, 2020, 04:51:19 PM »
Nice! Thanks for your contributions.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,491
  • Master of BBC Abuse
Re: [Evil Production] Boxed Latest Topics
« Reply #7 on: April 27, 2020, 05:23:22 PM »
Code: [Select]
// If this triggers any back-end developer, I won...
:D :D :D :D :D :D