I am using a script which I found at http://www.phptutorial.info/iptocountry/the_script.html
This script as you can see allows us to block a country by identifying their IP address.
The complete script is
$website_mode = "live"; // Set this to live to let the country blocking code work
function iptocountry($ip){
$numbers = explode( ".", $ip);
include("ip_files/".$numbers[0].".php");
$code = ($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
foreach($ranges as $key => $value){
if($key<=$code){
if($ranges[$key][0]>=$code){
$country=$ranges[$key][1];
break;
}
}
}
if($country==""){
$country="unknown";
}
return $country;
}
if($website_mode == "live"){
$gbc = $pdo->prepare("SELECT bc_countries FROM blocked_countries");
$gbc-> execute();
$gbf = $gbc->fetch();
$countries_to_block = explode(',', $gbf['bc_countries']);
if($_SERVER['HTTP_X_FORWARDED_FOR']){
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
$ip = $_SERVER['REMOTE_ADDR'];
}
$two_letter_country_code = iptocountry($ip);
if(in_array($two_letter_country_code, $countries_to_block)){
die("<center style='margin-top: 150px'><img src='images/stop.png' width='auto' height='200px'><br><br>*** Your country has been banned from accessing this website for security reasons ***</center>");
}
}
Here, I have written a script to work with the code which I found on http://azuliadesigns.com/blocking-website-access-country-php/. I modified it a bit so that it works with my database. But on live website its returning the following error.
Warning: include(ip_files/2405:204:4008:c78:d485:aba6:1eb4:9d6c, 2405:204:4008:c78:d485:aba6:1eb4:9d6c.php): failed to open stream: No such file or directory in /storage/supergens5cfqqgc/files/redd.supergenscript.com/functions.php on line 11
Warning: include(ip_files/2405:204:4008:c78:d485:aba6:1eb4:9d6c, 2405:204:4008:c78:d485:aba6:1eb4:9d6c.php): failed to open stream: No such file or directory in /storage/supergens5cfqqgc/files/redd.supergenscript.com/functions.php on line 11
Warning: include(): Failed opening 'ip_files/2405:204:4008:c78:d485:aba6:1eb4:9d6c, 2405:204:4008:c78:d485:aba6:1eb4:9d6c.php' for inclusion (include_path='.:/opt/php-fpm-5.6.29-1/lib/php') in /storage/supergens5cfqqgc/files/redd.supergenscript.com/functions.php on line 11
Warning: Invalid argument supplied for foreach() in /storage/supergens5cfqqgc/files/redd.supergenscript.com/functions.php on line 13
I have just followed all the procedures properly. Also, I have rechecked all the code a lot of times but I am not sure what is causing this error.
I am using this code
$userName=$this->input->post('user');
$password=$this->input->post('pass');
$lineNumber=$this->input->post('line');
$to= $this->input->post('Receiver');
$text=$this->input->post('messageBody');;
$client= new SoapClient('http://n.sms.ir/ws/SendReceive.asmx?wsdl');
$parameters['userName'] = $userName;
$parameters['password'] = $password;
$parameters['mobileNos'] = array(doubleval($to));
$parameters['messages'] = array($text);
$parameters['lineNumber'] = $lineNumber;
$parameters['sendDateTime'] = date("Y-m-d")."T".date("H:i:s");
print_r($client->SendMessageWithLineNumber($parameters));
But this happens
A PHP Error was encountered
Severity: Warning
Message:
SoapClient::SoapClient(http://n.sms.ir/ws/SendReceive.asmx?wsdl):
failed to open stream: Connection timed out
Filename: views/sms.php
Line Number: 19
and
A PHP Error was encountered
Severity: Warning
Message: SoapClient::SoapClient(): I/O warning : failed to load
external entity "http://n.sms.ir/ws/SendReceive.asmx?wsdl"
Filename: views/sms.php
Line Number: 19
Does anyone know what's wrong?
go to file system/core/CodeIgniter.php and increase set_time_limit by default it set 300
if (function_exists("set_time_limit") == TRUE AND #ini_get("safe_mode") == 0)
{
#set_time_limit(300);//increase it according to your requirement
}
So I have a PHP program that a line from a text file. Then it uses that line of text it read to point to another text file
$posts = "posts/posts.txt";
$postsLines = file($posts);
$fetchingPost = TRUE;
$postNumber = 0;
$postPointer;
$postPointerString;
$postLines;
$postTag;
$postTitle;
$postContent;
$endCondition = "end";
while ($fetchingPost == TRUE) {
$endOfFile = strcmp($postsLines[$postNumber], $endCondition);
if ($endOfFile == 0) {
$fetchingPost = FALSE;
}
if ($endOfFile <> 0) {
$postPointer[$postNumber] = $postsLines[$postNumber];
$postLines = file($postPointer[$postNumber]);
$postNumber = $postNumber + 1;
}
}
And I get this errors when I run it, I am using the WAMP server
Warning: file(posts/leapMotionSandbox.txt ): failed to open stream: Invalid argument in C:\wamp\www\noahhuppert\Paralax v2\index.php on line 45
Warning: file(posts/topDownShooter.txt ): failed to open stream: Invalid argument in C:\wamp\www\noahhuppert\Paralax v2\index.php on line 45
Please help
The elements of the array returned by file() have a newline at the end of each line. This is not a valid filename character on Windows (it's valid on Unix, although it would be perverse to include newlines in a filename).
From the documentation:
Each line in the resulting array will include the line ending, unless FILE_IGNORE_NEW_LINES is used, so you still need to use rtrim() if you do not want the line ending present.
Your loop can also be simplified greatly. There's no need for the $fetchingPost or $endOfFile variables, just test for the end in the while() condition.
while (($line = rtrim($postsLines[$postNumber]) != $endCondition) {
$postPointer[$postNumber] = $line;
$postLines = file($line);
$postNumber++;
}
Alternatively, you can do:
$postsLines = file($posts, FILE_IGNORE_NEW_LINES);
If i push a string which doesn't exist or misspelled to function benzer($ilk_artist) i am getting errors bottom. Whether i push a valid artist name or not variable $completeurl is always defined. So i can't put if($completeurl) I think i should control whether $completeurl is valid before simplexml_load_file($completeurl). Do you have an idea that how i can do it?
function benzer($ilk_artist)
{
$completeurl = 'http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist='.trim($ilk_artist).'&api_key='.LASTFM_APP_ID;
$completeurl = urlencode($completeurl);
$xml = simplexml_load_file($completeurl);
if(!$xml)
{
return false;
}
$artists = $xml->similarartists->artist;
$length = count($artists);
for ($i = 0; $i < $length; $i++) {
$artistname[$i] = $artists[$i]->name;
}
return simplexml_kurtul($artistname);
}
errors:
[17-Dec-2012 11:43:33] PHP Warning: simplexml_load_file(http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist=tgyu+6uh6n&api_key=APIKEY) [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request
in /home6/.../public_html/.../functions/fns.php on line 102
[17-Dec-2012 11:43:33] PHP Warning: simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: I/O warning : failed to load external entity "http%3A%2F%2Fws.audioscrobbler.com%2F2.0%2F%3Fmethod%3Dartist.getsimilar%26artist%3Dtgyu+6uh6n%26api_key=APIKEY0" in /home6/.../public_html/.../functions/fns.php on line 102
What about not printing out the warnings by adding '#'?
$xml = #simplexml_load_file($completeurl);
if(!$xml)
{
return false;
}
http://reps.michebagshows.com/forums/
Recently, our customer forums popped up with this slew of errors from settings.php in the Vanilla forum software. We have no idea how this happened, as none of the files have been modified for months. Todd over at Vanilla suggested that the permissions changed, but those haven't been touched either. He then sent me to another user for help, who hasn't even logged in in a week.
How can this be fixed? We're getting quite a few complaints about it because the forums are the way our customers trade and discuss our product among each other.
Any help would be greatly appreciated, thank you.
Example errors:
Warning: include_once(/path/to/vanilla/appg/database.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 244
Warning: include_once() [function.include]: Failed opening '/path/to/vanilla/appg/database.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 244
Warning: include_once(/path/to/your/database/file.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 245
Warning: include_once() [function.include]: Failed opening '/path/to/your/database/file.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 245
Warning: include_once(/path/to/your/library/Framework/Framework.Functions.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 246
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Functions.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 246
Warning: include_once(/path/to/your/library/Framework/Framework.Class.Database.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 247
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.Database.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 247
Warning: include_once(/path/to/your/library/Framework/Framework.Class.MySQL.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 248
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.MySQL.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 248
Warning: include_once(/path/to/your/library/Framework/Framework.Class.SqlBuilder.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 249
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.SqlBuilder.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 249
Warning: include_once(/path/to/your/library/Framework/Framework.Class.MessageCollector.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 250
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.MessageCollector.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 250
Warning: include_once(/path/to/your/library/Framework/Framework.Class.ErrorManager.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 251
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.ErrorManager.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 251
Warning: include_once(/path/to/your/library/Framework/Framework.Class.ObjectFactory.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 252
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.ObjectFactory.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 252
Warning: include_once(/path/to/your/library/Framework/Framework.Class.StringManipulator.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 253
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.StringManipulator.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 253
Warning: include_once(/path/to/your/library/Framework/Framework.Class.Context.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 254
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.Context.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 254
Warning: include_once(/path/to/your/library/Framework/Framework.Class.Delegation.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 255
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.Delegation.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 255
Warning: include_once(/path/to/your/library/Vanilla/Vanilla.Functions.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 256
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Vanilla/Vanilla.Functions.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 256
Warning: include_once(/path/to/your/library/People/People.Class.Authenticator.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 257
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/People/People.Class.Authenticator.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 257
Warning: include_once(/path/to/your/library/People/People.Class.Session.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 258
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/People/People.Class.Session.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 258
Warning: include_once(/path/to/your/library/People/People.Class.PasswordHash.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 259
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/People/People.Class.PasswordHash.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 259
Warning: include_once(/path/to/your/library/People/People.Class.User.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 260
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/People/People.Class.User.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 260
Fatal error: Class 'Context' not found in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 262
Settings.php
<?php
/*
* Copyright 2003 Mark O'Sullivan
* This file is part of Vanilla.
* Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
* Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* The latest source code for Vanilla is available at www.lussumo.com
* Contact Mark O'Sullivan at mark [at] lussumo [dot] com
* Description: Global application constants
* ATTENTION: !DO NOT CHANGE ANYTHING IN THIS FILE!
* If you wish to override any configuration setting, do it in the
* conf/settings.php file. This file will be overwritten when you apply upgrades
* to Vanilla. The conf/settings.php file will NOT be overwritten.
*/
ob_start();
$Configuration = array();
// Database Settings
$Configuration['DATABASE_SERVER'] = 'MySQL';
$Configuration['DATABASE_TABLE_PREFIX'] = 'LUM_';
$Configuration['DATABASE_HOST'] = 'localhost';
$Configuration['DATABASE_NAME'] = 'your_vanilla_database_name';
$Configuration['DATABASE_USER'] = 'your_vanilla_database_user_name';
$Configuration['DATABASE_PASSWORD'] = 'your_vanilla_database_password';
$Configuration['FARM_DATABASE_HOST'] = '';
$Configuration['FARM_DATABASE_NAME'] = 'your_farm_database_name';
$Configuration['FARM_DATABASE_USER'] = 'your_farm_database_user_name';
$Configuration['FARM_DATABASE_PASSWORD'] = 'your_farm_database_password';
$Configuration['DATABASE_CHARACTER_ENCODING'] = '';
$Configuration['DATABASE_VERSION'] = '1';
// Path Settings
$Configuration['APPLICATION_PATH'] = '/path/to/vanilla/';
$Configuration['DATABASE_PATH'] = '/path/to/your/database/file.php';
$Configuration['LIBRARY_PATH'] = '/path/to/your/library/';
$Configuration['EXTENSIONS_PATH'] = '/path/to/your/extensions/';
$Configuration['LANGUAGES_PATH'] = '/path/to/your/languages/';
$Configuration['THEME_PATH'] = '/path/to/vanilla/themes/vanilla/';
$Configuration['BASE_URL'] = 'http://your.base.url/to/vanilla/';
$Configuration['DEFAULT_STYLE'] = '/vanilla/themes/vanilla/styles/default/';
$Configuration['WEB_ROOT'] = '/vanilla/';
$Configuration['SIGNIN_URL'] = 'people.php';
$Configuration['SIGNOUT_URL'] = 'people.php?PostBackAction=SignOutNow';
// People Settings
$Configuration['AUTHENTICATION_MODULE'] = 'People/People.Class.Authenticator.php';
$Configuration['AUTHENTICATION_CLASS'] = 'Authenticator';
$Configuration['SESSION_NAME'] = '';
$Configuration['COOKIE_USER_KEY'] = 'lussumocookieone';
$Configuration['COOKIE_VERIFICATION_KEY'] = 'lussumocookietwo';
$Configuration['SESSION_USER_IDENTIFIER'] = 'LussumoUserID';
$Configuration['COOKIE_DOMAIN'] = '.domain.com';
$Configuration['COOKIE_PATH'] = '/';
$Configuration['SUPPORT_EMAIL'] = 'support#domain.com';
$Configuration['SUPPORT_NAME'] = 'Support';
$Configuration['LOG_ALL_IPS'] = '0';
$Configuration['FORWARD_VALIDATED_USER_URL'] = './';
$Configuration['ALLOW_IMMEDIATE_ACCESS'] = '0';
$Configuration['DEFAULT_ROLE'] = '0';
$Configuration['APPROVAL_ROLE'] = '3';
$Configuration['SAFE_REDIRECT'] = 'people.php?PageAction=SignOutNow';
$Configuration['PEOPLE_USE_EXTENSIONS'] = '1';
$Configuration['DEFAULT_EMAIL_VISIBLE'] = '0';
$Configuration['PASSWORD_HASH_ITERATION'] = '8';
$Configuration['PASSWORD_HASH_PORTABLE'] = '1';
// Framework Settings
$Configuration['SMTP_HOST'] = '';
$Configuration['SMTP_USER'] = '';
$Configuration['SMTP_PASSWORD'] = '';
$Configuration['DEFAULT_EMAIL_MIME_TYPE'] = 'text/plain';
$Configuration['LANGUAGE'] = "English";
$Configuration['URL_BUILDING_METHOD'] = 'Standard'; // Standard or mod_rewrite
$Configuration['CHARSET'] = 'utf-8';
$Configuration['PAGE_EVENTS'] = array('Page_Init', 'Page_Render', 'Page_Unload');
$Configuration['PAGELIST_NUMERIC_TEXT'] = '0';
$Configuration['LIBRARY_NAMESPACE_ARRAY'] = array('Framework', 'People', 'Vanilla');
$Configuration['LIBRARY_INCLUDE_PATH'] = '%LIBRARY%';
$Configuration['DEFAULT_FORMAT_TYPE'] = 'Text';
$Configuration['FORMAT_TYPES'] = array('Text');
$Configuration['APPLICATION_TITLE'] = 'Vanilla';
$Configuration['BANNER_TITLE'] = 'Vanilla';
$Configuration['UPDATE_REMINDER'] = 'Monthly';
$Configuration['LAST_UPDATE'] = '';
$Configuration['HTTP_METHOD'] = 'http'; // Could alternately be https
// Vanilla Settings
$Configuration['ENABLE_WHISPERS'] = '0';
$Configuration['DISCUSSIONS_PER_PAGE'] = '30';
$Configuration['COMMENTS_PER_PAGE'] = '50';
$Configuration['SEARCH_RESULTS_PER_PAGE'] = '30';
$Configuration['ALLOW_NAME_CHANGE'] = '1';
$Configuration['ALLOW_EMAIL_CHANGE'] = '1';
$Configuration['ALLOW_PASSWORD_CHANGE'] = '1';
$Configuration['USE_REAL_NAMES'] = '1';
$Configuration['PUBLIC_BROWSING'] = '1';
$Configuration['USE_CATEGORIES'] = '1';
$Configuration['MAX_COMMENT_LENGTH'] = '5000';
$Configuration['MAX_TOPIC_WORD_LENGTH'] = '45';
$Configuration['DISCUSSION_POST_THRESHOLD'] = '3';
$Configuration['DISCUSSION_TIME_THRESHOLD'] = '60';
$Configuration['DISCUSSION_THRESHOLD_PUNISHMENT'] = '120';
$Configuration['COMMENT_POST_THRESHOLD'] = '5';
$Configuration['COMMENT_TIME_THRESHOLD'] = '60';
$Configuration['COMMENT_THRESHOLD_PUNISHMENT'] = '120';
$Configuration['UPDATE_URL'] = 'http://lussumo.com/updatecheck/default.php';
// Vanilla Control Positions
$Configuration['CONTROL_POSITION_HEAD'] = '100';
$Configuration['CONTROL_POSITION_MENU'] = '200';
$Configuration['CONTROL_POSITION_BANNER'] = '200';
$Configuration['CONTROL_POSITION_PANEL'] = '300';
$Configuration['CONTROL_POSITION_NOTICES'] = '400';
$Configuration['CONTROL_POSITION_BODY_ITEM'] = '500';
$Configuration['CONTROL_POSITION_FOOT'] = '600';
$Configuration['CONTROL_POSITION_PAGE_END'] = '700';
// Vanilla Tab Positions
$Configuration['TAB_POSITION_DISCUSSIONS'] = '10';
$Configuration['TAB_POSITION_CATEGORIES'] = '20';
$Configuration['TAB_POSITION_SEARCH'] = '30';
$Configuration['TAB_POSITION_SETTINGS'] = '40';
$Configuration['TAB_POSITION_ACCOUNT'] = '50';
// Url Rewriting Definitions
$Configuration['REWRITE_categories.php'] = 'categories/';
$Configuration['REWRITE_index.php'] = 'discussions/';
$Configuration['REWRITE_comments.php'] = 'discussion/';
$Configuration['REWRITE_search.php'] = 'search/';
$Configuration['REWRITE_account.php'] = 'account/';
$Configuration['REWRITE_settings.php'] = 'settings/';
$Configuration['REWRITE_post.php'] = 'post/';
$Configuration['REWRITE_people.php'] = 'people/';
$Configuration['REWRITE_extension.php'] = 'extension/';
// Default values for role permissions
// Standard Permissions
$Configuration['PERMISSION_SIGN_IN'] = '0';
$Configuration['PERMISSION_ADD_COMMENTS'] = '0';
$Configuration['PERMISSION_START_DISCUSSION'] = '0';
$Configuration['PERMISSION_HTML_ALLOWED'] = '0';
// Discussion Moderator Permissions
$Configuration['PERMISSION_SINK_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_STICK_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_HIDE_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_CLOSE_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_EDIT_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_VIEW_HIDDEN_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_EDIT_COMMENTS'] = '0';
$Configuration['PERMISSION_HIDE_COMMENTS'] = '0';
$Configuration['PERMISSION_VIEW_HIDDEN_COMMENTS'] = '0';
$Configuration['PERMISSION_ADD_COMMENTS_TO_CLOSED_DISCUSSION'] = '0';
$Configuration['PERMISSION_ADD_CATEGORIES'] = '0';
$Configuration['PERMISSION_EDIT_CATEGORIES'] = '0';
$Configuration['PERMISSION_REMOVE_CATEGORIES'] = '0';
$Configuration['PERMISSION_SORT_CATEGORIES'] = '0';
$Configuration['PERMISSION_VIEW_ALL_WHISPERS'] = '0';
// User Moderator Permissions
$Configuration['PERMISSION_APPROVE_APPLICANTS'] = '0';
$Configuration['PERMISSION_RECEIVE_APPLICATION_NOTIFICATION'] = '0';
$Configuration['PERMISSION_CHANGE_USER_ROLE'] = '0';
$Configuration['PERMISSION_EDIT_USERS'] = '0';
$Configuration['PERMISSION_IP_ADDRESSES_VISIBLE'] = '0';
$Configuration['PERMISSION_MANAGE_REGISTRATION'] = '0';
$Configuration['PERMISSION_SORT_ROLES'] = '0';
$Configuration['PERMISSION_ADD_ROLES'] = '0';
$Configuration['PERMISSION_EDIT_ROLES'] = '0';
$Configuration['PERMISSION_REMOVE_ROLES'] = '0';
// Administrative Permissions
$Configuration['PERMISSION_CHECK_FOR_UPDATES'] = '0';
$Configuration['PERMISSION_CHANGE_APPLICATION_SETTINGS'] = '0';
$Configuration['PERMISSION_MANAGE_EXTENSIONS'] = '0';
$Configuration['PERMISSION_MANAGE_LANGUAGE'] = '0';
$Configuration['PERMISSION_MANAGE_THEMES'] = '0';
$Configuration['PERMISSION_MANAGE_STYLES'] = '0';
$Configuration['PERMISSION_ALLOW_DEBUG_INFO'] = '0';
// Default values for User Preferences
$Configuration['PREFERENCE_HtmlOn'] = '1';
$Configuration['PREFERENCE_ShowAppendices'] = '1';
$Configuration['PREFERENCE_ShowSavedSearches'] = '1';
$Configuration['PREFERENCE_ShowTextToggle'] = '1';
$Configuration['PREFERENCE_JumpToLastReadComment'] = '1';
$Configuration['PREFERENCE_ShowLargeCommentBox'] = '0';
$Configuration['PREFERENCE_ShowFormatSelector'] = '1';
$Configuration['PREFERENCE_ShowDeletedDiscussions'] = '0';
$Configuration['PREFERENCE_ShowDeletedComments'] = '0';
// Newbie settings
// Has Vanilla been installed (this will be set to true in conf/settings.php when setup completes)
$Configuration['SETUP_COMPLETE'] = '0';
$Configuration['ADDON_NOTICE'] = '1';
// Application versions
include(dirname(__FILE__) . '/version.php');
// Application Mode Constants
define('MODE_DEBUG', 'DEBUG');
define('MODE_RELEASE', 'RELEASE');
// Format type definitions
define('FORMAT_STRING_FOR_DISPLAY', 'DISPLAY');
define('FORMAT_STRING_FOR_DATABASE', 'DATABASE');
// PHP Settings
define('MAGIC_QUOTES_ON', get_magic_quotes_gpc());
// Self Url (should be hard-coded by each page - this is here just in case it was forgotten)
$Configuration['SELF_URL'] = #$_SERVER['PHP_SELF'];
// Include custom settings
include(dirname(__FILE__) . '/../conf/settings.php');
if ($Configuration['SETUP_COMPLETE'] == '0') {
header('Location: ./setup/index.php');
}
// Define a constant to prevent a register_globals attack on the configuration paths
define('IN_VANILLA', '1');
//upgrade database
if ($Configuration['DATABASE_VERSION'] < 2) {
include_once($Configuration['APPLICATION_PATH'].'appg/database.php');
include_once($Configuration['DATABASE_PATH']);
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Functions.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.Database.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.'.$Configuration['DATABASE_SERVER'].'.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.SqlBuilder.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.MessageCollector.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.ErrorManager.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.ObjectFactory.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.StringManipulator.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.Context.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.Delegation.php');
include_once($Configuration['LIBRARY_PATH'].'Vanilla/Vanilla.Functions.php');
include_once($Configuration['LIBRARY_PATH'].$Configuration['AUTHENTICATION_MODULE']);
include_once($Configuration['LIBRARY_PATH'].'People/People.Class.Session.php');
include_once($Configuration['LIBRARY_PATH'].'People/People.Class.PasswordHash.php');
include_once($Configuration['LIBRARY_PATH'].'People/People.Class.User.php');
$Context = new Context($Configuration);
$Context->DatabaseTables = &$DatabaseTables;
$Context->DatabaseColumns = &$DatabaseColumns;
$Query = 'ALTER TABLE '
. GetTableName('User', $DatabaseTables, $Configuration["DATABASE_TABLE_PREFIX"])
. ' CHANGE ' . $DatabaseColumns['User']['Password'].' '
. $DatabaseColumns['User']['Password'] . ' VARBINARY( 34 ) NULL DEFAULT NULL';
if ($Context->Database->Execute($Query,'','','',0)) {
AddConfigurationSetting($Context, 'DATABASE_VERSION', '2');
}
unset($Context, $Query);
}
?>
conf/settings.php
<?php
// Application Settings
$Configuration['SETUP_TEST'] = '1';
$Configuration['APPLICATION_PATH'] = '/var/www/michebagshows.com/vanilla/';
$Configuration['DATABASE_PATH'] = '/var/www/michebagshows.com/vanilla/conf/database.php';
$Configuration['LIBRARY_PATH'] = '/var/www/michebagshows.com/vanilla/library/';
$Configuration['EXTENSIONS_PATH'] = '/var/www/michebagshows.com/vanilla/extensions/';
$Configuration['LANGUAGES_PATH'] = '/var/www/michebagshows.com/vanilla/languages/';
$Configuration['THEME_PATH'] = '/var/www/michebagshows.com/vanilla/themes/Blogger/';
$Configuration['DEFAULT_STYLE'] = '/themes/Blogger/styles/default/';
$Configuration['WEB_ROOT'] = '/';
$Configuration['BASE_URL'] = 'http://forums.michebagshows.com/';
$Configuration['FORWARD_VALIDATED_USER_URL'] = 'http://forums.michebagshows.com/';
$Configuration['SUPPORT_EMAIL'] = 'info#michebag.com';
$Configuration['SUPPORT_NAME'] = 'Miche Bag';
$Configuration['APPLICATION_TITLE'] = 'Miche Bag Distributor Forums';
$Configuration['BANNER_TITLE'] = 'Distributor Forums';
$Configuration['COOKIE_DOMAIN'] = 'forums.michebagshows.com';
$Configuration['COOKIE_PATH'] = '/';
$Configuration['SETUP_COMPLETE'] = '1';
$Configuration['DATABASE_VERSION'] = '2';
$Configuration['ADDON_NOTICE'] = '0';
$Configuration['SMTP_USER'] = 'admin';
$Configuration['SMTP_PASSWORD'] = 'm1ch3b4g';
$Configuration['DEFAULT_ROLE'] = '3';
$Configuration['ALLOW_IMMEDIATE_ACCESS'] = '1';
$Configuration['NOTIFI_ALLOW_ALL'] = '1';
$Configuration['NOTIFI_ALLOW_DISCUSSION'] = '1';
$Configuration['NOTIFI_ALLOW_CATEGORY'] = '1';
$Configuration['NOTIFI_AUTO_ALL'] = '0';
$Configuration['NOTIFI_INSTALL_V2_COMPLETE'] = '1';
$Configuration['PASSWORD_RESET_VERSION'] = '0.3';
$Configuration['LAST_UPDATE'] = '1265210955';
$Configuration['DEFAULT_PAGE_USE_RETURN'] = '';
$Configuration['DEFAULT_PAGE'] = 'categories.php';
$Configuration['PUBLIC_BROWSING'] = '0';
$Configuration['ATTACHMENTS_UPLOAD_PATH'] = '/var/www/michebagshows.com/vanilla/uploads/%year%/%month%/';
$Configuration['ATTACHMENTS_MAXIMUM_FILESIZE'] = '3512000';
$Configuration['ATTACHMENTS_VERSION'] = '2.1';
?>
#DaveRandom is right. Your config file (settings.php) has been overwritten or backed up from a state that is not configured, but it is a mystery to me how this could have happened by accident.
The proof is right here, and indicates that the forum doesn't think it has been configured yet:
$Configuration['SETUP_COMPLETE'] = '0';
Perhaps someone reinstalled the Vanilla software, or tried to perform some kind of update, and accidentally overwrote this important file.
settings.php usually contains all the site-specific configuration for your forum, such as database names and passwords, the root folders of your site's various applications, etc. This is the kind of thing that is built at setup time, when you first install your forum.
Unless you have a backup of this file, you're going to have to perform the setup again. Make sure you backup your database first.
So we found out what the problem was... It turns out our old programmer didn't transfer the rest of the files over to the right server. I wasn't even aware there was a transfer. But it's fixed now! Thank you guys for your help.