• All Elements
Packages
  • [Backend]
  • [Implementation]
  • [Implementation]-[Backend]
  • [Plugins]
[Implementation]


  • Package Elements
  • Class Hierarchy

Quick Menu
  • Description

feindura - Docs

  • Back to feindura.org
  • Startpage
  • Feindura Class
Welcome
Documentation
CHANGELOG | LICENSE

example


Show Example
  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example uses all possible properties.
  5. It's also works much more simple: just call createLink(1) without setting properties
  6. and you have a simple link with the page title.
  7. */
  8.  
  9. // a session will be started in the "feindura.include.php",
  10. // therefor you have to include this file before the header of the HTML page is sent,
  11. // which means before any HTML Tag.
  12. require('cms/feindura.include.php');
  13.  
  14. // creates a new Feindura instance
  15. $feindura = new Feindura();
  16.  
  17. ?>
  18. <!DOCTYPE html>
  19. <html>
  20. ...
  21.  
  22. <?php
  23.  
  24. // set link properties
  25. $feindura->linkLength                 = 20; // shortens the page title in the link
  26. $feindura->linkId                     = 'exampleId';
  27. $feindura->linkClass                  = 'exampleClass';
  28. $feindura->linkAttributes             = 'test="exampleAttribute1" onclick="exampleAttribute2"';
  29. $feindura->linkBefore                 = 'text before link ';
  30. $feindura->linkAfter                  = ' text after link';
  31. $feindura->linkBeforeText             = 'text before ';
  32. $feindura->linkAfterText              = ' text after';
  33. $feindura->linkShowThumbnail          = true;
  34. $feindura->linkShowThumbnailAfterText = false;
  35. $feindura->linkShowPageDate           = true;
  36. $feindura->linkPageDateSeparator      = ' - ';
  37. $feindura->linkShowCategory           = true;
  38. $feindura->linkCategorySeparator      = ' -> ';
  39.  
  40. // set thumbnail properties
  41. $feindura->thumbnailAlign             = 'left';
  42. $feindura->thumbnailId                = 'thumbId';
  43. $feindura->thumbnailClass             = 'thumbClass';
  44. $feindura->thumbnailAttributes        = 'test="thumbnailAttr1" onclick="thumbnailAttr2"';
  45. $feindura->thumbnailBefore            = 'text before thumbnail ';
  46. $feindura->thumbnailAfter             = ' text after thumbnail';
  47.  
  48.  
  49. // finally create the link from the page with ID "1" using the above set link properties
  50. $link = $feindura->createLink(1);
  51.  
  52. // displays the link
  53. echo $link;
  54.  
  55.  
  56.                                *** RESULT *** 
  57. --------------------------------------------------------------------------------
  58.  
  59. text before link <a href="?category=1&amp;page=1" title="Example Category -> 2010-12-31 - Example Page"
  60. id="exampleId" class="exampleClass" test="exampleAttribute1" onclick="exampleAttribute2">
  61. text before thumbnail <img src="/path/thumb_page1.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page"
  62. id="thumbId" class="thumbClass" test="thumbnailAttr1" onclick="thumbnailAttr2" style="float:left;">
  63. text after thumbnail
  64. text before Example Category -> 2010-12-31 - Example ... text after
  65. </a> text after link
  66.  
  67. ?>


The feindura API reference was generated from the comments in the feindura source code on Sat, 01 Dec 2012 21:55:20 +0000 by phpDocumentor 1.4.3
feindura - Flat File Content Management System, Copyright © Fabian Vogelsteller [frozeman.de]