Skip to content

Commit

Permalink
More tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
freddirkse committed Jun 16, 2011
1 parent 2b9d876 commit fd1e450
Show file tree
Hide file tree
Showing 14 changed files with 1,016 additions and 52 deletions.
21 changes: 21 additions & 0 deletions conf/extensions/search.defaults.php
@@ -0,0 +1,21 @@
<?php

##################################################
#
# Copyright (c) 2004-2008 OIC Group, Inc. and Contributors
#
# This file is part of Exponent
#
# Exponent 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.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################

if (!defined('SAVE_SEARCH_QUERIES')) define ('SAVE_SEARCH_QUERIES',0);

?>
38 changes: 38 additions & 0 deletions conf/extensions/search.structure.php
@@ -0,0 +1,38 @@
<?php

##################################################
#
# Copyright (c) 2004-2006 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
#
# Exponent 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.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################

if (!defined('EXPONENT')) exit('');

$ctl = new checkboxcontrol(false,true);
$ctl->disabled = 0;

$i18n = exponent_lang_loadFile('conf/extensions/search.structure.php');

return array(
$i18n['title'],
array(
'SAVE_SEARCH_QUERIES'=>array(
'title'=>$i18n['save_search_queries'],
'description'=>$i18n['save_search_queries_desc'],
'control'=>$ctl
)
)
);

?>
24 changes: 24 additions & 0 deletions conf/extensions/simplenotes.defaults.php
@@ -0,0 +1,24 @@
<?php

##################################################
#
# Copyright (c) 2004-2006 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
#
# Exponent 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.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################

if (!defined('SIMPLENOTE_REQUIRE_LOGIN')) define('SIMPLENOTE_REQUIRE_LOGIN','1');
if (!defined('SIMPLENOTE_REQUIRE_APPROVAL')) define('SIMPLENOTE_REQUIRE_APPROVAL','0');
if (!defined('SIMPLENOTE_REQUIRE_NOTIFICATION')) define('SIMPLENOTE_REQUIRE_NOTIFICATION','1');
if (!defined('SIMPLENOTE_NOTIFICATION_EMAIL')) define('SIMPLENOTE_NOTIFICATION_EMAIL','');
?>
50 changes: 50 additions & 0 deletions conf/extensions/simplenotes.structure.php
@@ -0,0 +1,50 @@
<?php

##################################################
#
# Copyright (c) 2004-2009 OIC Group, Inc.
# Written and Designed by Adam Kessler
#
# This file is part of Exponent
#
# Exponent 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.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################

if (!defined('EXPONENT')) exit('');

$i18n = exponent_lang_loadFile('conf/extensions/simplenote.structure.php');

return array(
$i18n['title'],
array(
'SIMPLENOTE_REQUIRE_LOGIN'=>array(
'title'=>$i18n['simplenote_require_login'],
'description'=>$i18n['simplenote_require_login_desc'],
'control'=>new checkboxcontrol()
),
'SIMPLENOTE_REQUIRE_APPROVAL'=>array(
'title'=>$i18n['simplenote_require_approval'],
'description'=>$i18n['simplenote_require_approval_desc'],
'control'=>new checkboxcontrol()
),
'SIMPLENOTE_REQUIRE_NOTIFICATION'=>array(
'title'=>$i18n['simplenote_require_notification'],
'description'=>$i18n['simplenote_require_notification_desc'],
'control'=>new checkboxcontrol()
),
'SIMPLENOTE_NOTIFICATION_EMAIL'=>array(
'title'=>$i18n['simplenote_require_notification_email'],
'description'=>$i18n['simplenote_require_notification_email_desc'],
'control'=>new textcontrol()
),
)
);

?>
3 changes: 3 additions & 0 deletions cron/.htaccess
@@ -0,0 +1,3 @@
# secure directory by disabling script execution
# AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI
58 changes: 58 additions & 0 deletions cron/bootstrap.php
@@ -0,0 +1,58 @@
<?php
/*
SOME UTILITY FUNCTIONS
Normally these are wrapped up in Exponent but since this is a standalone file we'll need to define them explicitly
*/

/*function my__realpath($path)
{
$path = str_replace('\\','/',realpath($path));
if ($path{1} == ':')
{
// We can't just check for C:/, because windows users may have the IIS webroot on X: or F:, etc.
$path = substr($path,2);
}
return $path;
}*/

/*function expUnserialize($serial_str)
{
$out = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str );
return unserialize($out);
}*/

/*function exponent_unhtmlentities( $str )
{
$trans = get_html_translation_table(HTML_ENTITIES);
$trans['&apos;'] = '\'';
$trans=array_flip($trans);
$trans['&apos;'] = '\'';
$trans['&#039;'] = '\'';
return strtr($str, $trans);
}*/
/*
DEFINE A FEW CONSTANTS
*/

require_once('../exponent.php');
require_once('../conf/config.php');

//define('BASE',str_ireplace('/cron','',__realpath(dirname(__FILE__))));
define("EXP_PATH", BASE);
//Pull in the mysqli helper class form exponet.
// Sure, we could have used mysqli directly but we have this nice friendly class so why not use it
require_once(EXP_PATH . "subsystems/database/mysqli.php");

// Pull in the Swift lib from Exponent's external dir
require_once(EXP_PATH . "external/Swift/Swift.php");
require_once(EXP_PATH . "external/Swift/Connection/SMTP.php");
require_once(EXP_PATH . "external/Swift/Plugin/AntiFlood.php");
require_once(EXP_PATH . "external/Swift/Plugin/Decorator.php");

// instantiate the mysql helper class and connect
$db = new mysqli_database();
$db->connect(DB_USER, DB_PASS, DB_HOST.':'.DB_PORT, DB_NAME);

?>
1 change: 1 addition & 0 deletions cron/error_log
@@ -0,0 +1 @@

144 changes: 144 additions & 0 deletions cron/generateSiteMap.php
@@ -0,0 +1,144 @@
<?php
/**
* This is meant to be called from cron.
* It will send off the ealerts.
*/

require_once("bootstrap.php");

$filename = EXP_PATH . 'sitemap.xml';

$content="<?xml version='1.0' encoding='UTF-8'?>".chr(13).chr(10);
$content.="<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>".chr(13).chr(10);

if (is_writable($filename))
{
if (!$handle = fopen($filename, 'w')) {
echo "Cannot open file ($filename)";
exit;
}
// Write$somecontent to our opened file.
if (fwrite($handle, $content) == FALSE) {
$action_msg = "ER";
}
}
else
{
echo "$filename is not writeable.";
}

$count=0;
$columns = '';

//$ps = new product();
//$prodCount = $ps->find('count','parent_id=0 AND (availability_type=0 OR availability_type=1)');
//print "\n" . $prodCount . "\n";
//print "\n";

$sections = $db->selectObjectsBySql('SELECT sef_name FROM exponent_section WHERE public = 1 and active = 1');

//Sections
foreach ($sections as $item) {

$columns = '<url>'.chr(13).chr(10);


$columns.='<loc>';
$columns.="http://www.militaryuniformsupply.com/".$item->sef_name;
$columns.='</loc>'.chr(13).chr(10);

$columns.='<lastmod>';
$columns.= date('Y-m-d');
$columns.='</lastmod>'.chr(13).chr(10);

$columns.='<changefreq>';
$columns.= "weekly";
$columns.='</changefreq>'.chr(13).chr(10);

$columns.='<priority>';
$columns.= "0.5";
$columns.='</priority>'.chr(13).chr(10);

$columns.='</url>'.chr(13).chr(10);
$count++;
//size
// Write$somecontent to our opened file.
if (fwrite($handle, $columns.chr(13).chr(10)) == FALSE) {
$action_msg = "ER";
}
}

//Categories
$categories = $db->selectObjectsBySql('SELECT sef_url FROM exponent_storeCategories WHERE is_active = 1');
foreach ($categories as $item) {

$columns = '<url>'.chr(13).chr(10);

$columns.='<loc>';
$columns.="http://www.militaryuniformsupply.com/".$item->sef_url;
$columns.='</loc>'.chr(13).chr(10);

$columns.='<lastmod>';
$columns.= date('Y-m-d');
$columns.='</lastmod>'.chr(13).chr(10);

$columns.='<changefreq>';
$columns.= "weekly";
$columns.='</changefreq>'.chr(13).chr(10);

$columns.='<priority>';
$columns.= "0.5";
$columns.='</priority>'.chr(13).chr(10);

$columns.='</url>'.chr(13).chr(10);
$count++;
//size
// Write$somecontent to our opened file.
if (fwrite($handle, $columns.chr(13).chr(10)) == FALSE) {
$action_msg = "ER";
}
}


//Products
$products = $db->selectObjectsBySql("SELECT sef_url FROM exponent_product WHERE (active_type = 0 or active_type = 1) and parent_id = 0");
foreach ($products as $item) {

$columns = '<url>'.chr(13).chr(10);

$columns.='<loc>';
$columns.="http://www.militaryuniformsupply.com/".$item->sef_url;
$columns.='</loc>'.chr(13).chr(10);

$columns.='<lastmod>';
$columns.= date('Y-m-d');
$columns.='</lastmod>'.chr(13).chr(10);

$columns.='<changefreq>';
$columns.= "weekly";
$columns.='</changefreq>'.chr(13).chr(10);

$columns.='<priority>';
$columns.= "0.5";
$columns.='</priority>'.chr(13).chr(10);

$columns.='</url>'.chr(13).chr(10);
$count++;
//size
// Write$somecontent to our opened file.
if (fwrite($handle, $columns.chr(13).chr(10)) == FALSE) {
$action_msg = "ER";
}
}

$content='</urlset>'.chr(13).chr(10);

// Write$somecontent to our opened file.
if (fwrite($handle, $content) == FALSE) {
$action_msg = "ER";
}
$action_msg = "SC";
fclose($handle);
echo "\r\nGenerated $count products in the feed.\r\n";

?>

0 comments on commit fd1e450

Please sign in to comment.