This file contains 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
<?php | |
// displays some comments for a certain url | |
$url = 'http://developers.facebook.com/docs/reference/fql/comment/'; | |
// fql multiquery to fetch all the data we need to display in one go | |
$queries = array('q1' => 'select post_fbid, fromid, object_id, text, time from comment where object_id in (select comments_fbid from link_stat where url ="'.$url.'")', | |
'q2' => 'select post_fbid, fromid, object_id, text, time from comment where object_id in (select post_fbid from #q1)', | |
'q3' => 'select name, id, url, pic_square from profile where id in (select fromid from #q1) or id in (select fromid from #q2)', | |
); |
This file contains 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
//pass the function the MySQL standardized date and retreive a date relative to wordpress GMT and wordpress date and time display options | |
if(!function_exists('sm_display_date')) { function sm_display_date($mysqldate) { | |
$display_date = date_i18n( get_option('date_format').' '.get_option('time_format'),strtotime($mysqldate), get_option('gmt_offset') ); | |
return $display_date; | |
}} | |
//pass the function a UNIX TIMESTAMP or "Properly Formated Date/Time" and retreive a date formated for MySQL database date field type | |
//optionally pass a number of days to return a time XX days before or after the date/time sent | |
if(!function_exists('sm_mysql_date')) { function sm_mysql_date($time, $days = 0) { | |
$seconds = 60*60*24*$days; |
This file contains 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
// now upload the new images | |
$postvals = cp_process_new_image($_POST['ad_id']); | |
// associate the already uploaded images to the ad and create multiple image sizes | |
$attach_id = cp_associate_images($_POST['ad_id'], $postvals['attachment']); | |
//process each image thats being uploaded | |
function cp_process_new_image() { | |
global $wpdb; | |
$postvals = ''; |
This file contains 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
jQuery('#file_category').val(4); jQuery('#file_languages\\[\\]').val('en'); jQuery('#file_requirements\\[\\]').val('pdfread');jQuery('#updatefile').submit(); |
This file contains 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
<?php | |
//apparently no need for this... page-SLUG.php matches subpage slugs, | |
//only need this function if subpage slug conflicts occur | |
//Add this code to you themes functions.php file, or some other file. | |
//Next create your child page lets says "domain.com/resources/faq" | |
//Finally, create the php template page following the naming schema: | |
//page-PARENTSLUG-child-CHILDSLUG.php -> page-resources-child-faq.php | |
add_filter( 'page_template', 'enable_child_page_templates' ); | |
function enable_child_page_templates( $page_template ){ |
This file contains 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
<?php | |
//This example encrypts and decrypts a password | |
//it is a good use case for a "php class file" because the __FILE__ is constant for the key | |
//*additional security can be added by storing or defining a unique key per website | |
//using __FILE__ exmaple for class files | |
$pass = 'samplepassword123!'; | |
echo 'Password: '.$pass.'<br />'; | |
$encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, sha1(basename(__FILE__), TRUE), $pass, MCRYPT_MODE_ECB); | |
echo 'Encrypted Pass: '.$encrypted.'<br />'; |
This file contains 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
/* WE ARE ASSUMING JQUERY IS LOADED AND USING jQuery instead of $ */ | |
jQuery(document).ready(function($) { | |
window.setInterval(function(){ | |
/// call your function here | |
$('#increment').trigger('click'); | |
}, 5000); | |
}); | |
/* |
This file contains 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
<apex:page standardStylesheets="false" showHeader="false" sidebar="false"> | |
<apex:stylesheet value="{!URLFOR($Resource.WorkBookStyles, 'styles.css')}" /> |
This file contains 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
<table border="0" cellpadding="0" cellspacing="0" width="400"> | |
<tbody> | |
<tr height="10"> | |
<td height="10" colspan="2"><hr style="height: 1px; border: 0; border-bottom: 1px dashed #ccc; padding: 0; margin: 12px 0 5px 0;" /></td> | |
</tr> | |
<tr style="vertical-align: middle;" height="100"> | |
<td height="100" width="250" style="border-right: 1px dashed #ccc;"><strong>Seth Carstens</strong><br> | |
Rapid Recovery<br> | |
<a href="tel:8773727732">877-372-7732</a> office<br> | |
<a href="tel:4802033753">480-203-3753</a> cell<br> |
This file contains 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 get_base_website_url() { | |
if (!window.location.origin) | |
return window.location.origin = window.location.protocol+"//"+window.location.host; | |
else | |
return window.location.origin; | |
} |