<?php /** * Copyright: dtbaker 2012 * Licence: Please check CodeCanyon.net for licence details. * More licence clarification available here: http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca * Package Date: 2015-11-25 02:55:20 * IP Address: 67.79.165.254 */ if (!module_social::can_i('edit', 'Twitter', 'Social', 'social')) { die('No access to Twitter accounts'); } $social_twitter_id = isset($_REQUEST['social_twitter_id']) ? (int) $_REQUEST['social_twitter_id'] : 0; $twitter_account = new ucm_twitter_account($social_twitter_id); if ($twitter_account->get('social_twitter_id') && $twitter_account->get('social_twitter_id') == $social_twitter_id) { // do a quick oauth. require_once 'includes/plugin_social_twitter/includes/tmhOAuth.php'; class dtbaker_tmhOAuth extends tmhOAuth { public function __construct($config = array()) { $this->config = array_merge(array('consumer_key' => module_config::c('social_twitter_api_key', ''), 'consumer_secret' => module_config::c('social_twitter_api_secret', ''), 'user_agent' => 'UCM Twitter 0.1'), $config); parent::__construct($this->config); } } $tmhOAuth = new dtbaker_tmhOAuth(); function php_self($dropqs = true) { $protocol = 'http';
public function get_api() { if (!self::$api) { require_once 'includes/plugin_social_twitter/includes/tmhOAuth.php'; self::$api = new tmhOAuth(array('consumer_key' => module_config::c('social_twitter_api_key', ''), 'consumer_secret' => module_config::c('social_twitter_api_secret', ''), 'token' => $this->get('user_key'), 'secret' => $this->get('user_secret'), 'user_agent' => 'UCM Twitter 0.1')); } return self::$api; }
<?php /** * Copyright: dtbaker 2012 * Licence: Please check CodeCanyon.net for licence details. * More licence clarification available here: http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca * Package Date: 2015-11-25 02:55:20 * IP Address: 67.79.165.254 */ if (!module_social::can_i('edit', 'Twitter', 'Social', 'social')) { die('No access to Twitter accounts'); } $social_twitter_id = isset($_REQUEST['social_twitter_id']) ? (int) $_REQUEST['social_twitter_id'] : 0; $twitter_account = new ucm_twitter_account($social_twitter_id); ?> Manually refreshing twitter data... <?php $twitter_account->import_data(true);
<?php /** * Copyright: dtbaker 2012 * Licence: Please check CodeCanyon.net for licence details. * More licence clarification available here: http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca * Package Date: 2015-11-25 02:55:20 * IP Address: 67.79.165.254 */ if (module_social::can_i('view', 'Twitter Comments', 'Social', 'social')) { $social_twitter_id = isset($_REQUEST['social_twitter_id']) ? (int) $_REQUEST['social_twitter_id'] : 0; $twitter = new ucm_twitter_account($social_twitter_id); if ($social_twitter_id && $twitter->get('social_twitter_id') == $social_twitter_id) { $module->page_title = $twitter->get('account_name'); $header = array('title' => $twitter->get('account_name'), 'type' => 'h2', 'main' => true, 'button' => array()); if (module_social::can_i('create', 'Twitter Comments', 'Social', 'social')) { $header['button'] = array('url' => module_social_twitter::link_open_twitter_message($social_twitter_id, false), 'title' => _l('Compose Tweet'), 'type' => 'add', 'class' => 'socialtwitter_message_open social_modal', 'id' => 'socialtwitter_message_compose'); } print_heading($header); $search = isset($_REQUEST['search']) && is_array($_REQUEST['search']) ? $_REQUEST['search'] : array(); if (!isset($search['status'])) { $search['status'] = _SOCIAL_MESSAGE_STATUS_UNANSWERED; } $all_messages = $twitter->get_messages($search); ?> <script type="text/javascript"> $(function(){ $('#socialtwitter_message_compose').attr('data-modal-title','<?php _e('Compose Tweet');
echo htmlspecialchars($twitter_message->get_type_pretty()); ?> </div> <div id="twitter_message_holder"> <?php $twitter_message->full_message_output(module_social::can_i('create', 'Twitter Comments', 'Social', 'social')); ?> </div> </form> <?php } } } if ($social_twitter_id && !$social_twitter_message_id && module_social::can_i('create', 'Twitter Comments', 'Social', 'social')) { $twitter = new ucm_twitter_account($social_twitter_id); if ($social_twitter_id && $twitter->get('social_twitter_id') == $social_twitter_id) { $module->page_title = $twitter->get('twitter_name'); /* @var $pages ucm_twitter_page[] */ $pages = $twitter->get('pages'); //print_r($pages); ?> <form action="<?php echo module_social_twitter::link_open_message_view($social_twitter_id); ?> " method="post" enctype="multipart/form-data"> <input type="hidden" name="_process" value="send_twitter_message"> <?php module_form::print_form_auth(); ?>
public static function run_cron() { if (module_social::is_plugin_enabled() && self::is_plugin_enabled()) { $accounts = self::get_accounts(); foreach ($accounts as $account) { $twitter_account = new ucm_twitter_account($account['social_twitter_id']); $twitter_account->import_data(module_config::c('debug_cron_jobs', 0)); } } }
<?php /** * Copyright: dtbaker 2012 * Licence: Please check CodeCanyon.net for licence details. * More licence clarification available here: http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca * Package Date: 2015-11-25 02:55:20 * IP Address: 67.79.165.254 */ if (!module_social::can_i('edit', 'Twitter', 'Social', 'social')) { die('No access to Twitter accounts'); } $social_twitter_id = isset($_REQUEST['social_twitter_id']) ? (int) $_REQUEST['social_twitter_id'] : 0; $twitter = new ucm_twitter_account($social_twitter_id); $heading = array('type' => 'h3', 'title' => 'Twitter Account'); ?> <form action="" method="post"> <input type="hidden" name="_process" value="save_twitter"> <input type="hidden" name="social_twitter_id" value="<?php echo $twitter->get('social_twitter_id'); ?> "> <?php module_form::print_form_auth(); $fieldset_data = array('heading' => $heading, 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array(array('title' => _l('Account Name'), 'field' => array('type' => 'text', 'name' => 'account_name', 'value' => $twitter->get('account_name'), 'help' => 'Choose a name for this account. This name will be shown here in the system.')))); // check if this is active, if not prmopt the user to re-connect. if ($twitter->is_active()) {
" class="socialfacebook_message_open social_modal btn btn-success btn-sm" data-modal-title="<?php _e('Compose Post'); ?> "><?php _e('Compose Post'); ?> </a> </td> </tr> <?php } } if (module_social::can_i('create', 'Twitter Comments', 'Social', 'social')) { $accounts = module_social_twitter::get_accounts(); foreach ($accounts as $account) { $twitter_account = new ucm_twitter_account($account['social_twitter_id']); ?> <tr class="<?php echo $c++ % 2 ? "odd" : "even"; ?> "> <td class="row_action"> <img src="<?php echo _BASE_HREF; ?> includes/plugin_social_twitter/images/twitter-logo.png" class="twitter_icon"> <?php echo htmlspecialchars($twitter_account->get('account_name')); ?> <br/>