Exemplo n.º 1
0
require_once JPATH_COMPONENT . '/helpers/helper.php';
$app = JFactory::getApplication();
$params = JComponentHelper::getParams(S_APP_NAME);
define('S_DEBUG_ENABLED', $params->get('enable_debugging', 0) == '1');
CJFunctions::load_component_language(S_APP_NAME);
$task = $app->input->getCmd('task');
if (strpos($task, '.') !== false) {
    $controller = JControllerLegacy::getInstance('CommunitySurveys');
    $controller->execute($task);
    $controller->redirect();
} else {
    if ($params->get('enable_bootstrap', true)) {
        CJLib::import('corejoomla.ui.bootstrap', false);
    }
    CJFunctions::load_jquery(array('libs' => array('fontawesome')));
    $view = $app->input->getCmd('view', 'survey');
    if (JFile::exists(JPATH_COMPONENT . '/controllers/' . $view . '.php')) {
        require_once JPATH_COMPONENT . '/controllers/' . $view . '.php';
    } else {
        return CJFunctions::throw_error('View ' . JString::ucfirst($view) . ' not found!', 500);
    }
    $controller = new CommunitySurveysController();
    $controller->execute();
    $format = $app->input->getCmd('format');
    if ($format != 'raw' && $format != 'json') {
        $return = CJFunctions::send_messages_from_queue();
        if ($params->get('enable_credits', 1) == '1') {
            echo '';
        }
    }
}
Exemplo n.º 2
0
 public function process_queue($cids)
 {
     JArrayHelper::toInteger($cids);
     if (CJFunctions::send_messages_from_queue(count($cids), 0, false, $cids)) {
         return true;
     }
     return false;
 }
Exemplo n.º 3
0
 * @link		http://www.corejoomla.com/
 * @license		License GNU General Public License version 2 or later
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
require_once 'framework.php';
require_once JPATH_COMPONENT . DS . 'controller.php';
CJLib::import('corejoomla.framework.core');
$config = CJLib::get_cjconfig();
$task = JRequest::getCmd('task', '');
$secret = JRequest::getCmd('secret', null);
$component = 'com_cjlib';
if ($task == 'process' && !empty($secret) && strcmp($config['cron_secret'], $secret) == 0) {
    $emails = (int) $config['cron_emails'];
    $delay = (int) $config['cron_delay'];
    $sent = CJFunctions::send_messages_from_queue($emails, $delay, false);
    if (!empty($sent)) {
        echo json_encode($sent);
    }
} else {
    if ($task = 'socialcounts') {
        require_once CJLIB_PATH . DS . 'jquery' . DS . 'social' . DS . 'socialcounts.php';
        $url = base64_decode(JFactory::getApplication()->input->getString('url'));
        if (!SocialCount::REQUIRE_LOCAL_URL || SocialCount::isLocalUrl($url)) {
            try {
                $social = new SocialCount($url);
                $social->addNetwork(new Twitter());
                $social->addNetwork(new Facebook());
                $social->addNetwork(new GooglePlus());
                // $social->addNetwork(new ShareThis());
                echo $social->toJSON();