Demonic Posted April 16, 2007 Share Posted April 16, 2007 function PresetApps($content) { include_once("*****/*****/settings.php"); $Settings = new Settings;//New settings class - gets the CleanString function! include_once("*****/******/applets.php"); $Applets = new Applets;//New settings class - gets the CleanString function! $tag = array( '/\[uSERS_ONLINE\]/is', '/\[sTATS\]/is', '/\[uSER_CONTROLS\]/is', '/\[NEWS\]/is', '/\[sEARCH\]/is', '/\[FILE=(.*?)\]/e', ); $feature = array( "". $Applets->UsersOnline() ."", "". $Applets->GetStats() ."", "". $Applets->UserControlsApp() ."", "". $Applets->LatestNews() ."", "". $Applets->SearchBox() ."", "''. $Applets->ExternalFile('\\1') .''", ); $string = preg_replace($tag, $feature, $content);//Return the content return $string; } Alright in the SQL there is a [FILE=ads] and it would include the file and output whats in the file. ads.php function ads(){ echo "This is a test"; } ads(); So when the script is ran The box is working but the only thing that isn't working is the class: It outputs "ads" and not the actual function that should output "This is a test" It seems like its only echoing the regular expression and ignoring the class that is being called. How do I fix this?: function ExternalFile($file) { include_once("*****/*****/settings.php"); $Settings = new Settings; $Settings->GetInfo(); include($Settings->url."applets/".$file.".php"); } (this file is inside a class) Can someone help me fix this error so it makes the class initiate the function. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
btherl Posted April 16, 2007 Share Posted April 16, 2007 That's pretty complex. If I was debugging it, I would add print/echo statements all throughout the code you are interested in, to make sure the values are correct at every stage. That should help you find the problem. Quote Link to comment Share on other sites More sharing options...
Demonic Posted April 16, 2007 Author Share Posted April 16, 2007 I have been doing that. The Box shows. Then if I try any other way it will echo either "\1" or "$1" or "\$1" and thats why im getting very frustrated been trying to debug for last 2 hours so I came here . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.