Guest User

Untitled

a guest
Apr 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. <?php
  2. include_once('FirePHPCore/fb.php');
  3. ob_start();
  4. $thisstep = "1";
  5. include_once 'accesscontrol.php';
  6.  
  7. $userid = $_SESSION['userid'];
  8. $username = $_SESSION['username'];
  9. $useremail = $_SESSION['useremail'];
  10. $usersignature = getClean($_SESSION['usersignature']);
  11. $usertemplates = $_SESSION['usertemplates'];
  12.  
  13. unset($_SESSION['recipients']);
  14. unset($_SESSION['subject']);
  15. unset($_SESSION['newsubject']);
  16.  
  17. include 'overall_header.php';
  18.  
  19.  
  20. ?><h1 id="step">step <? echo $thisstep; ?>:</h1>
  21. <h2 id="stepname">choose your template</h2>
  22.  
  23. <div class="introcopy">The number of templates available to you at any given time may vary, based upon those activated or deactivated by the web administrator(s) for seasonality or other reasons.</div>
  24.  
  25. <div class="introcopy">If you do not see a template that you believe should be activated, contact the web administrator(s).</div>
  26.  
  27. <?
  28.  
  29. echo "<h3 class=\"subhead\">Template options:</h3>\n\n";
  30.  
  31. getTemplates($usertemplates);
  32. fb($usertemplates);
  33.  
  34. include 'overall_footer.php';
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. function getTemplates($string){
  47. $array = explode(',',$string);
  48.  
  49. dbConnect("db39440_joomla");
  50. $sql = "SELECT * FROM jos_bwmailtpl WHERE
  51. state='1' ORDER BY ordering DESC";
  52. $result = mysql_query($sql);
  53.  
  54. if (!$result) {
  55. error('A database error occurred while pulling the template options.');
  56. }
  57.  
  58. if (mysql_num_rows($result) == 0) {
  59. ?>
  60. <p>You currently have no template options available.</p>
  61. <?php
  62. } else {
  63. $count = mysql_num_rows($result);
  64. $rowindex = $count -1;
  65.  
  66. while ($count > 0){
  67. $thisid = mysql_result($result,$rowindex,'id');
  68.  
  69. if (in_array($thisid, $array)) {
  70. $thistitle = mysql_result($result,$rowindex,'title');
  71. $thissubject = mysql_result($result,$rowindex,'title_alias');
  72. $thismessage = getClean(mysql_result($result,$rowindex,'introtext'));
  73. $thissalutation = mysql_result($result,$rowindex,'salutation');
  74. $thisdesign = mysql_result($result,$rowindex,'design');
  75.  
  76. echo "
  77. <div style=\"border:1px solid #cccccc;height:272px;margin-bottom:10px;\">
  78. <div style=\"float:left;width:252px;height:252px;margin:10px;\"><a href=\"step2.php?id=" .$thisid. "\"><img src=\"design" .$thisdesign. "/thumb.png\" height=\"250\" width=\"250\" style=\"border:1px solid #999999;background-color:#e7e7e7;\" /></a></div>
  79. <div style=\"float:left;width:252px;height:252px;margin:10px 10px 10px 0px;\">
  80. <a href=\"step2.php?id=" .$thisid. "\" class=\"actionlinks\">" .$thistitle. "</a>
  81. <br /><br /><b>Default subject:</b><br />" .$thissubject. "
  82. <br /><br /><b>Default message:</b><br />" .$thismessage. "
  83. <br /><br /><b>Default salutation:</b><br />" .$thissalutation. "
  84. </div>
  85. </div>\n\n";
  86. }
  87.  
  88. $count = $count -1;
  89. $rowindex = $count -1;
  90. }
  91. }
  92. }
  93.  
  94. ?>
Add Comment
Please, Sign In to add comment