Diese Werbeeinblendung erscheint nach 5 Minuten Idletime.
- Werbung - weiter auf Codershell surfen.
Weitere Scriptsprachen » Lasttopic für Webspell
Seiten:  1 
[ Sie müssen angemeldet sein, um einen Beitrag zu verfassen. ]
Geschrieben von take (Moderator) am 21.12.2006 um 00:00 Uhr.
Beiträge: 613 / #749

Kontakt: Mailen | WWW

Hy, Ihr kennt sicher das Problem. Auf der Clanpage wurde ins Forum geschrieben und keiner merkt es? Dafür habe ich dieses Script geschrieben. Es schaut jede 5 Sekunden ob es neue Threads gibt, bzw neue Posts existieren.
Da es ja Public und Intern Bereiche gibt, benötigen wir 3 Dateien.
Step 1
Erstellt die Datei _intern.php
PHPCODE
  1. <?php 
  2. <?php
  3. //& SQL - SETTINGS;
  4. $sqlhost        'localhost';    // normaly 'localhost';
  5. $sqluser        '';            // the Database User;
  6. $sqlpass        '';            // the Pass of the User;
  7. $sqldatabase    '';            // the Database;
  8. $sqlprefix        'webs_';        // Prefix you selected in the Webspell installation;
  9. $urltoboard        'http://just-boosted.de/index.php?site=forum_topic&topic=';
  10. //& Code - don't edit anything, if you don't know what you do;
  11. define('prfx'$sqlprefix);
  12. mysql_connect($sqlhost$sqluser$sqlpass);
  13. mysql_select_db($sqldatabase);
  14. $sql 'SELECT * FROM '.prfx.'forum_posts
  15.         LEFT JOIN '.prfx.'user ON '.prfx.'forum_posts.poster = '.prfx.'user.userID
  16.         LEFT JOIN '.prfx.'forum_topics ON '.prfx.'forum_topics.topicID = '.prfx.'forum_posts.topicID
  17.         where '.prfx.'forum_topics.intern = 1
  18.         order by '.prfx.'forum_posts.postID DESC LIMIT 1';
  19. $out mysql_fetch_array(mysql_query($sql));
  20. echo '|'.$out["postID"].';'.$out["username"].';'.$urltoboard.''.$out["topicID"].';'.$out["topic"];
  21. ?>
  22.  ?>


Step 2
Erstellt die Datei _public.php

PHPCODE
  1. <?php 
  2. <?php
  3. //& SQL - SETTINGS;
  4. $sqlhost        'localhost';    // normaly 'localhost';
  5. $sqluser        '';            // the Database User;
  6. $sqlpass        '';            // the Pass of the User;
  7. $sqldatabase    '';            // the Database;
  8. $sqlprefix        'webs_';        // Prefix you selected in the Webspell installation;
  9. $urltoboard        'http://just-boosted.de/index.php?site=forum_topic&topic=';
  10. //& Code - don't edit anything, if you don't know what you do;
  11. define('prfx'$sqlprefix);
  12. mysql_connect($sqlhost$sqluser$sqlpass);
  13. mysql_select_db($sqldatabase);
  14. $sql 'SELECT * FROM '.prfx.'forum_posts
  15.         LEFT JOIN '.prfx.'user ON '.prfx.'forum_posts.poster = '.prfx.'user.userID
  16.         LEFT JOIN '.prfx.'forum_topics ON '.prfx.'forum_topics.topicID = '.prfx.'forum_posts.topicID
  17.         where '.prfx.'forum_topics.intern = 0
  18.         order by '.prfx.'forum_posts.postID DESC LIMIT 1';
  19. $out mysql_fetch_array(mysql_query($sql));
  20. echo '|'.$out["postID"].';'.$out["username"].';'.$urltoboard.''.$out["topicID"].';'.$out["topic"].'
  21. ';
  22. ?>
  23.  ?>


Step 3
nun erstellt noch die Datei checkboard.mrc
CODE
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
#  __              __                 
# / __          /                 
#   ,_     __    /'       __   
#    /   /'__`   , <     /'__` 
#     _ / L._  `  /  __/ 
#     __ __/._ _ _ ____
#     /__/ /__//_/ /_//_/ /____/
#                          www.t4k3.de

alias set_settings {
  set %url t4k3.de
  set %pfad_intern /_intern.php
  set %pfad_public /_public.php
  set %chan_intern #k1ng
  set %chan_public #k1ng
/timer.check 0 5 look
}
on *:connect:{
/timer.check 0 5 look
}
alias look {
  if ($sock(post_check_intern).status == active) { sockclose post_check_intern }
  if ($sock(post_check_public).status == active) { sockclose post_check_public }
  sockopen post_check_intern %url 80
  sockopen post_check_public %url 80
  .timer 1 1 sockclose post_check_intern
  .timer 1 1 sockclose post_check_public
}

on *:sockopen:post_check_intern: {
  sockwrite -n $sockname GET %pfad_intern HTTP/1.1
  sockwrite -n $sockname Host: %url $+ $str($crlf,2)
  sockwrite -n $sockname User-Agent: Mozilla
  sockwrite -n $sockname
  .timer 1 1 auswertung
}
on *:sockopen:post_check_public: {
  sockwrite -n $sockname GET %pfad_public HTTP/1.1
  sockwrite -n $sockname Host: %url $+ $str($crlf,2)
  sockwrite -n $sockname User-Agent: Mozilla
  sockwrite -n $sockname
}
on *:sockread:post_check_intern: {
  sockread %paste_intern
  if (| isin %paste_intern ) {
    set %lastpostid_intern $gettok(%paste, 1, 59)
    set %lastposter_intern $gettok(%paste, 2, 59)
    set %lastthreadid_intern $gettok(%paste, 3, 59)
    set %lasttopic_intern $gettok(%paste, 5, 59)
  }
}
on *:sockread:post_check_public: {
  sockread %paste_public
  if (| isin %paste_public ) {
    set %lastpostid_public $gettok(%paste, 1, 59)
    set %lastposter_public $gettok(%paste, 2, 59)
    set %lastthreadid_public $gettok(%paste, 3, 59)
    set %lasttopic_public $gettok(%paste, 5, 59)
  }
}
alias auswertung {
  if (%lastpostid_intern > %checkpostid_intern || !%checkpostid_intern) {
    msg %chan_intern [Board 4intern] Thread: %lasttopic_intern [|] Poster: %lastposter_intern [|] Link: %lastthreadid_intern [Board]
    set %checkpostid_intern %lastpostid_intern
  }
  if (%last_postid_public > %checkpostid_public || !%checkpostid_public) {
    msg %chan_public [Board] Thread: %lasttopic_public [|] Poster: %lastposter_public [|] Link: %lastthreadid_public [Board]
    set %checkpostid_public %lastpostid_public
  }
  unset %paste*
  unset %last*
}


Step 4
Editiert alle Settingseinstellungen und laded die 2 .php Datein auf euren Webspace und die 1 .mrc laded Ihr in eurem mIRC.
Nun noch im mIRC /set_settings eingeben.

Falls irgendwelche Fehler auftrehten postet Sie bitte, Script ist getestet.

Für die ganz Faulen: http://t4k3.de/?go=files&fileID=80444f0e6d39bb7d30d0c187a0effa4c

Viele Grüße

"Jeder, der andere kritisiert, muss eine Alternative haben, die er ihnen anbieten kann." - Mo Ti


wong itdel.iciode.blinklisttechnoratigoogleblinkbitsyahooyiggblogmarksfurlspurlwebnewsstumbleupondigg itma.gnolia.comco.mments Zitieren Beitrag melden
[ Sie müssen angemeldet sein, um einen Beitrag zu verfassen. ]
Seiten:  1 
Login / Account
E-Mail Adresse:

Passwort:



Passwort zurücksetzen
Werbung