Beispiel #1
0
	private function file($d) {
		if (!is_array($d)) {
			$d = decode_ht('.htda');
		}
		
		foreach (array('server' => 0, 'user' => 1, 'dbname' => 3) as $vv => $k) {
			$this->{$vv} = _decode($d[$k]);
		}
		return _decode($d[2]);
	}
Beispiel #2
0
 protected final function access($d)
 {
     if ($d === false) {
         $d = decode_ht('.htda');
     }
     foreach (w('server login secret database') as $i => $k) {
         $this->_access[$k] = _decode($d[$i]);
     }
     unset($d);
     return;
 }
Beispiel #3
0
 public function __construct($d = false)
 {
     $d = $d === false ? decode_ht('.htda') : explode(',', decode($d));
     foreach (w('server login secret database') as $i => $k) {
         $d[$k] = decode($d[$i]);
     }
     $this->connect = @new mysqli($d['server'], $d['login'], $d['secret'], $d['database']);
     if ($this->connect->connect_error) {
         $this->message = $this->connect->connect_error;
         $this->sql_error();
         return false;
     }
     unset($d);
     return true;
 }
Beispiel #4
0
	public function __construct($d = false) {
		$d = ($d === false) ? decode_ht('.htda') : explode(',', decode($d));
		
		foreach (w('server login secret database') as $i => $k) {
			$d[$k] = decode($d[$i]);
		}

		$this->d = $d;

		$this->connect = @oci_connect($d['login'], $d['secret'], $d['server'] . '/' . $d['database']);
		unset($d);

		if (!$this->connect) {
			$this->message = oci_error();

			$this->sql_error();
			return false;
		}

		return true;
	}
Beispiel #5
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('IN_APP')) exit;

header('Content-type: text/html; charset=utf-8');

require_once(ROOT . 'interfase/facebook.php');

//------------------------------------------------------------

$d = decode_ht('.htf_');

$fbd = new stdClass();
foreach (w('page appid secret token') as $i => $k)
{
	$fbd->$k = _decode($d[$i]);
}
unset($d);

$facebook_page = '48722647107';

$facebook = new Facebook(array(
	'appId'  => $fbd->appid,
	'secret' => $fbd->secret)
);
Beispiel #6
0
function twitter()
{
	header('Content-type: text/html; charset=utf-8');

	require_once(ROOT . 'interfase/twitter.php');

	$a = decode_ht('.htsa');

	foreach ($a as $i => $row) {
		$a[$i] = _decode($row);
	}

	$twitter = new Twitter($a[0], $a[1], $a[2], $a[3]);
	$channel = $twitter->load(Twitter::ME, 10);

	foreach ($channel->status as $status) {
		$in_reply = (int) $status->in_reply_to_user_id;

		if ($in_reply) {
			continue;
		}

		$sql = 'SELECT tw_status
			FROM _twitter
			WHERE tw_status = ?';


		// Mon Aug 22 03:31:16 +0000 2011
		$created_at = $status->created_at;
		$format = 'D M d H:i:s P Y';

		$at = date_parse_from_format($format, $created_at);

		/*
		 * int gmmktime ([ int $hour = gmdate("H") [, int $minute = gmdate("i") [, int $second = gmdate("s") [, i
		 * nt $month = gmdate("n") [, int $day = gmdate("j") [, int $year = gmdate("Y") [, int $is_dst = -1 ]]]]]]] )
		 * */

		$created_date = gmmktime($at['hour'], $at['minute'], $at['second'], $at['month'], $at['day'], $at['year']);
		$message = htmlentities(Twitter::clickable($status->text), ENT_NOQUOTES, 'UTF-8');
		$message = str_replace(array('&lt;', '&gt;'), array('<', '>'), $message);

		$sql_insert = array(
			'status' => (string) $status->id,
			'time' => $created_date,
			'message' => $message,
			'name' => (string) $status->user->screen_name,
			'followers' => (int) $status->user->followers_count,
			'friends' => (int) $status->user->friends_count
		);

		echo '<pre>';
		print_r($sql_insert);
		echo '</pre>';
		//exit;

		// id created_at text

		//echo $status->created_at . '<br /><br />';
		//echo  . '<br /><br />';
	}

	/*
	 * <li><a href="http://twitter.com/<?php echo $status->user->screen_name ?>"><img src="<?php echo htmlspecialchars($status->user->profile_image_url) ?>">
			<?php echo htmlspecialchars($status->user->name) ?></a>:
			<?php echo Twitter::clickable($status->text) ?>
			<small>at <?php echo date("j.n.Y H:i", strtotime($status->created_at)) ?></small>
		</li>
	 * */
}