Перейти к контенту

Логотип для каждого форума


Рекомендуемые сообщения

Помогите сделать мод для 1.3, позволяющий сделать так, чтобы при заходе в каждый раздел логотип менялся. То есть у каждого раздела должен быть свой логотип. Такой мод есть для 1.1, могу выложить его код. Помогите, пжлста с модом. :D
Ссылка на комментарий
Поделиться на других сайтах

Выкладывай! :D
Ссылка на комментарий
Поделиться на других сайтах

********************************************************************************
**
** Mod Title:  Custom Forum Logo Hack v1.1    **
** Mod for version:	1.1        **
** Mod Author:  Djelibeybi      **
** Mod E-Mail/MSN:	djeli_beybi@hotmail.com   	 **
**                    **
********************************************************************************
**
** This modification gives each forum a custom logo.   	 **
** You need to create a series of forum logos in GIF or JPG format (but they  **
** must all be the same format). The name of the logo must be X.gif where X is  **
** the forum ID number.        **
** The generic logo must be logo.gif or logo.jpg depending on what you use.	**
** The logos are skin-dependant	and should all be the same resolution  **
** to avoid any layout issues.     	 **
********************************************************************************
**
** Edit file(s): functions.php, Topics.php, Forums.php    **
** Admin CP Changes: Macro Set, Global HTML Elements    **
********************************************************************************
**
** Copyright (C) 2003 Djelibeybi. All rights reserved    **
********************************************************************************
**

Step 1: Upload your forum logos to your style_images/* directories
Step 2: Modify functions.php, Topics.php, Forums.php
Step 3: Add a Macro to each skin's macro set
Step 4: Change each skin to point to the new macro instead of hard-coded to the logo image


Step 1 you do with your FTP program.


Step 2:
//---------------------------------------------------------------------------
** Open sources/functions.php **

Find:
//---------------------------------------------------------------------------
$ibforums->skin['template'] = str_replace( "<#IMG_DIR#>", $ibforums->skin['img_dir'], $ibforums->skin['template'] );

//---------------------------------------------------------------------------
Add BEFORE (must be BEFORE!) GIF VERSION:
Only insert ONE of these two. Pick the one you need based on the image format.
//---------------------------------------------------------------------------

       if ($output_array['FID']) {
 $check_logo = "style_images/".$ibforums->skin['img_dir']."/".$output_array['FID'].".gif";
 if (file_exists($check_logo)) {
         $logo = $output_array['FID'].".gif";
      	 } else {
         $logo = "logo.gif";
      	 }
       } else {
        $logo = "logo.gif";
       }

$ibforums->skin['template'] = str_replace( "<#FORUM#>", $logo, $ibforums->skin['template'] );
 
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
Add BEFORE (must be BEFORE!) JPG VERSION:
//---------------------------------------------------------------------------

       if ($output_array['FID']) {
 $check_logo = "style_images/".$ibforums->skin['img_dir']."/".$output_array['FID'].".jpg";
 if (file_exists($check_logo)) {
         $logo = $output_array['FID'].".jpg";
      	 } else {
         $logo = "logo.jpg";
      	 }
       } else {
        $logo = "logo.jpg";
       }

$ibforums->skin['template'] = str_replace( "<#FORUM#>", $logo, $ibforums->skin['template'] );
 
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
** Open sources/Forums.php **

Find:
//---------------------------------------------------------------------------
$print->do_output( array( 'TITLE'    => $ibforums->vars['board_name']." -> ".$this->forum['name'],
                                 'JS'       => 0,
                                 'NAV'      => array(
                                                      "<a href='".$this->base_url."&act=SC&c={$this->forum['cat_id']}'>{$this->forum['cat_name']}</a>",
                                                      $this->nav_extra,
                                                      "<a href='".$this->base_url."&act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>",
                                                    ),
                             ) );

//---------------------------------------------------------------------------
REPLACE WITH:
//---------------------------------------------------------------------------
$print->do_output( array( 'TITLE'    => $ibforums->vars['board_name']." -> ".$this->forum['name'],
                                 'JS'       => 0,
                                 'FID'      => $this->forum['id'],
                                 'NAV'      => array(
                                                      "<a href='".$this->base_url."&act=SC&c={$this->forum['cat_id']}'>{$this->forum['cat_name']}</a>",
                                                      $this->nav_extra,
                                                      "<a href='".$this->base_url."&act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>",
                                                    ),
                             ) );
//---------------------------------------------------------------------------                              

//---------------------------------------------------------------------------
** Open sources/Topics.php **

Find:
//---------------------------------------------------------------------------
$print->do_output( array( 'TITLE'    => $ibforums->vars['board_name']." -> {$this->topic['title']}",
                                 'JS'       => 1,
                                 'NAV'      => array(
                                                      "<a href='".$this->base_url."&act=SC&c={$this->category['id']}'>{$this->category['name']}</a>",
                                                      $this->nav_extra,
                                                      "<a href='".$this->base_url."&act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>",
                                                    ),
                             ) );

//---------------------------------------------------------------------------
REPLACE WITH:
//---------------------------------------------------------------------------
$print->do_output( array( 'TITLE'    => $ibforums->vars['board_name']." -> {$this->topic['title']}",
                                 'JS'       => 1,
                                 'FID'      => $this->forum['id'],
                                 'NAV'      => array(
                                                      "<a href='".$this->base_url."&act=SC&c={$this->category['id']}'>{$this->category['name']}</a>",
                                                      $this->nav_extra,
                                                      "<a href='".$this->base_url."&act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>",
                                                    ),
                             ) );
//---------------------------------------------------------------------------                              


                            	 




Step 3:
//---------------------------------------------------------------------------
Open your Admin CP:
Navigate to Skins & Templates --> Manage Macros
Edit the Macro set for each skin

Add the Following Macro:

Macro Key: FORUM_LOGO
Macro Replacement: <img src='style_images/<#IMG_DIR#>/<#FORUM#>' border='0'  alt='Powered by Invision Power Board'>
//---------------------------------------------------------------------------




Step 4:
//---------------------------------------------------------------------------
In your Admin CP:
Navigate to Skins & Templates --> Manage HTML Templates
Edit the Global HTML Elements section of each skin template

In the Board Header (logo, links, etc) Section:

Find:
//---------------------------------------------------------------------------
 <img src='{ibf.vars.img_url}/logo.jpg' alt='Powered by Invision Power Board' border='0'>

//---------------------------------------------------------------------------  
Replace with:
//---------------------------------------------------------------------------
 
 <{FORUM_LOGO}>  


//---------------------------------------------------------------------------

DONE!

 

 

Подойдет ли это для 1.3???

Ссылка на комментарий
Поделиться на других сайтах

  • 3 недели спустя...
  • 5 месяцев спустя...

Если есть те, кто смогут переделать его под 2.0, буду благодарен. ;)

Тему такую видел в этом разделе, за 15 vmz кто-то предлогал, но это имхо многовато :D))

Ссылка на комментарий
Поделиться на других сайтах

Присоединиться к обсуждению

Вы можете ответить сейчас, а зарегистрироваться позже. Если у вас уже есть аккаунт, войдите, чтобы ответить от своего имени.

Гость
Ответить в этой теме...

×   Вы вставили отформатированный текст.   Удалить форматирование

  Допустимо не более 75 смайлов.

×   Ваша ссылка была автоматически заменена на медиа-контент.   Отображать как ссылку

×   Ваши публикации восстановлены.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.

Зарузка...
×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.