Jonathan
Members-
Posts
21 -
Joined
-
Last visited
Profile Information
-
Gender
Male
-
Location
Brisbane, Australia
Jonathan's Achievements
-
<?php if($user->hasRole("editor")){ echo ""; } elseif(!$user->allowed_screeners->has($page)){ $session->redirect("/screening-room/"); } include('./_header.php'); $fredi = $modules->get("Fredi"); echo $fredi->renderScript(); ?> <!-- Main --> <section id="main" class="container"> <section class="box special"> <header class="major"> <div> <?php include("./screener.php"); ?> <script src="http://jwpsrv.com/library/xxxxxxxxxxxxxx.js"></script> <div id="myElement">Loading the player...</div> <script type="text/javascript"> jwplayer("myElement").setup({ file: "rtmp://xxxxx.xxxxxxx.com/cfx/st/mp4:<?=$canned_policy_stream_name; ?>", width: "100%", aspectratio: "16:9" }); </script> </div> <?php echo $fredi->hideTabs('delete|settings')->renderAll(); ?> <br /> <h2> <?php echo $page->get('headline|title'); ?> </h2> <p> <?php // Render Year echo $page->year; echo " | "; // Render Runtime echo $page->runtime; echo " mins | "; // Get Classification and Render foreach($page->classification as $rating) { echo $rating->title; echo " | "; } // Get Genre and Render foreach($page->genre as $genre) { echo "{$genre->title} "; } ?> </p> <hr /> <?php echo $page->body; ?> </header> <?php foreach($page->images as $banner) echo "<span class='image featured'><img src='../../../site/assets/files/{$page->id}/{$banner->name}' alt='' /></span>"; ?> </section> </section> <!-- CTA --> <section id="cta"> <h2>Want to know more about <b><?php echo $page->title; ?></b>?</h2> <p>Enter your email and we'll be in touch shortly.</p> <form> <div class="row uniform 50%"> <div class="8u 12u(mobilep)"> <input class="fit" type="email" name="email" id="email" placeholder="Email Address" /> </div> <div class="4u 12u(mobilep)"> <input type="submit" value="Sign Up" /> </div> </div> </form> </section> <?php include('./_footer.php'); ?> Here's the current code from the template. Thanks Apeisa!
-
Did a clean PW install fix the issue? I'm having same issue - If I hide settings tab, can't save any changes to the page.
-
Solved the first problem of showing up on the first user. I moved the $freid->hideTabs function to the top of the page where I call in the fredi module. But, if I follow the instructions on the fredi module page and have echo $fredi->hideTabs it echos 'fredi' on the page as text. Removing the echo fixes this.
-
I'm using Fredi to allow other site admins to edit users. I have specified that the delete tab should be hidden but for some reason it still shows on the first user/page, but not on any others - I've deleted all users and started from scratch but the problem persists. Maybe I'm not using the 'hide tabs' function in the correct place? This is from my template file: echo $fredi->render('title|email|pass|allowed_screeners', $user); echo $fredi->hideTabs('delete'); This is echoed for each user with a specific role. Any ideas? Also, in future I might want to give some admins visibility of the delete tab but currently, if I delete a user, the iframe refreshes and shows the entire page tree from the home page. Is it possible to make it have the same function as when a user saves the changes? ie. refresh the entire page/close the modal and show the changes on the page? Hope that makes sense! Thanks in advance. Jonathan I'm using 2.5.3
-
Jonathan started following Protected files , Fredi - friendly frontend editing , Can't echo page title and 2 others
-
Does anyone know how to remove the tabs at the top of the modal? Thanks! Great module Antti!
-
Thanks Adrian, I knew it was a simple fix and had been trying to get implode working but found PHPs manual a bit confusing. Ryan's examples made it much easier to understand. Cheers $gt = $genre->implode(' ', 'title');
-
Hi PW community, Here's my code: $films = $pages->find("template=film"); foreach($films as $film){ $poster = $film->poster->size(200, 280); $g = $film->genre; echo "..." If I echo $g, I get the page id of each array item (eg. 1159|1245|1291 etc), but if I echo $g->title I get nothing. I'm quite confused as if I echo $poster->url or path or name, that echoes out just fine. Thanks in advance!
-
Take a look at the AmazonS3CloudFront module - I was using Hani's .htaccess method but am now using S3/CloudFront + signed URLs to deliver content securely. Works great and also takes the load of supplying the file off the web server.
- 27 replies
-
- 3
-
- private
- protected files
-
(and 1 more)
Tagged with:
-
I googled the error before posting but the only suggestion that I could see was to ensure that jquery was being called first, which it is.
-
I'm hoping you smart folk can help me out. I cannot for the life of me figure out why fancybox is not working in my PW install - 2.5.2 Here's my head code <!-- FANCY BOX --> <!-- Add jQuery library --> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <!-- Add fancyBox --> <link rel="stylesheet" href="<?php echo $config->urls->templates?>fancybox/source/jquery.fancybox.css" type="text/css" media="screen" /> <script type="text/javascript" src="<?php echo $config->urls->templates?>fancybox/source/jquery.fancybox.pack.js"></script> <!-- END FANCYBOX --> Template code (I'm pointing to the assets with the method below because I have Amazon S3 module install which changes $file->url to the cloudfront URL, which I don't want for this. <?php include("./_head.php"); foreach($page->images as $file) { $large = $file->width(500); $thumb = $file->width(300); echo "<a href='../../site/assets/files/$page->id/$large->name' class='fancybox' rel='group' ><img src='../../site/assets/files/$page->id/$thumb->name' ></a>"; } include("./_foot.php"); ?> And lastly, the footer <script type="text/javascript"> $(document).ready(function() { $(".fancybox").fancybox(); }); </script> I'm getting thumbnails but when I click them, it simply goes to the actual url of the file, instead of opening in fancybox. Any help is greatly appreciated! Cheers, Jono
-
Great module! I'm creating a film database site with private content that authenticated users can download. I've used your plugin and configured it to work with signed URLs so users can't distribute the download link. Is signed urls the best method to ensure that downloads are only available for authenticated users? is it possible to have a setting within a file upload field to flag whether to upload the file to S3/cloudfront or store it locally on the PW server? Jonathan
-
Hi Hani, Quick question: How are you redirecting to the passthrough page? I've created a template file with the PHP code you posted and created a page using that template but now I'm a little stuck. I've also got the .htaccess file in assets/files/xxxx/
- 27 replies
-
- private
- protected files
-
(and 1 more)
Tagged with:
-
Get image from multiple pages based on current page selection
Jonathan replied to Jonathan's topic in General Support
Thanks Joss! -
Took a little bit to get the 'if else' syntax correct but it does exactly what I need. Thanks again for your help!
-
That does answer my questions, thanks. Is there a simple way to only do the above check if the current user has a specific role e.g. 'viewer'? There will be a couple of users who will have access to every film, but I don't want to have to add each film for those users. Am I on the right track if if use: if($user->hasRole($viewer)) and then do the check based on whether that returns true or false? Thanks, Jonathan