Jump to content

diogo

Moderators
  • Posts

    4,315
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by diogo

  1. 12 days to go, it's time for those that didn't vote to do it. There is a link on the top of this page, but I will make it even easier for you http://www.cmscritic.com/critics-choice-cms-awards/
  2. You could use the name of the page for the title. I know it's redundant, but either than the space it takes, i don't see any disadvantage. edit: I didn't see netcarver's answer before posting
  3. Add it here: Options +FollowSymLinks -MultiViews For those who may be interested, apparently GoDaddy has multiviews enabled by default, and this can mess up some rules http://support.godad...che-multiviews/
  4. See if this works http://davidwalsh.name/mod_rewrite-htaccess-godaddy
  5. The B's are not aware where they are included, but they can ask: $pages_that_include_me = $pages->find("page_field=$page"); This will give you an array of all the pages that include the page you are in. Edit: Rereading your question I see that you where asking the opposite. Assuming that you want to list all B's that where included on any A page without repetitions, you can do this: foreach ($pages->find("template=B") as $b){ if($pages->find("template=A, page_field=$b")->count() > 0) echo $b->url; }
  6. Arjen answered directly to this question. The link he pointed to can help giving some answers to your other concern.
  7. inside phop you can do: echo "<img src='{$page->image->url}'/>"; and outside php: <img src='<?php echo $page->image->url ?>'/>
  8. Hey, welcome to the forum! If you just copied the code, I can't think of any reason why PHP would be outputing that... could it be the javascript generated by Artisteer doing it? Although it's a shot in the dark, can you test the site with javascript disabled?
  9. You could do it with str_replace(), but depending of what you want maybe javascript would be better. Have you consider it?
  10. You can try this instead: if ($user->hasPermission($permissions->page-view, $page)) edit: see correction from Ryan on the next answer
  11. You're right, sorry... I understood wrong and complicated the simple. Try this on the home template: if(!$session->noPop){ echo "POP!"; $session->noPop = 1; } edit: netcarver beat me to it
  12. you can use session for this. Something like this should work: if($page->template == "home"){ if($session->noPop){ // No popup }else{ // Go popup!! } }else{ if(!$session->noPop){ $session->noPop = 1; } }
  13. I've never seen a panther fly... but if they would it would be more elegantly than a pig for sure
  14. There's nothing too complicated about it. PHP works in PW templates as it work everywhere else, if you understand how PHP works, you will also understand how it works with PW Answering your question: (although, honestly, I don't really get why you want to spread the form all over your fields. Did you consider having the form on a fixed place, like a sidebar?) If you have a file that you include in all the templates where you need this (for example, head.inc in the default install), you can put the code on a function there, and call that function from any place that includes the file. in head.inc function subscribeForm($field){ $formCode = <<<FORM <!-- Begin MailChimp Signup Form --> <div id="mc_embed_signup"> <form action="http://link here" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate> <label for="mce-EMAIL">Subscribe to my mailing list</label> <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required> <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div> </form> </div> <!--End mc_embed_signup--> FORM; $result = str_replace("{{MCsignup}}", $formCode, $field); return $result; } in any template that includes head.inc echo subscribeForm($page->body); //you can use any field here The alternative would be to build a textFormatter module, but I think this case doesn't justify.
  15. Very nice!! Have a look at this solution by Apeisa for responsive images. It would at least cut some weight on the images for small screens.
  16. Yes, that's what it does. to make it more clear, here is the complete code: <?php $formCode = <<<FORM <!-- Begin MailChimp Signup Form --> <div id="mc_embed_signup"> <form action="http://link here" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate> <label for="mce-EMAIL">Subscribe to my mailing list</label> <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required> <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div> </form> </div> <!--End mc_embed_signup--> FORM; $body = str_replace("{{MCsignup}}", $formCode, $page->body); echo $body; ?> First we assign the form code to the variable $formCode using the heredoc sintax (look for it here http://php.net/manua...ypes.string.php to be aware of what it does and cautions to have while using it). Here I'm using <<<FORM and FORM; to delimit the code, but I could use any other word. Then we find the chosen shortcode inside the body field and replace it by the form code with str_replace(), and assign the result to $body. Finally we echo $body. The shortcode could also be anything like ##myform## or **signup**. Just make sure it's something you wouldn't use inadvertently in the text.
  17. you can also use a special tag and php to insert it in the right spot. lets say you put {{MCsignup}} where you want the form inside the body field, and in your template do: $body = str_replace("{{MCsignup}}", $formCode, $page->body); echo $body; i'm on mobile and doing this by heart, so you should check the correct form of str_replace because i might have messed up the order
  18. oh, ok
  19. but, if the content is displayed somewhere else, why would you need search engines to find it in the original page? ir is the content being displayed with ajax? i'm on mobile, so i can't check those things.
  20. if vou don't want the pages to be accessed just keep their template without any file associated.
  21. that image is called favicon. google it and you will find the answer. i'm on mobile so i can't help more.
  22. Ryan, for youtube I only had to download teh zend gdata folder and only had to use the youtube part and the AuthSub.php file for the authentication. I imagine that it's the same thing with twitter.
  23. If it's ubuntu, mod_rewrite should be enabled by default. The most common problem is not having "AllowOverride" enabled in the etc/apache2/sites-available files change from AllowOverride None to AllowOverride All
  24. I don't think there are modules for those, but for user profiles you can do by adding fields to the "user" template (see the blog profile); For private messages you would need a page fieldType for choosing receiver and a text field, then, you could have a message center for each user with $msgsForMe = $pages->find("template=privateMsg, receiver=$user"); Settings is easy, a simple page with everything you need as fields (see the homepage of the blogprofile); email notifications... well, that depends of what you want to notify, of course, but I can imagine that you would have to make a module that hooks on the page saving (in the case of notifications for private messages, for sure), and to mess around with mail() or something more robust. But overall, everything is possible depending on the time you want to dedicate to it
×
×
  • Create New...