function pullurl($url) { if (function_exists("curl_init")) { return _curl($url); } // For sume reason the socket code isn't working //if (function_exists("fsockopen")) return _sock($url); return @file($url); }
/** * @desc WHAT? * @author * @since 2012-07-05 16:56:01 * @throws 注意:无DB异常处理 * @param $config ['width']按照宽度缩放,$config['height']按照高度缩放,都设置,按照比例裁剪再缩放 */ function fetchimg($url, $filename = null, $config = array()) { if (!$filename) { $filename = md5($url); } $imageData = _curl($chinfo, $url); if ($imageData) { $date = date('Y-m') . '/'; $path = VIMAGE_PATH . $date; if (!is_dir($path)) { mkdir($path); } $filepath = $path . $filename . ".jpg"; $bool = file_put_contents($filepath, $imageData); if ($config) { $thumb_bg = $this->_cut_image($filepath, $config); $bool = imagejpeg($thumb_bg, $filepath, 100); } list($width, $height, $type, $attr) = getimagesize($filepath); if ($bool) { return array('url' => VIMAGE . $date . $filename . '.jpg', 'width' => $width, 'height' => $height); } } return null; }
} } } // args for potentially inserted links to commsy-pages $args['linkTitle'] = $link_text; $args['linkPrefix'] = $c_commsy_domain.$c_commsy_url_path; $args['linkTarget'] = '_parent'; $args['reduceFeatureSet'] = true; $current_user_item = $environment->getCurrentUserItem(); $own_room = $current_user_item->getOwnRoom(); if ( !empty($_GET['mb_card_id']) ) { $url_params['mb_card_id'] = $_GET['mb_card_id']; } if ( isset($own_room) ) { $args['fullLocationFromOverlay'] = _curl(false,$own_room->getItemID(), $system, 'index', $url_params); } unset($current_user_item); } $script = $helper->bodyScript($args); // plugin view $current_user_item = $environment->getCurrentUserItem(); $plugin_view = $class_factory->getClass(PLUGIN_VIEW,array('environment' => $environment)); $plugin_view->setName($system); $plugin_view->setTitle($commsy_mediabird->getDisplayName()); $plugin_view->setIcon($commsy_mediabird->getRubricTitleIcon()); // $output = pure indicates that html for whole page has be provided (case of in-place note-taking)
$url = $row->link_google . '?authuser=0'; //$data['url'] = $url; $data['ids'] = $row->ids; $data_content = postPage($url, $post_google); //$data_content = _curl($url); $html = str_get_html($data_content); $items = $html->find("div[class=details] h2 a[class=title]"); for ($i = 0; $i < 5; $i++) { $content = ''; $item = $items[$i]; //$title = $item->plaintext; //$slug = vnit_change_title($title); $link = $item->href; $link = strpos($link, 'https://') !== false ? $link : 'https://play.google.com' . $link; $id_com = getCom($link); $itemdatas = _curl($link); $itemhtml = str_get_html($itemdatas); $title = $itemhtml->find("div[class=document-title]")[0]->plaintext; $slug = vnit_change_title($title); $images = $itemhtml->find("div[class=cover-container] img[0]")[0]->src; $find_list_img = $itemhtml->find("img[class=screenshot]"); // Check title $check_alias = $lib->check_com($id_com); if ($check_alias == 0) { for ($j = 0; $j < count($find_list_img); $j++) { $item_img = $find_list_img[$j]->src; } $version = $itemhtml->find('div[class=meta-info] div[itemprop="softwareVersion"]')[0]->plaintext; $manufacture = $itemhtml->find('a[class="document-subtitle primary"] span')[0]->plaintext; $post_meta['_infomation_name'] = $title; $post_meta['_infomation_version'] = $version;
public function getDataAsXML($with_file_data = false) { $retour = '<file_item>' . LF; $retour .= $this->_getDataAsXML(); if ($with_file_data) { $retour .= '<base64>' . $this->_getFileAsBase64() . '</base64>' . LF; } else { $session_item = $this->_environment->getSessionItem(); $file_md5_array = $session_item->getValue('file_md5_array'); if (isset($file_md5_array[$this->getFileID()]) and !empty($file_md5_array[$this->getFileID()])) { $retour .= '<md5>' . $file_md5_array[$this->getFileID()] . '</md5>' . LF; } else { $md5 = md5($this->_getFileAsString()); $retour .= '<md5>' . $md5 . '</md5>' . LF; $file_md5_array[$this->getFileID()] = $md5; $session_item->setValue('file_md5_array', $file_md5_array); $session_manager = $this->_environment->getSessionManager(); $session_manager->save($session_item); $this->_environment->setSessionItem($session_item); } $params = array(); $params['iid'] = $this->getFileID(); $params['SID'] = $session_item->getSessionID(); global $c_commsy_domain, $c_commsy_url_path; include_once 'functions/curl_functions.php'; $url = _curl(false, $this->getContextID(), 'material', 'getfile', $params); global $c_single_entry_point; $url = str_replace('soap.php', $c_single_entry_point, $url); $retour .= '<resource_link><![CDATA[' . $c_commsy_domain . $c_commsy_url_path . '/' . $url . ']]></resource_link>' . LF; } $retour .= '</file_item>' . LF; return $retour; }
public function getVoyeurURL ( $filename = '' ) { $retour = ''; $url = $this->_getConfigValueFor($this->_identifier.'_server_url'); if ( !empty($url) ) { $url_params = array(); if ( empty($filename) ) { $url_params['iid'] = $this->_environment->getValueOfParameter('iid'); } else { $url_params['filename'] = $filename; } $session_item = $this->_environment->getSessionItem(); if ( isset($session_item) ) { $url_params['SID'] = $session_item->getSessionID(); } unset($session_item); global $c_commsy_domain, $c_commsy_url_path; $url_to_zip = $c_commsy_domain.$c_commsy_url_path; $url_to_zip .= '/'._curl(false,$this->_environment->getCurrentContextID(),$this->_identifier,'download',$url_params); if ( strstr($url,'?') ) { $url .= '&'; } else { $url .= '?'; } #$url .= 'inputFormat=zip'; $url .= '&input='.urlencode($url_to_zip); $url = str_replace('&&','&',$url); } if ( !empty($url) ) { $retour = $url; } return $retour; }
public function getRoomDetails($session_id, $context_id, $room_id) { $xml = ""; if ($this->_isSessionValid($session_id)) { $this->_environment->setCurrentContextID($context_id); $this->_environment->setSessionID($session_id); $translator = $this->_environment->getTranslationObject(); $sessionItem = $this->_environment->getSessionItem(); $userId = $sessionItem->getValue('user_id'); $authSourceId = $sessionItem->getValue('auth_source'); // get user item $userManager = $this->_environment->getUserManager(); $userItem = $userManager->getItemByUserIDAuthSourceID($userId, $authSourceId); // room access $userManager->setUserIdLimit($userId); $userManager->setAuthSourceLimit($authSourceId); $userManager->setContextLimit($room_id); $userManager->select(); $userList = $userManager->get(); $roomManager = $this->_environment->getRoomManager(); $roomItem = $roomManager->getItem($room_id); global $c_commsy_domain, $c_commsy_url_path; include_once 'functions/curl_functions.php'; $contactPersons = $roomItem->getContactModeratorList(); $communityRooms = $roomItem->getCommunityList(); $mayEdit = $userItem && ($userItem->isModerator() || $roomItem->mayEdit($userItem)); $xml .= "<room>\n"; $xml .= "<id><![CDATA[" . $roomItem->getItemId() . "]]></id>\n"; $xml .= "<name><![CDATA[" . $roomItem->getTitle() . "]]></name>\n"; $xml .= "<access><![CDATA[" . ($userList->isEmpty() ? "no" : "yes") . "]]></access>\n"; $xml .= "<link><![CDATA[" . $c_commsy_domain . $c_commsy_url_path . "/" . _curl(false, $roomItem->getItemId(), 'home', 'index', array()) . "]]></link>\n"; $xml .= "<description><![CDATA[" . $roomItem->getDescription() . "]]></description>\n"; $xml .= "<mayEdit><![CDATA[" . ($mayEdit ? "yes" : "no") . "]]></mayEdit>\n"; $xml .= "<isDeleted><![CDATA[" . ($roomItem->isDeleted() ? "yes" : "no") . "]]></isDeleted>\n"; $type = "group"; if ($roomItem->isProjectRoom()) { $type = "project"; } else { if ($roomItem->isCommunityRoom()) { $type = "community"; } } $xml .= "<type><![CDATA[" . $type . "]]></type>\n"; $xml .= "<contacts>\n"; if ($contactPersons->isNotEmpty()) { $contactPerson = $contactPersons->getFirst(); while ($contactPerson) { $xml .= "<person>\n"; $xml .= " <fullName><![CDATA[" . $contactPerson->getFullName() . "]]></fullName>\n"; $xml .= " <email><![CDATA[" . $contactPerson->getEmail() . "]]></email>\n"; $xml .= "</person>\n"; $contactPerson = $contactPersons->getNext(); } } $xml .= "</contacts>\n"; $xml .= "<communities>\n"; if ($communityRooms->isNotEmpty()) { $communityRoom = $communityRooms->getFirst(); while ($communityRoom) { $xml .= " <room>\n"; $xml .= " <id><![CDATA[" . $communityRoom->getItemId() . "]]></id>\n"; $xml .= " <title><![CDATA[" . $communityRoom->getTitle() . "]]></title>\n"; $xml .= " </room>\n"; $communityRoom = $communityRooms->getNext(); } } $xml .= "</communities>\n"; if ($this->_environment->getCurrentContextItem()->showTime() && ($roomItem->isProjectRoom() || $roomItem->isCommunityRoom())) { $timeList = $roomItem->getTimeList(); if ($timeList->isNotEmpty()) { if ($roomItem->isContinuous()) { $xml .= " <time assigned='true' continues='true'>\n"; $xml .= " <intervalTranslation><![CDATA[" . $translator->getMessage('COMMON_TIME_NAME') . "]]></intervalTranslation>\n"; $timeItem = $timeList->getFirst(); if ($roomItem->isClosed()) { $timeItemLast = $timeList->getLast(); if ($timeItemLast->getItemId() == $timeItem->getItemId()) { $xml .= "<intervals>\n"; $xml .= " <interval>\n"; $xml .= " <title><![CDATA[" . $translator->getMessage("COMMON_FROM2") . " " . $translator->getTimeMessage($timeItem->getTitle()) . "]]></title>\n"; $xml .= " <id><![CDATA[" . $timeItem->getItemId() . "]]></id>\n"; $xml .= " </interval>\n"; $xml .= " <interval>\n"; $xml .= " <title><![CDATA[" . $translator->getMessage("COMMON_TO") . " " . $translator->getTimeMessage($timeItemLast->getTitle()) . "]]></title>\n"; $xml .= " <id><![CDATA[" . $timeItem->getItemId() . "]]></id>\n"; $xml .= " </interval>\n"; $xml .= "</intervals>\n"; } else { $xml .= " <constant><![CDATA[" . $translator->getTimeMessage($timeItem->getTitle()) . "]]></constant>\n"; } } else { $xml .= " <constant><![CDATA[" . $translator->getMessage("ROOM_CONTINUOUS_SINCE") . ' ' . BRLF . $translator->getTimeMessage($timeItem->getTitle()) . "]]></constant>\n"; } } else { $xml .= " <time assigned='true' continues='false'>\n"; $xml .= " <intervalTranslation><![CDATA[" . $translator->getMessage('COMMON_TIME_NAME') . "]]></intervalTranslation>\n"; $timeItem = $timeList->getFirst(); $xml .= "<intervals>\n"; while ($timeItem) { $xml .= "<interval>\n"; $xml .= " <title><![CDATA[" . $translator->getTimeMessage($timeItem->getTitle()) . "]]></title>\n"; $xml .= " <id><![CDATA[" . $timeItem->getItemId() . "]]></id>\n"; $xml .= "</interval>\n"; $timeItem = $timeList->getNext(); } $xml .= "</intervals>\n"; } } else { $xml .= "<time assigned='false'>\n"; $xml .= " <intervalTranslation><![CDATA[" . $translator->getMessage('COMMON_TIME_NAME') . "]]></intervalTranslation>\n"; } } else { $xml .= "<time>\n"; } $xml .= "</time>\n"; $xml .= "</room>"; $xml = $this->_encode_output($xml); } else { return new SoapFault('ERROR', 'Session (' . $session_id . ') not valid!'); } return $xml; }
function _get_stats_flag_data($conn_db, $v1, $v2, $stats_flag, $date) { $v2_index = ''; $v2_index = strstr($v2, '点击数(总量)') ? 'TOTAL_CLI' : $v2_index; $v2_index = strstr($v2, '点击数(独立IP)') ? 'TOTAL_IP' : $v2_index; $v2_index = strstr($v2, '点击数(人均)') ? 'AVG' : $v2_index; if ($v2_index == '') { echo 'v2 参数错误'; return false; } $url = "http://partner.site.com/interface/rd/sc?ud={$date}&cli={$stats_flag}"; $chinfo = null; $result = _curl($chinfo, $url); if ($result == '') { echo "接口数据有误"; return fasle; } $result = json_decode($result, true); $result = $result[0]; if ($v2_index == 'AVG' && $result['TOTAL_IP']) { $result['AVG'] = $result['TOTAL_CLI'] / $result['TOTAL_IP']; } else { $result['AVG'] = 0; } //更新配置表 $sql = "update {$this->report_monitor} set fun_count=:fun_count where v1=:v1 and v2=:v2 and cal_date =to_date(:cal_date,'yyyy-mm-dd hh24:mi:ss')"; $stmt = _ociparse($conn_db, $sql); _ocibindbyname($stmt, ':v1', $v1); _ocibindbyname($stmt, ':v2', $v2); _ocibindbyname($stmt, ':cal_date', $date); _ocibindbyname($stmt, ':fun_count', $result[$v2_index]); $error = _ociexecute($stmt); if (ocirowcount($stmt)) { $sql = "insert into {$this->report_monitor}(id, v1, v2, v3, v5, fun_count, cal_date, md5, add_time ) values\n (seq_{$this->report_monitor}.nextval, :v1, :v2, :vip, :vip, :fun_count, to_date(:cal_date,'yyyy-mm-dd hh24:mi:ss'), :md5, sysdate)"; $stmt = _ociparse($conn_db, $sql); _ocibindbyname($stmt, ':v1', $v1); _ocibindbyname($stmt, ':v2', $v2); _ocibindbyname($stmt, ':vip', VIP); _ocibindbyname($stmt, ':fun_count', $result[$v2_index]); _ocibindbyname($stmt, ':cal_date', $date); _ocibindbyname($stmt, ':md5', md5($v1 . $v2 . $date)); $error = _ociexecute($stmt); } //更新天表数据 $sql = "update {$this->report_monitor_date} set fun_count=:fun_count where v1=:v1 and v2=:v2 and cal_date =to_date(:cal_date,'yyyy-mm-dd')"; $stmt = _ociparse($conn_db, $sql); _ocibindbyname($stmt, ':v1', $v1); _ocibindbyname($stmt, ':v2', $v2); _ocibindbyname($stmt, ':cal_date', $date); _ocibindbyname($stmt, ':fun_count', $result[$v2_index]); $error = _ociexecute($stmt); var_dump($error); if (!ocirowcount($stmt)) { $sql = "insert into {$this->report_monitor_date}( v1, v2, fun_count, cal_date) values\n ( :v1, :v2, :fun_count, to_date(:cal_date,'yyyy-mm-dd hh24:mi:ss'))"; $stmt = _ociparse($conn_db, $sql); _ocibindbyname($stmt, ':v1', $v1); _ocibindbyname($stmt, ':v2', $v2); _ocibindbyname($stmt, ':fun_count', $result[$v2_index]); _ocibindbyname($stmt, ':cal_date', $date); $error = _ociexecute($stmt); var_dump($error); } //更新小时表数据 $sql = "update {$this->report_monitor_hour} set fun_count=:fun_count where v1=:v1 and v2=:v2 and cal_date =to_date(:cal_date,'yyyy-mm-dd hh24:mi:ss')"; $stmt = _ociparse($conn_db, $sql); _ocibindbyname($stmt, ':v1', $v1); _ocibindbyname($stmt, ':v2', $v2); _ocibindbyname($stmt, ':cal_date', $date); _ocibindbyname($stmt, ':fun_count', $result[$v2_index]); $error = _ociexecute($stmt); var_dump($error); if (!ocirowcount($stmt)) { $sql = "insert into {$this->report_monitor_hour}( v1, v2, v3, fun_count, cal_date ) values\n (:v1, :v2, :v3, :fun_count, to_date(:cal_date,'yyyy-mm-dd hh24:mi:ss'))"; $stmt = _ociparse($conn_db, $sql); _ocibindbyname($stmt, ':v1', $v1); _ocibindbyname($stmt, ':v2', $v2); _ocibindbyname($stmt, ':v3', VIP); _ocibindbyname($stmt, ':fun_count', $result[$v2_index]); _ocibindbyname($stmt, ':cal_date', $date); $error = _ociexecute($stmt); var_dump($error); } }
$params2 = $environment->getCurrentParameterArray(); $params2['jscheck'] = '1'; /* if ( !empty($_POST['user_id']) ) { $params2['user_id'] = $_POST['user_id']; } if ( !empty($_POST['password']) ) { $params2['password'] = $_POST['password']; } */ $params1 = $params2; $params1['isJS'] = '1'; $url1 = _curl( false, $environment->getCurrentContextID(), $environment->getCurrentModule(), $environment->getCurrentFunction(), $params1 ); $url2 = curl( $environment->getCurrentContextID(), $environment->getCurrentModule(), $environment->getCurrentFunction(), $params2 ); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <noscript> <meta http-equiv="refresh" content="0; URL=<?PHP echo($url2); ?>"> </noscript> <script src="javascript/Adobe/AC_OETags.js" language="javascript"></script>
$post_id = $val->id; $post_from_category = clean_insert($val->from->category); $post_from_name = clean_insert($val->from->name); $post_from_id = $val->from->id; $post_message = clean_insert($val->message); $post_picture = clean_insert($val->picture); $post_link = clean_insert($val->link); $post_name = clean_insert($val->name); $post_caption = clean_insert($val->caption); $post_type = clean_insert($val->type); $post_description = clean_insert($val->description); $post_created_time = $val->created_time; $post_updated_time = $val->updated_time; # PAGE POST COMMENTS [START] $url = "https://graph.facebook.com/{$post_id}/comments?access_token={$user_page_info['page_access_token'][0]}&limit=10"; $output_json = _curl($url); $page_post_comments_details = (array) json_decode($output_json); $comment_sql = ''; $comments_count = count($page_post_comments_details['data']); if ($comments_count > 0) { $comment_sql = "INSERT INTO tbl_facebook_page_post_comments (comment_id, from_name,from_id, message, created_time, like_count, user_likes, page_post_id) VALUES "; foreach ($page_post_comments_details['data'] as $cv) { $comment_id = $cv->id; $comment_from_name = clean_insert($cv->from->name); $comment_from_id = $cv->from->id; $comment_message = clean_insert($cv->message); $comment_like_count = $cv->like_count; $comment_created_time = clean_insert($cv->created_time); $comment_user_likes = $cv->user_likes; $comment_sql .= "('" . $comment_id . "',"; $comment_sql .= "'" . $comment_from_name . "',";
$con2 = 0; echo "<p>Ip :" . $ip . "</p>"; echo '<table align="center" border="1" width="50%" cellspacing="1" cellpadding="5">'; echo '<tr><td> <font color="white"> Web Site </td><td> <font color="white">Jce Rezult </font></td></tr>'; while ($j < 50000000) { $url = 'http://www.bing.com/search?q=ip:' . $ip . '%20index.php?option%20&first=' . $j; $result = _curl($url, 'http://www.bing.com/'); preg_match_all('(<div class="sb_tlst">.*<h3>.*<a href="(.*)".*>(.*)</a>.*</h3>.*</div>)siU', $result, $findlink); $cont = count($findlink[1]); for ($i = 0; $i < $cont; $i++) { $shit = explode("/", $findlink[1][$i]); if (preg_match("/\\bindex.php\\b/i", $findlink[1][$i])) { preg_match_all('(http://(.*)index.php)siU', $findlink[1][$i], $shit); $website = "http://" . $shit[1][0]; $dork = "/index.php?option=com_jce&task=plugin&plugin=imgmanager&file=imgmanager&method=form&cid=20&6bc427c8a7981f4fe1f5ac65c1246b5f=9d09f693c63c1988a9f8a564e0da7743"; $result2 = _curl($website . $dork, $website); if (strpos($result2, '{"result":null,"error":"No function call specified!"}')) { echo '<tr><td><font color="green" ><a href="' . $website . '">' . $website . "</a></td>"; echo "<td> <font color='green' >Jce On </font></td></tr>"; } else { echo '<tr><td><font color="red" ><a href="' . $website . '">' . $website . "</a></td>"; echo "<td> <font color='red' >Error</font></td></tr>"; } } } $j = $j + 10; $con2 = $con2 + $cont; if ($cont < 10) { break; } if ($cont == 0) {
function asHTML() { $html = ''; $html .= '<div id="' . get_class($this) . '" style="padding-bottom:5px;">' . LF; $html .= ' <span style="margin-bottom:0px; margin-top:0px; font-weight:bold;">' . $this->_translator->getMessage('COMMON_SORTING_BOX') . ':</span> ' . LF; $html .= '<a href="javascript:callStudyLogSortAlphabetical()">' . $this->_translator->getMessage('COMMON_TITLE') . '</a>' . LF; $html .= ' | <a href="javascript:callStudyLogSortChronological()">' . $this->_translator->getMessage('COMMON_CALENDAR_DATE') . '</a>' . LF; $html .= ' | <a href="javascript:callStudyLogSortDefault()">' . $this->_translator->getMessage('COMMON_NO_SORTING') . '</a>' . LF; $html .= '</div>' . LF; $current_context_item = $this->_environment->getCurrentContextItem(); $color_array = $current_context_item->getColorArray(); unset($current_context_item); $params = array(); $params = $this->_environment->getCurrentParameterArray(); $params['output'] = 'XML'; $params['SID'] = $this->_environment->getSessionID(); $data_url = utf8_encode(rawurlencode(_curl(false, $this->_environment->getCurrentContextID(), 'material', 'index', $params))); unset($params); $height = '450px'; $bgcolor = '#ffffff'; unset($color_array); # $html .= '<div class="index_flash" style="height: '.$height.'; background-color: '.$bgcolor.';">'.LF; $html .= '<div id="docuverser" style="height: ' . $height . '; background-color: ' . $bgcolor . ';">' . LF; // jQuery //$html .= '<script src="javascript/studylog_flash.js" language="javascript" type="text/javascript"></script>'.LF; // jQuery $html .= '<noscript>' . LF; $html .= ' <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' . LF; $html .= ' id="study_log" width="100%" height="' . $height . '"' . LF; $html .= ' codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">' . LF; $html .= ' <param name="movie" value="flash/study_log.swf" />' . LF; $html .= ' <param name="quality" value="high" />' . LF; $html .= ' <param name="FlashVars" value="applicationType=commsy&commsyXml=' . $data_url . '" />' . LF; $html .= ' <param name="wmode" value="transparent" />' . LF; $html .= ' <param name="bgcolor" value="' . $bgcolor . '" />' . LF; $html .= ' <param name="allowScriptAccess" value="sameDomain" />' . LF; $html .= ' <embed src="study_log.swf" quality="high" bgcolor="' . $bgcolor . '"' . LF; $html .= ' width="100%" height="' . $height . '" name="study_log" align="middle"' . LF; $html .= ' play="true"' . LF; $html .= ' FlashVars="applicationType=commsy&commsyXml=' . $data_url . '"' . LF; $html .= ' wmode="transparent"' . LF; $html .= ' loop="false"' . LF; $html .= ' quality="high"' . LF; $html .= ' allowScriptAccess="sameDomain"' . LF; $html .= ' type="application/x-shockwave-flash"' . LF; $html .= ' pluginspage="http://www.adobe.com/go/getflashplayer">' . LF; $html .= ' </embed>' . LF; $html .= ' </object>' . LF; $html .= '</noscript>' . LF; $html .= '</div>' . LF; return $html; }
/** * Construct a commsy url (custom url) related to a given schema. * Module and function specify a target script to be called with this curl, * parameter and fragment are used to pass values to that script, * filehack is used to fake a files realname into a curl (used by * the material manager). * * @param $module commsy module referring to * @param $function functions are represented by filesnames (without extension) * @param $parameter normal parameters ARRAY * @param $fragment (optional) anchor what goes behind a '#' * @param $filehack (optional) for faking real filenames into file downloads * @param $file (optional) for switching between commsy tools * */ function curl($context_id, $module, $function, $parameter, $fragment = '', $filehack = '', $file = '') { return _curl(true, $context_id, $module, $function, $parameter, $fragment, $filehack, $file); }
public function getDetailActionAsHTML () { $retour = ''; $current_user = $this->_environment->getCurrentUserItem(); if ( $this->_environment->inPrivateRoom() ) { $own_room = $this->_environment->getCurrentContextItem(); } else { $own_room = $current_user->getOwnRoom(); } if ( isset($own_room) and !$current_user->isOnlyReadUser() ) { $system = 'mediabird'; $url_params = array(); $url_params['name'] = $system; $url_params['SID'] = $this->_environment->getSessionID(); include_once('functions/security_functions.php'); $url_params['security_token'] = getToken(); $url_params['output'] = 'pure'; $plugin_folder = 'plugins'; $plugin_name = '/mediabird'; $plugin_dir = $plugin_folder.$plugin_name; $commsyUrl = $this->_getContentLink(); include_once($plugin_dir.'/config/config_default.php'); include($plugin_dir.'/config/config.php'); include_once($plugin_dir.'/server/helper.php'); include_once($plugin_dir.'/server/utility.php'); include_once($plugin_dir.'/server/dbo.php'); include_once($plugin_dir.'/server/db_mysql.php'); global $mediabirdDb; $mediabirdDb = new MediabirdDboMySql(); $helper = new MediabirdHtmlHelper(); $userId = $this->_getMBUserID(); if($mediabirdDb->connect()) { $relatedNotes = $helper->findRelatedNotes($commsyUrl,$userId,$mediabirdDb); $title = $this->_translator->getMessage('MEDIABIRD_ACTION_ICON_USER_TITLE'); if($relatedNotes && count($relatedNotes[0])>0) { // there are own notices $card_id = $relatedNotes[0][0]; $img = ucfirst($this->_translator->getMessage('MEDIABIRD_ACTION_NAME_DETAIL')).' ('.count($relatedNotes[0]).')'; } else { //no related notes yet $img = ucfirst($this->_translator->getMessage('MEDIABIRD_ACTION_NAME_DETAIL')); //determine the card the user's been to most recently if(isset($userId) && ($sessionRecord = $mediabirdDb->getRecord(MediabirdConfig::tableName("Session",true),"user_id=$userId"))) { $card_id = $sessionRecord->card_id; } } $mediabirdDb->disconnect(); } else { $title = $this->_translator->getMessage('MEDIABIRD_ACTION_ICON_USER_TITLE'); $img = ucfirst($this->_translator->getMessage('MEDIABIRD_ACTION_NAME_DETAIL')); } $retour = '<a href="javascript:void(0)" id="mediabirdLink" title="'.$title.'">'.$img.'</a>'.LF; $frameUrl = _curl(false,$this->_environment->getCurrentContextID(),$system,'index',$url_params); $frameUrl .= "&mb_url=".urlencode($commsyUrl); if ( !empty( $card_id ) ) { $frameUrl .= "&mb_card_id=".urlencode($card_id); } $titleHtml = '<div class="title">'.$this->_translator->getMessage('MEDIABIRD_OVERLAY_TITLE').'</div>'; $retour .= '<div id="mediabirdOverlay" class="mediabird-overlay">'.LF; $retour .= ' <div class="bar"><a href="javascript:void(0)" class="closer">X</a><a href="javascript:void(0)" class="expander expanded"></a>'.$titleHtml.'</div>'.LF; $retour .= ' <div class="resize-handle right"></div>'.LF; $retour .= ' <div class="resize-handle"></div>'.LF; $retour .= ' <iframe src="" frameborder="no" scrolling="no" id="mediabirdFrame">'.LF; $retour .= ' </iframe>'.LF; $retour .= '</div>'.LF; $retour .= '<script type="text/javascript" src="'.$plugin_dir.'/js/overlay.js"></script>'.LF; $retour .= '<link rel="stylesheet" href="'.$plugin_dir.'/css/overlay_commsy.php?cid='.$this->_environment->getCurrentContextID().'"/>'.LF; $retour .= '<script type="text/javascript">'.LF; $retour .= '//<![CDATA['.LF; $retour .= ' mbOverlay.MAX_HEIGHT = 544;'.LF; $retour .= ' mbOverlay.MAX_WIDTH = 685;'.LF; $retour .= ' mbOverlay.SIZE_SECURE = 34;'.LF; $retour .= ' var url = "'.$frameUrl.'";'.LF; $retour .= ' mbOverlay.doIframe(url,document.getElementById("mediabirdLink"),document.getElementById("mediabirdOverlay"),{width:685,height:544},document.getElementById("mediabirdFrame"));'.LF; $retour .= '//]]>'.LF; $retour .= '</script>'.LF; } elseif ( $current_user->isOnlyReadUser() ) { $title = $this->_translator->getMessage('COMMON_NO_ACTION_NEW',$this->_translator->getMessage('MEDIABIRD_OVERLAY_TITLE')); $img = '<img src="'.$this->getActionNotActiveIcon().'" style="vertical-align:bottom;" title="'.$title.'"/>'; $retour = $img.LF; } else { $title = $this->_translator->getMessage('MEDIABIRD_ACTION_ICON_NOT_ACTIVE_TITLE'); $img = '<img src="'.$this->getActionNotActiveIcon().'" style="vertical-align:bottom;" title="'.$title.'"/>'; $retour = $img.LF; } return $retour; }
public function getItemUrl() { $type = $this->getType(); $fct = 'detail'; $params = array(); if ($type == CS_FILE_TYPE) { $mod = type2Module(CS_MATERIAL_TYPE); $fct = 'getfile'; $params['iid'] = $this->getFileID(); } elseif ($type == CS_LABEL_TYPE) { $mod = type2Module($this->getLabelType()); $params['iid'] = $this->getItemID(); } else { $mod = type2Module($type); $params['iid'] = $this->getItemID(); } $session_item = $this->_environment->getSessionItem(); if (isset($session_item) and $session_item->issetValue('cookie') and $session_item->issetValue('cookie') != 1) { $params['SID'] = $session_item->getSessionID(); } global $c_commsy_domain; global $c_commsy_url_path; $retour = $c_commsy_domain . $c_commsy_url_path . '/' . _curl(false, $this->getContextID(), $mod, $fct, $params); return $retour; }
$youtube_info_data['video_category'] = remove_spacial_1(remove_spacial(clean_insert($ev->category[1]->label))); $youtube_info_data['published_date'] = $published_date; $youtube_info_data['video_url'] = mysql_real_escape_string($ev->link[0]->href); $youtube_info_data['project_id'] = $project_id; $youtube_info_data['created_date'] = $current_date; $youtube_info_data['updated_date'] = $current_date; # TO STORE VIDEO INFO DATA [END] # ADD NEW VIDEO DATA $video_info_id = addData('tbl_youtube_video_info', $youtube_info_data); } else { $video_info_id = $video_info_result['video_info_id']; } # COMMENT CRON [START] if (!empty($ev->{'gd$comments'}->{'gd$feedLink'}->href)) { $comment_url = $ev->{'gd$comments'}->{'gd$feedLink'}->href . '&max-results=' . $max_result . '&alt=json'; $output_json = _curl($comment_url); $comment_data = json_decode($output_json); # COMMENT CRON [END] $comments_entry = $comment_data->feed->entry; $j = 1; $comment_user_name = ''; foreach ($comments_entry as $ck => $cv) { if (!empty($cv->author[0]->{'uri'}->{'$t'})) { $get_comment_user_id = end(explode('/', $cv->author[0]->{'uri'}->{'$t'})); $comment_user_id = "http://www.youtube.com/user/" . $get_comment_user_id; $comment_user_name = remove_spacial_1(remove_spacial(clean_insert($cv->author[0]->{'name'}->{'$t'}))); } $comments_published_date = date('Y-m-d H:i:s', strtotime($cv->published->{'$t'})); $comment = remove_spacial_1(remove_spacial(clean_insert($cv->content->{'$t'}))); # TO STORE VIDEO COMMENTS DATA [START] $youtube_comment_data = array();
/** redirect to a given commsy page * first save session than * construct a commsy url (custom url) related to a given schema * and redirect to the commsy page * * Module and function specify a target script to be called with this curl, * parameter and fragment are used to pass values to that script, * filehack is used to fake a files realname into a curl (used by * the material manager). * * @param $context_id id of the current context * @param $module commsy module referring to * @param $function functions are represented by filesnames (without extension) * @param $parameter (optional) normal parameters ARRAY * @param $fragment (optional) anchor what goes behind a '#' * @param $filehack (optional) for faking real filenames into file downloads * @param $file (optional) for switching between commsy tools */ function redirect($context_id, $module, $function, $parameter = '', $fragment = '', $filehack = '', $file = '') { include_once 'functions/curl_functions.php'; redirect_with_url(_curl(false, $context_id, $module, $function, $parameter, $fragment, $filehack, $file)); }
function getDokuverserJavascriptAsHTML() { $current_context_item = $this->_environment->getCurrentContextItem(); $color_array = $current_context_item->getColorArray(); unset($current_context_item); $params = array(); $params = $this->_environment->getCurrentParameterArray(); $params['output'] = 'XML'; $params['SID'] = $this->_environment->getSessionID(); $data_url = utf8_encode(rawurlencode(_curl(false, $this->_environment->getCurrentContextID(), 'material', 'index', $params))); unset($params); $height = '450px'; $bgcolor = '#ffffff'; unset($color_array); $html = ''; $html .= '<script src="javascript/AC_OETags.js" language="javascript" type="text/javascript"></script>' . LF; $html .= '<script src="javascript/history/history.js" language="javascript" type="text/javascript"></script>' . LF; $html .= '<script language="JavaScript" type="text/javascript">' . LF; $html .= '<!--' . LF; $html .= '// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)' . LF; $html .= 'var hasProductInstall = DetectFlashVer(6, 0, 65);' . LF; $html .= '// Version check based upon the values defined in globals' . LF; $html .= 'var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);' . LF; $html .= 'if ( hasProductInstall && !hasRequestedVersion ) {' . LF; $html .= ' // DO NOT MODIFY THE FOLLOWING FOUR LINES' . LF; $html .= ' // Location visited after installation is complete if installation is required' . LF; $html .= ' var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";' . LF; $html .= ' var MMredirectURL = window.location;' . LF; $html .= ' document.title = document.title.slice(0, 47) + " - Flash Player Installation";' . LF; $html .= ' var MMdoctitle = document.title;' . LF; $html .= ' jQuery("#docuverser").append(AC_FL_RunContent(' . LF; $html .= ' "src", "flash/playerProductInstall",' . LF; $html .= ' "FlashVars", "MMredirectURL="+MMredirectURL+\'&MMplayerType=\'+MMPlayerType+\'&MMdoctitle=\'+MMdoctitle+\'&commsyXml=\'+\'' . $data_url . '\'+\'&applicationType=commsy\'+"",' . LF; $html .= ' "width", "100%",' . LF; $html .= ' "height", "' . $height . '",' . LF; $html .= ' "align", "middle",' . LF; $html .= ' "id", "study_log",' . LF; $html .= ' "wmode", "transparent",' . LF; $html .= ' "quality", "high",' . LF; $html .= ' "bgcolor", "' . $bgcolor . '",' . LF; $html .= ' "name", "study_log",' . LF; $html .= ' "allowScriptAccess","sameDomain",' . LF; $html .= ' "type", "application/x-shockwave-flash",' . LF; $html .= ' "pluginspage", "http://www.adobe.com/go/getflashplayer"' . LF; $html .= ' ));' . LF; $html .= '} else if (hasRequestedVersion) {' . LF; $html .= ' // if we\'ve detected an acceptable version' . LF; $html .= ' // embed the Flash Content SWF when all tests are passed' . LF; $html .= ' jQuery("#docuverser").append(AC_FL_RunContent(' . LF; $html .= ' "src", "flash/study_log",' . LF; $html .= ' "FlashVars", "thickbox=false&thickboxHeight=550&motionSpeed=18&thumbWidth=14&applicationType=commsy&commsyXml=' . $data_url . '",' . LF; $html .= ' "width", "100%",' . LF; $html .= ' "height", "' . $height . '",' . LF; $html .= ' "align", "middle",' . LF; $html .= ' "id", "study_log",' . LF; $html .= ' "wmode", "transparent",' . LF; $html .= ' "quality", "high",' . LF; $html .= ' "bgcolor", "' . $bgcolor . '",' . LF; $html .= ' "name", "study_log",' . LF; $html .= ' "allowScriptAccess","sameDomain",' . LF; $html .= ' "type", "application/x-shockwave-flash",' . LF; $html .= ' "pluginspage", "http://www.adobe.com/go/getflashplayer"' . LF; $html .= ' ));' . LF; $html .= ' } else { // flash is too old or we can\'t detect the plugin' . LF; $html .= ' var alternateContent = \'This content requires the Adobe Flash Player. <a href="http://www.adobe.com/go/getflash/">Get Flash</a>;\'' . LF; $html .= ' jQuery("#docuverser").append(alternateContent); // insert non-flash content' . LF; $html .= ' }' . LF; $html .= '// -->' . LF; $html .= '</script>' . LF; return $html; }