× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
a
5
k
5
c
5
B
5
l
5
C
4
s
4
a
4
t
4
i
4
r
4
r
4
New Topic  
bio_man bio_man
wrote...
Administrator
Educator
Posts: 33240
6 years ago
Code:
global $context, $modSettings, $scripturl, $settings, $txt;

echo'
<table cellspacing="0" cellpadding="0" style="width: 100%; margin-bottom: 8px;">
<tr>
<td style="width: 50%; padding-right: 4px; vertical-align: top;" id="front-featured-links">
<div class="tp_block_design">
<div class="blockbody">
<div class="tabsmenuclass">
<ul id="front_tabs">
<li><a href="#" rel="#default" class="selected">Recently Updated Topics</a></li>
<li><a href="Sources/upperblock.php?front_unanswered" rel="front_tabs_container">Unanswered Questions</a></li>
<li><a href="Sources/upperblock.php?front_articles" rel="front_tabs_container">Discussion</a></li>
</ul>
</div>
<div id="countrydivcontainer" class="tabsmenucontentclass">';
   
if (($what = cache_get_data('ssi_mainpagecache', 300)) == null)
{
$what = ssi_recentTopics('10', $exclude_boards = array(29, 44, 17, 38, 53, 61, 68), 'array');

// Check if cache is enabled
global $modSettings;
if (!empty($modSettings['cache_enable']))
cache_put_data('ssi_mainpagecache', $what, 300);
}

echo '
<table cellpadding="0" cellspacing="0" id="topictable">
<tbody style="display: none;">
<tr class="catbg2">
<td colspan="2">
Subjects
</td>
</tr>
</tbody>';

$cnt = 1;

foreach ($what as $topic)
{
$cnt++;
if ($cnt >= 2) $cnt = 0;
{
echo '
<tbody class="topictablerow">
<tr class="windowbg', $cnt == 0 ? '' : '2', '">
<td style="background-image: url(', $topic['iconurl'], ');" title="', $topic['preview'] ,'">
<div>
', $topic['link'], '
</div>
<div>
<span>',$topic['board']['link'],'</span><span>  <i class="fa fa-clock-o fa-fw" aria-hidden="true"></i> ',$topic['time'],'</span><span>  <i class="fa fa-user fa-fw" aria-hidden="true"></i> ',$topic['poster']['link'],'</span><span>  <i class="fa fa-reply fa-fw" aria-hidden="true"></i> <span>';

if($topic['replies'] == 0)
echo'N/A';
elseif($topic['replies'] != 1)
echo $topic['replies'],' Replies';
else
echo $topic['replies'],' Reply';

echo'</span><span>  <i class="fa fa-eye fa-fw" aria-hidden="true"></i> ',$topic['views'],' View',$topic['views'] != 1 ?'s':'','</span>
</div>
</td>
</tr>
</tbody>';
}
}

if(end($what))
echo'
<tr style="display:none;">
<td colspan="2">
<a href="',$scripturl,'?action=latest">
View More Recently Updated Topics <i class="fa fa-external-link fa-fw" aria-hidden="true"></i>
</a>
</td>
</tr>';

echo '
</table>
</div>

<script type="text/javascript">
var countries=new ddajaxtabs("front_tabs", "countrydivcontainer")
countries.setpersist(false)
countries.setselectedClassTarget("link")
countries.init()
</script>
</div>
</div>
</td>

<td style="width: 50%; padding-left: 4px; vertical-align: top;"  id="front-featured-blogs">
<div class="tp_block_design">
<div class="tp_header_1">
Latest Blogs
</div>
<div class="blockbody" style="font-size: 14px;">
<ul class="latest_blogs_list">';

$i = 0;

foreach($context['blog_lines'] as $blog)
{

if($i < 3)
echo'<li>'.$blog.'</li>';

$i++;
}
echo'
</ul>
</div>
</div>
</td>
</table>';



Code:
//Recent Updated Topics

function recent_updated_topics($count=3)
{
global $scripturl, $settings, $context, $txt;

$cache_name = 'upperblock_desktop_recent_'.$count;

if (($what = cache_get_data($cache_name, 180)) == null)
{
$what = ssi_recentTopics($count, $exclude_boards = array(29, 44, 17, 38, 53, 61, 68), 'array'); 

// Check if cache is enabled
global $modSettings;

if (!empty($modSettings['cache_enable']))
cache_put_data($cache_name, $what, 180);
}

echo '
<table cellpadding="0" cellspacing="0" id="topictable">
<tbody>
<tr>
<td colspan="2" style="border-top: 1px solid #ccc; padding: 0;"></td>
</tr>
</tbody>';

$cnt = 1;

foreach ($what as $topic)
{
$cnt++;
if ($cnt >= 2)
$cnt = 0;

{
echo '
<tbody class="topictablerow">
<tr class="windowbg', $cnt == 0 ? '' : '2', '">
<td style="background-image: url(', $topic['iconurl'], ');" title="', $topic['preview'] ,'">
<div>
', $topic['link'];

// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<span class="new_post">', $txt[302], '</span>';
echo'
</div>
<div>
<span>',$topic['board']['link'],'</span><span>  <i class="fa fa-clock-o fa-fw" aria-hidden="true"></i> ',$topic['time'],'</span><span>  <i class="fa fa-user fa-fw" aria-hidden="true"></i> ',$topic['poster']['link'],'</span><span>  <i class="fa fa-reply fa-fw" aria-hidden="true"></i> <span>';

if($topic['replies'] == 0)
echo'N/A';
elseif($topic['replies'] != 1)
echo $topic['replies'],' Replies';
else
echo $topic['replies'],' Reply';

echo'</span><span>  <i class="fa fa-eye fa-fw" aria-hidden="true"></i> ',$topic['views'],' View',$topic['views'] != 1 ?'s':'','</span>
</div>
</td>
</tr>
</tbody>';
}
}

if(end($what))
echo'
<tr>
<td colspan="2">
<a href="',$scripturl,'?action=latest">
View More Recently Updated Topics <i class="fa fa-external-link fa-fw" aria-hidden="true"></i>
</a>
</td>
</tr>';

echo '
</table>';
}
Read 527 times

Related Topics

New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  913 People Browsing
Related Images
  
 382
  
 133
  
 305