Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. $sql1 = mysql_query("select state_id,state_name from ".TABLE_STATE);
  2.  
  3. <?php
  4. update_option('image_default_link_type','none');
  5.  
  6. include("/home/cingen/config_admin.php");
  7.  
  8. function listMembers() {
  9. $sql1 =mysql_query("select state_id,state_name from ".TABLE_STATE);
  10. ob_start(); //send all future echo statements to the buffer instead of output
  11.  
  12. while($row1=mysql_fetch_assoc($sql1)) { ?>
  13. <a href="#'STATE'" onclick="getDetails(<?php echo $row1["state_id"];?>)"> <?php echo $row1["state_name"]; ?> </a> &nbsp;
  14. <?php } ?>
  15. <br/><br/><div id="resultDiv"></div>
  16. <?php
  17. $result = ob_get_clean(); //capture the buffer into $result
  18. return $result; //return it, instead of echoing
  19. }
  20. add_shortcode('memberlist', 'listMembers');
  21.  
  22. //Shortcode to list Rescue Standards members
  23. function listRescueStandards() {
  24.  
  25. $display_members = '';
  26. $sql = mysql_query("SELECT vc.*, s.*, m.*
  27. FROM ".TABLE_COMPLIANCE." vc, ".TABLE_STATE." s, ".TABLE_MEMBERS." m
  28. WHERE vc.member_id = m.cid
  29. AND m.status = '1'
  30. AND m.state = s.state_abbr
  31. ORDER BY m.state, m.organization ASC");
  32.  
  33. while ($row = mysql_fetch_array($sql)) {
  34. $organization = stripslashes($row['organization']);
  35.  
  36. if ($row['website']) {
  37. $link = "<a href='http://".$row['website']."' target='_blank'>";
  38. $endlink = "</a>";
  39. } else {
  40. $link = "";
  41. $endlink = "";
  42. }
  43.  
  44. if($x != $row['state_name']){
  45. $display_members .= "<br /><strong>".strtoupper($row['state_name'])."</strong><br />";
  46. $x = $row['state_name'];
  47. }
  48.  
  49. $display_members .= $link.$organization.$endlink."<br />
  50. ".stripslashes($row['address'])." ".stripslashes($row['address2'])."<br />
  51. ".stripslashes($row['city']).", ".stripslashes($row['state'])." ".$row['zip']."<br />";
  52.  
  53. if ($row['contact_name']) $display_members .= "Contact: ".stripslashes($row['contact_name']);
  54. if ($row['contact_title']) $display_members .= ", ".stripslashes($row['contact_title']);
  55. if ($row['phone']) $display_members .= "<br />Tel: ".stripslashes($row['phone']);
  56. if ($row['fax']) $display_members .= "<br />Fax: ".stripslashes($row['fax']);
  57. if ($row['email']) $display_members .= "<br />".$row['email'];
  58. if ($row['website']) $display_members .= "<br /><a href='http://".$row['website']."' target='_blank'>".$row['website']."</a>";
  59. if ($row['year_est']) $display_members .= "<br />Founded in ".$row['year_est'].".";
  60. if ($row['org501c3'] == "1") $display_members .= "<br />This organization IS registered with the IRS as a 501(c)3.";
  61. if ($row['org501c3'] != "1") $display_members .= "<br />This organization is NOT registered with the IRS as a 501(c)3.";
  62.  
  63. $display_members .= "<br /><br />";
  64. }
  65.  
  66. //return "<div class='memberlist'>" . $display_members[$i + ($j * $rows)] . "</div>";
  67. return "<div class='memberlist'>" . $display_members . "</div>";
  68. }
  69. add_shortcode('standardslist', 'listRescueStandards');
  70. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement