Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: sioks toks robotukas, ne pagalbos...

Parašė cipis· 2008 Spa. 1 21:10:23
#1

Tai va Perdareu robotuka , galima rasyti pvz labas atsako labas vakaras, cipis, kaip sekas? Nereike i ji kreiptis niekaip, bote , robote ir pn....


<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fu...
+----------------------------------------------------+
| Pradine Saukyklos robotuko versija sukurta: snapsas
| Prie robotuko kurimo daug prisidejo: bdZ
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }


openside($locale['120']);
if (iMEMBER || $settings['guestposts'] == "1") {
   if (isset($_POST['post_shout'])) {
      $flood = false;
      if (iMEMBER) {
         $shout_name = $userdata['user_id'];
      } elseif ($settings['guestposts'] == "1") {
         $shout_name = trim(stripinput($_POST['shout_name']));
         $shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
         if (isNum($shout_name)) $shout_name="";
      }
     
      $shout_message = str_replace("\n", " ", $_POST['shout_message']);
      $shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
      $shout_message = preg_replace("/([^\s]{25})/", "$1\n", $shout_message);
      $shout_message = trim(stripinput(censorwords($shout_message)));
      $shout_message = str_replace("\n", "<br>", $shout_message);
      if ($shout_name != "" && $shout_message != "") {
   
   

      //pradedam boto koda
     
      $h = date("H", time());
     
      if ($h > 00 && $h <= 05) {
      $time = "Laba naktis";
      $timemsg = "Ne laikas miegoti dar?";
      } elseif ($h > 05 && $h <= 10) {
      $time = "Labas rytas";
      $timemsg = "Kaip miegojai?";
      } elseif ($h > 10 && $h <= 18) {
      $time = "Laba diena";
      $timemsg = "Kaip einasi?";
      } elseif ($h > 18 && $h <= 21) {
      $time = "Labas vakaras";
      $timemsg = "Kaip sekasi?";
      } elseif ($h > 21 && $h <= 23) {
      $time = "Laba naktis";
      $timemsg = "Ne laikas miegoti dar?";
      }
     
   $msg = strtolower($_POST['shout_message']);
   $msg = str_replace(array(":","<",">","@","#","$","%","^","&","*","(",")","_","=","+","/","-", "?", ",", "'", "`", "!", "."), "", $msg);
   $msg = str_replace(array("ą", "č", "ę", "ė", "į", "š", "ų", "ū", "ž"), array("a", "c", "e", "e", "i", "s", "u", "u", "z"), $msg);
   
   // klausimus rasom be zenklu, kurie yra $pakeisti array'uje
      $QA = array (

         
         "(labas|sveiki|Kas geresnio?|kaip sekas?|svx|swx|labux).*" => "$time,<font style=\"color:red;\">".$userdata['user_name']."</font>,$timemsg",
         "(gerai|nor|normalei|nuosta|ideal).*" => "Nuostabu! <font style=\"color:red;\">".$userdata['user_name']."</font>",
         "(blogai|suknistai).*" => "Kodel? <font style=\"color:red;\">".$userdata['user_name']."</font>",
         "(sergu|seip).*" => "Blogai :(<font style=\"color:red;\">".$userdata['user_name']."</font>",
         "(Duok Skype|koks Tavo skype?|Koks skype?).*" => "Netiriu :( <font style=\"color:red;\">".$userdata['user_name']."</font>",
         "(kaip tau?|gerai, kaip Tau?|gerai kaip tau?).*" => "Nuostabu, ir man gerai :D <font style=\"color:red;\">".$userdata['user_name']."</font>",
         "(ka darai?|ka veiki?).*" => "nieko", "nesakysiu", "verdu samagona", "Rukau", "geriu", "netrugdyk dabar su merga", "einu", "begu", "skrenu", "zaidziu cs", "losiu cs",
         "(eik).*" => "jau senai ta darau :)",
         "(bek).*" => "dabar einu :)",
         "(skrisk).*" => "dabar begu :)",
         "(sok).*" => "dabar skrendu :)",
         "(gerka).*" => "dabar myzu :)",
         "(mysk).*" => "dabar geriu :)",
         ".{0,10}(ro){0,1}bot[a-z,0-9]*\040(gau|musi|be).*" => "Jau bėgu :D",
         ".{0,10}(ro){0,1}bot[a-z,0-9]*\040(ei).*" => "Kur? :D",
         ".{0,10}(ro){0,1}bot[a-z,0-9]*\040(kodel?).*" => "Tingiu :D",
         "[^[a-z,0-9]]*.*bot.*" => "Nesakysiu :)"

      );
         
     
     
      $rezas = false;
      foreach ($QA as $q => $a) {
      if (ereg($q, $msg)) {
      $rezas = true;
      $atsakymas = $a;
      break;
      }
      }
     
      //botas baigesi
     
         $result = dbquery("SELECT MAX(shout_datestamp) AS last_shout FROM ".$db_prefix."shoutbox WHERE shout_ip='".USER_IP."'");
         if (!iSUPERADMIN || dbrows($result) > 0) {
            $data = dbarray($result);
            if ((time() - $data['last_shout']) < $settings['flood_interval']) {
           
            //panaikinam siuksles
            if ($rezas) $flood = false; else $flood = true;
           
               
               $result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
               if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
                  if (iMEMBER) $result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
               }
            }
         }
         if (!$flood) $result = dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
     
      //boto uzklausa
      if ($rezas) $result = dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('Robotukas', '$atsakymas', '".(time() + 1)."', '0.0.0.0')");
     
      }
      fallback(FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&", "&", FUSION_QUERY) : ""));
   }
   echo "<form name='chatform' method='post' action='".FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "")."'>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td colspan='2'>\n";
   if (iGUEST) {
      echo $locale['121']."<br>
<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px;'><br>
".$locale['122']."<br>\n";
   }
   echo "<textarea name='shout_message' rows='4' cols='20' class='textbox'></textarea>
</td>
</tr>
<tr>
<td><input type='submit' name='post_shout' value='".$locale['123']."' class='button'></td>
<td align='right' class='small'><a href='".INFUSIONS."shoutbox_panel/shoutboxhelp.php' class='side'>".$locale['124']."</a></td>
</tr>
</table>
</form>
<br>\n";
} else {
   echo "<center>".$locale['125']."</center><br>\n";
}
$result = dbquery("SELECT count(shout_id) FROM ".$db_prefix."shoutbox");
$numrows = dbresult($result, 0);
$result = dbquery(
   "SELECT * FROM ".$db_prefix."shoutbox LEFT JOIN ".$db_prefix."users
   ON ".$db_prefix."shoutbox.shout_name=".$db_prefix."users.user_id
   ORDER BY shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result) != 0) {
   $i = 0;
   while ($data = dbarray($result)) {
      echo "<span class='shoutboxname'><img src='".THEME."images/bullet.gif' alt=''> ";
      if ($data['user_name']) {
         echo "<a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='side'>".$data['user_name']."</a>\n";
      } else {
         echo $data['shout_name']."\n";
      }
      echo "</span><br>\n<span class='shoutboxdate'>".showdate("shortdate", $data['shout_datestamp'])."</span>";
      if (iADMIN && checkrights("S")) {
         echo "\n[<a href='".ADMIN."shoutbox.php".$aidlink."&action=edit&shout_id=".$data['shout_id']."' class='side'>".$locale['048']."</a>]";
      }
      echo "<br>\n<span class='shoutbox'>".parsesmileys($data['shout_message'])."</span><br>\n";
      if ($i != $numrows) echo "<br>\n";
   }
   if ($numrows > $settings['numofshouts']) {
      echo "<center>\n<img src='".THEME."images/bullet.gif' alt=''>
<a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['126']."</a>
<img src='".THEME."images/bulletb.gif' alt=''></center>\n";
   }
} else {
   echo "<div align='left'>".$locale['127']."</div>\n";
}
closeside();
?>




Redagavo cipis· 2008 Spa. 2 11:10:38

Parašė ---· 2008 Spa. 1 21:10:51
#2

nu ir ka kad padarei?

Parašė edis2· 2008 Spa. 1 21:10:29
#3

nukopinai is phpfusion.lt :[

Parašė cipis· 2008 Spa. 1 21:10:12
#4

Perdareu.......... :s

Parašė ---· 2008 Spa. 1 21:10:41
#5

NU :] tipo pats sugebetum padaryt :D

Parašė cipis· 2008 Spa. 1 21:10:29
#6

Padaryti ne pet perdaryti jo....

Parašė Tyler· 2008 Spa. 1 21:10:16
#7

idomu ;) malacius.

cipis parašė:
Padaryti ne pet perdaryti jo....

o ant v7 perdarytum ?|

Parašė cipis· 2008 Spa. 1 21:10:55
#8

gal nezinau kas ten per s nes nesinaudiju v7 reikes pameginti , gera minti davei B)

Parašė Gugiss· 2008 Spa. 1 21:10:23
#9

O dieve... stfu... o bože moj.. php dievas... jis moka pakeist kelis zodzius :|

Redagavo Gugiss· 2008 Spa. 1 21:10:54

Parašė cipis· 2008 Spa. 1 21:10:39
#10

as esu niekas. Tu manes nematai negirdi neuzuodi :s :s :s

Parašė 7even· 2008 Spa. 1 21:10:50
#11

| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fu oj zwngiau :d

Parašė cipis· 2008 Spa. 1 21:10:41
#12

Tai saku kad as i ji idejau tik kelis zodzius, perdareu ir pn...................... :s

Parašė Apocal· 2008 Spa. 1 21:10:51
#13

Kaip vaikas... Pakeite kelius zodzius ir deda. Cai net zalias zmogus susiprotetu... :[ :[ :[ LOL.

Parašė Niger· 2008 Spa. 1 21:10:27
#14

Apocal parašė:
Kaip vaikas... Pakeite kelius zodzius ir deda. Cai net zalias zmogus susiprotetu... :[ :[ :[ LOL.


O kaip tu buvai vaikas ka keisdavai? zmogus nors rodo pastangas (stengiasi)...

Parašė cipis· 2008 Spa. 1 21:10:54
#15

beto nevisi ir moka pakeisti ;(

Parašė Apocal· 2008 Spa. 1 21:10:56
#16

Kokais jis pastangas rodo? Kas pakeite teksta? Tas pats, kad as pakeisciau "labas i sveikas" c|

P.S.

Tai gal visi pradekim deti, modus pakete pvz: pavadinima, arba koky nors zodi.

Redagavo Apocal· 2008 Spa. 1 21:10:48

Parašė 7even· 2008 Spa. 1 21:10:18
#17

cipis parašė:
beto nevisi ir moka pakeisti ;(
:D nemates dar tokio kuris nemoketu pakeist kai wiskas pries aki :D

Parašė cipis· 2008 Spa. 1 21:10:08
#18

:( :[ as zales ne prinoke..............

Parašė Dandžu· 2008 Spa. 2 09:10:21
#19

Debilas kažkoks kitaip nepavadinsi. Snapso darbus dalina tipo pats kūrė asilas.

Parašė cipis· 2008 Spa. 2 11:10:33
#20

ar as akeu kad kureu? as sakeu kad perdareu....

Parašė Marčius· 2008 Spa. 2 11:10:12
#21

Tai va Padareu sioki toki robotuka , galima rasyti pvz labas atsako labas vakaras, cipis, kaip sekas? Nereike i ji kreiptis niekaip, bote , robote ir pn


Viskas aiškiai parašyta :)

Parašė cipis· 2008 Spa. 2 11:10:37
#22

Reike siokios tokios pagalbos :) noriu kad robotukas atsakytu skirtingus zodzius kiekviena karta :) koki koda iterpti? jau isbandzeu kokius 3 metodus 1 metodas neisejo neatkartoja zodziu :) antras metodas vietoi zodziu skicei keices :D tai va padekit :(

Parašė Dandžu· 2008 Spa. 2 13:10:45
#23

Sakei jog kūriai tik pakeitei tą postą.