function showTweets() { $twitter_customer_key = 'OwW0zw2QJjVVP5UtNrIhwhMSM'; $twitter_customer_secret = 'Pp4rROT1RUzypx2h737KUYk0SEApuYFiVEDUQ2kAJH4bzlbswP'; $twitter_access_token = '4909361-4SWD4DnQL9cc0LGC9Zvs8PkwAAMiX9Ud0Y9iyp4Zf8'; $twitter_access_token_secret = 'eIBtX5YOIBLAAgqiuqfnzx1MQJB2FLw9H9w90Ymow9jnU'; $connection = new TwitterOAuth($twitter_customer_key, $twitter_customer_secret, $twitter_access_token, $twitter_access_token_secret); $my_tweets = $connection->get('statuses/user_timeline', array('screen_name' => 'hartmanforpa', 'count' => 1)); if (isset($my_tweets->errors)) { $content .= 'Error :' . $my_tweets->errors[0]->code . ' - ' . $my_tweets->errors[0]->message; } else { $content .= makeClickableLinks($my_tweets[0]->text); } echo $content; }
public function fetch_tweets($tweetlimit = 5, $charlimit = False, $limit = 42) { $tweetshtml = ''; $ch = curl_init(); $target = 'http://www.twitter.com/statuses/user_timeline/' . $this->user . '.xml'; curl_setopt($ch, CURLOPT_URL, $target); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); //Parsing the data $getweet = curl_exec($ch); $twitters = new SimpleXMLElement($getweet); //error reporting if (array_key_exists('@attributes', $twitters)) { //die("<b>Fatal Error</b> Twitter is currently unavaliable"); } //echo each tweet that was fetched. $counter = 0; foreach ($twitters->status as $twit) { $twiturl = 'http://twitter.com/' . $this->user . '/statuses/' . $twit->id; $created = substr($twit->created_at, 0, 16); if (++$counter > $tweetlimit) { break; } else { if ($charlimit) { if (strlen($twit->text) > $charlimit) { $tweet = substr($twit->text, 0, $limit) . "..."; } else { $tweet = substr($twit->text, 0, $limit); } } else { $tweet = $twit->text; } $tweet = makeClickableLinks($tweet); $tweetshtml .= '<li class="tweet">' . $tweet . '<br /><small>' . $created . '</small></li>'; } } return $tweetshtml; }
echo '</thead><tbody>'; } else { echo '<tr class="usermsg"><th style="text-align:right;"><span class="label label-info"><i class="icon-info-sign icon-white"></i> Info</span></th><th><i class="icon-comment icon-white"></i> You are viewing the archived messages within 7 days.</th></tr>'; echo '</thead><tbody>'; } $lines = array(); $j = 1; for ($i = $start; $i < $end; $i++) { // make sure that PHP doesn't try to show results that don't exist if ($i == $total_results) { break; } $userid = mysql_result($result, $i, 'id'); $nick = mysql_result($result, $i, 'username'); $posttime = mysql_result($result, $i, 'datetime'); $shout_combined = makeClickableLinks(bbCode(mysql_result($result, $i, 'shout'))); $shoutx = stripslashes(rtrim($shout_combined)); $class = $j % 2 === 0 ? 'row_even' : 'row_odd'; $data = mysql_query("SELECT * FROM i_users WHERE userwd='{$nick}'") or die(mysql_error()); $row = mysql_fetch_array($data); if (mysql_num_rows($data) > 0) { // check shoutmsg of each user $total_usershouts = implode(mysql_fetch_assoc(mysql_query("SELECT COUNT(shout) FROM i_shouts WHERE username='******'"))); // admin if (in_array(strtolower($nick), $admin, true)) { $lines[] = ' <tr onmouseover="document.getElementById(\'timeago-' . $userid . '\').style.display = \'block\'" onmouseout="document.getElementById(\'timeago-' . $userid . '\').style.display = \'none\'"><td class="chatter-box"><span class="mark_admin">ADMIN</span> <a href="profile.php?user='******'" class="chatter" title="View ' . $nick . ' Profile"><strong>' . $nick . '</strong></a><br /><span class="timeAgo">' . time_ago($posttime) . '</span></td> <td>' . $shoutx . '<div class="timeago" id="timeago-' . $userid . '" style="display:none;text-align:right;">'; $lines[] = '<span class="label label-success reply-nick" style="font-weight:normal;" onclick="insertNickname(\'@' . $nick . '\')"><i class="icon-retweet icon-white"></i> Reply</span> '; $lines[] = '</div></td></tr> ';
die('Something Wrong Goto : login.php'); } // We've got everything we need // TwitterOAuth instance, with two new parameters we got in twitter_login.php $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $request_token['oauth_token'], $request_token['oauth_token_secret']); $access_token = $connection->oauth("oauth/access_token", array("oauth_verifier" => $_REQUEST['oauth_verifier'])); echo '<pre>'; print_r($access_token); echo '</pre>'; $_SESSION['access_token'] = $access_token; // Third Step $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']); $user = $connection->get("account/verify_credentials"); $_SESSION['twitter_user'] = $user; echo '<pre>'; print_r($user); echo '</pre>'; echo '<h1>Get Twitter</h1>'; $my_tweets = $connection->get('statuses/user_timeline', array('screen_name' => 'wostest2dh', 'count' => 1)); echo '<div class="twitter-bubble">'; if (isset($my_tweets->errors)) { echo 'Error :' . $my_tweets->errors[0]->code . ' - ' . $my_tweets->errors[0]->message; } else { echo makeClickableLinks($my_tweets[0]->text); } echo '</div>'; //function to convert text url into links. function makeClickableLinks($s) { return preg_replace('@(https?://([-\\w\\.]+[-\\w])+(:\\d+)?(/([\\w/_\\.#-]*(\\?\\S+)?[^\\.\\s])?)?)@', '<a target="blank" rel="nofollow" href="$1" target="_blank">$1</a>', $s); }
printf(__('%1$s at %2$s', 'vbegy'), get_comment_date(), get_comment_time()); ?> </div> </div> </div> <div class="text"> <?php if ($comment->comment_approved == '0') { ?> <em><?php _e('Your comment is awaiting moderation.', 'vbegy'); ?> </em><br> <?php } echo makeClickableLinks(nl2br($comment->comment_content)); ?> </div> </div> </div> </li> <?php } ?> </ol> </div> <?php } else { echo "<div class='page-content page-content-user'><div class='user-questions'><p class='no-item'>" . __("No answers yet .", "vbegy") . "</p></div></div>"; } } else {
} else { echo '<table class="table table-borderz shoutbox-striped table-override" id="shoutbox-table"><colgroup><col class="span2"><col class="span6"></colgroup>'; echo '<thead><tr><th></th><th>Latest <span class="requestcode">!update</span> from Sharers '; echo ' <a href="sharer_updates.php?page=1" class="label label-success">More...</a></th></tr></thead><tbody>'; while ($shout = mysql_fetch_assoc($result)) { // data clearance period $data_date = time() - 60 * 60 * 24 * 21; // 21 days $check_data = mysql_query("SELECT * FROM i_updates WHERE `datetime` < {$data_date}") or die(mysql_error()); if (mysql_num_rows($check_data) > 0) { mysql_query("DELETE FROM i_updates WHERE `datetime` < {$data_date}"); } $userid = $shout['id']; $nick = $shout['username']; $posttime = $shout['datetime']; $shout_combined = makeClickableLinks(bbCode($shout['item'])); $shoutx = stripslashes(rtrim($shout_combined)); $data = mysql_query("SELECT * FROM i_users WHERE userwd='{$nick}'") or die(mysql_error()); $row = mysql_fetch_array($data); if (mysql_num_rows($data) > 0) { // admin if (in_array($nick, $admin, true)) { $lines[] = ' <tr><td class="chatter-box"><a href="profile.php?user='******'" class="chatter" title="View ' . $nick . ' Profile"><strong>' . $nick . '</strong></a><br /><span class="timeAgo">' . time_ago($posttime) . '</span></td> <td>' . $shoutx . ''; $lines[] = '</td></tr>'; // VIP } else { if (in_array($nick, $kitty, true)) { $lines[] = ' <tr><td class="chatter-box"><a href="profile.php?user='******'" class="chatter" title="View ' . $nick . ' Profile"><strong>' . $nick . '</strong></a><br /><span class="timeAgo">' . time_ago($posttime) . '</span></td>
/** * Fetch the current task for this user and group combination, will return * the pending task if the user has any pending task * * @param json $groupid id of the group that the user is currently accessing * @param json $userid id of the currently logged in user * @return json $returnObject will return the task details or the error message */ public function getNewTask() { $groupid = Input::json('groupid'); $user = Auth::user(); $userid = $user->id; $returnObject = new stdClass(); $returnObject->status = 'error'; $returnObject->message = array(); if (empty($userid)) { $statusMessage[] = 'Userid can not be empty'; } //TODO: check if user exists //TODO: check if group exists if (empty($groupid)) { $statusMessage[] = 'Groupid can not be empty'; } $group = Group::find($groupid); $outcome = Outcome::find($group->outcome); $availArray = array_fetch($outcome->tasks->toArray(), 'id'); $currentDay = round((time() - $group->timestart) / 86400, 0); $pendingTask = DB::table('user_tasks')->where('user_id', $userid)->where('group_id', $group->id)->where('complete', 0)->first(); // check if there is a pending task if ($pendingTask) { $task = Task::find($pendingTask->task_id); $returnObject->pendingTask = 1; $returnObject->taskno = array_search($pendingTask->task_id, $availArray); } else { // return the random number but different than the last number $lastMission[] = DB::table('final_task')->where('outcome_id', $group->outcome)->pluck('task_id'); $tmpUserTaskArray[] = DB::table('user_tasks')->where('outcome_id', $group->outcome)->where('user_id', $userid)->lists('task_id'); $doneArray = $tmpUserTaskArray[0]; $array = array_diff($availArray, $lastMission); //print_r($availArray); $array = array_diff($array, $doneArray); $array = array_values($array); $numberOfDay = count($availArray); //print_r($numberOfDay); //print_r($array); if (empty($array)) { //echo "sss"; //if ($currentDay == count($tmpUserTaskArray) + 1) { //$rand = array_rand($array); $returnObject->taskno = count($availArray); $task = Task::find($lastMission); //print_r($task[0]->description); $returnObject->title['name'] = strip_tags(makeClickableLinks($task[0]->name)); $returnObject->title['description'] = strip_tags(makeClickableLinks($task[0]->description)); $returnObject->didyouknow = strip_tags(makeClickableLinks($task[0]->didyouknow)); $returnObject->reference = strip_tags(makeClickableLinks($task[0]->reference)); $returnObject->taskid = $task[0]->id; //} //echo $currentDay; } else { $rand = array_rand($array); $returnObject->taskno = $rand + 1; $task = Task::find($array[$rand]); $returnObject->title['name'] = strip_tags(makeClickableLinks($task->name)); $returnObject->title['description'] = strip_tags(makeClickableLinks($task->description)); $returnObject->didyouknow = strip_tags(makeClickableLinks($task->didyouknow)); $returnObject->reference = strip_tags(makeClickableLinks($task->reference)); $returnObject->taskid = $task->id; } //print_r($array); $returnObject->pendingTask = 0; //print_r($rand); } //print_r($returnObject); $returnObject->status = "success"; /* * if ($pendingTask) { $task = Task::find($pendingTask->task_id); $returnObject->pendingTask = 1; $returnObject->taskno= array_search($pendingTask->task_id,$availArray); } else { $doneArray[] = $outcome->getFinalTask(); $array = array_diff($availArray, $doneArray); $array = array_values($array); if (empty($array)) { if ($currentDay >= 21) { $array[20] = $outcome->getFinalTask(); } else { $array = $availArray; } } elseif ($currentDay >= 21) { $array = array(); $array[20] = $outcome->getFinalTask(); } $rand = array_rand($array); $task = Task::find($array[$rand]); //$user->getNextTask(); $returnObject->pendingTask = 0; $returnObject->taskno = $rand + 1; } $returnObject->title = makeClickableLinks($task->description); $returnObject->didyouknow = makeClickableLinks($task->didyouknow); $returnObject->reference = makeClickableLinks($task->reference); $returnObject->status = "success"; $returnObject->taskid = $task->id; //Return the JSON object with the info return Response::json($returnObject); * */ return Response::json($returnObject); }
<?php echo 'szerintem ez egy php kód...'; echo '<br> '; $site = file_get_contents('./ksanyi_nnet.html'); function makeClickableLinks($site) { return preg_replace('@(https?://([-\\w\\.]+[-\\w])+(:\\d+)?(/([\\w/_\\.#-]*(\\?\\S+)?[^\\.\\s])?)?)@', '<a href="$1" target="_blank">$1</a>', $s); } /** * Created by PhpStorm. * User: user * Date: 2015.11.05. * Time: 16:43 */ echo makeClickableLinks($site);
function front_end($args, $instance) { extract($args); if (ot_get_option('facebook_app_id') && ot_get_option('facebook_app_secret')) { global $fb; $fb = new Facebook(array('appId' => ot_get_option('facebook_app_id'), 'secret' => ot_get_option('facebook_app_secret'))); $fb->getAccessToken(); $load = intval($instance['load']); $title = $instance['title']; $facebook_id = $instance['facebook_id']; $button_text = $instance['button_text']; $button_url = $instance['button_url']; $new_window = $instance['new_window']; ?> <div class="facebook-widget"><?php echo $title ? $before_title . $title . $after_title : ''; ?> <?php if ($button_url || $button_text) { ?> <a href="<?php echo $button_url; ?> "<?php if ($new_window) { ?> target="_blank"<?php } ?> class="widget-button"><?php echo $button_text; ?> </a><?php } ?> <ul> <?php $statuses = $fb->api('/' . $facebook_id . '/feed', array('limit' => $load, 'type' => 'message')); if (!empty($statuses['data'])) { $temp_count = 0; foreach ($statuses['data'] as $s) { $temp_count++; if ($temp_count <= $load) { if ($s['type'] == 'photo') { ?> <li> <span class="tweet_text"><em><?php echo makeClickableLinks(js_char_shortalize($s['story'])); ?> </em><?php echo '<br /><strong><a href="' . $s['link'] . '">View photo</a></strong>'; ?> </span> <span class="tweet_time"><a href="http://facebook.com/<?php echo $s['id']; ?> ">about <?php echo relativeTime($s['created_time'], true); ?> </a></span> </li> <?php } else { if (isset($s['message'])) { $message = $s['message']; } else { $message = $s['story']; } ?> <li> <span class="tweet_text"><?php echo makeClickableLinks(js_char_shortalize($message)); if ($s['type'] == 'link') { echo '<br /><a href="' . $s['link'] . '">Click to view link</a>'; } ?> </span> <span class="tweet_time"><a target="_blank" href="http://facebook.com/<?php echo $s['id']; ?> ">about <?php echo relativeTime($s['created_time'], true); ?> — View on Facebook</a></span> </li> <?php } } else { break; } } } ?> </ul> </div><?php } else { echo '<p style="color:#dd0000;"><strong>Important:</strong> You need to enter your Facebook Settings on the Theme Options panel before you can use this widget.</p>'; } }
$doneArray = array(); $doneArray = DB::table('user_tasks')->where('group_id', $groupid)->where('user_id', $userid)->where('complete', 1)->lists('task_id'); $doneArray[] = $outcome->getFinalTask(); $array = array_diff($availArray, $doneArray); if (empty($array)) { if ($currentDay >= 21) { $array[20] = $outcome->getFinalTask(); } else { $array = $availArray; } } elseif ($currentDay >= 21) { $array = array(); $array[20] = $outcome->getFinalTask(); } echo '<pre>'; print_r($array); echo '</pre>'; $rand = array_rand($array); $task = Task::find($array[$rand]); //$user->getNextTask(); $returnObject = new stdClass(); $pendingTask = DB::table('user_tasks')->where('user_id', $userid)->where('group_id', $group->id)->where('complete', 0)->get(); echo 'Random: ' . $rand; $returnObject->taskno = $rand + 1; $returnObject->title = '<p id="todaysactivity"><b>' . t('dice.todaysactivity') . '</b>' . makeClickableLinks($task->description) . '</p>'; $returnObject->didyouknow = makeClickableLinks($task->didyouknow); $returnObject->reference = makeClickableLinks($task->reference); echo '<pre>'; print_r($returnObject); echo '</pre>'; die;
$dataToSend['since_id'] = $_REQUEST['newest_id']; $dataToSend['count'] = 200; } $content = $to->OAuthRequest('http://api.twitter.com/1/statuses/home_timeline.json', $dataToSend, 'GET'); $results = json_decode($content, true); $results = array_slice($results, 0, 30); $posts = array(); $i = 0; foreach ($results as $result) { if ($result['id']) { $posts[$i] = array(); $posts[$i]['id'] = $result['id']; $posts[$i]['author'] = $result['user']['screen_name']; $posts[$i]['author_name'] = $result['user']['name']; $posts[$i]['pic'] = $result['user']['profile_image_url']; $posts[$i]['message'] = makeClickableLinks($result['text']); $posts[$i]['time'] = strtotime($result['created_at']); $posts[$i]['client'] = $result['source']; $posts[$i]['type'] = "twitter"; if ($result['in_reply_to_user_id'] != "") { $posts[$i]['target'] = $result['in_reply_to_user_id']; } if ($result['in_reply_to_screen_name'] != "") { $posts[$i]['target_name'] = $result['in_reply_to_screen_name']; } if ($result['in_reply_to_status_id'] != "") { $posts[$i]['target_id'] = $result['in_reply_to_status_id']; } } $i++; }
echo 'A league key is required', PHP_EOL; exit; } try { $m = new YahooMessageArchiver(TRUE); } catch (OauthException $e) { echo 'ERROR: Response: ', $e->lastResponse, PHP_EOL; exit; } // @todo Make output prettier and not print_r() everywhere try { echo '<h3>Local Messages</h3>'; $rows = $m->getLocalMessages($_GET['lk']); foreach ($rows as $row) { echo '<p>Subject: ', $row['subject'], '</p>'; echo '<p>', nl2br(makeClickableLinks($row['text'])), '</p>'; echo '<p>By: ', $row['display_name'], ' (', $row['team_name'], ') on ', date('F d, Y', $row['timestamp']); echo '<hr />'; } // @todo test this, make it possible to export //exportToCsv( (array) $rows, '/tmp/tmp.csv'); echo '<h3>Remote Messages</h3>'; echo '<p>Disabled, See code.</p>'; /* echo '<pre>'; $rows = $m->getMessages( 0, 100, $_GET['lk'] ); print_r( $rows ); echo '</pre>'; */ } catch (OAuthException $e) { echo '<pre>';
function renderForm($error, $requestID, $requester) { include 'includes.php'; include 'settings.php'; ?> <div class="under-nav special-bg"> <div class="head-text"> <h1>Reply to the Request</h1> <h3>You're about to reply to someone's request. Thank you for your kindness! <i class="icon-heart icon-white"></i></h3> </div> </div> <div class="container"> <div class="row"> <div class="span8"> <div class="well special-bg"> <div style='padding-bottom:15px;height:30px;' id='more_shouts_nav'> <a href='request_shouts.php?page=1' class='btn btn-info'><i class='icon-chevron-left icon-white'></i> Back to Request Message</a> </div> <?php echo '<table class="table table-borderz shoutbox-striped table-override" id="shoutbox-table"><colgroup><col class="span2"><col class="span6"></colgroup>'; echo '<thead><tr><th class="chatter-box"><span class="ranking-title">TOP 5 SHOUTERS <i class="icon-chevron-right"></i></span></th><th>'; $topuser = mysql_query("SELECT username, COUNT(username) AS top5 FROM i_shouts GROUP BY username ORDER BY top5 DESC LIMIT 5"); $rankz = 1; echo '<div class="ranking">'; while ($userz = mysql_fetch_assoc($topuser)) { $poster = $userz['username']; $noofmsg = implode(mysql_fetch_assoc(mysql_query("SELECT COUNT(shout) FROM i_shouts WHERE username='******'"))); echo '<span class="user-rank rank-' . $rankz . ' rankno" title="Rank No. ' . $rankz . '"><a href="profile.php?user='******'">' . $poster . '</a> <strong>' . $noofmsg . '</strong></span> '; $rankz++; } echo '</div>'; echo '</th></tr>'; echo '</thead><tbody>'; echo '<tr><td colspan="2" style="text-align:center;background:#eee;border-bottom:1px solid #000"><strong>Request Message</strong></td></tr>'; $result = mysql_query("SELECT * FROM i_requests WHERE id='{$requestID}' ORDER BY id DESC LIMIT 1") or die(mysql_error()); $reqmsg = mysql_fetch_array($result); if ($reqmsg) { $userid = $reqmsg['id']; $nick = $reqmsg['username']; $posttime = $reqmsg['datetime']; $shout_combined = makeClickableLinks(bbCode($reqmsg['item'])); $shoutx = stripslashes(rtrim($shout_combined)); $data = mysql_query("SELECT * FROM i_users WHERE userwd='{$nick}'") or die(mysql_error()); $row = mysql_fetch_array($data); if (mysql_num_rows($data) > 0) { // admin if (in_array($nick, $admin, true)) { $lines[] = ' <tr><td class="chatter-box"><a href="profile.php?user='******'" class="chatter" title="View ' . $nick . ' Profile"><strong>' . $nick . '</strong></a><br /><span class="timeAgo">' . time_ago($posttime) . '</span></td> <td>' . $shoutx . '<div class="timeago" style="text-align:right;">'; $lines[] = '</div>'; $lines[] = '<div class="replied-answer">'; $result1 = mysql_query("SELECT * FROM i_replies WHERE item_id='{$userid}' ORDER BY id DESC LIMIT 3"); while ($item1 = mysql_fetch_assoc($result1)) { $answer1 = linkThisOne($item1['answer']); $answer2 = stripslashes(rtrim($answer1)); $lines[] = '<div class="replied-msg"><strong>' . $item1['user'] . '</strong> ' . $answer2 . '</div>'; } $lines[] = '</div>'; $lines[] = '</td></tr>'; // VIP } else { if (in_array($nick, $kitty, true)) { $lines[] = ' <tr><td class="chatter-box"><a href="profile.php?user='******'" class="chatter" title="View ' . $nick . ' Profile"><strong>' . $nick . '</strong></a><br /><span class="timeAgo">' . time_ago($posttime) . '</span></td> <td>' . $shoutx . '<div class="timeago" style="text-align:right;">'; $lines[] = '</div>'; $lines[] = '<div class="replied-answer">'; $result1 = mysql_query("SELECT * FROM i_replies WHERE item_id='{$userid}' ORDER BY id DESC LIMIT 3"); while ($item1 = mysql_fetch_assoc($result1)) { $answer1 = linkThisOne($item1['answer']); $answer2 = stripslashes(rtrim($answer1)); $lines[] = '<div class="replied-msg"><strong>' . $item1['user'] . '</strong> ' . $answer2 . '</div>'; } $lines[] = '</div>'; $lines[] = '</td></tr>'; // public user } else { $lines[] = ' <tr><td class="chatter-box"><a href="profile.php?user='******'" class="chatter" title="View ' . $nick . ' Profile"><strong>' . $nick . '</strong></a><br /><span class="timeAgo">' . time_ago($posttime) . '</span></td> <td>' . $shoutx . '<div class="timeago" style="text-align:right;">'; $lines[] = '</div>'; $lines[] = '<div class="replied-answer">'; $result1 = mysql_query("SELECT * FROM i_replies WHERE item_id='{$userid}' ORDER BY id DESC LIMIT 3"); while ($item1 = mysql_fetch_assoc($result1)) { $answer1 = linkThisOne($item1['answer']); $answer2 = stripslashes(rtrim($answer1)); $lines[] = '<div class="replied-msg"><strong>' . $item1['user'] . '</strong> ' . $answer2 . '</div>'; } $lines[] = '</div>'; $lines[] = '</td></tr>'; } } // public user } else { $lines[] = ' <tr><td class="chatter-box"><a href="profile.php?user='******'" class="chatter" title="View ' . $nick . ' Profile"><strong>' . $nick . '</strong></a><br /><span class="timeAgo">' . time_ago($posttime) . '</span></td> <td>' . $shoutx . '<div class="timeago" style="text-align:right;">'; $lines[] = '</div>'; $lines[] = '<div class="replied-answer">'; $result1 = mysql_query("SELECT * FROM i_replies WHERE item_id='{$userid}' ORDER BY id DESC LIMIT 3"); while ($item1 = mysql_fetch_assoc($result1)) { $answer1 = linkThisOne($item1['answer']); $answer2 = stripslashes(rtrim($answer1)); $lines[] = '<div class="replied-msg"><strong>' . $item1['user'] . '</strong> ' . $answer2 . '</div>'; } $lines[] = '</div>'; $lines[] = '</td></tr>'; } } echo implode($lines); echo '</tbody></table>'; if ($error != '') { echo '<div id="console" class="alert alert-error">' . $error . '</div>'; echo '<script type="text/javascript">function $(a){return document.getElementById(a)} var hideerr = setTimeout("$(\'console\').style.display=\'none\';$(\'console\').innerHTML = \'\'",5e3)</script>'; } ?> <form class="form-horizontal" action="" method="post"> <div class="shouting-section"> <textarea class="shouting-box" placeholder="Type your reply message here" name="answer" id="shout" rows="2" maxlength="250"></textarea> <input type="hidden" name="requestID" value="<?php echo $requestID; ?> "> <input type="hidden" name="requester" value="<?php echo $requester; ?> "> <div class="shouting-function"> <span id="charcount" class="shouting-count">250</span> <span class="shouting-btn"> <input type="submit" class="btn btn-info" name="reply" value="Shout"> </span> </div><!--/shouting-function--> </div><!--/shouting-section--> </form> </div> </div><!--/span--> <div class="span4"> <div class="well special-bg"> <?php include 'sharerlink.php'; ?> </div><!--/well--> </div><!--/span--> </div><!--/row--> <?php include 'copyright.php'; ?> </div><!--/.fluid-container--> <?php include 'footer.php'; }
<td align="left" height="30" class="styleabu"> DESCRIPTION</td> </tr> <tr> <td align="left" colspan="2"><hr color="silver" style="width:98%;" class=""></td> </tr> <tr> <td colspan="2"> </td> </tr> <?php $flatken = str_replace(" ", " ", $dataHalDepan["advdesc"]); ?> <tr> <td colspan="2"> <table width="95%" class="web_border" background="images/container.png" style="color:#424242;margin-left:1.5em;" cellpadding="2" cellspacing="2"> <tr><td><?php echo makeClickableLinks($flatken); ?> </td></tr> </table> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td align="left" height="30" class="styleabu"> COMMENTS</td> </tr> <tr> <td align="left" colspan="2"><hr color="silver" style="width:98%;" class=""></td> </tr> <tr>
function vbegy_answer($comment, $args, $depth) { global $post; $GLOBALS['comment'] = $comment; $add_below = ''; $comment_vote = get_comment_meta($comment->comment_ID, 'comment_vote'); $comment_vote = !empty($comment_vote) ? $comment_vote[0]["vote"] : ""; $the_best_answer = get_post_meta($post->ID, "the_best_answer", true); $comment_best_answer = $the_best_answer == $comment->comment_ID ? "comment-best-answer" : ""; $active_reports = vpanel_options("active_reports"); $active_vote = vpanel_options("active_vote"); $GLOBALS['comment'] = $comment; ?> <li <?php comment_class('comment ' . $comment_best_answer); ?> id="li-comment-<?php comment_ID(); ?> "> <div id="comment-<?php comment_ID(); ?> " class="comment-body clearfix" rel="post-<?php echo $post->ID; ?> "> <div class="avatar-img"> <?php if ($comment->user_id != 0) { $vpanel_get_user_url = vpanel_get_user_url($comment->user_id, get_the_author_meta('user_nicename', $comment->user_id)); if (get_the_author_meta('you_avatar', $comment->user_id)) { $you_avatar_img = get_aq_resize_url(esc_attr(get_the_author_meta('you_avatar', $comment->user_id)), "full", 65, 65); echo "<img alt='" . $comment->comment_author . "' src='" . $you_avatar_img . "'>"; } else { echo get_avatar($comment, 65); } } else { $vpanel_get_user_url = $comment->comment_author_url != "" ? $comment->comment_author_url : "vpanel_No_site"; echo get_avatar($comment->comment_author_email, 65); } ?> </div> <div class="comment-text"> <div class="author clearfix"> <div class="comment-author"> <?php if ($vpanel_get_user_url != "" && $vpanel_get_user_url != "vpanel_No_site") { ?> <a href="<?php echo esc_url($vpanel_get_user_url); ?> "> <?php } echo get_comment_author(); if ($vpanel_get_user_url != "" && $vpanel_get_user_url != "vpanel_No_site") { ?> </a> <?php } ?> </div> <?php if ($active_vote == 1) { ?> <div class="comment-vote"> <ul class="single-question-vote"> <?php if (is_user_logged_in()) { ?> <li class="loader_3"></li> <li><a href="#" class="single-question-vote-up comment_vote_up<?php echo isset($_COOKIE['comment_vote' . $comment->comment_ID]) ? " " . $_COOKIE['comment_vote' . $comment->comment_ID] . "-" . $comment->comment_ID : ""; ?> " title="<?php _e("Like", "vbegy"); ?> " id="comment_vote_up-<?php echo $comment->comment_ID; ?> "><i class="icon-thumbs-up"></i></a></li> <li><a href="#" class="single-question-vote-down comment_vote_down<?php echo isset($_COOKIE['comment_vote' . $comment->comment_ID]) ? " " . $_COOKIE['comment_vote' . $comment->comment_ID] . "-" . $comment->comment_ID : ""; ?> " id="comment_vote_down-<?php echo $comment->comment_ID; ?> " title="<?php _e("Dislike", "vbegy"); ?> "><i class="icon-thumbs-down"></i></a></li> <?php } else { ?> <li class="loader_3"></li> <li><a href="#" class="single-question-vote-up comment_vote_up vote_not_user" title="<?php _e("Like", "vbegy"); ?> "><i class="icon-thumbs-up"></i></a></li> <li><a href="#" class="single-question-vote-down comment_vote_down vote_not_user" title="<?php _e("Dislike", "vbegy"); ?> "><i class="icon-thumbs-down"></i></a></li> <?php } ?> </ul> </div> <span class="question-vote-result question_vote_result <?php echo $comment_vote < 0 ? "question_vote_red" : ""; ?> "><?php echo $comment_vote != "" ? $comment_vote : 0; ?> </span> <?php } ?> <div class="comment-meta"> <div class="date"><i class="icon-time"></i><?php printf(__('%1$s at %2$s', 'vbegy'), get_comment_date(), get_comment_time()); ?> </div> </div> <div class="comment-reply"> <?php edit_comment_link(__("Edit", "vbegy"), ' ', ''); if ($active_reports == 1) { ?> <a class="question_r_l comment_l report_c" href="#"><i class="icon-flag"></i><?php _e("Report", "vbegy"); ?> </a> <?php } comment_reply_link(array_merge($args, array('reply_text' => '<i class="icon-reply"></i>' . __('Reply', 'vbegy'), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> </div> <div class="text"> <?php if ($active_reports == 1) { ?> <div class="explain-reported"> <h3><?php _e("Please briefly explain why you feel this answer should be reported .", "vbegy"); ?> </h3> <textarea name="explain-reported"></textarea> <div class="clearfix"></div> <div class="loader_3"></div> <a class="color button small report"><?php _e("Report", "vbegy"); ?> </a> <a class="color button small dark_button cancel"><?php _e("Cancel", "vbegy"); ?> </a> </div><!-- End reported --> <?php } if ($comment->comment_approved == '0') { ?> <em><?php _e('Your comment is awaiting moderation.', 'vbegy'); ?> </em><br> <?php } echo nl2br(makeClickableLinks($comment->comment_content)); ?> <div class="clearfix"></div> <?php $added_file = get_comment_meta($comment->comment_ID, 'added_file', true); if ($added_file != "") { echo "<div class='clearfix'></div><br><a href='" . wp_get_attachment_url($added_file) . "'>" . __("Attachment", "vbegy") . "</a>"; } ?> </div> <div class="clearfix"></div> <div class="loader_3"></div> <?php $admin_best_answer = vpanel_options("admin_best_answer"); if ($the_best_answer == $comment->comment_ID) { echo '<div class="commentform question-answered question-answered-done"><i class="icon-ok"></i>' . __("Best answer", "vbegy") . '</div> <div class="clearfix"></div>'; if ((is_user_logged_in() && get_current_user_id() == $post->post_author || $admin_best_answer == 1 && is_super_admin(get_current_user_id())) && $the_best_answer != 0) { echo '<a class="commentform best_answer_re question-report" title="' . __("Cancel the best answer", "vbegy") . '" href="#">' . __("Cancel the best answer", "vbegy") . '</a>'; } } if ((is_user_logged_in() && get_current_user_id() == $post->post_author || $admin_best_answer == 1 && is_super_admin(get_current_user_id())) && ($the_best_answer == 0 or $the_best_answer == "")) { ?> <a class="commentform best_answer_a question-report" title="<?php _e("Select as best answer", "vbegy"); ?> " href="#"><?php _e("Select as best answer", "vbegy"); ?> </a> <?php } ?> <div class="no_vote_more"></div> </div> </div> <?php }
function userContent($displayname, $userCont, $imageUrl, $forumName, $desc, $subject, $accountPic, $website, $forumSn, $createAccountSn) { global $image_count; //if() //$pos = strpos($userCont, PHP_EOL, 2); $enter = count(explode(PHP_EOL, $userCont)); $enter_limit = 1; if ($enter > 3) { $usrCont_a = explode(PHP_EOL, $userCont); foreach ($usrCont_a as $key) { if ($enter_limit <= 3) { $usrCont_limit = $usrCont_limit . $key . PHP_EOL; } $enter_limit++; } $userCont = $usrCont_limit; } if (strlen($userCont) > 191 || $enter > 3) { $userCont = substr($userCont, 0, 191) . "..."; } else { $userCont = $userCont . " "; } ?> <div id=forum_<?php echo $forumSn; ?> onmousemove='ShowDeleteForum(<?php echo $forumSn; ?> ,<?php echo $createAccountSn; ?> )' onmouseout='HideDeleteForum(<?php echo $forumSn; ?> )' class='wrap' style="margin: 10px 10px 0 20px; background-color:#FFF; width: 598px; padding: 20px 20px; border-bottom: 0; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border: 1px solid;border-top-color: rgb(229, 230, 233);border-top-style: solid;border-top-width: 1px;border-right-color: rgb(223, 224, 228);border-right-style: solid;border-right-width: 1px;border-bottom-color: rgb(208, 209, 213);border-bottom-style: solid;border-bottom-width: 1px; border-left-color: rgb(223, 224, 228);border-left-style: solid;border-left-width: 1px;border-color: #e5e6e9 #dfe0e4 #d0d1d5; min-height: 110px;"> <div class=account_image style="width: 114px; float: left; height: 114px; text-align: left; font-size: 15px; font-weight: bold;"> <img style="width: 114px;height: 114px;" id=account_img src="/api/file/download_photo.php?sn=<?php echo $accountPic; ?> "> </div> <div class="delete_forum"><a href="javascript:Delete_Forum(<?php echo $forumSn; ?> )" id='forumDeleteBt_<?php echo $forumSn; ?> ' style="position: absolute; margin-left: 460px;display: none;"><img style="float: right;" src="/image/close.png"></a></div> <div class="account" style="/* font-weight: bold; */ color: #444; line-height: 20px;position: absolute;/* margin-top: 95px; *//* text-align: center; */margin-left: 128px;margin-top: 6px;font-size: 14px;"><a href="/account/info?sn=<?php echo $createAccountSn; ?> " target="_blank"><?php echo $displayname; ?> </a>:</div> <div class="article" style="margin-bottom: 10px; width: 450px; height: 83px; text-align: left; background-color: #fff; float: left;padding: 30px 20px 0px 12px;border: 1px solid;border-top-color: rgb(229, 230, 233);border-top-style: solid;border-top-width: 1px;border-right-color: rgb(223, 224, 228);border-right-style: solid;border-right-width: 1px;border-bottom-color: rgb(208, 209, 213);border-bottom-style: solid;border-bottom-width: 1px;border-left-color: rgb(223, 224, 228);border-left-style: solid;border-left-width: 1px;border-color: #e5e6e9 #dfe0e4 #d0d1d5; font-family: Georgia, 'lucida grande',tahoma,verdana,arial,sans-serif;line-height: 16px;font-size: 12px;color: #141823;"> <?php //echo nl2br(formatUrlsInText($userCont)); echo nl2br(makeClickableLinks($userCont)); /* $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/g"; if(preg_match_all($reg_exUrl, $userCont, $url)) { // make the urls hyper links //if(strlen($userCont) > 56) //$userCont_a = preg_replace($reg_exUrl, '<a class=userContent href="'.$url[0].'" target="_blank">'.substr($url[0],0,56).'...</a>', $userCont); //else $userCont_a = preg_replace($reg_exUrl, '<a class=userContent href="'.$url[0].'" target="_blank">'.$url[0].'</a>', $userCont); echo nl2br($userCont_a); } else { $reg_exUrl = "/(^|[^\/])([a-zA-Z0-9\-\_]+\.[\S]+(\b|$))/"; // if no urls in the text just return the text if(preg_match($reg_exUrl, $userCont, $url)){ //if(strlen($userCont) > 56) //$userCont_a = preg_replace($reg_exUrl, '<a class=userContent href="http://'.$url[0].'" target="_blank">'.substr($url[0],0,56).'...</a>', $userCont); //else $userCont_a = preg_replace($reg_exUrl, '<a class=userContent href="http://'.$url[0].'" target="_blank">'.$url[0].'</a>', $userCont); echo nl2br($userCont_a); } else echo nl2br($userCont); } */ ?> </div> <div class="more" style="/* font-weight: bold; */ color: #444; line-height: 20px;position: absolute;/* margin-top: 95px; *//* text-align: center; */margin-left: 520px;margin-top: 88px;font-size: 12px;"><a href="/forum/thread?sn=<?php echo $forumSn; ?> " target="_blank">See More</a></div> <a style="text-decoration:none;" target="_blank" href="<?php echo urldecode($website); ?> "> <?php if ($imageUrl != NULL && $imageUrl != "none") { $parts = basename($imageUrl); //if(file("thumb/".$parts)){ //echo '<div class="top" style=" background-color: #FFF;"><img id="img_'.$image_count.'" width="598px" src="thumb/'.$parts.'"></div>'; //} //else{ echo '<div class="top" style=" background-color: #FFF;"><img id="img_' . $image_count . '" width="598px" src="' . $imageUrl . '"></div>'; //} $image_count++; } ?> <div class='bottom' style="background-color: #FFF; "> <div class="title" style="font-family: Georgia, 'lucida grande',tahoma,verdana,arial,sans-serif;font-size: 18px;font-weight: 500;line-height: 22px;margin-bottom: 4px;max-height: 44px;overflow: hidden;word-wrap: break-word;"> <?php if ($forumName != NULL && $forumName != "none") { echo $forumName; } ?> </div> <div class="descriptipn" style=" font-family: Georgia, 'lucida grande',tahoma,verdana,arial,sans-serif;line-height: 16px;font-size: 12px;color: #141823; margin-bottom: 5px;"> <?php if ($desc != NULL && $desc != "none") { echo $desc; } ?> </div> <div class="site_name" style="color: #adb2bb;font-size: 12px;"> <?php if ($subject != NULL && $subject != "none") { echo $subject; } ?> </div> </div></a> </div> <?php }
$sqlAccount = "SELECT fbPictureUrl FROM account WHERE sn = '{$cfAccountSn}'"; $resultAccount = mysql_query($sqlAccount, $dbLink); $rowAccount = mysql_fetch_array($resultAccount); $accFbPictureUrl = $rowAccount[fbPictureUrl]; $pictureUrl = $accFbPictureUrl; } else { $sqlFile = "SELECT sn FROM file WHERE accountSn = '{$cfAccountSn}'"; $resultFile = mysql_query($sqlFile, $dbLink); $rowFile = mysql_fetch_array($resultFile); $fileSn = $rowFile[sn]; $pictureUrl = "/api/file/download_photo?sn={$fileSn}"; } echo "<div id=\"comment_info_{$forumSn}\" class=\"comment_info\" onmousemove=\"ShowDeleteBt({$cfSn}, {$cfAccountSn})\" onmouseout=\"HideDeleteBt({$cfSn})\">"; echo "<div class=\"comment_img\"><img src=\"{$pictureUrl}\" width=\"32\" height=\"32\"></div>"; echo "<div class=\"comment_cont_data\">"; echo "<div class=\"comment_user\"><a href=\"/account/info?sn={$cfAccountSn}\" target=\"_blank\"><font color=\"#3b5998\">" . GtAccount_GetNameDisplay($cfAccountSn) . "</font></a> " . makeClickableLinks($cfMessage) . "</div>"; echo "<div class=\"comment_time\">{$cfCreateDate}</div>"; //user comment like $sqlCommentLike = "SELECT sn FROM commentLike WHERE likeCommentAccountSn = '{$cfAccountSn}' AND accountSn = '{$accountSn}' AND commentFormSn = '{$cfSn}' AND status = '1'"; $resultCommentLike = mysql_query($sqlCommentLike, $dbLink); $rowCommentLike = mysql_fetch_array($resultCommentLike); if ($rowCommentLike != FALSE) { $likeCommentBt = t("Unlike"); } else { $likeCommentBt = t("Like"); } $accountCount = ""; $i = 0; $sqlCommentLike = "SELECT accountSn FROM commentLike WHERE likeCommentAccountSn = '{$cfAccountSn}' AND commentFormSn = '{$cfSn}' AND status = '1'"; $resultCommentLike = mysql_query($sqlCommentLike, $dbLink); $numCommentLike = mysql_num_rows($resultCommentLike);
function get_tweets($count) { $about = get_page_by_path('about'); $handle = get_field('twitter', $about); include_once get_template_directory() . '/libraries/twitteroauth/twitteroauth.php'; $twitter_customer_key = 'w6jdx2IiW59vScHvUyYR6LJ5i'; $twitter_customer_secret = '4kYwLxdDXyIPi5ndLAht3Ln1oFX3iRTHxYqakghmeAGEVglTpY'; $twitter_access_token = '4343711140-4bb6E3bLjnIChxGwtD71disJm3C6H3Oo2u4qXFX'; $twitter_access_token_secret = '7NVIEwXODgcK6hB46UheZG9bPkFT63Ck8Fbwi4UaKzl1T'; $connection = new TwitterOAuth($twitter_customer_key, $twitter_customer_secret, $twitter_access_token, $twitter_access_token_secret); $raw_tweets = $connection->get('statuses/user_timeline', array('screen_name' => $handle, 'count' => $count)); $tweets = new ArrayObject(); $twitter_url = 'http://twitter.com/' . $handle; echo '<div class="twitter">'; echo '<div class="follow">'; echo '<h3 class="title">'; echo '<a href="' . $twitter_url . '" target="_blank">Follow us on Twitter @' . $handle . '</a>'; echo '</h3>'; echo '</div>'; echo '<div class="tweets">'; $counter = 0; foreach ($raw_tweets as $tweet) { if (isset($tweet->errors)) { // $tweet = 'Error :'. $raw_tweets[$counter]->errors[0]->code. ' - '. $raw_tweets[$counter]->errors[0]->message; } else { $text = makeClickableLinks($tweet->text); $timestamp = strtotime($tweet->created_at); $elapsed = humanTiming($timestamp); $id = $tweet->id; $url = 'http://twitter.com/' . $handle . '/status/' . $id; echo '<div class="tweet">'; echo '<div class="text">'; echo utf8_encode($text); echo '</div>'; echo '<a href="' . $url . '" target="_blank" class="timestamp">'; echo $elapsed; echo '</a>'; echo '</div>'; } } echo '</div>'; echo '</div>'; }