Strona 2 z 2 PierwszyPierwszy 12
Pokaż wyniki od 11 do 20 z 20

Wątek: skrypt czatu- jak zrobić

  1. #11
    mex
    mex jest nieaktywny
    Zarejestrowany
    Dołączył
    Jun 2009
    Posty
    1,625

    Domyślnie

    no to zrób to reczęnie.. najpiersw stwórz tabelę podając jej nazwę potem 3 rekordy ustaw odpowiednie wartości i już
    Zaplanuj swoją spontaniczność

    http://www.elmarco.pl/cms/pliki/flagi/flaga_polska.jpg

  2. #12
    Zarejestrowany
    Dołączył
    Aug 2010
    Posty
    42

    Domyślnie

    no dobra stworzyłem tabele ręcznie i sie udało ale teraz gdy wejde w gre i klikne na czat wszystko wydawało by sie oki ponieważ to standardowy czat bez grafiki itd ale mam na dole błąd
    Fatal error: Cannot redeclare mysql_fetch_query() (previously declared in C:\wamp\www\includes\inc.functions.php:15) in C:\wamp\www\includes\inc.functions.php on line 23
    podam tutaj kawałek tegoo pliku zaczne od 15 linijki a skończe na tej 23
    Kod php:
      function mysql_fetch_query($query)
      {
          if(
    strtolower(substr($query06)) == "select") {
            
    $selection mysql_query($query);
            return 
    mysql_fetch_assoc($selection);
          } else {
            die(
    '<br /><b>Parse error</b>: using unexpected query in <b>' __FILE__ '</b>, expecting SELECT  on line <b>' __LINE__ '</b><br />');
          }
      } 
    i jeśli chce coś napisać i klikam wyśli pojawia sie komunikat że nie można wyświetlić strony...

  3. #13
    Zasłużony Awatar karer
    Dołączył
    Apr 2008
    Posty
    2,554

    Domyślnie

    masz 2 razy includowany plik inc.functions.php
    Zeby tego uniknac mozesz dodac "_once" do standardowej funkcji includowania plikow.

  4. #14
    Zarejestrowany
    Dołączył
    Aug 2010
    Posty
    42

    Domyślnie

    Cytat Zamieszczone przez karer Zobacz posta
    masz 2 razy includowany plik inc.functions.php
    Zeby tego uniknac mozesz dodac "_once" do standardowej funkcji includowania plikow.
    możesz napisać to po normalnemu? ( nie każdy jest w takim stopniu zaawansowany w php )

  5. #15
    mex
    mex jest nieaktywny
    Zarejestrowany
    Dołączył
    Jun 2009
    Posty
    1,625

    Domyślnie

    Cytat Zamieszczone przez kuczko Zobacz posta
    możesz napisać to po normalnemu? ( nie każdy jest w takim stopniu zaawansowany w php )
    przecież napisał Karer .. robisz 2 razy inlude inc.functions.php

    a masz zrobić include_once co spowoduje ze include wykona się tylko raz a nie za każdym razem kiedy odświeżasz stronę ipt

    więcej ze strony kess.snug.pl

    Instrukcja include_once() służy do wczytania i wykonania kodu z określonego pliku w trakcie wykonywania skryptu. Działanie instrukcji podobne jest do include(), z jednym wyjątkiem, tzn. jeśli dany plik został już raz do danego skryptu wczytany, nie będzie już wczytany ponownie. Wskazuje na to nazwa instrukcji: include_once znaczy wczytaj_raz.

    include_once() powinno być stosowane w przypadkach, gdzie ten sam plik może być wczytany więcej niż raz w czasie wykonywania skryptu, ale ty chcesz mieć pewność że będzie wczytany tylko jeden raz, aby uniknąć problemów z redefiniowaniem funkcji, nadpisaniem wartości zmiennych, itp.
    Ostatnio edytowane przez mex ; 05-09-2010 o 17:25
    Zaplanuj swoją spontaniczność

    http://www.elmarco.pl/cms/pliki/flagi/flaga_polska.jpg

  6. #16
    Zarejestrowany
    Dołączył
    Aug 2010
    Posty
    42

    Domyślnie

    no tak ale gdzie mam to zrobić w którym pliku...

  7. #17
    Zasłużony Awatar karer
    Dołączył
    Apr 2008
    Posty
    2,554

    Domyślnie

    Tego to juz nie wiem. Tresc ktora mi podales nie mowi w ktorym pliku. Mozesz przeszukiwac wszystkie pliki i szukac odpowiedniego kawalka

  8. #18
    Zarejestrowany
    Dołączył
    Aug 2010
    Posty
    42

    Domyślnie

    aha czyli teraz cie rozumiem przed tym co ci podałem jest
    require("includes/class.filter.php");
    Kod php:
    <?php
     
    /*
      * Script voor het weghalen van de beginbescherming.
      */

     
    if(@$_GET['action'] == "deletesafe") {
        
    $own['safe'] = 0;
        
    mysql_query("UPDATE users SET safe = '0' WHERE id = '" . @$own['id'] . "'");
      }
      
      
    //Functies

      
    require("includes/class.filter.php");

      function 
    mysql_fetch_query($query)
      {
          if(
    strtolower(substr($query06)) == "select") {
            
    $selection mysql_query($query);
            return 
    mysql_fetch_assoc($selection);
          } else {
            die(
    '<br /><b>Parse error</b>: using unexpected query in <b>' __FILE__ '</b>, expecting SELECT  on line <b>' __LINE__ '</b><br />');
          }
      }
          

      function 
    groot($getal)
      {
          return 
    number_format($getal0'.''.');
      }
      
      function 
    special_check($userid)
      {
          
    $user mysql_fetch_query("SELECT login, admin, moderator, vip, health FROM users WHERE id = '" $userid "'");
          
    $name $user['login'];
          if(
    $user['admin'] == "Ja") {
            
    $name '<font color="red"><b>' $name '</b></font>';
          } elseif(
    $user['moderator'] == "Ja") {
            
    $name '<font color="blue"><b>' $name '</b></font>';
          }

          if(
    $user['health'] <= 0) {
            
    $name '<s>' $name '</s>';
          }

          if(
    $user['vip'] > 0) {
            
    $name .= '<img src="images/icons/vipstar.gif" border="0">';
          }
          return 
    $name;
      }
      
      function 
    online($userid)
      {
          
    $user mysql_num_rows(mysql_query("SELECT id FROM users WHERE id = '" $userid "' AND '" tijd() . "' - UNIX_TIMESTAMP(online) < '180'"));
          if(
    $user 0) {
            return 
    "<img src=\"images/icons/status_online.gif\" alt=\"Online\">";
          } else {
            return 
    "<img src=\"images/icons/status_offline.gif\" alt=\"Offline\">";
          }
      }
      
      
    $minutenerbijdateentijd = -4;
      
      function 
    get_global_date($string)
      {
          global 
    $minutenerbijdateentijd;
          
    $datum = new DateTime(date("Y-m-d H:i:s"));
          
    $datum->modify("+" $minutenerbijdateentijd " minutes");
          return 
    $datum->format($string);
      }
      
      function 
    tijd()
      {
          global 
    $minutenerbijdateentijd;
          return 
    time() + (60 $minutenerbijdateentijd);
      }
      
      function 
    correct_number_input($number) {
        if(
    is_numeric($number) && $number >= && $number == floor($number)) {
          return 
    true;
        } else {
          return 
    false;
        }
      }
      
      function 
    missiondone($mission) {
        global 
    $own;
        
    $mission mysql_fetch_query("SELECT opdracht, beloning_geld, beloning_power, rank, id FROM missions WHERE id = '" $mission "'") or die(mysql_error());
        if(
    $own['rank'] >= $mission['rank'] && !preg_match("/-" $mission['id'] . "-/"$own['missiesvolbracht'])) {
          
    $own['missiesvolbracht'] .= "-" $mission['id'] . "-";
          
    mysql_query("UPDATE users SET missiesvolbracht = '" $own['missiesvolbracht'] . "', cash = cash + '" $mission['beloning_geld'] . "', power = power + '" $mission['beloning_power'] . "' WHERE id = '" $own['id'] . "'");
          
    mysql_query("INSERT INTO berichten (onderwerp, bericht, afzender, geaddresseerde, datum, outbox) VALUES('Missie volbracht!', 'Beste crimineel,\r\n\r\nJe hebt een missie volbracht: [b]" $mission['opdracht'] . "[/b]\r\nMet vriendelijke groet,\r\nAnoniem.', 'Anoniem', '" $own['id'] . "', '" get_global_date("Y-m-d H:i:s") . "', 'False')") or die(mysql_error());
        }
      }
    ?>
    i tam musze szukac lecz tam nie mam nigdzie zwrotu include może pokaże pliczek
    Kod php:
    <?php
      
    class filter
      
    {

          function 
    scheldwoorden($text)
          {
              
    $text str_ireplace("kut""***"$text);
              
    $text str_ireplace("loser""*****"$text);
              
    $text str_ireplace("kanker""******"$text);
              
    $text str_ireplace("tering""******"$text);
              
    $text str_ireplace("godverdomme""***********"$text);
              
    $text str_ireplace("fuck""****"$text);
              
    $text str_ireplace("klootzak""********"$text);
              
    $text str_ireplace("lul""***"$text);
              
    $text str_ireplace("stront""******"$text);
              
    $text str_ireplace("sex""***"$text);
              
    $text str_ireplace("seks""****"$text);
              
    $text str_ireplace("neuk""****"$text);
              
    $text str_ireplace("tyfus""*****"$text);
              
    $text str_ireplace("gvd""***"$text);
              
    $text str_ireplace("trut""****"$text);
              
    $text str_ireplace("hoer""****"$text);
              
    $text str_ireplace("banditi""*******"$text);
              
    $text str_ireplace("bitch""*****"$text);
              
    $text str_ireplace("fack""****"$text);
              
    $text str_ireplace("slet""****"$text);
              
    $text str_ireplace("eikel""*****"$text);
              return 
    $text;
          }

          function 
    ubb($text)
          {
              
    $text str_replace("[b]","<b>",$text);
              
    $text str_replace("[/b]","</b>",$text);
              
    $text str_replace("[i]","<i>",$text);
              
    $text str_replace("[/i]","</i>",$text);
              
    $text str_replace("[u]","<u>",$text);
              
    $text str_replace("[/u]","</u>",$text);
              
    $text eregi_replace("\\[img]([^\\[]*)\\[/img]","<img src=\"\\1\" border=\"0\">",$text);
              
    $text eregi_replace("\\[color=([^\\[]*)\\]([^\\[]*)\\[/color]","<font color=\"\\1\">\\2</font>",$text);
              
    $text str_replace("[center]""<center>"$text);
              
    $text str_replace("[/center]""</center>"$text);
              
    $text str_replace("[small]""<small>"$text);
              
    $text str_replace("[/small]""</small>"$text);
              return 
    $text;
          }

          function 
    smilies($text)
          {
              
    $text str_replace(":)""<img src=\"images/smilies/blij.gif\">"$text);
              
    $text str_replace(":-)""<img src=\"images/smilies/blij.gif\">"$text);
              
    $text str_replace(":(""<img src=\"images/smilies/nietblij.gif\">"$text);
              
    $text str_replace(":-(""<img src=\"images/smilies/nietblij.gif\">"$text);
              
    $text str_replace(":'(""<img src=\"images/smilies/huilen.gif\">"$text);
              
    $text str_replace(":'-(""<img src=\"images/smilies/huilen.gif\">"$text);
              
    $text str_replace(";)""<img src=\"images/smilies/knipoog.gif\">"$text);
              
    $text str_replace(";-)""<img src=\"images/smilies/knipoog.gif\">"$text);
              
    $text str_replace(":-p""<img src=\"images/smilies/tong.gif\">"$text);
              
    $text str_replace(":-P""<img src=\"images/smilies/tong.gif\">"$text);
              
    $text str_replace(":p""<img src=\"images/smilies/tong.gif\">"$text);
              
    $text str_replace(":P""<img src=\"images/smilies/tong.gif\">"$text);
              
    $text str_replace(":D""<img src=\"images/smilies/heelblij.gif\">"$text);
              
    $text str_replace(":d""<img src=\"images/smilies/heelblij.gif\">"$text);
              
    $text str_replace(":-d""<img src=\"images/smilies/heelblij.gif\">"$text);
              
    $text str_replace(":-D""<img src=\"images/smilies/heelblij.gif\">"$text);
              
    $text str_replace("8-)""<img src=\"images/smilies/cool.gif\">"$text);
              
    $text str_replace("8)""<img src=\"images/smilies/cool.gif\">"$text);
              
    $text str_replace(":o""<img src=\"images/smilies/verbaasd.gif\">"$text);
              
    $text str_replace(":-o""<img src=\"images/smilies/verbaasd.gif\">"$text);
              
    $text str_replace(":O""<img src=\"images/smilies/verbaasd.gif\">"$text);
              
    $text str_replace(":-O""<img src=\"images/smilies/verbaasd.gif\">"$text);
              
    $text str_replace(":-$""<img src=\"images/smilies/blozen.gif\">"$text);
              
    $text str_replace(":$""<img src=\"images/smilies/blozen.gif\">"$text);
              return 
    $text;
          }

          function 
    addquote($text)
          {
              while(
    eregi_replace("\\[quote]([^\\[]*)\\[/quote]","<div class=\"quotetitle\">Quote:</div><div class=\"quotecontent\">\\1</div>",$text) != $text) {
                
    $text eregi_replace("\\[quote]([^\\[]*)\\[/quote]","<div class=\"quotetitle\">Quote:</div><div class=\"quotecontent\">\\1</div>",$text);
              }
              return 
    $text;
          }
    }
    ?>

  9. #19
    Zarejestrowany
    Dołączył
    Dec 2007
    Posty
    37

    Domyślnie

    Kod php:
    require("includes/class.filter.php"); 
    Na:
    Kod php:
    require_once 'includes/class.filter.php'
    O to chodzi?

  10. #20
    Zarejestrowany
    Dołączył
    Aug 2010
    Posty
    42

    Domyślnie

    nie niestety też pojawia sie ten sam błąd...;/

Strona 2 z 2 PierwszyPierwszy 12

Informacje o wątku

Użytkownicy przeglądający ten wątek

Aktualnie 1 użytkownik(ów) przegląda ten wątek. (0 zarejestrowany(ch) oraz 1 gości)

Podobne wątki

  1. Jak zrobić ?
    Przez cados16 w dziale TribalWars - Plemiona
    Odpowiedzi: 0
    Ostatni post / autor: 24-07-2010, 00:02
  2. jak zrobić 10%?
    Przez boosik01 w dziale PHP / MySql
    Odpowiedzi: 24
    Ostatni post / autor: 10-10-2009, 19:16
  3. Błąd czatu (wersja 1.0D)
    Przez zlywilk w dziale Błędy silnika Xnova
    Odpowiedzi: 3
    Ostatni post / autor: 25-06-2009, 16:21
  4. Czy da sie zrobić :
    Przez Cadilia w dziale Support Vallheru
    Odpowiedzi: 1
    Ostatni post / autor: 11-10-2008, 15:52
  5. Błąd Co zrobić
    Przez Patryk457 w dziale Pytania dotyczące silnika Xnova
    Odpowiedzi: 5
    Ostatni post / autor: 24-05-2008, 16:33

Zakładki

Uprawnienia umieszczania postów

  • Nie możesz zakładać nowych tematów
  • Nie możesz pisać wiadomości
  • Nie możesz dodawać załączników
  • Nie możesz edytować swoich postów
  •