PHP-Nuke
  Strona głównaDownloadForumFAQ Zaloguj się  
Forum


 
Regulamin  Forum FAQ   Szukaj   Grupy   Rejestracja   Zaloguj
 
 
Zadając pytanie dotyczące PHPNuke podaj jego wersje!!

Zobacz następny temat
Zobacz poprzedni temat
Napisz nowy temat   Odpowiedz do tematu  Forum PHP-Nuke.org.pl Strona Główna » Modyfikacje - poszukiwane, propozycje
Autor Wiadomość
fomicz
~user



Dołączył(a): 1.04.2005
Posty: 97
Ostrzeżeń: 1


Status: Offline


 
PostWysłany: 26 Wrz 2007 08:04:55 Back to top  
Przeglądarka użytkownikaUA: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7

Jezeli interesuje kogos mod laczenia dwoch koljnych postow napisanych przez tego samego autora to dziala ten z phpBB.
http://www.phpbbhacks.com/viewhack.php?id=2206

Oczywiscie trzeba uzyc innych sciezek:
Kod:


\modules\Forums\posting.php
includes\function_post.php
\modules\Forums\admin\admin_board.php
\modules\Forums\language\lang_english\lang_admin.php
\modules\Forums\templates\subSilver\admin\board_config_body.tpl



Oraz nie korzystac z pliku php do dolozenia tabeli lecz zrobic to w MySQLu:
Kod:

INSERT INTO nuke_bbconfig (config_name, config_value) VALUES ('join_interval', '18');




Testowane i dzialajace
Powodzenia
Ja jeszcze zmienilem format i tekst wstawiany do postu na (zmiana w pliku posting.php):

z:
Kod:

#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
   //
   // Submit post/vote (newtopic, edit, reply, etc.)
   //
#
#-----[ AFTER, ADD ]------------------------------------------
#
   // double_post eliminate start
   if ( $mode == 'reply' && $userdata['user_id'] != ANONYMOUS )
   {
      $poster_id = $userdata['user_id'];
      $sql = "SELECT post_id, poster_id, post_time, MAX(post_time) FROM " . POSTS_TABLE . " WHERE topic_id = $topic_id GROUP BY post_time ORDER BY post_time DESC LIMIT 1";
   
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
      }
      $post_id_last_row = $db->sql_fetchrow($result);
      $post_id = $post_id_last_row['post_id'];
      $current_time = time();
      $difference_time = $current_time - $post_id_last_row['post_time'];
      $hours = floor($difference_time/60/60);
      $minutes = floor($difference_time/60%60);
      $seconds = $difference_time%60;
      $separator = ' \n\n[size=9]Added after';
      if ( $hours != 0 )         $separator .= ' ' . $hours . ' hours';
      if ( $minutes != 0 )         $separator .= ' ' . $minutes . ' minutes';
      if ( $hours == 0 && $minutes == 0 )   $separator .= ' ' . $seconds . ' seconds';
                     $separator .= ':
[/size]\n\n ';
      
      if ( $post_id_last_row['poster_id'] == $poster_id && ( $difference_time < ( $board_config['join_interval'] * 3600 ) ) )
      {         
         $mode = 'editpost';
         $sql = "SELECT post_text, bbcode_uid FROM " . POSTS_TEXT_TABLE . " WHERE post_id = $post_id";
         if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
            }
         $last_message_row = $db->sql_fetchrow($result);
         $bb_uid = ':' . $last_message_row['bbcode_uid'];
         
         // i don't know much about parsing the message, so it may well be that,
         // there are some wrongs, anyway all seems to work fine
         $last_message = str_replace($bb_uid, '', $last_message_row['post_text']);
         $last_message = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $last_message);
         $last_message = undo_htmlspecialchars(addslashes($last_message));
         
      }   
   }
   // double_post eliminate end
#
#-----[ FIND ]------------------------------------------
                     ';


na:
Kod:

#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
   //
   // Submit post/vote (newtopic, edit, reply, etc.)
   //
#
#-----[ AFTER, ADD ]------------------------------------------
#
   // double_post eliminate start
   if ( $mode == 'reply' && $userdata['user_id'] != ANONYMOUS )
   {
      $poster_id = $userdata['user_id'];
      $sql = "SELECT post_id, poster_id, post_time, MAX(post_time) FROM " . POSTS_TABLE . " WHERE topic_id = $topic_id GROUP BY post_time ORDER BY post_time DESC LIMIT 1";
   
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
      }
      $post_id_last_row = $db->sql_fetchrow($result);
      $post_id = $post_id_last_row['post_id'];
      $current_time = time();
      $difference_time = $current_time - $post_id_last_row['post_time'];
      $hours = floor($difference_time/60/60);
      $minutes = floor($difference_time/60%60);
      $seconds = $difference_time%60;
### ------moja zmiana-----------
$separator = '
      
      [size=9]Dodane po';
      if ( $hours != 0 )         $separator .= ' ' . $hours . ' godz.';
      if ( $minutes != 0 )         $separator .= ' ' . $minutes . ' min.';
      if ( $hours == 0 && $minutes == 0 )   $separator .= ' ' . $seconds . ' sek.';
                     $separator .= ':
[/size]
                     ';      
### ------koniec zmiany-----------

if ( $post_id_last_row['poster_id'] == $poster_id && ( $difference_time < ( $board_config['join_interval'] * 3600 ) ) )
      {         
         $mode = 'editpost';
         $sql = "SELECT post_text, bbcode_uid FROM " . POSTS_TEXT_TABLE . " WHERE post_id = $post_id";
         if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
            }
         $last_message_row = $db->sql_fetchrow($result);
         $bb_uid = ':' . $last_message_row['bbcode_uid'];
         
         // i don't know much about parsing the message, so it may well be that,
         // there are some wrongs, anyway all seems to work fine
         $last_message = str_replace($bb_uid, '', $last_message_row['post_text']);
         $last_message = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $last_message);
         $last_message = undo_htmlspecialchars(addslashes($last_message));
         
      }   
   }
   // double_post eliminate end
#
#-----[ FIND ]------------------------------------------





_________________
Pozdrawiam
To///ek
Zobacz profil autora Odwiedź stronę autora    
Wyświetl posty z ostatnich:   
Napisz nowy temat   Odpowiedz do tematu

Zobacz następny temat
Zobacz poprzedni temat
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 dołączać plików na tym forum
Możesz ściągać pliki na tym forum


Powered by phpBB [CR] © 2001, 2006 phpBB Group.
   
 

Copyright © 2004-2009 by phpnuke.org.pl :: PHP-Nuke Copyright © 2004 by Francisco Burzi.
Zdjęcia ślubne
Tworzenie strony: 0.21 sekund
Zapytań: 8