Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> bramka gg -> massmsg
bumfank
post
Post #1





Grupa: Zarejestrowani
Postów: 87
Pomógł: 0
Dołączył: 29.02.2004
Skąd: /dev/null

Ostrzeżenie: (0%)
-----


Witam, mam klase gg z gg.wha.la skonfigurowalem ja nalezycie i wysyla mi tak jak trzeba, ale potrzebuje wyslac do masowego odbiorcy ktorzy sa wpisani w bazie mysql
kombinowalem ale nie doszedlem do tego jak to wykombinowac i raz mi daje blank page a raz mi pokazuje ze mam podac adresata (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
narazie kombinowalem tak:
  1. <?php
  2.  
  3. // zapytanie sql
  4.  
  5. //poczatek klasy
  6.  
  7. while($numerek= mysql_fetch_array($numerek))
  8. {
  9. $adresat = numerek['nr'];
  10. }
  11. // reszta klasy klasa
  12.  
  13. ?>


w tym przypadku napisalo mi ze mam podac adresata

  1. <?php
  2.  
  3. // zapytanie sql
  4.  
  5. while($numerek= mysql_fetch_array($numerek))
  6. {
  7. //poczatek klasy
  8. $adresat = numerek['nr'];
  9.  
  10. //klasa
  11. }
  12.  
  13.  
  14. ?>


tutaj to dostalem poprostu blank page (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

prosilbym bardzo o pomoc.

dziekuje i pozdrawiam (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
hwao
post
Post #2


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




Wiec tak (nie wiem jak zrobiona jest ta klasa - nie pamietam juz)

Przed petla laczysz sie z serwerem

Potem pobierasz dane nry z bazy danych

W ciele pelti dajesz wyslanie informacji na dany nr.

Zamykasz polaczenie

Koniec
Go to the top of the page
+Quote Post
angel2953
post
Post #3





Grupa: Zarejestrowani
Postów: 199
Pomógł: 5
Dołączył: 8.07.2004
Skąd: gdynia

Ostrzeżenie: (0%)
-----


Cytat(bumfank @ 2005-06-26 15:10:59)
  1. <?php
  2.  
  3. // zapytanie sql
  4.  
  5. //poczatek klasy
  6.  
  7. while($numerek= mysql_fetch_array($numerek))
  8. {
  9. $adresat = numerek['nr'];
  10. }
  11. // reszta klasy klasa
  12.  
  13. ?>

masz małą literówkę:
  1. <?php
  2. while( $numerek = mysql_fetch_array( $numerek ) )
  3. {
  4. $adresat = $numerek['nr'];
  5. }
  6. // reszta klasy klasa
  7. ?>


a pozatym $numerek = mysql_fetch_array( $numerek ) to mi jakoś nie bardzo pasuje...
Go to the top of the page
+Quote Post
bumfank
post
Post #4





Grupa: Zarejestrowani
Postów: 87
Pomógł: 0
Dołączył: 29.02.2004
Skąd: /dev/null

Ostrzeżenie: (0%)
-----


angel2953 sluchaj to bylo napisane od reki tak teraz zeby tylko pokazac istote tego wszystkiego. zaraz sproboje sposob hwao (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)


////

noi staralem sie jak hwao mowil ale wysyla tylko do jednego kolesia znajdujacego sie na samej gorze ale do reszty nie, nie zapetla sie...

tutaj dam jak to wyglada w kodzie:

  1. <?php
  2. function wiadomosc($adresat, $tresc, $DODAWAJ_SPACJE_W_LINKACH = TRUE)
  3. {
  4. ///////////////////
  5. /// Zapytanie ////
  6. /////////////////
  7.  
  8. include(&#092;"include/config.php\");
  9. $numerek_zap = &#092;"SELECT nr FROM subskrypcja_gg\";
  10. $numerek_query = mysql_query($numerek_zap);
  11. while($numerek = mysql_fetch_array($numerek_query))
  12. {
  13.  
  14. $adresat = $numerek['nr'];
  15. # Usuniecie dodatkowych  przy włączonym magic_quotes w php.ini
  16. $tresc = stripslashes($tresc);
  17.  
  18. # Modyfikacja linkow www, email i slow www, pl ktore sa filtrowane przez blokade
  19. \"antyspamowa\"
  20. if ($DODAWAJ_SPACJE_W_LINKACH)
  21. $tresc = txt::odlinkuj($tresc);
  22.  
  23. # Sprawdzenie danych czy sie nadaja do wysyłania:)
  24. if ($adresat == \"\") {
  25. $this->error = \"Wpisz numer adresata\";
  26. return FALSE;
  27. }
  28. if (!is_numeric($adresat) or ($adresat <= 1000) or ($adresat > 10000000)) {
  29. $this->error = \"Adresat ma byc numerkiem gadu - gadu\";
  30. return FALSE;
  31. }
  32. if (strlen($tresc) == 0) {
  33. $this->error = \"Nie wpisaleś treści wiadomości\";
  34. return FALSE;
  35. }
  36. if (strlen($tresc) > 1999) {
  37. $this->error = \"Dlugość Wiadomości nie może przekroczyć 2000 znaków\";
  38. return FALSE;
  39. }
  40. if (($this->numer < 1000) or ($this->numer > 10000000) or ($this->haslo == \"\")) {
  41. $this->error = \"Wpisz poprawnie numer i hasło nadawcy\";
  42. return FALSE;
  43. }
  44. if ($adresat == $this->numer) {
  45. $this->error = \"Nie możesz wysłać wiadomości sam do siebie\";
  46. return FALSE;
  47. }
  48.  
  49. for ($i = 1; $i <= $this->ilosc_prob; ++$i) {
  50. $this->Debug(\"Proba $i\");
  51.  
  52. # Pyta o host z jakim nalezy sie polaczyc lub losuje domyslny w przypadku n
  53. epowodzenia 
  54. list ($host, $port) = $this->znajdz_serwer($this->numer);
  55.  
  56. # Logowanie do serwera GG 
  57. switch ($this->login($this->numer, $this->haslo, $host, 
  58. $port, $this->OPIS_W_STATUSIE_PO_ZALOGOWANIU)) 
  59. {
  60.  
  61. # Wysyłanie wiadomości gdy GG_LOGIN_OK 
  62. case GG_LOGIN_OK:
  63. if ($this->wyslij_liste_kontaktow ($adresat)) {
  64. if ($seq = $this->wyslij_wiadomosc($adresat, $tresc))
  65. if ($this->odbierz_dane($this->auto_odpowiedz)) // czy wysylac odp. ze bramka
  66. $this->logoff($this->OPIS_W_STATUSIE_PO_WYLOGOWANIU);
  67. return $seq; //sukces :)
  68. } else {
  69. $this->Debug(\"Połączenie zerwane po zalogowaniu\"); break;
  70. }
  71.  
  72. case DISCONNECTED:
  73. $this->Debug(\"Polaczenie odrzucone dla: $host
  74. &#092;".gethostbyaddr($host).\": $port\"); break;
  75.  
  76. case GG_LOGIN_FAILED:
  77. $this->error = &#092;"<BR>LOGIN FAILED - złe hasło\";
  78. return FALSE;
  79.  
  80. case GG_LOGIN_FAILED2:
  81. $this->error = &#092;"<BR>LOGIN FAILED. \"; return FALSE;
  82.  
  83. default:
  84. $this->error = '<BR>LOGIN FAILED - hm, to nie powinno sie zdarzyc:)'; 
  85. return FALSE;
  86. }
  87. } // for i..
  88.  
  89. $this->error = &#092;"<BR>LOGIN FAILED - połączenie odrzucone $i krotnie<BR>n\"
  90. .&#092;"Mozesz sprobowac jeszcze raz (odwiez strone)n\";
  91.  
  92. return FALSE;
  93.  
  94. } // function wiadomosc
  95.  
  96. } // koniec klasy www2gg
  97.  
  98. //////////////////////////
  99.  } // ZAKONCZENIE PETLI !!!!!!
  100. /////////////////////////
  101. ?>


jakby ktos potrzebowal calej klasy to moge podeslac na PM`a

Ten post edytował bumfank 26.06.2005, 23:32:09
Go to the top of the page
+Quote Post
niko
post
Post #5





Grupa: Zarejestrowani
Postów: 109
Pomógł: 0
Dołączył: 2.06.2005

Ostrzeżenie: (30%)
XX---


sorki za głupie pytanie - ale o co tu chodzi ? po co to jest napisane ? prosz o info (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) to wysyła coś do użytkowników z GG ? (IMG:http://forum.php.pl/style_emoticons/default/blink.gif)
Go to the top of the page
+Quote Post
hwao
post
Post #6


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




Cytat(niko @ 2005-07-01 21:40:40)
sorki za głupie pytanie - ale o co tu chodzi ? po co to jest napisane ? prosz o info (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) to wysyła coś do użytkowników z GG ? (IMG:http://forum.php.pl/style_emoticons/default/blink.gif)

do wysylania informacji do danych nr'ow gg (normlanie dojda tak jakbys je wpisal w komunik. np gadu-gadu)
Go to the top of the page
+Quote Post
niko
post
Post #7





Grupa: Zarejestrowani
Postów: 109
Pomógł: 0
Dołączył: 2.06.2005

Ostrzeżenie: (30%)
XX---


hmmmmmmmmmmmmm ciekawe to a może ktoś tu umieścić linka do zipa z tym wszystkim ? (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) proszę (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
hwao
post
Post #8


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




Cytat(niko @ 2005-07-02 01:33:33)
hmmmmmmmmmmmmm ciekawe to a może ktoś tu umieścić linka do zipa z tym wszystkim ? (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) proszę (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

sciagasz z tad:
http://gg.wha.la/jak.html

I masz juz do wysylania jednej, tylko dopisac do paru i mozna pare slac, sciagni sobie i zobacz.

EOT.
Go to the top of the page
+Quote Post
kyno
post
Post #9





Grupa: Przyjaciele php.pl
Postów: 121
Pomógł: 1
Dołączył: 4.01.2004
Skąd: Jawor

Ostrzeżenie: (0%)
-----


bumfank:
  1. <?php
  2. require '../core/klasy-gg.inc';
  3.  
  4. $numer = ''; //numer gygy
  5. $pass = ''; //haslo oczywiscie gygy (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
  6.  
  7. $tresc = &#092;"Wiadomosc (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) \"; //tresc wiadomosci
  8.  
  9. $gg = new www2gg ($numer, $pass);
  10.  
  11. $numerek_zap = &#092;"SELECT nr FROM subskrypcja_gg\";
  12. $numerek_query = mysql_query($numerek_zap);
  13. while($numerek = mysql_fetch_array($numerek_query))
  14. {
  15. $gg->wiadomosc($numerek['nr'], $tresc, 0);
  16. }
  17. ?>

zapetlaj wysylanie... (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
bumfank
post
Post #10





Grupa: Zarejestrowani
Postów: 87
Pomógł: 0
Dołączył: 29.02.2004
Skąd: /dev/null

Ostrzeżenie: (0%)
-----


dzieki kyno (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) juz myslalem ze mi nikt nie pomoze (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
i dziala (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

dziekuje i pozdrawiam (IMG:http://forum.php.pl/style_emoticons/default/exclamation.gif) (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 23:23