public function activityUpdatesBySubject($dryrun = false) { echo "<h3>Running Activity Tweet Update</h3><i>Date Started: " . date('r') . "</i>" . BR . BR; if ($dryrun == "true") { echo "<pre>RUNNING IN DRY-RUN MODE - NO ACTUAL TWEETS WILL BE SENT!!! Remove /true in the URL to run properly!</pre>"; } // Setup our API access $this->load->library('twitter'); $twitter = new Twitter(array('consumerKey' => $this->consumer_key, 'consumerSecret' => $this->consumer_secret)); $twitter->setOAuthToken($this->oauth_access_token); $twitter->setOAuthTokenSecret($this->oauth_access_secret); // Go and get our activity information $service_url = registry_url('services/rda/getLatestActivityBySubject/' . $this->num_days_history); $data = @json_decode(@file_get_contents($service_url), true); if (!isset($data['results']) || count($data['results']) == 0) { echo "No activity information to be displayed. No updates matched the query at " . $service_url; return; } else { echo "<h4>Found " . count($data['results']) . " updates for the past " . $this->num_days_history . " days...</h4>"; // Reverse the sort order so largest update counts come last (i.e. highest on the Twitter feed) krsort($data['results']); foreach ($data['results'] as $idx => $update) { try { // Format our tweet message $tweet = sprintf("%d %s added with the subject '%s' #ANZSRC%s", $update['num_records'], pluralise("collection", $update['num_records']), ellipsis($update['value']), $update['notation']); echo "Sending Tweet: <i>" . $tweet . "</i>..."; flush(); if (!$dryrun) { $twitter->statusesUpdate($tweet); echo "sent " . BR; flush(); } sleep(0.5); // Pause between big chunks of tweets if ($idx % 5 == 0) { sleep(5); } } catch (TwitterException $e) { echo BR . BR . "Unable to send Tweet to Twitter API: " . $e->getMessage() . BR . BR; } catch (Exception $e) { echo BR . BR . "Unknown Exception: " . $e->getMessage() . BR . BR; } } } return; }
$order = 0; while (list($key, $val) = each($mostViewedTracks)) { list($id, $artist, $title) = explode('|', html_entity_decode($key)); $fontSize = 2.3 * (1 - $order / 5) + $order / 5 * 0.6; echo "<li><span class=\"count bdBot\">"; $i18n->views(intval($mostViewedTracks[$key])); echo "</span><span class=\"order bdTop bdBot\">" . ++$order . "</span><span class=\"title\"><a style=\"font-size: " . $fontSize . "em\" href=\"" . _SITE_URL . "/t/" . DBUtils::toUid($id, _BASE_MULTIPLIER) . "\">" . ellipsis($title, 30) . "</a></span><span class=\"artist bdTop\">" . $artist . "</span></li>"; } ?> </ul> </div> <div id="mostViewedAlbums"> <h2 class="color"><?php echo $i18n->most_viewed_albums($listDisplayLimit); ?> </h2> <ul> <?php $order = 0; while (list($key, $val) = each($mostViewedAlbums)) { list($id, $artist, $title) = explode('|', html_entity_decode($key)); $fontSize = 2.3 * (1 - $order / 5) + $order / 5 * 0.6; echo "<li><span class=\"count bdBot\">"; $i18n->views(intval($mostViewedAlbums[$key])); echo "</span><span class=\"order bdTop bdBot\">" . ++$order . "</span><span class=\"title\"><a style=\"font-size: " . $fontSize . "em\" href=\"" . _SITE_URL . "/a/" . DBUtils::toUid($id, _BASE_MULTIPLIER) . "\">" . ellipsis($title, 30) . "</a></span><span class=\"artist bdTop\">" . $artist . "</span></li>"; } ?> </ul> </div> </div>
if ($data->picture->thumb_url) { $image = $data->picture->thumb_url; } } else { // Get Channel data $data = json_decode(file_get_contents('http://api.new.livestream.com/accounts/' . $username . '/')); // Image if ($data->picture->thumb_url) { $image = $data->picture->thumb_url; } } break; } // Strings $live = 'LIVE'; $game = ellipsis($game); $offline = 'Offline'; // Fonts $font = '../styles/fonts/OpenSans-Regular.ttf'; $font_bold = '../styles/fonts/OpenSans-Bold.ttf'; $custom_font = '../styles/fonts/badge-eye.ttf'; // Live image/icon $image_live = '../images/live.png'; $image_eye = 'e'; /*** Positions ***/ // Username $username_font_size = 12; $username_x = 64; $username_y = 23; // Live $live_font_size = 9;
?> " data-toggle="tooltip" data-placement="left" title="<?php echo $viewProject; ?> "> <?php echo clean($e['projectName']); ?> </a> <span class="pull-right"> <?php echo $createdByTableHead; ?> : <?php echo clean($e['theAdmin']); ?> </span> </strong> <br /> <?php echo ellipsis($e['taskDesc'], 120); ?> </p> </div> </div> </div> <?php } ?> </div>
"> <?php echo clean($cols['fileTitle']); ?> </a> </td> <td data-th="<?php echo $descriptionText; ?> "> <span data-toggle="tooltip" data-placement="top" title="<?php echo ellipsis($cols['fileDesc'], 200); ?> "> <?php echo ellipsis($cols['fileDesc'], 50); ?> </span> </td> <td data-th="<?php echo $folderText; ?> "> <a href="index.php?action=viewFolder&folderId=<?php echo $cols['folderId']; ?> " data-toggle="tooltip" data-placement="right" title="<?php echo $viewFolderText; ?> "> <?php
<th class="name">Album</th> <th class="name" width="52px"></th> </tr> </thead> <tbody> <?php while (list($id, $item) = each($items)) { echo "<tr><td width=\"35px\" class=\"image\"><img src=\"" . $item['image'] . "\" width=\"30px\" /></td><td class=\"name\">"; if ($type == _TABLE_TRACK) { echo "<a href=\"" . _SITE_URL . '/t/' . DBUtils::toUid($id, _BASE_MULTIPLIER) . "\" target=\"_blank\">" . html_entity_decode($item['name']) . "</a></td>"; } else { echo "<a href=\"" . _SITE_URL . '/a/' . DBUtils::toUid($id, _BASE_MULTIPLIER) . "\" target=\"_blank\">" . html_entity_decode($item['album']) . "</a></td>"; } echo "<td class=\"name\">" . html_entity_decode($item['artist']) . "</td>"; if ($type == _TABLE_TRACK) { echo "<td class=\"name\">" . ellipsis(html_entity_decode($item['album']), 40) . "</td>"; } else { echo "<td class=\"name\"></td>"; } echo "<td class=\"name addAPick\" rel=\"" . $id . "\">pick it</td></tr>"; } ?> </tbody> </table> </div> </div> </div> </div> </div> </div>
echo $rows['projectId']; ?> " data-toggle="tooltip" data-placement="right" title="<?php echo $viewProject; ?> "> <?php echo clean($rows['projectName']); ?> </a> </td> <td data-th="<?php echo $descText; ?> "><?php echo ellipsis($rows['projectDeatils'], 65); ?> </td> <td data-th="<?php echo $assignedToText; ?> "><?php echo clean($rows['managerAssigned']); ?> </td> <td data-th="<?php echo $percentCompleteText; ?> "><?php echo clean($rows['percentComplete']); ?>
<?php echo clean($msg['messageTitle']); ?> </a> </h4> <p class="infoLabels"> <?php echo $rcvdFromField . ': ' . clean($msg['sentBy']); ?> <span class="pull-right"><?php echo $dateRcvdField . ': ' . $msg['messageDate']; ?> </span> </p> <p><?php echo ellipsis($msg['messageText'], 140); ?> </p> </div> <?php } } else { ?> <div class="alertMsg default"> <i class="fa fa-minus-square-o"></i> <?php echo $noRecentMsgFound; ?> </div> <?php } ?>
/** * @brief Loads an image from a local file. * @param $imageref The path to a local file. * @returns An image resource or false on error */ public function loadFromFile($imagepath = false) { if (!is_file($imagepath) || !file_exists($imagepath) || !is_readable($imagepath)) { // Debug output disabled because this method is tried before loadFromBase64? OC_Log::write('core', 'OC_Image->loadFromFile, couldn\'t load: ' . ellipsis($imagepath, 50), OC_Log::DEBUG); return false; } $itype = exif_imagetype($imagepath); switch ($itype) { case IMAGETYPE_GIF: if (imagetypes() & IMG_GIF) { $this->resource = imagecreatefromgif($imagepath); } else { OC_Log::write('core', 'OC_Image->loadFromFile, GIF images not supported: ' . $imagepath, OC_Log::DEBUG); } break; case IMAGETYPE_JPEG: if (imagetypes() & IMG_JPG) { $this->resource = imagecreatefromjpeg($imagepath); } else { OC_Log::write('core', 'OC_Image->loadFromFile, JPG images not supported: ' . $imagepath, OC_Log::DEBUG); } break; case IMAGETYPE_PNG: if (imagetypes() & IMG_PNG) { $this->resource = imagecreatefrompng($imagepath); } else { OC_Log::write('core', 'OC_Image->loadFromFile, PNG images not supported: ' . $imagepath, OC_Log::DEBUG); } break; case IMAGETYPE_XBM: if (imagetypes() & IMG_XPM) { $this->resource = imagecreatefromxbm($imagepath); } else { OC_Log::write('core', 'OC_Image->loadFromFile, XBM/XPM images not supported: ' . $imagepath, OC_Log::DEBUG); } break; case IMAGETYPE_WBMP: case IMAGETYPE_BMP: if (imagetypes() & IMG_WBMP) { $this->resource = imagecreatefromwbmp($imagepath); } else { OC_Log::write('core', 'OC_Image->loadFromFile, (W)BMP images not supported: ' . $imagepath, OC_Log::DEBUG); } break; /* case IMAGETYPE_TIFF_II: // (intel byte order) break; case IMAGETYPE_TIFF_MM: // (motorola byte order) break; case IMAGETYPE_JPC: break; case IMAGETYPE_JP2: break; case IMAGETYPE_JPX: break; case IMAGETYPE_JB2: break; case IMAGETYPE_SWC: break; case IMAGETYPE_IFF: break; case IMAGETYPE_ICO: break; case IMAGETYPE_SWF: break; case IMAGETYPE_PSD: break; */ /* case IMAGETYPE_TIFF_II: // (intel byte order) break; case IMAGETYPE_TIFF_MM: // (motorola byte order) break; case IMAGETYPE_JPC: break; case IMAGETYPE_JP2: break; case IMAGETYPE_JPX: break; case IMAGETYPE_JB2: break; case IMAGETYPE_SWC: break; case IMAGETYPE_IFF: break; case IMAGETYPE_ICO: break; case IMAGETYPE_SWF: break; case IMAGETYPE_PSD: break; */ default: // this is mostly file created from encrypted file $this->resource = imagecreatefromstring(\OC_Filesystem::file_get_contents(\OC_Filesystem::getLocalPath($imagepath))); $itype = IMAGETYPE_PNG; OC_Log::write('core', 'OC_Image->loadFromFile, Default', OC_Log::DEBUG); break; } if ($this->valid()) { $this->imagetype = $itype; $this->filepath = $imagepath; } return $this->resource; }
if (sizeof($recent_records) > 0) { foreach ($recent_records as $record) { ?> <a href="<?php echo registry_url('registry_object/view/' . $record->registry_object_id); ?> "> <img class="class_icon pull-left" style="width:20px;padding-right:10px;" src="<?php echo registry_url('assets/img/party.png'); ?> "> <div class="pull-left" style="line-height:10px;"> <small> <?php echo ellipsis($record->title, 55); ?> <small class="clearfix muted">Updated <?php echo timeAgo($record->updated); ?> </small> </small> </div> <span class="tag pull-right status_<?php echo $record->status; ?> "><?php echo readable($record->status, true); ?> </span> </a> <br class="clear"/>
echo $row['templateId']; ?> " data-toggle="tooltip" data-placement="right" title="<?php echo $viewTemplateTooltip; ?> "> <?php echo clean($row['templateName']); ?> </a> </td> <td data-th="<?php echo $descriptionText; ?> "><?php echo ellipsis($row['templateDesc'], 75); ?> </td> <td data-th="<?php echo $uploadedByText; ?> "><?php echo clean($row['theAdmin']); ?> </td> <td data-th="<?php echo $dateUploadedText; ?> "><?php echo $row['templateDate']; ?>
public function getSuggestedLinksForRegistryObject(_registry_object $registry_object, $start, $rows) { $CI =& get_instance(); $q = preg_replace("/[^A-Za-z0-9\\- ]/", ' ', $registry_object->titleWithoutCommonWords()); // preg_replace("/[^A-Za-z0-9 ]/", ' ', $significantsArray = $registry_object->splitTitleBySignificance(strtolower($q)); $q = rawurlencode($q); $q = str_replace("%5C%22", "\"", $q); //silly encoding $q = '?q=+title:(' . $significantsArray[0] . ")+description:(" . $significantsArray[0] . ")"; // Result variable $links = array(); // Build the weighted URL based on datacite:resourceTypeGeneral // - First Collections/Datasets // - Then Film, Image, Sound, PhysicalObject, InteractiveResource // - Then Model, Software, Service // - Then Event, Text // - Finally those without a resourceType $url = self::DATACITE_SOLR_URL; $urlTail = '&defType=disMax'; $urlTail = '&fq=language_facet%3A"English"'; // only English $urlTail .= '&qf=resourceTypeGeneral:("Collection","Dataset")^9999'; $urlTail .= '%20+resourceTypeGeneral:("Film","Image","Sound","PhysicalObject","InteractiveResource")^5555'; $urlTail .= '%20+resourceTypeGeneral:("Model","Software","Service")^1777'; $urlTail .= '%20+resourceTypeGeneral:("Event","Text")^111'; $urlTail .= '%20+resourceTypeGeneral:""^1'; $urlTail .= '&fl=*,score'; $urlTail .= '&start=' . $start; $urlTail .= '&rows=' . $rows; $urlTail .= '&version=2.2&wt=json'; $content = json_decode(file_get_contents($url . $q . $urlTail), true); // Check for a valid SOLR response if (!isset($content['response']['numFound'])) { return $links; } $found = $content['response']['numFound']; /* If we got no results, then lets be more tolerant and add the non-significant words and do fuzzy match */ $fuzzy_match_url = ""; if ($found < 10) { if (isset($significantsArray[1]) && $significantsArray[1] != '') { $q .= '+title:(' . $significantsArray[1] . ")+description:(" . $significantsArray[1] . ")"; } $fuzzy_match_url = $url . $q . $urlTail . '&defType=dismax&mm=3%3C75%25'; $content = json_decode(file_get_contents($fuzzy_match_url), true); $found = $content['response']['numFound']; } /* Generate the links data */ if (isset($content['response']['docs'])) { foreach ($content['response']['docs'] as $doc) { if ($doc['title'][0]) { $links[] = array("url" => self::DATACITE_URL_PREFIX . $doc[self::DATACITE_URL_FIELD], "title" => ellipsis($doc['title'][0], self::DATACITE_TITLE_LENGTH), "class" => "external", "expanded_html" => $CI->load->view("registry_object/datacite_preview", $doc, true)); } } } if (!$rows) { $rows = 10; } $pagination = array(); if ($start == 0) { $currentPage = 1; } else { $currentPage = ceil($start / $rows) + 1; } $totalPage = ceil($content['response']['numFound'] / (int) $rows); if ($currentPage != 1) { $prev = $start - $rows; $next = $start + $rows; } else { if ($currentPage == 1 && $totalPage == 1) { $prev = false; $next = false; } else { if ($currentPage == $totalPage) { $prev = $start - $rows; $next = false; } else { $prev = false; $next = $start + $rows; $debug = '1'; } } } $pagination = array("currentPage" => $currentPage, "totalPage" => $totalPage); if ($prev) { $pagination['prev'] = $prev; } if ($next) { $pagination['next'] = $next; } if ($start == 10) { $pagination['prev'] = '0'; } $response = array("count" => $found, "links" => $links, "pagination" => $pagination, "suggestor" => "datacite"); return $response; }
echo $tp_image[2] == "null" ? _SITE_URL . "/img/nothumb_track.png" : $tp_image[2]; ?> " width="50" height="50" /> <span class="coverlay"></span> </div> <div class="info"> <div class="title"><?php echo ellipsis($tp_name[2], 24); ?> </div> <div class="artist"><?php echo ellipsis($tp_artist[2], 40); ?> </div> <div class="album"><?php echo $tp_album[2] == "null" ? $i18n->various_albums : ellipsis($tp_album[2], 36); ?> </div> </div> </div> <a class="btn btn_picks" href="<?php echo $tp_link[2]; ?> "><?php echo $i18n->pick_discover; ?> </a> </div> <?php }
?> /img/new_window.png" width="14" /></div></a><?php } else { ?> </div><?php } ?> <div class="artist"><?php echo ellipsis($artist, 40); ?> </div> <?php if ($action == 'track') { ?> <div class="album"><?php echo $album == "null" ? $i18n->various_albums : ellipsis($album, 40); ?> </div> <?php } if ($iframeMode) { ?> <div id="platforms"><?php echo $results; ?> </div><?php } ?> </div> </div> </div>
" data-toggle="tooltip" data-placement="right" title="View Folder"> <?php echo clean($row['folderTitle']); ?> </a> </td> <td data-th="<?php echo $descText; ?> "> <span data-toggle="tooltip" data-placement="top" title="<?php echo ellipsis($row['folderDesc'], 200); ?> "> <?php echo ellipsis($row['folderDesc'], 50); ?> </span> </td> <td data-th="<?php echo $dateCreatedText; ?> "><?php echo $row['folderDate']; ?> </td> <td data-th="<?php echo $createdByText; ?> "> <?php
?> <h4> <a href="index.php?page=viewFile&fileId=<?php echo $file['fileId']; ?> "><?php echo ellipsis($file['fileTitle'], 35); ?> </a> <small class="pull-right">Project: <?php echo clean($file['projectName']); ?> </small> </h4> <p><?php echo ellipsis($file['fileDesc'], 160); ?> </p> </div> <?php } } else { ?> <div class="alertMsg default no-margin"> <i class="fa fa-minus-square-o"></i> <?php echo $noRecentUplds; ?> </div> <?php } ?>
} ?> var url = <?php echo json_encode($url); ?> ; var metrics = <?php echo json_encode($metrics); ?> ; </script> <h2>Details for <a target="_blank" href="<?php echo htmlentities($url); ?> " rel="nofollow"><?php echo htmlentities(ellipsis($url, 31)); ?> </a></h2> <?php if (!is_null($addThisProfile)) { ?> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style" style="margin-right: 10px;"> <a href="http://www.addthis.com/bookmark.php?v=250&username=<?php echo urlencode($addThisProfile); ?> " class="addthis_button_compact">Share</a> <span class="addthis_separator">|</span> <a class="addthis_button_twitter"></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_google"></a>
echo $row['requestId']; ?> " data-toggle="tooltip" data-placement="right" title="<?php echo $viewRequestTooltip; ?> "> <?php echo clean($row['requestTitle']); ?> </a> </td> <td data-th="<?php echo $descText; ?> "><?php echo ellipsis($row['requestDesc'], 65); ?> </td> <?php if ($set['enablePayments'] == '1') { ?> <td data-th="<?php echo $budgetText; ?> "><?php echo $requestBudget; ?> </td> <?php } ?>
echo $noUploadsMsg; ?> </a></dt> </dl> <?php } else { echo '<dl class="accordion">'; while ($c = mysqli_fetch_assoc($fileres)) { ?> <dt><a><?php echo ellipsis($c['fileTitle'], 35); ?> <span><i class="fa fa-angle-right"></i></span></a></dt> <dd class="hideIt"> <p><?php echo ellipsis($c['fileDesc'], 125); ?> </p> <p class="updatedOn"> <?php echo $uploadedOnText; ?> : <?php echo $c['fileDate']; ?> </p> <p> <a href="index.php?action=viewFile&fileId=<?php echo $c['fileId']; ?> " class="btn btn-primary btn-xs btn-icon"><i class="fa fa-file-o"></i> <?php
"> <?php echo clean($row['discussionTitle']); ?> </a> </td> <td data-th="<?php echo $commentsText; ?> "> <span data-toggle="tooltip" data-placement="top" title="<?php echo ellipsis($row['discussionText'], 200); ?> "> <?php echo ellipsis($row['discussionText'], 50); ?> </span> </td> <td data-th="<?php echo $createdByTableHead; ?> "> <?php if ($row['adminId'] != '0') { echo clean($row['theAdmin']); } else { echo clean($row['theClient']); } ?> </td>
"> <?php echo clean($row['fileTitle']); ?> </a> </td> <td data-th="<?php echo $descText; ?> "> <span data-toggle="tooltip" data-placement="top" title="<?php echo ellipsis($row['fileDesc'], 200); ?> "> <?php echo ellipsis($row['fileDesc'], 50); ?> </span> </td> <td data-th="<?php echo $folderText; ?> "> <a href="index.php?page=viewFolder&folderId=<?php echo $row['folderId']; ?> " data-toggle="tooltip" data-placement="right" title="<?php echo $viewFolderTooltip; ?> "> <?php