public function index() { $sc = new SystemConfig(); $hostTypes = (new HostType())->permissionList(); ksort($hostTypes, SORT_STRING); $success = Session::get('SCS', false); $user = GithubLogin::getLoginUser(); $watchSites = Watch::allSiteWatched($user->login); foreach ($this->validSites as $key => $value) { if (in_array($value['siteId'], $watchSites)) { $this->validSites[$key]['watch'] = true; } } return View::make('index', array('listSites' => $this->validSites, 'hostTypes' => $hostTypes, 'success' => $success, 'workRoot' => $sc->get(SystemConfig::WORK_ROOT_FIELD))); }
public function __construct(PlUser $owner) { $notifs = Watch::getEvents($owner); $infos = array(); foreach ($notifs as $n) { foreach ($n['users'] as $user) { $op = $n['operation']; $date = $op->getDate($user); @($datetext = new Date($date)); @($datetext = $datetext->format('%e %B %Y')); $profile = $user->profile(); $infos[] = array('operation' => $op, 'title' => '[' . $op->getTitle(1) . '] - ' . $user->fullName() . ' le ' . $datetext, 'author' => $user->fullName(), 'publication' => $op->publicationDate($user), 'date' => strtotime($date), 'id' => $op->flag . '-' . $user->id() . '-' . strtotime($date), 'data' => $op->getData($user), 'hruid' => $user->login(), 'dead' => $user->deathdate, 'profile' => $user->profile()->hrid(), 'link' => Platal::globals()->baseurl . '/profile/' . $profile->hrid(), 'user' => $user, 'contact' => $owner->isContact($profile)); } } $this->it = PlIteratorUtils::fromArray($infos); }
function handler_panel($page) { $page->changeTpl('carnet/panel.tpl'); if (Get::has('read')) { XDB::execute('UPDATE watch SET last = FROM_UNIXTIME({?}) WHERE uid = {?}', Get::i('read'), S::i('uid')); S::user()->invalidWatchCache(); Platal::session()->updateNbNotifs(); pl_redirect('carnet/panel'); } require_once 'notifs.inc.php'; $page->assign('now', time()); $user = S::user(); $notifs = Watch::getEvents($user, time() - 7 * 86400); $page->assign('notifs', $notifs); $page->assign('today', date('Y-m-d')); $this->_add_rss_link($page); }
* You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ require_once 'connect.db.inc.php'; require_once 'plmailer.php'; require_once 'notifs.inc.php'; ini_set('memory_limit', '128M'); $uids = XDB::query('SELECT uid FROM watch WHERE FIND_IN_SET(\'mail\', flags) ORDER BY uid'); $iterator = User::iterOverUIDs($uids->fetchColumn()); while ($user = $iterator->next()) { $watch = new Watch($user); if ($watch->count() > 0) { $notifs = $watch->events(); $mailer = new PlMailer('carnet/notif.mail.tpl'); $mailer->assign('sex', $user->isFemale()); $mailer->assign('yourself', $user->display_name); $mailer->assign('week', date('W - Y')); $mailer->assign('notifs', $notifs); $mailer->sendTo($user); unset($mailer); unset($notifs); } unset($watch); unset($user); } XDB::execute("UPDATE watch_profile\n SET ts = NOW()\n WHERE field = 'broken'");
public function updateNbNotifs() { require_once 'notifs.inc.php'; $user = S::user(); $n = Watch::getCount($user); S::set('notifs', $n); }
/** * Remove the specified watch from storage. * * @param int $id * @return Response */ public function destroy($id) { Watch::destroy($id); return Redirect::route('watches.index'); }
static function _addWatch($controller, $memberObj, $prodObj, $notifyEmail) { $watch = new Watch(); $watch->setItemId($prodObj->getId()); if ($memberObj) { $memberId = $memberObj->getId(); } if ($notifyEmail) { $memberId = $notifyEmail; } $watch->setMemberId($memberId); $controller->dbAddObject('watches', 'addWatch', array($watch)); }
public static function getEvents(PlUser $user, $date = null) { $watch = new Watch($user, $date); return $watch->events(); }
static function handle_shortcode($atts) { self::$add_script = true; extract(shortcode_atts(array('class' => false), $atts, 'watch')); $video = new stdClass(); $parameters = new stdClass(); $parameters->title = 0; $parameters->byline = 0; $parameters->portrait = 0; $parameters->color = "ffffff"; $parameters->api = 1; $parameters->player_id = 'frame'; if (isset($_GET['vid'])) { $video->id = $_GET['vid']; $videos = new stdClass(); $videos = boxVimeo($video); $video = (object) array_merge((array) $video, (array) $videos->video_0); //debug( $video ); $parameters->autoplay = 1; } $guts_id = "955350"; if (!isset($_GET['vid']) || $video->user_id != $guts_id) { $video = getLatestVideo(); } $video->query = http_build_query($parameters); ob_start(); ?> <div class="hero-foreground animated fadeIn animated-3s animated-delay-1s" style="<?php //BG Color Overlay if (get_field('page_color')) { ?> background: <?php echo get_field('page_color'); ?> ; <?php //#000000 ?> background: rgba(<?php echo hex2rgb(get_field('page_color')); ?> ,0.85); <?php //rgba(0,0,0,0.8) } ?> "> <div class="container"> <div class="page-header"> </div> <div class="hero-content"> <?php //echo do_shortcode('[content]'); ?> </div> </div> </div> <div class="hero-background"> <div class="ir frame-container"> <iframe id="frame" src="//player.vimeo.com/video/<?php echo $video->id; ?> ?<?php echo $video->query; ?> " data-gc-id="<?php echo $guts_id; ?> " frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen ></iframe> </div> </div> <?php $content = ob_get_clean(); return $content; }
/** * Deletes the trigger. * * @return boolean `true` if the trigger has been deleted. */ public function delete() { return $this->watch->deleteTrigger($this->name); }