[HELP] Мод Forum icons

Статус
В этой теме нельзя размещать новые ответы.
Сделал все по инструкции и все получилось с первого раза версия ипб 2.3.4
 
Кто-нибудь пробовал на 2.3.6? Иконки тоже не кликабельны?
 
Скажу вам всем. Вы пишите (Кто-нибудь пробовал на 2.3.6, 2.3.5 и т.д) запомните раз и навсегда моды идущие на 2.3.5 или написанно там, идут и на 2.2 и на 2.3!
 
ошибка

Установил на 2.3.4 нажимаю список форумов выдает Parse error: syntax error, unexpected T_VARIABLE in /home/pcwareznik/domains/apofeoz.com/public_html/forum/sources/action_admin/forums.php on line 1118

В чем проблема подскажите.
 
ПРОблема в строке 1118 файла /sources/action_admin/forums.php
 
Metsof
Выложи сюда текст 1118 строчки, посмотрим
(можно целиком файл)
 
для того чтобы появилось кликокабельность я где то вычитал и мне помогло

в ./sources/classes/class_forums.php
PHP:
if($forum_data['icon']){
    return $forum_data['last_post'] > $rtime ? "<img src=\"".$this->ipsclass->vars['board_url']."/html/forumicons/".$forum_data['icon'].".gif\">"
    : "<img src=\"".$this->ipsclass->vars['board_url']."/html/forumicons/".$forum_data['icon']."_off.gif\">";
}else{
        return ( $forum_data['last_post'] && $forum_data['last_post'] > $rtime ) ? "<{C_ON".$sub_cat_img."}>" : "<{C_OFF".$sub_cat_img."}>";
}
заменить на
PHP:
if($forum_data['icon']){
        return $forum_data['last_post'] > $rtime ? "<a href=\"".$this->ipsclass->base_url."showforum=".$forum_data['id']."\"><img src=\"".$this->ipsclass->vars['board_url']."/html/forumicons/".$forum_data['icon'].".gif\"></a>"
    : "<a href=\"".$this->ipsclass->base_url."showforum=".$forum_data['id']."\"><img src=\"".$this->ipsclass->vars['board_url']."/html/forumicons/".$forum_data['icon']."_off.gif\"></a>";
}else{
        return ( $forum_data['last_post'] && $forum_data['last_post'] > $rtime ) ? "<{C_ON".$sub_cat_img."}>" : "<{C_OFF".$sub_cat_img."}>";
}
рабит на ура и на 2.3.5 и на 2.3.6
 
Ребята, послушайте, кто нибудь может оставить саму инструкцию по установке?
Поделитесь, чтобы другие не поднимали этот вопрос.
 
Народ, может кто-нибудь инструкцию перевести на русский язык?
 
Народ, может кто-нибудь инструкцию перевести на русский язык?

Код:
--------------------------------------------------------------------

######################################################################
Выполните следующий SQL запрос в базе данных
======================================================================
ALTER TABLE `ibf_forums` ADD `icon` text NOT NULL;
ALTER TABLE `ibf_skin_sets` ADD `set_use_fimgs` tinyint(1) DEFAULT '1';
======================================================================

######################################################################
Создайте папку ./forumicons в корне IPB форума
======================================================================

Откройте фаил "class_forums.php"
######################################################################
./sources/classes/class_forums.php
======================================================================
Найдите:
----------------------------------------------------------------------
        if ( $forum_data['img_new_post'] == '<{C_ON}>' )
        {
            $forum_data['img_new_post'] = $this->ipsclass->compiled_templates['skin_boards']->forum_img_with_link($forum_data['img_new_post'], $forum_data['id']);
        }
        else if ( $forum_data['img_new_post'] == '<{C_ON_CAT}>' )
        {
            $forum_data['img_new_post'] = $this->ipsclass->compiled_templates['skin_boards']->subforum_img_with_link($forum_data['img_new_post'], $forum_data['id']);
        }
----------------------------------------------------------------------
Ниже добавьте:
----------------------------------------------------------------------
        # [b] Forum icons (Alex/AT)
        else if ( substr($forum_data['img_new_post'], 0, 12) == '<img tag="" ' )
        {
            $forum_data['img_new_post'] = '<img '.substr($forum_data['img_new_post'], 12);
            $forum_data['img_new_post'] = $this->ipsclass->compiled_templates['skin_boards']->forum_img_with_link($forum_data['img_new_post'], $forum_data['id']);
        }
        else if ( substr($forum_data['img_new_post'], 0, 16) == '<img tag="_CAT" ' )
        {
            $forum_data['img_new_post'] = '<img '.substr($forum_data['img_new_post'], 16);
            $forum_data['img_new_post'] = $this->ipsclass->compiled_templates['skin_boards']->subforum_img_with_link($forum_data['img_new_post'], $forum_data['id']);
        }
        # [E] Forum icons (Alex/AT)
----------------------------------------------------------------------
Найдите:
----------------------------------------------------------------------
    return ( $forum_data['last_post'] && $forum_data['last_post'] > $rtime ) ? "<{C_ON".$sub_cat_img."}>" : "<{C_OFF".$sub_cat_img."}>";
----------------------------------------------------------------------
Замените на:
----------------------------------------------------------------------
    # [b] Forum icons (Alex/AT)
    if ($this->ipsclass->skin['_fimgs'] AND $forum_data['icon']){
        return ( $forum_data['last_post'] && $forum_data['last_post'] > $rtime ) ? ( "<img tag=\"".$sub_cat_img."\" src=\"".$this->ipsclass->vars['board_url']."/forumicons/".$forum_data['icon'].".gif\">" )
        : "<img src=\"".$this->ipsclass->vars['board_url']."/forumicons/".$forum_data['icon']."_off.gif\">";
    }else{
            return ( $forum_data['last_post'] && $forum_data['last_post'] > $rtime ) ? "<{C_ON".$sub_cat_img."}>" : "<{C_OFF".$sub_cat_img."}>";
    }
    # [E] Forum icons (Alex/AT)
======================================================================

######################################################################
./sources/action_admin/forums.php
======================================================================
Найдите:
----------------------------------------------------------------------
        $form['parent_id']    = $this->ipsclass->adskin->form_dropdown("parent_id"   , $forumlist, $_POST['parent_id'] ? $_POST['parent_id']    : $forum['parent_id'] );
        $form['status']       = $this->ipsclass->adskin->form_dropdown("status"      , $dd_state , $_POST['status']    ? $_POST['status']       : $forum['status'] );
        $form['sub_can_post'] = $this->ipsclass->adskin->form_yes_no(  'sub_can_post', $_POST['sub_can_post']          ? $_POST['sub_can_post'] : $forum['sub_can_post'] );
----------------------------------------------------------------------
Ниже добавьте:
----------------------------------------------------------------------
        # [b] Forum icons (Alex/AT)
        $dh = opendir( ROOT_PATH.'forumicons' );
        $icons = array();
        $icons[] = array("", "Default Icons");
        while ($icon = readdir($dh)) {
            if((preg_match("/(.gif)/",$icon) || preg_match("/(.jpg)/",$icon) || preg_match("/(.jpeg)/",$icon) || preg_match("/(.png)/",$icon)) && !preg_match("/(_off)/",$icon)) {
                if($icon != '.' || $icon != '..') {
                $iconname = str_replace(".gif","",$icon);
                $icons[] = array($iconname, $iconname);
                }
            }
        }
        closedir($dh);

        sort($icons);

        $form['icon'] = $this->ipsclass->adskin->form_dropdown( "icon", $icons, $_POST['icon'] ? $_POST['icon'] : $forum['icon'] );
        # [E] Forum icons (Alex/AT)
----------------------------------------------------------------------
Найдите:
----------------------------------------------------------------------
        $save = array (  'name'                    => $this->ipsclass->input['name'],
----------------------------------------------------------------------
Ниже добавьте:
----------------------------------------------------------------------
                        # [b] Forum icons (Alex/AT)
                         'icon'                    => $this->ipsclass->input['icon'],
                        # [E] Forum icons (Alex/AT)
======================================================================

######################################################################
./skin_acp/IPB2_Standard/acp_skin_html/cp_skin_forums.php
======================================================================
Найдите: 
----------------------------------------------------------------------
    <tr>
        <td width='40%' class='tablerow1'><strong>Описание</strong><div class='desctext'>HTML разрешен.<br />Переносы строк автоматически заменяются на <br>.</div></td>

        <td width='60%' class='tablerow2'>{$form['description']}</td>
    </tr>
----------------------------------------------------------------------
Выше добавьте:
----------------------------------------------------------------------
    <!-- [b] Forum icons (Alex/AT) -->
    <tr>
        <td width='40%' class='tablerow1'><strong>Иконка</strong></td>
        <td width='60%' class='tablerow2'>{$form['icon']}</td>
    </tr>
    <!-- [E] Forum icons (Alex/AT) -->
======================================================================
В файле "skin_sets.php"
######################################################################
./sources/action_admin/skin_sets.php
======================================================================
Найдите:
----------------------------------------------------------------------
        $new['set_name']          = $this->ipsclass->input['set_name'];
        $new['set_image_dir']     = $this_set['set_image_dir'];
        $new['set_hidden']        = $this->ipsclass->input['hidden'];
        $new['set_default']       = 0;
----------------------------------------------------------------------
Ниже добавьте:
----------------------------------------------------------------------
        # [b] Forum icons (Alex/AT)
        $new['set_use_fimgs']     = $this->ipsclass->input['set_use_fimgs'];
        # [E] Forum icons (Alex/AT)
----------------------------------------------------------------------
Найдите:
----------------------------------------------------------------------
                         'set_css_method'      => $this->ipsclass->input['set_css_method'],
                         'set_hidden'          => $this->ipsclass->input['set_hidden'],
                         'set_image_dir'       => $this->ipsclass->input['set_image_dir'],
                         'set_author_email'    => $this->ipsclass->input['set_author_email'],
----------------------------------------------------------------------
Ниже добавьте:
----------------------------------------------------------------------
                        # [b] Forum icons (Alex/AT)
                         'set_use_fimgs'       => $this->ipsclass->input['set_use_fimgs'],
                        # [E] Forum icons (Alex/AT)
----------------------------------------------------------------------
Найдите:
----------------------------------------------------------------------
                               <td width='60%' class='tdrow1'>style_emoticons/ ".$this->ipsclass->adskin->form_dropdown('set_emoticon_folder', $emodirs, $row['set_emoticon_folder'])."</td>
                             </tr>
----------------------------------------------------------------------
Ниже добавьте:
----------------------------------------------------------------------
                            <!-- [b] Forum icons (Alex/AT) -->
                             <tr>
                               <td width='40%' class='tdrow1'>Использовать нестандартные иконки для форумов?</td>
                               <td width='60%' class='tdrow1'>".$this->ipsclass->adskin->form_yes_no('set_use_fimgs', $row['set_use_fimgs'])."</td>
                             </tr>
                            <!-- [E] Forum icons (Alex/AT) -->
======================================================================


В файле "ipsclass.php"
######################################################################
./sources/ipsclass.php
======================================================================
Найдите:
----------------------------------------------------------------------
            $db_skin = $this->DB->simple_exec_query( array( 'select' => 'set_cache_css,set_cache_wrapper,set_cache_macro,set_image_dir,set_emoticon_folder,set_skin_set_id,set_name,set_css_method', 'from' => 'skin_sets', 'where' => 'set_skin_set_id='.$id ) );
----------------------------------------------------------------------
Замените на:
----------------------------------------------------------------------
            $db_skin = $this->DB->simple_exec_query( array( 'select' => 'set_cache_css,set_cache_wrapper,set_cache_macro,set_image_dir,set_emoticon_folder,set_skin_set_id,set_name,set_css_method,set_use_fimgs', 'from' => 'skin_sets', 'where' => 'set_skin_set_id='.$id ) );
----------------------------------------------------------------------
Найдите6
----------------------------------------------------------------------
        $this->skin['_css']         = $db_skin['set_cache_css'];
        $this->skin['_wrapper']     = $db_skin['set_cache_wrapper'];
        $this->skin['_macro']       = $db_skin['set_cache_macro'];
        $this->skin['_imagedir']    = $db_skin['set_image_dir'];
        $this->skin['_emodir']      = $db_skin['set_emoticon_folder'];
        $this->skin['_setid']       = $db_skin['set_skin_set_id'];
----------------------------------------------------------------------
Ниже добавьте:
----------------------------------------------------------------------
        # [b] Forum icons (Alex/AT)
        $this->skin['_fimgs']       = $db_skin['set_use_fimgs'] ? 1 : 0;
        # [E] Forum icons (Alex/AT)
======================================================================


В файле "boards.php"
######################################################################
./sources/action_public/boards.php
======================================================================
Найдите в двух местах:
----------------------------------------------------------------------
                //-----------------------------------------
                // Get all subforum stats
                // and calculate
                //-----------------------------------------
                
                if ( $this->ipsclass->vars['forum_cache_minimum'] )
                {
                    $forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
                    $need_desc[] = $forum_data['id'];
                }
                    
                if ( $forum_data['redirect_on'] )
                {
                    $temp_html .= $this->ipsclass->compiled_templates['skin_boards']->forum_redirect_row( $forum_data );
                }
                else
                {
                    $temp_html .= $this->ipsclass->compiled_templates['skin_boards']->ForumRow( $this->ipsclass->forums->forums_format_lastinfo( $this->ipsclass->forums->forums_calc_children( $forum_data['id'], $forum_data ) ) );
                }
----------------------------------------------------------------------
Замените на следующий код (2 раза)
----------------------------------------------------------------------
                //-----------------------------------------
                // Get all subforum stats
                // and calculate
                //-----------------------------------------
                
                if ( $this->ipsclass->vars['forum_cache_minimum'] )
                {
                    $forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
                    $need_desc[] = $forum_data['id'];
                }
                    
                # [b] Forum icons (Alex/AT)
                if ( $forum_data['redirect_on'] )
                {
                    # Alex/AT Mod - redirect can have images, too
                    if ($this->ipsclass->skin['_fimgs'] AND ($forum_data['icon'])) {
                        $temp_html_redir = $this->ipsclass->compiled_templates['skin_boards']->forum_redirect_row( $forum_data );
                        $temp_html .= strtr($temp_html_redir, array('<{BR_REDIRECT}>' => "<img src=\"".$this->ipsclass->vars['board_url']."/forumicons/".$forum_data['icon'].".gif\">"));
                    } else {
                        $temp_html .= $this->ipsclass->compiled_templates['skin_boards']->forum_redirect_row( $forum_data );
                    }
                }
                else
                {
                    $temp_html .= $this->ipsclass->compiled_templates['skin_boards']->ForumRow( $this->ipsclass->forums->forums_format_lastinfo( $this->ipsclass->forums->forums_calc_children( $forum_data['id'], $forum_data ) ) );
                }
                # [E] Forum icons (Alex/AT)
======================================================================

В файле "ipb_forum.js"
######################################################################
./jscripts/ipb_forum.js
======================================================================
Найдите:
----------------------------------------------------------------------
function boards_send_marker_update( fid, is_subforum )
{
try
{
var imgsrc = document.getElementById( 'f-'+fid ).innerHTML;
if ( imgsrc )
{
var regex  = new RegExp( "src=['\"](.*/)("+regex_markers+")['\"]");var results=imgsrc.match(regex);if(img_markers[results[2]]){imgsrc=imgsrc.replace(regex,"src='$1"+img_markers[results[2]]+"'");document.getElementById('f-'+fid).innerHTML=imgsrc;}}}catch(e){}var text_return=0;do_request_function=function(){if(!xmlobj.readystate_ready_and_ok()){return;};text_return=xmlobj.xmlhandler.responseText;};xmlobj=new ajax_request();xmlobj.onreadystatechange(do_request_function);xmlobj.process(ipb_var_base_url+'act=xmlout&do=mark-forum&fid='+fid+'&sf='+is_subforum);if(text_return==1){return false;}}
----------------------------------------------------------------------
Замените на:
----------------------------------------------------------------------
function boards_send_marker_update( fid, is_subforum )
{
try
{
var imgsrc = document.getElementById( 'f-'+fid ).innerHTML;
if ( imgsrc )
{
var regex  = new RegExp( "src=['\"](.*/)("+regex_markers+")['\"]");
var results=imgsrc.match(regex);
if(results && img_markers[results[2]]){
imgsrc=imgsrc.replace(regex,"src='$1"+img_markers[results[2]]+"'");
document.getElementById('f-'+fid).innerHTML=imgsrc;
}
else
{
var regex  = new RegExp( "src=['\"](.*forumicons/)(.+)(\\..+)['\"]");
var results=imgsrc.match(regex);
if(results && results[2]){
imgsrc=imgsrc.replace(regex,"src='$1$2_off$3'");
document.getElementById('f-'+fid).innerHTML=imgsrc;
}
}
}
}catch(e){}var text_return=0;do_request_function=function(){if(!xmlobj.readystate_ready_and_ok()){return;};text_return=xmlobj.xmlhandler.responseText;};xmlobj=new ajax_request();xmlobj.onreadystatechange(do_request_function);xmlobj.process(ipb_var_base_url+'act=xmlout&do=mark-forum&fid='+fid+'&sf='+is_subforum);if(text_return==1){return false;}}
======================================================================
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху