You can see the demo here
What does this mod does?
This mod allows you to add icons near download categories (in pafiledb downloads section).
It can be configured through ACP in ACP -> Downloads -> Manage categories (when adding or editing a category).
Installation instructions
Spoiler: [ Show ]
Spoiler: [ Hide ]
Run this SQL query. Remember to replace ip_ with your table prefix.
Open adm/admin_pa_category.php
FindAfter, addFindAfter, addFindAfter, addFindAfter, add
Open language/lang_english/lang_admin_pafiledb.php
Repeat this action in each language you have installed
Find This is a partial search, full line is longerAfter, add
Open pafiledb/includes/functions_pafiledb.php
FindAfter, addFindBefore, addFindAfter, addFindBefore, addFindAfter, addFind. This is a partial search, full line is longerIn-Line FindIn-Line After, addFind (next line)In-Line FindIn-Line After, addFindIn-Line FindIn-Line After, add
Open templates/common/ACP/pa_admin_cat_edit.tpl
FindAfter, add
Open templates/mg_themes/pa_category_body.tpl
Repeat this action in each template you have installed
Find. This is a partial search, full line is longerIn-Line FindIn-Line After, addIn-Line FindIn-Line After, add
Open templates/mg_themes/pa_main_body.tpl
Repeat this action in each template you have installed
Find. This is a partial search, full line is longerIn-Line FindIn-Line After, addIn-Line FindIn-Line After, add
ALTER TABLE `ip_pa_cat` ADD `cat_icon` VARCHAR( 255 ) NOT NULL AFTER `cat_desc` ;
Open adm/admin_pa_category.php
Find
$cat_desc = ( !empty( $_POST['cat_desc'] ) ) ? $_POST['cat_desc'] : '';
$cat_icon = ( !empty( $_POST['cat_icon'] ) ) ? $_POST['cat_icon'] : '';
$cat_desc = $pafiledb->cat_rowset[$cat_id]['cat_desc'];
$cat_icon = $pafiledb->cat_rowset[$cat_id]['cat_icon'];
'L_CAT_ICON' => $lang['Caticon'],
'L_CAT_ICON_INFO' => $lang['Caticoninfo'],
'L_CAT_ICON_INFO' => $lang['Caticoninfo'],
Open language/lang_english/lang_admin_pafiledb.php
Repeat this action in each language you have installed
Find This is a partial search, full line is longerAfter, add
$lang['Caticon'] = 'Category Icon';
$lang['Caticoninfo'] = 'Insert the url to the category icon (leave it empty if you don't want to use it)';
$lang['Caticoninfo'] = 'Insert the url to the category icon (leave it empty if you don't want to use it)';
Open pafiledb/includes/functions_pafiledb.php
FindAfter, add
$cat_icon = '<img src="' . $subcat_row['cat_icon'] . '" alt="" title="' . $subcat_row['cat_name'] . '" border="0" />';
'IS_CAT_ICON' => ((empty($subcat_row['cat_icon'])) ? false : true),
'CAT_ICON' => $cat_icon,
'CAT_ICON' => $cat_icon,
$url_cat = append_sid('dload.' . $phpEx . '?action=category&cat_id=' . $sub_cat_rowset[$k]['cat_id']);
}
}
$cat_icon = '<img src="' . $sub_cat_rowset[$k]['cat_icon'] . '" alt="" title="' . $sub_cat_rowset[$k]['cat_name'] . '" border="0" />';
'CAT_DESC' => $sub_cat_rowset[$k]['cat_desc'])
'IS_CAT_ICON' => ((empty($sub_cat_rowset[$k]['cat_icon'])) ? false : true),
'CAT_ICON' => $cat_icon,
'CAT_ICON' => $cat_icon,
$cat_desc = ( isset($_POST['cat_desc']) ) ? htmlspecialchars($_POST['cat_desc']) : '';
$cat_icon = (isset( $_POST['cat_icon'])) ? htmlspecialchars($_POST['cat_icon']) : '';
$sql = 'INSERT INTO ' . PA_CATEGORY_TABLE . "
Open templates/common/ACP/pa_admin_cat_edit.tpl
Find
<td class="row2"><input type="text" class="post" size="50" name="cat_desc" value="{CAT_DESC}"></td>
</tr>
</tr>
<tr>
<td class="row1">{L_CAT_ICON}<br /><span class="gensmall">{L_CAT_ICON_INFO}</span></td>
<td class="row2"><input type="text" class="post" size="50" name="cat_icon" value="{CAT_ICON}"></td>
</tr>
<td class="row1">{L_CAT_ICON}<br /><span class="gensmall">{L_CAT_ICON_INFO}</span></td>
<td class="row2"><input type="text" class="post" size="50" name="cat_icon" value="{CAT_ICON}"></td>
</tr>
Open templates/mg_themes/pa_category_body.tpl
Repeat this action in each template you have installed
Find. This is a partial search, full line is longerIn-Line FindIn-Line After, add
<!-- IF no_cat_parent.IS_CAT_ICON -->
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" valign="middle" nowrap><a href="{no_cat_parent.U_CAT}">{no_cat_parent.CAT_ICON}</a><img src="images/spacer.gif" height="1" width="3" alt="" /></td>
<td valign="middle" width="100%">
<!-- ENDIF -->
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" valign="middle" nowrap><a href="{no_cat_parent.U_CAT}">{no_cat_parent.CAT_ICON}</a><img src="images/spacer.gif" height="1" width="3" alt="" /></td>
<td valign="middle" width="100%">
<!-- ENDIF -->
<!-- IF no_cat_parent.IS_CAT_ICON -->
</td></tr></table>
<!-- ENDIF -->
</td></tr></table>
<!-- ENDIF -->
Open templates/mg_themes/pa_main_body.tpl
Repeat this action in each template you have installed
Find. This is a partial search, full line is longerIn-Line FindIn-Line After, add
<!-- IF no_cat_parent.IS_CAT_ICON -->
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" valign="middle" nowrap><a href="{no_cat_parent.U_CAT}">{no_cat_parent.CAT_ICON}</a><img src="images/spacer.gif" height="1" width="3" alt="" /></td>
<td valign="middle" width="100%">
<!-- ENDIF -->
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" valign="middle" nowrap><a href="{no_cat_parent.U_CAT}">{no_cat_parent.CAT_ICON}</a><img src="images/spacer.gif" height="1" width="3" alt="" /></td>
<td valign="middle" width="100%">
<!-- ENDIF -->
Please ask for help in this topic. Greetings!