6221
amin_ts
Re: blank page
  • 2014/12/23 6:20

  • amin_ts

  • Just popping in

  • Posts: 70

  • Since: 2005/3/6 1


I cleared cashe but home page is blank yet!
PHP version 5.3.29

my other web sites open normally after upgrading to 2.5.7.1 with this version of PHP



6222
wishcraft
Cron4://cron-twits.php - Executable CronJob or Sceduduled Task -- forums, tag's categories!!

Executable CronJob or Sceduduled Task -- forums, tag's categories!!


/**
 *  Xoops Functions
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
 * @package         crons
 * @since           2.5.7
 * @version         $Id: cron-twits.php XXXXX XXXX-XX-XX XX:XX:XXZ xxxxxx $
 */ 

error_reporting(E_ERROR);
set_time_limit(2999);
ini_set('display_errors'1);
ini_set('error_log'dirname(__FILE__) . DIRECTORY_SEPARATOR "errors.txt");
require_once(
dirname(__FILE__) . DIRECTORY_SEPARATOR "TwitterAPIExchange.php");
/**
 * Gets a response from a URL with cURL or wGET
 * @param string $url
 * @param array $params
 * @param string $context
 * @param array $header
 * @param string $method
 * @return string|mixed|boolean
 */
function getURL($url$params$context ''$header = array(), $method 'GET') {
    if (!
function_exists('curl_init')||$method=='FGC') {
        
$url .= '?'.http_build_query($params);
        
$data file_get_contents$url0$context );
        return 
$data;
    } else {
        if (
$ch curl_init()) {
            if (!
is_array($header))
                
$header explode("n"str_replace("r"""$header));
            if (
count($header)>0)
                
curl_setopt($ch,CURLOPT_HTTPHEADER$header);
            switch(
$method) {
                default:
                case 
'GET':
                    
$url .= '?'.http_build_query($params);
                    break;
                case 
'POST':
                    
curl_setopt($chCURLOPT_POST1);
                    
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($params));
            }
            
curl_setopt($chCURLOPT_URL$url);
            
//curl_setopt($ch, CURLOPT_HEADER, 1);
            
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER0);
            
curl_setopt($chCURLOPT_SSL_VERIFYHOSTfalse);
            
curl_setopt($chCURLOPT_RETURNTRANSFER1);
            
curl_setopt($chCURLOPT_USERAGENT'Chronolabs Translation API 1.02 - PHP Version ' PHP_VERSION.'');
            
$data curl_exec($ch);
            
curl_close($ch);
            return 
$data;
        }
    }
    return 
false;
}
error_reporting(E_ERROR);
$settings['twitter']['Cipherocity'] = array(
        
'oauth_access_token' => "----------------------------------------------------",
        
'oauth_access_token_secret' => ""----------------------------------------------------",
        'consumer_key' => ""----------------------------------------------------"
,
        
'consumer_secret' => ""----------------------------------------------------"
);
define("
_REPLY", "@%s topic similar %s this article %s entitled'%s'");
mt_srand(mt_rand(-microtime(true), microtime(true)));
mt_srand(mt_rand(-microtime(true), microtime(true)));
mt_srand(mt_rand(-microtime(true), microtime(true)));
mt_srand(mt_rand(-microtime(true), microtime(true)));
error_reporting(E_ERROR);
include_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "
web" . DIRECTORY_SEPARATOR . "public_html" . DIRECTORY_SEPARATOR . "mainfile.php";
if (isset(
$GLOBALS['xoops']))
    include_once 
$GLOBALS['xoops']->path("/class/cache/xoopscache.php");
ini_set('display_errors', 1);
ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . "
errors.txt");
error_reporting(E_ERROR);

foreach (
$settings['twitter'] as $key => $setting) {
    
$tweets = array();
    foreach(file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'retweet.diz') as 
$id => $line)
    {
        
$parts = explode("|", $line);
        
$range = explode("-", $parts[1]);
        
$searchfor[$id][$parts[0]] = mt_rand($range[0]$range[1]);
    }
    foreach(
$searchfor as $term => $count) {
        if (defined('XOOPS_ROOT_PATH'))
            if (!
$results = XoopsCache:: read('tweetercron_'.str_replace(' ', '_', strtolower($term)))) {
                
$results = array('since_id'=>0);
            }
        else
            
$results = array('since_id'=>0);
        
$url = 'https://api.twitter.com/1.1/search/tweets.json';
        
$getfield = '?q='.urlencode($term).'&'.($result['since_id']!=0?'since_id='.$result['since_id'].'&':'').'result_type=mixed&count='.$count;
        
$postfields = array();
        
$requestMethod = 'GET';
        
$twitter = new TwitterAPIExchange($setting);
        
$tweets[] = array_merge(json_decode($twitter    ->setGetfield($getfield)
                                                        ->buildOauth(
$url$requestMethod)
                                                        ->performRequest(), true), array('count' => 
$count));
    }            
    foreach(
$tweets as $keyb => $tweet
    {
        if (
$tweet['user']['screen_name'] != $key
        {
            if (is_array(
$tweet)&&!empty($tweet)) 
            {
                
$count = $tweet['count'];
                
$keys = array_keys($tweet);
                while(count(
$tweet)>$count) {
                    
$key = $keys[mt_rand(0, count($keys)-1)];
                    unset(
$tweet[$key]);
                    unset(
$keys[$key]);
                }
                foreach(
$tweet as $key => $values
                {
                    if (
$values['user']['screen_name'] != $key
                    {
                        switch (
$key
                        {
                            case 'statuses':
                                foreach(
$values as $keyb => $valuesb
                                {

                                    
$url = 'https://api.twitter.com/1.1/statuses/retweet/'.$valuesb['id_str'].'.json';
                                    
$requestMethod = 'POST';
                                    
$postfields = array();
                                    
$twitter = new TwitterAPIExchange($setting);
                                    
$retweets[] = json_decode($twitter    ->buildOauth($url$requestMethod)
                                                                        ->setPostfields(
$postfields)
                                                                        ->performRequest(), true);
                                    echo "
Retweeted" . ($last = $valuesb['id_str']) . " :: " . $valuesb['text'] . "br>";
                                }
                                if (defined('XOOPS_ROOT_PATH') && class_exists("
XoopsCache"))
                                    XoopsCache::write('tweetercron_'.str_replace(' ', '_', strtolower(
$term)), array('since_id'=>$last));
                                break;
                            case 'search_metadata':
                                if (defined('XOOPS_ROOT_PATH') && class_exists("
XoopsCache"))
                                    XoopsCache::write('tweetercron_'.str_replace(' ', '_', strtolower(
$term)), array('since_id'=>$values['since_id']));
                                break;
                        }
                    }
                }
            }
        }
    }
        
    
$tweets = array();
    
$searchfor = array();
    
$resulters = array();
    foreach(file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'replies.diz') as 
$id => $line)
    {
        
$parts = explode("|", $line);
        
$range = explode("-", $parts[2]);
        foreach(json_decode(getURL(
$parts[1]), true) as $term => $data
            
$searchfor[$term][mt_rand($range[0]$range[1])] = array_merge($data, array("suffix" => $parts[0]));
    }
    foreach(
$searchfor as $tterm => $resource
    {
        
$skip = false;
        foreach(
$resource as $count => $data)
        {
            if (
$skip != true)
            {
                foreach(
$data as $identy => $termset
                {
                    if (
$skip != true)
                    {
                        
$secondary = $termidor = array_merge(explode(" ", $termset["title"]), $termset['plus']);
                        shuffle(
$termidor);
                        shuffle(
$termidor);
                        shuffle(
$termidor);
                        shuffle(
$termidor);
                        shuffle(
$termidor);
                        shuffle(
$secondary);
                        shuffle(
$secondary);
                        shuffle(
$secondary);
                        shuffle(
$secondary);
                        shuffle(
$secondary);    
                        foreach(
$termidor as $tteerm) {                
                            foreach(
$secondary as $stteerm)
                            {
                                if (
$skip != true && $stteerm != $tteerm)
                                {
                                    
$resulters[$term = $tterm . " " . $tteerm . " " . $stteerm] = array('title' => $termset['title'], 'url' => $termset['url'], 'count' => $count);                        
                                    if (defined('XOOPS_ROOT_PATH'))
                                        if (!
$results = XoopsCache:: read('twitscron_'.str_replace(' ', '_', strtolower($term)))) {
                                            
$results = array('since_id'=>0);
                                        }
                                    else
                                        
$results = array('since_id'=>0);
        
                                    
$url = 'https://api.twitter.com/1.1/search/tweets.json';
                                    
$getfield = '?q='.urlencode($term).'&'.($result['since_id']!=0?'since_id='.$result['since_id'].'&':'').'result_type=mixed&count='.$count;
                                    
$postfields = array();
                                    
$requestMethod = 'GET';
                                    
$twitter = new TwitterAPIExchange($setting);
                                    
$rrt = $rrt + count($tweets[$term][$termset['suffix']][] = json_decode($twitter    ->setGetfield($getfield)
                                            ->buildOauth(
$url$requestMethod)
                                            ->performRequest(), true));
                                    if (
$rrt >= $count)
                                        
$skip = true;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
$keys = array_keys($resulters);
    shuffle(
$keys);
    shuffle(
$keys);
    shuffle(
$keys);
    shuffle(
$keys);
    shuffle(
$keys);
    foreach(
$keys as $term) {
        foreach(
$tweets[$term] as $suffix => $twits) {
            foreach(
$twits as $keyb => $tweet) {
                if (
$tweet['user']['screen_name'] != $key) {
                    if (is_array(
$tweet)&&!empty($tweet)) {
                        
$number = 0;
                        
$count = $resulters[$term]['count'];
                        
$keys = array_keys($tweet);
                        while(count(
$tweet)>$count) {
                            
$key = $keys[mt_rand(0, count($keys)-1)];
                            unset(
$tweet[$key]);
                            unset(
$keys[$key]);
                        }
                        if (!count(
$tweet['errors']))
                        {
                            foreach(
$tweet as $key => $values) {
                                if (
$values['user']['screen_name'] != $key) {
                                    switch (
$key) {
                                        case 'statuses':
                                            foreach(
$values as $keyb => $valuesb) {
                                                
                                                    
$geoRand = json_decode(getURL("http://places.labs.coop/v1/random/random/json.api"), true);
                                                    
$url 'https://api.twitter.com/1.1/statuses/update.json';
                                                    
$requestMethod 'POST';
                                                    
$res sprintf(_REPLY$valuesb['user']['screen_name'], $suffix$resulters[$term]['url'], $resulters[$term]['title']);
                                                    
$postfields = array('status' => $res'in_reply_to_status_id' => $valuesb['id_str'], 'possibly_sensitive' => 'true''lat' => (float)$geoRand['place']["Latitude_Float"], 'long' => (float)$geoRand['place']["Longitude_Float"], 'display_coordinates' => 'true');
                                                    
$twitter = new TwitterAPIExchange($setting);
                                                    
$retweets[] = json_decode($twitter    ->buildOauth($url$requestMethod)
                                                            ->
setPostfields($postfields)
                                                            ->
performRequest(), true);
                                                    echo 
"Reply: " . ($last $valuesb['id_str']) . " :: " $res "
"
;
                                                    
$number++;
                                            }
                                            if (
defined('XOOPS_ROOT_PATH') && class_exists("XoopsCache"))
                                                
XoopsCache::write('twitscron_'.str_replace(' ''_'strtolower($term)), array('since_id'=>$last));
                                            break;
                                        case 
'search_metadata':
                                            if (
defined('XOOPS_ROOT_PATH') && class_exists("XoopsCache"))
                                                
XoopsCache::write('twitscron_'.str_replace(' ''_'strtolower($term)), array('since_id'=>$values['since_id']));
                                            break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    
    
$url 'https://api.twitter.com/1.1/followers/ids.json';
    
$getfield 'cursor=-1&screen_name='.$key.'&count=5000';
    
$requestMethod 'GET';
    
$postfields = array();
    
$twitter = new TwitterAPIExchange($setting);
    
$friends $twitter    ->setGetfield($getfield)
                         ->
buildOauth($url$requestMethod)
                        ->
performRequest();

    if (isset(
$friends['ids'])) {
        foreach(
$friends['ids'] as $id) {
            
$url 'https://api.twitter.com/1.1/friendships/create.json ';
            
$requestMethod 'POST';
            
$postfields = array('user_id'=>$id'follow'=>true);
            
$twitter = new TwitterAPIExchange($setting);
            
$friends $twitter    ->buildOauth($url$requestMethod)
                                ->
setPostfields($postfields)
                                ->
performRequest();        
        }
    }
}

?>



6223
wishcraft
Cron3://TwitterAPIExchange.php - tweetable.php to dial for replies -- forums, tag's categories!!

PHP - Linux - (With tag's,categories!! Lookup)

This example shows a class for talking to the Twitter API 1.1 on twitter with an application with write mode enabled set up as an application token system with http://apps.twitter.com


/**
 * Twitter-API-PHP : Simple PHP wrapper for the v1.1 API
 * 
 * PHP version 5.3.10
 * 
 * @category Awesomeness
 * @package  Twitter-API-PHP
 * @author   James Mallison 
 * @license  MIT License
 * @link     http://github.com/j7mbo/twitter-api-php
 */
class TwitterAPIExchange
{
    private 
$oauth_access_token;
    private 
$oauth_access_token_secret;
    private 
$consumer_key;
    private 
$consumer_secret;
    private 
$postfields;
    private 
$getfield;
    protected 
$oauth;
    public 
$url;

    
/**
     * Create the API access object. Requires an array of settings::
     * oauth access token, oauth access token secret, consumer key, consumer secret
     * These are all available by creating your own application on dev.twitter.com
     * Requires the cURL library
     * 
     * @param array $settings
     */
    
public function __construct(array $settings)
    {
        if (!
in_array('curl'get_loaded_extensions())) 
        {
            throw new 
Exception('You need to install cURL, see: http://curl.haxx.se/docs/install.html');
        }
        
        if (!isset(
$settings['oauth_access_token'])
            || !isset(
$settings['oauth_access_token_secret'])
            || !isset(
$settings['consumer_key'])
            || !isset(
$settings['consumer_secret']))
        {
            throw new 
Exception('Make sure you are passing in the correct parameters');
        }

        
$this->oauth_access_token $settings['oauth_access_token'];
        
$this->oauth_access_token_secret $settings['oauth_access_token_secret'];
        
$this->consumer_key $settings['consumer_key'];
        
$this->consumer_secret $settings['consumer_secret'];
    }
    
    
/**
     * Set postfields array, example: array('screen_name' => 'J7mbo')
     * 
     * @param array $array Array of parameters to send to API
     * 
     * @return TwitterAPIExchange Instance of self for method chaining
     */
    
public function setPostfields(array $array)
    {
        if (!
is_null($this->getGetfield())) 
        { 
            throw new 
Exception('You can only choose get OR post fields.'); 
        }
        
        if (isset(
$array['status']) && substr($array['status'], 01) === '@')
        {
            
$array['status'] = sprintf("%s"$array['status']);
        }
        
        
$this->postfields $array;
        
        return 
$this;
    }
    
    
/**
     * Set getfield string, example: '?screen_name=J7mbo'
     * 
     * @param string $string Get key and value pairs as string
     * 
     * @return TwitterAPIExchange Instance of self for method chaining
     */
    
public function setGetfield($string)
    {
        if (!
is_null($this->getPostfields())) 
        { 
            throw new 
Exception('You can only choose get OR post fields.'); 
        }
        
        
$search = array('#'',''+'':');
        
$replace = array('%23''%2C''%2B''%3A');
        
$string str_replace($search$replace$string);  
        
        
$this->getfield $string;
        
        return 
$this;
    }
    
    
/**
     * Get getfield string (simple getter)
     * 
     * @return string $this->getfields
     */
    
public function getGetfield()
    {
        return 
$this->getfield;
    }
    
    
/**
     * Get postfields array (simple getter)
     * 
     * @return array $this->postfields
     */
    
public function getPostfields()
    {
        return 
$this->postfields;
    }
    
    
/**
     * Build the Oauth object using params set in construct and additionals
     * passed to this method. For v1.1, see: https://dev.twitter.com/docs/api/1.1
     * 
     * @param string $url The API url to use. Example: https://api.twitter.com/1.1/search/tweets.json
     * @param string $requestMethod Either POST or GET
     * @return TwitterAPIExchange Instance of self for method chaining
     */
    
public function buildOauth($url$requestMethod)
    {
        if (!
in_array(strtolower($requestMethod), array('post''get')))
        {
            throw new 
Exception('Request method must be either POST or GET');
        }
        
        
$consumer_key $this->consumer_key;
        
$consumer_secret $this->consumer_secret;
        
$oauth_access_token $this->oauth_access_token;
        
$oauth_access_token_secret $this->oauth_access_token_secret;
        
        
$oauth = array( 
            
'oauth_consumer_key' => $consumer_key,
            
'oauth_nonce' => time(),
            
'oauth_signature_method' => 'HMAC-SHA1',
            
'oauth_token' => $oauth_access_token,
            
'oauth_timestamp' => time(),
            
'oauth_version' => '1.0'
        
);
        
        
$getfield $this->getGetfield();
        
        if (!
is_null($getfield))
        {
            
$getfields str_replace('?'''explode('&'$getfield));
            foreach (
$getfields as $g)
            {
                
$split explode('='$g);
                
$oauth[$split[0]] = $split[1];
            }
        }
        
        
$base_info $this->buildBaseString($url$requestMethod$oauth);
        
$composite_key rawurlencode($consumer_secret) . '&' rawurlencode($oauth_access_token_secret);
        
$oauth_signature base64_encode(hash_hmac('sha1'$base_info$composite_keytrue));
        
$oauth['oauth_signature'] = $oauth_signature;
        
        
$this->url $url;
        
$this->oauth $oauth;
        
        return 
$this;
    }
    
    
/**
     * Perform the actual data retrieval from the API
     * 
     * @param boolean $return If true, returns data.
     * 
     * @return string json If $return param is true, returns json data.
     */
    
public function performRequest($return true)
    {
        if (!
is_bool($return)) 
        { 
            throw new 
Exception('performRequest parameter must be true or false'); 
        }
        
        
$header = array($this->buildAuthorizationHeader($this->oauth), 'Expect:');
        
        
$getfield $this->getGetfield();
        
$postfields $this->getPostfields();

        
$options = array( 
            
CURLOPT_HTTPHEADER => $header,
            
CURLOPT_HEADER => false,
            
CURLOPT_URL => $this->url,
            
CURLOPT_RETURNTRANSFER => true,
            
CURLOPT_TIMEOUT => 10,
        );

        if (!
is_null($postfields))
        {
            
$options[CURLOPT_POSTFIELDS] = $postfields;
        }
        else
        {
            if (
$getfield !== '')
            {
                
$options[CURLOPT_URL] .= $getfield;
            }
        }

        
$feed curl_init();
        
curl_setopt_array($feed$options);
        
$json curl_exec($feed);
        
//var_dump($options);
        //print_r(curl_getinfo($feed), true);
        
        
curl_close($feed);

        if (
$return) { return $json; }
    }
    
    
/**
     * Private method to generate the base string used by cURL
     * 
     * @param string $baseURI
     * @param string $method
     * @param array $params
     * 
     * @return string Built base string
     */
    
private function buildBaseString($baseURI$method$params
    {
        
$return = array();
        
ksort($params);
        
        foreach(
$params as $key=>$value)
        {
            
$return[] = "$key=" $value;
        }
        
        return 
$method "&" rawurlencode($baseURI) . '&' rawurlencode(implode('&'$return)); 
    }
    
    
/**
     * Private method to generate authorization header used by cURL
     * 
     * @param array $oauth Array of oauth data generated by buildOauth()
     * 
     * @return string $return Header used by cURL for request
     */    
    
private function buildAuthorizationHeader($oauth
    {
        
$return 'Authorization: OAuth ';
        
$values = array();
        
        foreach(
$oauth as $key => $value)
        {
            
$values[] = "$key="" . rawurlencode($value) . """;
        }
        
        
$return .= implode(', '$values);
        return 
$return;
    }

}



6224
wishcraft
Cron2://retweets.diz - tweetable.php to dial for replies -- forums, tag's categories!!

PHP - Linux - (With tag's,categories!! Lookup)

This example shows the data file stored on the remote system running the cron, this is a flat text file with Linux Page break for service://retweets.diz

File Contents -:SearchTerm|minimumlot-maximumlot\n
Cipherocity|11-19
ChronolabsCoop
|6-13
PublicHoneypot
|6-13
AusPol
|2-5



6225
wishcraft
Cron1://replies.diz - tweetable.php to dial for replies -- forums, tag's categories!!

PHP - Linux - (With tag's,categories!! Lookup)

This example shows the data file stored on the remote system running the cron, this is a flat text file with Linux Page break for service://replies.diz

File Contents -:SourceOpen|http://Part1-remote-tweetables.php|minimumlot-maximumlot\n
@Cipherocity|http://cipher.labs.coop/tweetable.php|8-13
@hempembassy|http://hempembassy.net/tweetable.php|7-21



6226
wishcraft
Part1://tweetables.php - Includes ie. for wordpress -- forums, tag's categories!!

XOOPS - (With Xforum Lookup)

This example is retrieving the pages with tag categories to receive a dial-able file for crons to find categories of content like a journal for suggestion of links on twitter like where this file is from http://hempembassy.net/tweetable.php..


/**
 *  Xoops Functions
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
 * @package         kernel
 * @since           2.5.7
 * @version         $Id: tweetables.php XXXXX XXXX-XX-XX XX:XX:XXZ xxxxxx $
 */ 


    
$supports = array('xforum''xcenter');
    require_once( 
dirname(__FILE__) . '/mainfile.php' );
    @include_once 
XOOPS_ROOT_PATH "/modules/tag/include/functions.php";
    
    
$module_handler xoops_gethandler('module');
    
$modids = array();
    foreach(
$supports as $dirname) {
        
$mod $module_handler->getByDirname($dirname);
        if (
is_object($mod))
            
$modids[$mod->getVar('mid')] = $mod->getVar('mid');
    }
    
$results = array();
    
$criteria = new criteria('tag_modid'"(" implode(", "$modids) . ")""IN");
    
$criteria->setSort("RAND()");
    
$criteria->setLimit(mt_rand(2242));
    
$links_handler xoops_getmodulehandler('link''tag');
    
$tags_handler xoops_getmodulehandler('tag''tag');
    
$tags $mods_ids $cats_ids $items_ids = array();
    foreach(
$links_handler->getObjects($criteriafalse) as $link)
    {
        
$items_ids[$link->getVar("tag_itemid")] = $link->getVar("tag_itemid");
        
$cats_ids[$link->getVar("tag_catid")] = $link->getVar("tag_catid");
        
$mods_ids[$link->getVar("tag_modid")] = $link->getVar("tag_modid");
        
$obj $tags_handler->get($link->getVar("tag_id"));
        
$tags[$obj->getVar('tag_term')] = array("tag_id" => $obj->getVar('tag_id'), "tag_itemid" => $link->getVar("tag_itemid"));
    }
    
    
$criteria = new CriteriaCompo(new Criteria("o.tag_itemid""(" implode(", "$items_ids) . ")""IN"));
    
$criteria->setOrder('RAND()');
    if (!empty(
$mods_ids)) {
        
$criteria->add( new Criteria("o.tag_modid""(" implode(", "$mods_ids) . ")""IN"));
        if (!empty(
$cats_ids)) {
            
$criteria->add( new Criteria("o.tag_catid""(" implode(", "$cats_ids) . ")""IN"));
        }
    }
    
$items $tags_handler->getItems($criteria); // Tag, imist, start, sort, order, modid, catid
    
$items_module = array();
    
$modules_obj = array();
    if (!empty(
$items)) {
        foreach (
array_keys($items) as $key) {
            
$items_module[$items[$key]["modid"]][$items[$key]["itemid"]] = $tags_handler->getByItem($items[$key]["itemid"], $items[$key]["modid"], $items[$key]["catid"]);
        }
        
$module_handler =& xoops_gethandler('module');
        
$modules_obj $module_handler->getObjects(new Criteria("mid""(" implode(", "array_keys($modids)) . ")""IN"), true);
        foreach (
array_keys($modules_obj) as $mid) {
            try {
                    
                
$dirname $modules_obj[$mid]->getVar("dirname""n");
                
xoops_loadLanguage('modinfo'$dirname);
                
                
// Return related item infomation: title, content, time, uid, all tags
                
foreach(array_keys($items_module[$mid]) as $identy)
                {
                    switch (
$dirname)
                    {
                        case 
"xforum":
                            
$post_handler xoops_getmodulehandler('post'$dirname);
                            
$post $post_handler->get($identy);
                            if (
is_object($post))
                            {
                                
$results[$base root_tag($items_module[$mid][$identy], array_keys($tags))][$identy]['title'] = $post->getVar('subject');
                                
$results[$base][$identy]['url'] = $post->getURL();
                                foreach(
$items_module[$mid][$identy] as $tag_id => $tag)
                                if (!
in_array($tag$tags))
                                    
$results[$base][$identy]['plus'][$tag_id] = $tag;
                            }
                            break;
                        case 
"xcenter":
                            require_once(
$GLOBALS['xoops']->path(_XTR_PATH_PHP_FUNCTIONS));
                            
$content_handler xoops_getmodulehandler('xcenter'$dirname);
                            
$post $content_handler->getContent($identy);
                            if (
is_object($post))
                            {
                                
$results[$base root_tag($items_module[$mid][$identy], array_keys($tags))][$identy]['title'] = $post['title']->getVar('title');
                                
$results[$base][$identy]['url'] = XOOPS_URL "/modules/$dirname/?storyid=$identy";
                                foreach(
$items_module[$mid][$identy] as $tag_id => $tag)
                                if (!
in_array($tag$tags))
                                    
$results[$base][$identy]['plus'][$tag_id] = $tag;
                            }
                            break;
                    }
                }
                
            }
            catch (
Exception $e) { echo "$e
"
; }
        }
    }
    
header('Origin: *');
    
header('Access-Control-Allow-Origin: *');
    
header('Context-type: application/json');
    echo 
json_encode($results);
    exit(
0);
    
    function 
root_tag($res = array(), $tags = array())
    {
        foreach(
$res as $id => $tag)
            if (
in_array($tag$tags))
                return 
$tag;
    }
?>

[size=large]WORDPRESS - (With Categories & Tags Lookup)[/size]

[font=Courier][size=x-large][color=006633]This example is retrieving the pages with tag categories to receive a dial-able file for crons to find categories of content like a journal for suggestion of links on twitter like where this file is from http://simonaroberts.com/tweetable.php..[/color][/size][/font]


[code]

/**
 *  Xoops Functions
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
 * @package         kernel
 * @since           2.5.7
 * @version         $Id: tweetables.php XXXXX XXXX-XX-XX XX:XX:XXZ xxxxxx $
 */ 
    
require_once( dirname(__FILE__) . '/wp-load.php' );
    
$results = array();
    
$objects $wpdb->get_results("SELECT tr.object_id, tt.term_id, tt.count, tm.name FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id INNER JOIN $wpdb->terms AS tm ON tm.term_id = tt.term_id WHERE tt.taxonomy IN ('category', 'post_tag') ORDER BY RAND() LIMIT 10");
    foreach(
$objects as $object)
    {
        
$posts = (array)get_objects_in_term($object->term_id, array('category''post_tag'));
        foreach(
$posts as $id => $post_id
        {

            
$post get_post($post_id'ARRAY');
            
$results[$object->name][$post_id]['title'] = $post->post_title;
            
$results[$object->name][$post_id]['url'] = get_option('home') . "?p=$post_id";
            foreach(
wp_get_object_terms($post_id, array('category''post_tag')) as $term)
                if (
$term->name!=$object->name)
                    
$results[$object->name][$post_id]['plus'][$term->term_id] = $term->name;
        }
            
    }
    
header('Origin: *');
    
header('Access-Control-Allow-Origin: *');
    
header('Context-type: application/json');
    echo 
json_encode($results);
    exit(
0);
?>



6227
wishcraft
Fix for xoops_getBaseDomain::== COOKIE Dependant System ~~ data.iana.org

hhttps://data.iana.org/TLD/tlds-alpha-by-domain.txt
/**
 * YOU SHOULD NOT THIS METHOD, IT WILL BE REMOVED
 */
/**
 * Function to get the base domain name from a URL.
 * credit for this function should goto Phosphorus and Lime, it is released under LGPL.
 *
 * @param string $url the URL to be stripped.
 * @param int    $debug
 * @return string
 * @deprecated
 */
function xoops_getBaseDomain($url$debug 0)
{
    
xoop_load('xoopscache');
    
$base_domain '';
    
$url strtolower($url);

    
// generic tlds (source: http://en.wikipedia.org/wiki/Generic_top-level_domain)
    
if (!$G_TLD XoopsCache::read('gtlds-alpha-by-domain'))
    {
           
$G_TLD array_merge(array('localhost''127.0.0.1''::1''ip6-localhost'), explode("n"file_get_content("https://data.iana.org/TLD/tlds-alpha-by-domain.txt")));
           unset(
$G_TLD[4]);
           
XoopsCache::write('gtlds-alpha-by-domain'$G_TLD[4], 3600 3.751);
    }

    
$C_TLD = array(
    
// active
    
'ac','ad','ae','af','ag','ai','al','am','an','ao','aq','ar','as','at','au','aw','ax','az',
    
'ba','bb','bd','be','bf','bg','bh','bi','bj','bm','bn','bo','br','bs','bt','bw','by','bz',
    
'ca','cc','cd','cf','cg','ch','ci','ck','cl','cm','cn','co','cr','cu','cv','cx','cy','cz',
    
'de','dj','dk','dm','do','dz','ec','ee','eg','er','es','et','eu','fi','fj','fk','fm','fo',
    
'fr','ga','gd','ge','gf','gg','gh','gi','gl','gm','gn','gp','gq','gr','gs','gt','gu','gw',
    
'gy','hk','hm','hn','hr','ht','hu','id','ie','il','im','in','io','iq','ir','is','it','je',
    
'jm','jo','jp','ke','kg','kh','ki','km','kn','kr','kw','ky','kz','la','lb','lc','li','lk',
    
'lr','ls','lt','lu','lv','ly','ma','mc','md','mg','mh','mk','ml','mm','mn','mo','mp','mq',
    
'mr','ms','mt','mu','mv','mw','mx','my','mz','na','nc','ne','nf','ng','ni','nl','no','np',
    
'nr','nu','nz','om','pa','pe','pf','pg','ph','pk','pl','pn','pr','ps','pt','pw','py','qa',
    
're','ro','ru','rw','sa','sb','sc','sd','se','sg','sh','si','sk','sl','sm','sn','sr','st',
    
'sv','sy','sz','tc','td','tf','tg','th','tj','tk','tl','tm','tn','to','tr','tt','tv','tw',
    
'tz','ua','ug','uk','us','uy','uz','va','vc','ve','vg','vi','vn','vu','wf','ws','ye','yu',
    
'za','zm','zw',
    
// inactive
    
'eh','kp','me','rs','um','bv','gb','pm','sj','so','yt','su','tp','bu','cs','dd','zr');

    
// get domain
    
if (!$full_domain xoops_getUrlDomain($url)) {
        return 
$base_domain;
    }

    
// break up domain, reverse
    
$DOMAIN explode('.'$full_domain);
    if (
$debug) {
        
print_r($DOMAIN);
    }
    
$DOMAIN array_reverse($DOMAIN);
    if (
$debug) {
        
print_r($DOMAIN);
    }
    
// first check for ip address
    
if (count($DOMAIN) == && is_numeric($DOMAIN[0]) && is_numeric($DOMAIN[3])) {
        return 
$full_domain;
    }

    
// if only 2 domain parts, that must be our domain
    
if (count($DOMAIN) <= 2) {
        return 
$full_domain;
    }

    
/*
    finally, with 3+ domain parts: obviously D0 is tld now,
    if D0 = ctld and D1 = gtld, we might have something like com.uk so,
    if D0 = ctld && D1 = gtld && D2 != 'www', domain = D2.D1.D0 else if D0 = ctld && D1 = gtld && D2 == 'www',
    domain = D1.D0 else domain = D1.D0 - these rules are simplified below.
    */
    
if (in_array($DOMAIN[0], $C_TLD) && in_array($DOMAIN[1], $G_TLD) && $DOMAIN[2] != 'www') {
        
$full_domain $DOMAIN[2] . '.' $DOMAIN[1] . '.' $DOMAIN[0];
    } else {
        
$full_domain $DOMAIN[1] . '.' $DOMAIN[0];
    }
    
// did we succeed?
    
return $full_domain;
}



6228
wishcraft
XOOPS 2.5 Theme :--: Sexting - Version 1.0.1

Resized Image

This theme has been designed for XOOPS 2.5 by the Chronolabs Cooperative and is open for use by the general public this video will show you around it:-

Video:


Features:
  • Changing Gradients
  • Global navigation
  • Right & Left Blocks
  • Center blocks
  • Radio from shoutcast.com


Download:




6229
Mamba
Re: blank page
  • 2014/12/22 19:15

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Did you clear cache?
What PHP version do you have?
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



6230
amin_ts
blank page
  • 2014/12/22 17:57

  • amin_ts

  • Just popping in

  • Posts: 70

  • Since: 2005/3/6 1


My home page of web site show blank page for guest users after upgrade from 2.5.6 fo 2.5.7.1
other page of web site open noramlly for guest user and home page web site open normall for members and administrator user




TopTop
« 1 ... 620 621 622 (623) 624 625 626 ... 29425 »



Login

Who's Online

500 user(s) are online (410 user(s) are browsing Support Forums)


Members: 0


Guests: 500


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits