phpBB2 by Przemo
Support forów phpBB2 modified by Przemo

FAQFAQ - PIERWSZA POMOC!!  regulaminREGULAMIN  SzukajSZUKAJ  UżytkownicyUżytkownicy  GrupyGrupy  StatystykiStatystyki
RejestracjaRejestracja  ZalogujZaloguj  DownloadDownload  katalog Forów DyskusyjnychKatalog Forów   FAQ Video tutoriale

Poprzedni temat «» Następny temat
Przesunięty przez: joli
22-01-2009, 17:43
[mod]1.12.5 Similar topics
Autor Wiadomość
usterka


Pomógł: 3 razy
Posty: 47
Wysłany: 25-03-2007, 16:58   [mod]1.12.5 Similar topics

Kod:
##############################################################
## MOD Title: Extended Similar topics
## MOD Author: Porutchik < garnitur356 [at] mail15.com > (Sergey) http://forum.aeroion.ru
## Mod Adapted: usterka(s4a&grom_sl) < s4a @ o2.pl > http://sat-elita.info
## MOD Description: This mod adds a table at the bottom of a thread and displays other threads that are similar in topic.
## Mod dodaje tabele podobnych tematow pod szybka odpowiedzia w widoku tematu
## MOD Version: 1.0.3a
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
## Files To Edit: (3)                
##                    language/lang_english/lang_main.php
##                    templates/subSilver/viewtopic_body.tpl
##                    viewtopic.php
##
## Included Files:     (4)
##                    admin_similar_topics.php
##                    similar_topics.php
##                    similar_viewtopic.tpl
##                    admin_similar_topics_body.tpl
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##     Based on the "Similar Topics" mod by Leuchte (http://www.leuchte.net)
##    (you can find at 'contrib')
##
##    Templates to other themes you can find at contrib/templates.
##    Translations to other languages you can find at 'translations'.
##
##    If you wish to use Topic Description mod with this mod,
##    you can install the add-on: contrib/add_on_topic_description.txt
##
##    If you wish to use Ignore/Hide Forums mod by mosymuis with this mod,
##    you can install the add-on: contrib/add_on_ignore_hide_forums.txt
##
##############################################################
## MOD History:
##   
##    2006-03-01     - Version 1.0.3a
##                - no change code
##                - added the ADD-ON for the Ignore/Hide Forums mod by mosymuis
##    2006-02-28     - Version 1.0.3
##                - fixed a bug in show of time of last post.
##                - added a name of the author of last post.
##                - added the translation in the German language. A special thanks to easygo (http://www.net4seven.de/).
##                - minor change code
##    2006-02-21     - Version 1.0.2
##                - added the section in the Administration Panel
##                - added the ADD-ON for the Topic Description mod
##                - added the filter of stops-words
##    2006-02-15     - Version 1.0.1
##                - change code
##    2006-02-08     - Version 1.0.0
##                - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]------------------------------------------
# You can execute the following querys via phpmyadmin.
# Please keep in mind that you need to change the table-prefixes if you didn't use 'phpbb_'.
# It may be necessary to change the SQL-commands depending on the database you use.
#
ALTER TABLE phpbb_topics ADD FULLTEXT (topic_title);
INSERT INTO phpbb_config (config_name, config_value) VALUES ('similar_stopwords',1);
INSERT INTO phpbb_config (config_name, config_value) VALUES ('similar_ignore_forums_ids','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('similar_sort_type','relev');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('similar_max_topics',5);

#
#-----[ COPY ]------------------------------------------
#
copy root/admin/admin_similar_topics.php to admin/admin_similar_topics.php
copy root/includes/similar_topics.php to includes/similar_topics.php
copy root/templates/subSilver/admin/admin_similar_topics_body.tpl to templates/subSilver/admin/admin_similar_topics_body.tpl
copy root/templates/subSilver/similar_viewtopic.tpl to templates/subSilver/similar_viewtopic.tpl

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
$is_auth = $tree['auth'][POST_FORUM_URL . $forum_id];

#
#-----[ REPLACE WITH ]------------------------------------------
#
// [begin] Similar topics mod
//$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data);
$forums_auth = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata);
$is_auth = $forums_auth[$forum_id];
// [end] Similar topics mod

#
#-----[ FIND ]------------------------------------------
#
$template->pparse('body');

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [begin] Similar topics mod

if ( $board_config['similar_ignore_forums_ids'] )
{
    $ignore_forums_ids = array_map('intval', explode("\n", trim($board_config['similar_ignore_forums_ids'])));
}
else
{
    $ignore_forums_ids = array();
}

// Get forum auth information to insure privacy of hidden topics
$forums_auth_sql = '';
foreach ($forums_auth as $k=>$v)
{
    if ( count($ignore_forums_ids) && in_array($k, $ignore_forums_ids) )
    {
        continue;
    }
    if ( $v['auth_view'] && $v['auth_read'] )
    {
        $forums_auth_sql .= (( $forums_auth_sql == '' ) ? '': ', ') . $k;
    }
}
if ($forums_auth_sql != '')   
{
    $forums_auth_sql = ' AND t.forum_id IN (' . $forums_auth_sql . ') ';
}

if ( $board_config['similar_stopwords'] )
{
    // encoding match for workaround
    $multibyte_charset = 'utf-8, big5, shift_jis, euc-kr, gb2312';

    // check against stopwords start
    @include_once($phpbb_root_path . 'includes/functions_search.'.$phpEx);
    $stopword_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_stopwords.txt');
    $synonym_array = array();
    // check against stopwords end

    $title_search = '';
    $title_search_array = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ? split_words(clean_words('post', stripslashes($topic_title), $stopword_array, $synonym_array), 'search') : split(' ', $topic_title);

    for ($i = 0; $i < count($title_search_array); $i++)
    {
        $title_search .= (( $title_search == '' ) ? '': ' ') . $title_search_array[$i];
    }
}
else
{
    $title_search = $topic_title;
}

$sql_match = "MATCH(t.topic_title) AGAINST('" . addslashes($title_search) . "')";

if ( $board_config['similar_sort_type'] == 'time' )
{
    $sql_sort = 'p.post_time';
}
else
{
    $sql_sort = 'relevance';
}

$sql = "SELECT t.*, u.user_id, u.username, u2.username as user2, u2.user_id as id2, f.forum_id, f.forum_name, p.post_time, p.post_username, $sql_match as relevance
            FROM ". TOPICS_TABLE ." t, ". USERS_TABLE ." u, ". FORUMS_TABLE ." f, ". POSTS_TABLE ." p, " . USERS_TABLE . " u2
            WHERE t.topic_id <> $topic_id $forums_auth_sql
            AND $sql_match
            AND t.forum_id = f.forum_id
            AND p.poster_id = u2.user_id
            AND p.post_id = t.topic_last_post_id
            AND t.topic_poster = u.user_id
            AND t.topic_status <> " . TOPIC_MOVED . '
            GROUP BY t.topic_id
            ORDER BY t.topic_type DESC, ' . $sql_sort . ' DESC LIMIT 0,' . intval($board_config['similar_max_topics']);
if ( !($result = $db->sql_query($sql)) )
{
    message_die(GENERAL_ERROR, "Could not get main information for similar topics", '', __LINE__, __FILE__, $sql);
}
$similar_topics = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$count_similar = count($similar_topics);
if ( $count_similar > 0 )
{
    include($phpbb_root_path . 'includes/similar_topics.'.$phpEx);
}
// [end] Similar topics mod


#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [begin] Similar topics mod
$lang['Similar'] = 'Ostatnie posty';
// [end] Similar topics mod

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#
    {QUICKREPLY_OUTPUT}

#
#-----[ AFTER, ADD ]------------------------------------------
#
{SIMILAR_VIEWTOPIC}

#
#-----[ DIY INSTRUCTIONS ]------------------------------------
#
Regardless how you've installed this MOD (by EasyMOD or manually), if you want to install other languages than English please use the sub MODs in the /translations/ directory (as for the moment EasyMOD is not able to carry on automatically).

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM




similar topics.zip
Pobierz Plik ściągnięto 450 raz(y) 18,44 KB

 
     
Gadatliwa Kasia 

   
jaco1992

Pomógł: 10 razy
Posty: 220
Wysłany: 23-06-2008, 14:51   

Kod:
Parse error: syntax error, unexpected T_VARIABLE in /home/jaco1992/public_html/language/lang_polish/lang_main.php on line 1118


Jak to naprawić ?
 
     
ENC


Pomógł: 8 razy
Posty: 32
Wysłany: 23-06-2008, 15:03   

jaco1992, popsułeś coś podczas edycji pliku
jaco1992 napisał/a:
language/lang_polish/lang_main.php
Najlepiej wyedytuj go ponownie.
_________________
Podejmuję zlecenia na: przenoszenie for, konwertowanie for (rodzina phpBB), łączenie baz danych, pisanie MODyfikacji,przerabianie MODyfikacji, instalacja for/stylów/MODyfikacji, opiekę nad forum.
 
     
jaco1992

Pomógł: 10 razy
Posty: 220
Wysłany: 24-06-2008, 09:20   

Zrobione. Widoczne 2 x była ta sama komenda,ponieważ instalowałem też wcześniej .Dzieki za fatygę
 
     
szafa81

Pomógł: 1 raz
Posty: 62
Wysłany: 25-06-2008, 01:26   

fajnie jakby pomijal przy porownywaniu tagi zawarte w tematach postow :)

nie moge sie doszukac ustawien w PA ;/
_________________
Pozdrawiam, szafa.
 
     
jaco1992

Pomógł: 10 razy
Posty: 220
Wysłany: 29-06-2008, 16:26   

Wrzucłem inny styl i gdy jestem tutaj
usterka napisał/a:
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#
{QUICKREPLY_OUTPUT}

#
#-----[ AFTER, ADD ]------------------------------------------
#
{SIMILAR_VIEWTOPIC}


To jak dodaje to nie pokazuje mi ;/


Daje plik w załączniku .

P.S Dlaczego własnie w PA nie ma żadnych ustawień ?

viewtopic_body.rar
Pobierz Plik ściągnięto 257 raz(y) 3,16 KB

 
     
adrkwi

Pomógł: 1 raz
Posty: 59
Wysłany: 06-09-2008, 19:27   

wszystko robię ok a podobne tematy mi się nie pokazują ;)

edit : poradziłem sobie
 
     
lukaszq369

Posty: 19
Wysłany: 09-11-2008, 21:02   

No właśnie, dlaczego w PA nie ma żadnych ustawień? Zainstalowałem moda, ale nie wiem gdzie go włączyć..
 
     
Gadatliwa Kasia 

   
zomb25

Pomógł: 5 razy
Posty: 85
Wysłany: 14-12-2008, 16:15   

mi smiga ladnie,
tylko jak zrobic aby byla tylko 1 kolumna "Ostatnie posty" a nie 2 ?

http://img2.vpx.pl/up/20081214/potiki.jpg
 
     
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Kopiowanie wszelkich treści zawartych na forum, modyfikacji oraz instrukcji bez zgody administracji i autorów tematów/postów zabronione!

Powered by phpBB modified by Przemo © 2003 phpBB
Strona wygenerowana w 0,09 sekundy. Zapytań do SQL: 15
Polecane serwisy

Najlepsze oprogramowanie do prowadzenia sklepu internetowegoNajlepszy program do sklepu firmowany przez Przem'a

Sklep z gadżetami

serwis laptopów

phpbb

Polisy Ubezpieczeniowe TU Europa

Design Cart - Tworzenie sklepu internetowego

dnirozwoju.pl

Ranking Hostingów HostingOnline.pl

• Zamów reklamę