vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   problem with fopen and input (https://vborg.vbsupport.ru/showthread.php?t=48403)

bandersen 02-01-2003 05:59 PM

problem with fopen and input
 
1 Attachment(s)
Hi - I am trying to get the Tombot AI hack to work but have trouble with the bot reply. I appreciate any help.

This is the section in tomstalkerbot.php that gives the reply:

$rss = preg_replace("#^(.*)\[/quote\]#ies","",$message);
$ff = fopen($ttb_alicelocation . "?input=" . urlencode($rss),"r");
$response = fread($ff,10000);
fclose($ff);

Edit: using the above I only got the smileys in the reply.
I changed it to the following:

$rss = preg_replace("#^(.*)\[/quote\]#ies","",$message);
shell_exec("fetch -o /forums/upload/alice \"$ttb_alicelocation?input=".urlencode($rss)."\"") ;
$ff = fopen("/forums/upload/alice","r");
$response = fread($ff,10000);
fclose($ff);

This is how the reply comes up (se attachment for picture):

Ž³ .Šµ .. ³aimlN=푳 sql’³ src“³
COPYING³,#talk.php?input=are+you+there+now%3F³ ,!talk.php?input=testing+thi s+thing#ÀA¶X2talk.php? input=Testing+after+incl+Mike%27s+changesÇ

(ps:he repeats/ answers the third question with all 3 separate questions/posts)

I use 2.2.9
Php 4.2.3
I am on a shared server, but php.ini does not have safe mode enabled. I have tried to change the $ttb_alicelocation (/forums/upload/alice) to the full path (/user222/username/public_html/forums/upload/alice) with no changes in the reply.

I appreciate any help!

bandersen 02-03-2003 04:13 PM

OK - my server said it disabled "remote" fopen, but that fopen will work for all local files.

Can someone help with the following:
How do I rephrase the following so that it will work /reads as local:

$ff = fopen($ttb_alicelocation . "?input=" . urlencode($rss),"r");

where

$ttb_alicelocation =
"http://www.mydomain.com/forums/upload/alice/src/talk.php";

Could I use something like:

$ttb_alicelocation = "/forums/upload/alice/src/talk.php"; ....ps...that is not working, maybe I'm writing it wrong?

or should I change the $ff = fopen....... to something?

cirisme 04-02-2003 04:22 PM

What I did was change that code to

Code:

include "E:\\network\\Apache2\\htdocs\\forum\\alice\\src\\respond.php";

# Here is where we get the reply.
$botresponse=reply($rss,"5");

$response = $botresponse->response;

I also went into the TomBot files and modified the gettemplate() function to be gettemplate2() so it wouldn't conflict with vBulletin. The only problem with doing it this way is that I get warnings that some regular expressions are empty, but it works fine nonetheless.

(note: this code is the same as what is in the file that it is trying to fopen)


All times are GMT. The time now is 10:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01025 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete