[ Príspevok: 1 ] 
AutorSpráva
Offline

Prevádzkovateľ fóra
Prevádzkovateľ fóra
Categories & Forum Icon

Registrovaný: 01.05.05
Príspevky: 12422
Témy: 1447 | 1447
Bydlisko: Bratislava
Vek: 32
NapísalOffline : 13.10.2006 9:29 | Categories & Forum Icon

Kód:
###############################################
##
## MOD Title:   Categories & Forum Icon
## MOD Version: 1.0.0
## Author: Anh Le Minh < netanh@zapo.net >
## Website: http://www.netanh.com
## Forum: http://forum.netanh.com
## Description: This Mod gives 1 images beside your categories name, forum name on
## index page
##
## Files To Edit: 7
##                language/lang_xxx/lang_main.php
##                language/lang_xxx/lang_admin.php
##                admin/admin_forums.php
##                templates/YOUR_TEMPLATE/admin/forum_edit_body.tpl
##                templates/YOUR_TEMPLATE/admin/category_edit_body.tpl
##                templates/YOUR_TEMPLATE/index_body.tpl
##                index.php
## Installation Time:   10-15 Minutes
## Included Files:      none
##
###################################################################################
##
## Installation/Author Notes:
## First always make a back-up from the files that
## you're going to edit.
##
## This add-on MOD adds a few field to your 'forums' & 'categories' table.
###################################################################################

#
#-----[ ACTION: EXECUTE]-----------------------------------
#
#
SQL QUERY:
ALTER TABLE prefix_forums ADD forum_icon VARCHAR(100);
ALTER TABLE prefix_categories ADD cat_icon VARCHAR(100);

#
#-----[ ACTION: ]------------------------------------------
# OPEN: language/lang_xxx/lang_main.php

[FIND]:
//
// That's all Folks!

[ADD AFTER]:

// Categories & Forum icon MOD
$lang['Icon'] = "Icon";

####### SAVE & CLOSE: language/lang_xxx/lang_main.php #######
#############################################################


#
#-----[ ACTION: ]------------------------------------------
# OPEN: language/lang_xxx/lang_admin.php

[FIND]:
//
// That's all Folks!

[ADD AFTER]:

// Categories & Forum icon MOD
$lang['Icon'] = "Icon";

####### SAVE & CLOSE: language/lang_xxx/lang_admin.php #######
#############################################################


#
#-----[ ACTION: ]------------------------------------------
# OPEN: admin\admin_forums.php

[FIND]:
case 'editforum':
         //
         // Show form to create/modify a forum
         //
         if ($mode == 'editforum')
         {
            // $newmode determines if we are going to INSERT or UPDATE after posting?

            $l_title = $lang['Edit_forum'];
            $newmode = 'modforum';
            $buttonvalue = $lang['Update'];

            $forum_id = intval($HTTP_GET_VARS[POST_FORUM_URL]);

            $row = get_info('forum', $forum_id);

            $cat_id = $row['cat_id'];
            $forumname = $row['forum_name'];
            $forumdesc = $row['forum_desc'];
            $forumstatus = $row['forum_status'];
[ADD AFTER]:
$forumicon = $row['forum_icon'];

------------------------------
[FIND]:
$forumdesc = '';

[ADD AFTER]:
$forumicon = '';

------------------------------
[FIND]:
'L_FORUM_DESCRIPTION' => $lang['Forum_desc'],

[ADD AFTER]:
'L_ICON' => $lang['Icon'],

------------------------------
[FIND]:
'DESCRIPTION' => $forumdesc)

[REPLACE WITH]:
'DESCRIPTION' => $forumdesc,
'F_ICON' => $forumicon)

------------------------------
[FIND]:
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
            VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";

[REPLACE]:
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, forum_icon, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
            VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumicon']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";


------------------------------
[FIND]:
$sql = "UPDATE " . FORUMS_TABLE . "
            SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
            WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);


[REPLACE]:
$sql = "UPDATE " . FORUMS_TABLE . "
            SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_icon = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumicon']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
            WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);


------------------------------
[FIND]:
$sql = "INSERT INTO " . CATEGORIES_TABLE . " (cat_title, cat_order)
            VALUES ('" . $HTTP_POST_VARS['categoryname'] . "', $next_order)";


[REPLACE]:
$sql = "INSERT INTO " . CATEGORIES_TABLE . " (cat_title, cat_order, cat_icon)
            VALUES ('" . $HTTP_POST_VARS['categoryname'] . "', $next_order, $caticon)";

------------------------------
[FIND]:
$cat_title = $row['cat_title'];

[ADD AFTER]:
$caticon = $row['cat_icon'];


------------------------------
[FIND]:
'CAT_TITLE' => $cat_title,

[ADD AFTER]:
'CAT_ICON' => $caticon,
'L_ICON' => $lang['Icon'],


------------------------------
[FIND]:
// Modify a category in the DB
$sql = "UPDATE " . CATEGORIES_TABLE . "
   SET cat_title = '" . str_replace("\'", "''", $HTTP_POST_VARS['cat_title']) . "'
   WHERE cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]);

[REPLACE]:
$sql = "UPDATE " . CATEGORIES_TABLE . "
   SET cat_title = '" . str_replace("\'", "''", $HTTP_POST_VARS['cat_title']) . "', cat_icon = '" . str_replace("\'", "''", $HTTP_POST_VARS['cat_icon']) . "'
   WHERE cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]);


------------------------------
[FIND]:
$name = $catinfo['cat_title'];

[ADD AFTER]:
$caticon = $catinfo['cat_icon'];

####### SAVE & CLOSE: admin\admin_forums.php #######
#############################################################

#
#-----[ ACTION: ]------------------------------------------
# OPEN: index.php

[FIND]:
//
// Start page proper
//
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
   FROM " . CATEGORIES_TABLE . " c

[REPLACE]:
//
// Start page proper
//
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order, c.cat_icon
   FROM " . CATEGORIES_TABLE . " c

------------------------------
[FIND]:
if ( $display_forums )
      {
         $template->assign_block_vars('catrow', array(
            'CAT_ID' => $cat_id,
            'CAT_DESC' => $category_rows[$i]['cat_title'],
            'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
         );

[REPLACE]:
if ( $display_forums )
      {
            if ($category_rows[$i]['cat_icon'] != '')
            {$c_icon = '&nbsp;<img src="'.$category_rows[$i]['cat_icon'].'"/>&nbsp;';}
                                else {$c_icon = '';}
         $template->assign_block_vars('catrow', array(
            'CAT_ID' => $cat_id,
            'CAT_DESC' => $category_rows[$i]['cat_title'],
            'CAT_ICON' => $c_icon,
            'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
         );


------------------------------
[FIND]:
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
                     
$template->assign_block_vars('catrow.forumrow',   array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'FORUM_FOLDER_IMG' => $folder_image,
'FORUM_ID' => $forum_data[$j]['forum_id'],
'FORUM_NAME' => $forum_data[$j]['forum_name'],
'FORUM_DESC' => $forum_data[$j]['forum_desc'],
'POSTS' => $forum_data[$j]['forum_posts'],
'TOPICS' => $forum_data[$j]['forum_topics'],


[REPLACE]:
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
if ($forum_data[$j]['forum_icon'] != '')
{$f_icon = '&nbsp;<img src="'.$forum_data[$j]['forum_icon'].'">&nbsp;';}
else {$f_icon = '';}

$template->assign_block_vars('catrow.forumrow',   array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'FORUM_FOLDER_IMG' => $folder_image,
'FORUM_ID' => $forum_data[$j]['forum_id'],
'FORUM_NAME' => $forum_data[$j]['forum_name'],
'FORUM_DESC' => $forum_data[$j]['forum_desc'],
'FORUM_ICON' => $f_icon,
'POSTS' => $forum_data[$j]['forum_posts'],
'TOPICS' => $forum_data[$j]['forum_topics'],

####### SAVE & CLOSE: index.php #######
#############################################################


#
#-----[ ACTION: ]------------------------------------------
# OPEN: templates\subSilver\admin\forum_edit_body.tpl

[FIND]:
   <tr>
     <td class="row1">{L_FORUM_DESCRIPTION}</td>
     <td class="row2"><textarea rows="5" cols="45" wrap="virtual" name="forumdesc" class="post">{DESCRIPTION}</textarea></td>
   </tr>

[ADD AFTER]:
<tr>
   <td class="row1">{L_ICON}</td>
   <td class="row2"><input type="text" size="25" name="forumicon" value="{F_ICON}" class="post" /></td>
</tr>

####### SAVE & CLOSE: templates\subSilver\admin\forum_edit_body.tpl #######
###########################################################################


#
#-----[ ACTION: ]------------------------------------------
# OPEN: templates\subSilver\admin\category_edit_body.tpl

[FIND]:
   <tr>
     <td class="row1">{L_CATEGORY}</td>
     <td class="row2"><input type="text" size="25" name="cat_title" value="{CAT_TITLE}" /></td>
   </tr>

[ADD AFTER]:
<tr>
   <td class="row1">{L_ICON}</td>
   <td class="row2"><input type="text" size="25" name="cat_icon" value="{CAT_ICON}" class="post" /></td>
</tr>


####### SAVE & CLOSE: templates\subSilver\admin\category_edit_body.tpl #######
##############################################################################


#
#-----[ ACTION: ]------------------------------------------
# OPEN: templates\subSilver\index_body.tpl

[FIND]:
<span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span>

[ADD BEFORE]:
{catrow.CAT_ICON}


------------------------------
[FIND]:
<span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a>

[ADD BEFORE]:
{catrow.forumrow.FORUM_ICON}


####### SAVE & CLOSE: templates\subSilver\index_body.tpl #######
################################################################


_________________
SilverStone SST CS01 | Corsair SF600 600W SFX | ASRock X99E-ITX/ac | Intel Xeon E5-2683 v4 (16 Cores / 32 Threads) & Noctua NH-U9DX i4 | Kingston HyperX Savage 32 GB DDR4 2400 MHz | PNY NVIDIA Quadro K1200 DP 4 GB DDR5 | Intel SSD 750 1.2 TB NVMe & Intel SSD 730 240 GB SATA & Seagate BackUp Plus Portable 12 TB USB | 31.5" 4K LCD EIZO FlexScan EV3237 & 2 x 24" LCD EIZO FlexScan EV2451 | Ergotron LX Wall Mount Keyboard Arm | Logitech Craft | Logitech Wireless G700s | Harman Kardon Nova | Microsoft Windows 7 Ultimate | APC Back-UPS ES 700 | Lenovo ThinkPad X250 - Intel Core i7 5600U, 8 GB DDR3 1600 MHz, Intel HD Graphics 5500, SanDisk SSD 512 GB, 12.5 FHD LED IPS, WWAN 3G 4G LTE, Microsoft Windows 7 Ultimate | Nintendo Classic Mini | BlackBerry Passport 96 GB
 [ Príspevok: 1 ] 


Categories & Forum Icon



Podobné témy

 Témy  Odpovede  Zobrazenia  Posledný príspevok 
V tomto fóre nie sú ďalšie neprečítané témy.

Categories Hierarchy problem

v Redakčné systémy

3

326

04.05.2007 11:09

Devil_SK

V tomto fóre nie sú ďalšie neprečítané témy.

PREKLAD: Categories Hierarchy Mod SK

v Redakčné systémy

0

1837

30.11.2006 16:49

JanoF

V tomto fóre nie sú ďalšie neprečítané témy.

Symbian & android & iOS & WinMobile

[ Choď na stránku:Choď na stránku: 1, 2 ]

v Smartfóny a tablety

41

1772

15.12.2011 21:16

haffen

V tomto fóre nie sú ďalšie neprečítané témy.

Android icon pack

v Smartfóny a tablety

11

197

22.08.2015 1:17

kllr007

V tomto fóre nie sú ďalšie neprečítané témy.

Java icon jar

v Assembler, C, C++, Pascal, Java

0

199

08.02.2012 11:56

Logik

V tomto fóre nie sú ďalšie neprečítané témy.

youtuba channel icon

v Ostatné programy

2

209

29.12.2011 13:59

Iron-Tiger

V tomto fóre nie sú ďalšie neprečítané témy.

win xp battery icon missing

v Operačné systémy Microsoft

2

182

28.10.2011 17:39

beginner

V tomto fóre nie sú ďalšie neprečítané témy.

Flat icon pack by SKRiPT v2.0

[ Choď na stránku:Choď na stránku: 1, 2 ]

v Grafické programy

34

1149

10.11.2017 12:41

SKRiPT

V tomto fóre nie sú ďalšie neprečítané témy.

P: slúchadlá Skullcandy Icon 2 - Shoe Red w/Mic/065

v Predám

1

336

07.07.2011 14:16

klaudia

V tomto fóre nie sú ďalšie neprečítané témy.

P: War 3 RoCH & TFT, Diablo 2 & LOD

v Predám

1

348

17.05.2011 20:25

KocuR

Táto téma je zamknutá, nemôžete posielať nové príspevky alebo odpovedať na staršie.

P: AMD Athlon II X3 455 AM3 & DDR3 8Gb & 4Gb

v Predám

6

233

14.12.2012 12:37

MilanYX

V tomto fóre nie sú ďalšie neprečítané témy.

DELL XPS L502X & Kingston HyperX FURY SSD 120GB & ICY BOX AC642

v SSD disky

11

254

24.12.2014 16:11

Miso122

V tomto fóre nie sú ďalšie neprečítané témy.

vyhladenie & zmensenie & spestrenie obrazka

v Grafické programy

5

781

12.06.2007 20:22

Devil_SK

V tomto fóre nie sú ďalšie neprečítané témy.

sapphire & asus & Gigabite

v Grafické karty

6

426

21.07.2008 20:40

Daron

V tomto fóre nie sú ďalšie neprečítané témy.

FLASH "icon zoom effect"

v Ostatné

0

383

27.01.2009 15:16

max-m

V tomto fóre nie sú ďalšie neprečítané témy.

K: Dell R410 & Dell R310 & HP DL160 g6

v Kúpim

0

49

14.10.2017 20:32

d0.0b



© 2005 - 2017 PCforum, edited by JanoF