This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function export_connect_csv(user_id, res){ | |
ConnectModel.mysqlPool.getConnection(function(err, connection){ | |
res.header('Content-Type', 'text/csv'); | |
var csv_header_row = "Email,First Name,Last Name,Status,Created\n"; | |
res.write(csv_header_row); | |
var query = connection.query('SELECT * FROM connects where user_id = ? AND deleted = 0', [user_id]); | |
query | |
.on('error', function(err) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function export_connect_csv(user_id, res){ | |
ConnectModel.mysqlPool.getConnection(function(err, connection){ | |
res.header('Content-Type', 'text/csv'); | |
var csv_header_row = "Email,First Name,Last Name,Status,Created\n"; | |
res.write(csv_header_row); | |
var query = connection.query('SELECT * FROM connects where user_id = ? AND deleted = 0', [user_id]); | |
query | |
.on('error', function(err) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function export_connect_csv(user_id, file_location){ | |
mysqlPool.getConnection(function(err, connection){ | |
var csv_row = "Email,First Name,Last Name,Status,Created\n"; | |
function processRow (row) { | |
var csv_row = row.email+','+row.first_name+','+row.last_name+','+row.status+','+row.created+"\n"; | |
fs.appendFile(file_location, csv_row, function (err) { | |
if(err){ | |
throw err; | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_insert_post', 'wpexpo_on_publish'); | |
function wpexpo_on_publish($post_id){ | |
if ( !wp_is_post_revision( $post_id ) ) { | |
$post_status = get_post_status($post_id); | |
if($post_status == 'publish' and (isset($_POST['original_publish']) and $_POST['original_publish'] == 'Publish')){ | |
//codes here | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
, S = require('string') | |
, moment = require('moment') | |
, redis = require('redis') | |
, RedisStore = require('connect-redis')(express) | |
, rClient = exports.rClient = redis.createClient() | |
, sessionStore = exports.sessionStore = new RedisStore({client: rClient}) | |
, app = express() | |
, cfg = require('./config/app_conf') | |
, passport = require('passport') |
NewerOlder