Today am gonna show you guys
How to customize your smf wap2 by adding Board details like Total Post/Topics and Board descriptions
(http://afriwap.com/gallery/1_12_01_14_5_32_12.png)
Difficulty: EASY
Just follow the steps Below
[/b][/u]make sure you backup before proceeding
Login to your Control panel using Filezilla or Any Ftp program
Goto public_html/Themes/default/wireless.template.php
Edit and Find
foreach ($category['boards'] as $board)
{
$count++;
echo '
<div class="body">', $board['new'] ? '<span class="updated"><img border="0" src="' .$settings['default_images_url']. '/wap/new.png" width="18px" height="9px"> ' : '<img border="0" src="' .$settings['default_images_url']. '/wap/newg.png" width="9px" height="9px">', $board['children_new'] && !$board['new'] ? '<span class="updated">+ ' : '', $board['new'] || $board['children_new'] ? '</span>' : ' ', '<a href="', $scripturl, '?board=', $board['id'], '.0;wap2"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $board['name'], '</a></div>';
}
Then Replace with
foreach ($category['boards'] as $board)
{
$count++;
echo '
<div class="body">', $board['new'] ? '<span class="updated"><img border="0" src="' .$settings['default_images_url']. '/wap/new.png" width="18px" height="9px"> ' : '<img border="0" src="' .$settings['default_images_url']. '/wap/newg.png" width="9px" height="9px">', $board['children_new'] && !$board['new'] ? '<span class="updated">+ ' : '', $board['new'] || $board['children_new'] ? '</span>' : ' ', '<a href="', $scripturl, '?board=', $board['id'], '.0;wap2"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $board['name'], '</a></div>';
$boardname=$board['id'];
//connecting to db
$sq = mysql_query("select * from smf_boards where id_board='$boardname'");
if(!$sq)
{
die(mysql_error());
}
while($ow=mysql_fetch_array($sq))
{
$ntopic=$ow['num_topics'];
$npost=$ow['num_posts'];
$desc = $ow['description'];
if(!$desc)
{
$desc="No description";
}
echo'<div class="ss">'.$desc.'<br/>Topics: '.$ntopic.' Posts: '.$npost.'</div></div>';
}
}
Or you can use the include function (Same we used in adding links to wap2)
Add the below code to a file and include it
$boardname=$board['id'];
//connecting to db
$sq = mysql_query("select * from smf_boards where id_board='$boardname'");
if(!$sq)
{
die(mysql_error());
}
while($ow=mysql_fetch_array($sq))
{
$ntopic=$ow['num_topics'];
$npost=$ow['num_posts'];
$desc = $ow['description'];
if(!$desc)
{
$desc="No description";
}
echo'<div class="ss">'.$desc.'<br/>Topics: '.$ntopic.' Posts: '.$npost.'</div></div>';
}
Simple! :)
Dont forget to Like / Tweet