So I inherited a product reviews module. A cron runs every 6 hours. It checks for when to send an email out, but has not been working as of late.
Here's the config.xml file part containing the crontab. The crontab node is only placed within .
<crontab>
<jobs>
<company_reviews_delay>
<schedule>
<cron_expr>* * * * *</cron_expr><!-- every 6 hours -->
</schedule>
<run>
<model>reviews/adminhtml_observer::delaySend</model>
</run>
</company_reviews_delay>
</jobs>
</crontab>
The php file with the delaySend method is in Reviews/Model/Adminhtml/Observer.php
Here's the code for it
public function delaySend() {
$error_counter = 0;
$unsent_notifications = $this->getNotificationCollection()->addFieldToFilter('notified', array('lt' => 1));
foreach($unsent_notifications as $notification){
try{
$order = Mage::getModel('sales/order')->loadByIncrementId($notification->getOrderId());
if(!$this->getConfig()->isCronEnabled($order->getStoreId()) || !$this->getConfig()->isEnabled($order->getStoreId())){
continue; //skip for store that is disabled
}
$shipments_collection = $order->getShipmentsCollection();
if (empty($shipments_collection)) continue;
$shipment = $shipments_collection->getFirstItem();
}catch(Exception $e){
if($error_counter == 0){
mage::helper('mymodule_base')->logError('Review delay send error: ' . $e, true);
}
mage::helper('mymodule_base')->logError('Issue with notification order ID: ' . $notification->getOrderId(), false);
$error_counter++;
continue;
}
$execution_time = strtotime($shipment->getCreatedAt().'+'. $this->getConfig()->getCronDelay($order->getStoreId())); //e.g (+1 day to shipping date)
if($execution_time < time()){
$notification->sendEmail($order->getStoreId());
}
}
return $this;
}
I substituted a simple print "Hello"; command in the method and ran it on command line. Hello was printed out but we get this error:
2015-07-22T15:48:54+00:00 ERR (3): Warning: include(Symfony\Component\Console\Event\ConsoleTerminateEvent.php): failed to open stream: No such file or directory in /home/os2/public_html/lib/Varien/Autoload.php on line 94
2015-07-22T15:48:54+00:00 ERR (3): Warning: include(Symfony\Component\Console\Event\ConsoleTerminateEvent.php): failed to open stream: No such file or directory in /home/os2/public_html/lib/Varien/Autoload.php on line 94
2015-07-22T15:48:54+00:00 ERR (3): Warning: include(): Failed opening 'Symfony\Component\Console\Event\ConsoleTerminateEvent.php' for inclusion (include_path='/home/os2/public_html/app/code/local:/home/os2/public_html/app/code/community:/home/os2/public_html/app/code/core:/home/os2/public_html/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/os2/public_html/lib/Varien/Autoload.php on line 94
Can anyone offer some advice or help? Thanks.
Related
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.
Im trying to use the simple html dom parser within WAMP - for some reason I can't get the php file to recognise the parser - I'm using example code from the parser website and it is not working - the code is as follows;
<?php
include_once('C:\wamp\www\reports\simple_html_dom.php');
function scraping_digg() {
// create HTML DOM
$html = file_get_html('http://digg.com/');
// get news block
foreach($html->find('div.news-summary') as $article) {
// get title
$item['title'] = trim($article->find('h3', 0)->plaintext);
// get details
$item['details'] = trim($article->find('p', 0)->plaintext);
// get intro
$item['diggs'] = trim($article->find('li a strong', 0)->plaintext);
$ret[] = $item;
}
// clean up memory
$html->clear();
unset($html);
return $ret;
}
// -----------------------------------------------------------------------------
// test it!
// "http://digg.com" will check user_agent header...
ini_set('user_agent', 'My-Application/2.5');
$ret = scraping_digg();
foreach($ret as $v) {
echo $v['title'].'<br>';
echo '<ul>';
echo '<li>'.$v['details'].'</li>';
echo '<li>Diggs: '.$v['diggs'].'</li>';
echo '</ul>';
}
?>
So far I have tried having the path as follows;
include_once('C:\wamp\www\reports\simple_html_dom.php');
include_once('http://localhost/reports/simple_html_dom.php');
include_once('simple_html_dom.php');
Here are the error messages I recieve
) Warning: include_once(../../simple_html_dom.php): failed to open stream: No such file or directory in C:\wamp\www\reports\example_scraping_digg.php on line 2
Warning: include_once(): Failed opening '../../simple_html_dom.php' for inclusion (include_path='.;C:\php\pear') in C:\wamp\www\reports\example_scraping_digg.php on line 2
I also get another error on line 6..;
Fatal error: Call to undefined function file_get_html() in C:\wamp\www\reports\example_scraping_digg.php on line 6
Thanks in advance for any help you can offer - It is greatly appreciated.
The file in question is located here : C:\wamp\www\reports\simple_html_dom.php
which is why I'm so confused - Thanks again for your help
After hours of looking at the problem - It was incorrect php.ini settings in the WAMP folder - Thanks
I am using PHP with MySQL to pull programs, courses, etc. on 2003 box with PHP 5.2. I am transferring my site to a new 2008 box with PHP 5.4 (because of injection exploits on database). My data still pulls to my site (programs, courses etc) from my new server.
The issue is I have a page that is for login and will not load (HTTP 500 error). I have traced back to section of code that kicks out and believe it is the session_start(). I know in 5.3 it changed and will now return false if it fails to start instead of the previous true.
I've tried echoing out what loads line by line with each variable since I can compare it with the two versions. I've tried starting the session at the beginning. Ending it before my code, etc. It seems simple, but I haven't got it to work yet.
Here's the beginning of my page "login-inc-header.php":
<?php
if(!isset($session_started)) $session_started = session_start();
// avoids duplicate pstings
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
ini_set("display_errors", "1");
if(!isset($requires)) $requires = "User";
include_once("includes/handleLogin.php");
include_once("../includes_app/db_settings.php");
?>
If I remove this block, The page will load just without my login boxes. Pages works perfect in version 5.2. Ideas?
My db_settings:
<?php
//$site_root = "/var/www/html/";
$site_root = "C:\\Inetpub\\wwwroot\\"; //changed 12-13-13 for new server
//$site_root = substr($_SERVER['PATH_TRANSLATED'], 0, (-1 * strlen($_SERVER['PATH_INFO'])));
$site_url = "http://10.20.251.60/";
include_once($site_root."includes_app/adodb/adodb.inc.php");
$db =& ADONewConnection('mysql');
$db->Connect("localhost", "####", "####", "####");
$db->SetFetchMode(ADODB_FETCH_ASSOC);
// for mysql only...make sure we are NOT in strict mode
$db->Execute("SET sql_mode=''");
$tblprefix = "";
$extraFieldLabHours = true;
$extraFieldOBIHours = true;
$extraFieldsPrereqCoreq = true;
$extraFieldProgramRequirements = true;
$maxCourseCodeLength = 4;
$maxCoursePrefixLength = 4; // 11-05-10 added this line to fix prefix length
$exportReport[$site_url.'includes_app/html_word_export.php'] = "Export for Microsoft Word 2007";
$exportReport[$site_url.'includes_app/html_rtf_export.php'] = "Export for Adobe InDesign CS2";
$exportReport[$site_url.'directory/print.php'] = "Export Directory to HTML";
$sysadmin_email = "gntc#gntc.edu";
$extraModuleEmployeeDirectory = true;
$extraModuleCampusAlert = true;
$extraFieldAtAGlance = true;
$areas = array();
$configAreasResult = $db->Execute("SELECT dbName, displayName FROM ".$tblprefix."areas ORDER BY sequence");
while($configRow = $configAreasResult->fetchRow()) $areas[$configRow['dbName']] = $configRow['displayName'];
$program_types = array();
$configProgramTypesResult = $db->Execute("SELECT dbName, displayName FROM ".$tblprefix."program_types ORDER BY sequence");
while($configRow = $configProgramTypesResult->fetchRow()) $program_types[$configRow['dbName']] = $configRow['displayName'];
$extraFieldCampus = array();
$configCampusesResult = $db->Execute("SELECT displayName FROM ".$tblprefix."campuses ORDER BY sequence");
while($configRow = $configCampusesResult->fetchRow()) $extraFieldCampus[] = $configRow['displayName'];
$extraFieldEmployeeOfficeHours = true;
$extraFieldEmployeeBio = true;
$extraFieldEmployeePicture = true;
$extraFieldFoptNumRequirements = true;
$alternateTitleGeneralCoreCourses = "General Core Curriculum";
$alternateTitleOccupationalCourses = "Occupational Curriculum";
$extraModuleCampusAlert = true; // added on 3-10-10 to make campus alert feature work
$alternateTitleEmployeeEducation = "Credentials"; $showBannerID = true;
$deeperMenus = true;
$importModules = array();
$importModules['import_courses_xml.php'] = "Courses XML";
$importModules['import_employees_xml.php'] = "Employees XML";
$extraModuleDivisions = true;
$gntc_local_upload_dir = $site_root."uploads/";
$gntc_web_upload_dir = $site_url."uploads/";
$exportReport[$site_url.'includes_app/phone_sheet_csv.php'] = "Phone Sheet CSV";
?>
Log File:
[16-Jan-2014 21:17:46 UTC] PHP Warning: include_once(includes/handleLogin.php): failed to open stream: No such file or directory in C:\inetpub\wwwroot\login\includes\header.php on line 8
[16-Jan-2014 21:17:46 UTC] PHP Warning: include_once(): Failed opening 'includes/handleLogin.php' for inclusion (include_path='.;C:\php\pear') in C:\inetpub\wwwroot\login\includes\header.php on line 8
[16-Jan-2014 21:17:46 UTC] PHP Warning: include_once(../includes_app/db_settings.php): failed to open stream: No such file or directory in C:\inetpub\wwwroot\login\includes\header.php on line 9
[16-Jan-2014 21:17:46 UTC] PHP Warning: include_once(): Failed opening '../includes_app/db_settings.php' for inclusion (include_path='.;C:\php\pear') in C:\inetpub\wwwroot\login\includes\header.php on line 9
[16-Jan-2014 21:17:46 UTC] PHP Notice: Undefined variable: title in C:\inetpub\wwwroot\login\includes\header.php on line 16
[16-Jan-2014 21:17:46 UTC] PHP Notice: Undefined variable: title in C:\inetpub\wwwroot\login\includes\header.php on line 159
I noticed that this referenced PEAR, which in not installed by default like older versions. Could this be the issue?
You have put this as your site root
$site_root = "C:\\Inetpub\\wwwroot\\";
Try putting
$site_root = "http://yourhost/folder_name/"
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.