Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.98 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. // Wake the sleeping giant
  5.  
  6. // **********************************************************************
  7. // Basic Configuration Info
  8. // **********************************************************************
  9.  
  10. include("inc/functions.php");
  11. include("inc/config.php");
  12. include("inc/bbcode.php");
  13.  
  14. $themeurl = grabanysetting("themeurl");
  15.  
  16. // **********************************************************************
  17. // Define our top links by calling getlinks()
  18. // **********************************************************************
  19.  
  20. $links = getlinks();
  21.  
  22. // **********************************************************************
  23. // Define our ads by calling getads()
  24. // **********************************************************************
  25.  
  26. $ads = getads("any");
  27.  
  28. // **********************************************************************
  29. // Grab any dynamic article content from the content table
  30. // **********************************************************************
  31.  
  32. $article_title = $pagecontent[title];
  33. $article_content = $pagecontent[content];
  34.  
  35. // Convert the BBCODE to HTML
  36. $article_content = bbconvert($article_content);
  37.  
  38. // Convert line breaks to <br>
  39. $article_content = nl2br($article_content);
  40.  
  41. // **********************************************************************
  42. // Grab any settings that we will need for the current page from the DB
  43. // **********************************************************************
  44.  
  45. $browsertitle = grabanysetting("browsertitle");
  46. $sitename = grabanysetting("sitename");
  47. $slogan = grabanysetting("slogan");
  48.  
  49. // **********************************************************************
  50. // Check and see if the user is logged in to the site
  51. // **********************************************************************
  52.  
  53. $loginstatus = logincheck();
  54. $isloggedin = $loginstatus[loginstatus];
  55. $loggedinname = $loginstatus[username];
  56.  
  57. // **********************************************************************
  58. // End Prepwork - Output the page to the user
  59. // **********************************************************************
  60. //header("refresh:300");
  61.  
  62. $article_title = "Who's Online";
  63. $article_content = "<div style='text-align:center;'>This page shows you all online users within the last 5 minutes. After 5 minutes of inactivity they will be marked as offline and will not be shown here</div><br /><hr /><br /><p><span style='color: red;'>Username</span><span style='color: green; margin-left: 33.5%;'>Number of Adoptables</span><span style='color: blue;margin-left:33.5%;'>Cash</span><br /><hr /><br /><p>";
  64.  
  65. $sql3="SELECT ".$prefix."online.username, ".$prefix."users.dollar FROM ".$prefix."online, ".$prefix."users WHERE ".$prefix."online.username = ".$prefix."users.username AND ".$prefix."online.username!='Visitor' ORDER BY ".$prefix."online.username";
  66. $result3=mysql_query($sql3);
  67. $userarray = array();
  68. while($row = mysql_fetch_array($result3))
  69. {
  70. if($row['username'] != "Visitor")
  71. {
  72. $userarray[] = $row['username'];
  73.  
  74.  
  75. $article_content = $article_content."<a href='/profile.php?user=".$row['username']."' class='onlinelist'><span class='onlinelistt'>".$row['username']."</span><span class='onlinelistj'>".getadoptables()."</span><span class='onlinelistp'>".$row['dollar']."</span></a><br />";
  76.  
  77. }
  78. }
  79. $article_content = $article_content."</p></p><br /><hr /><br />";
  80.  
  81. $result = mysql_query("SELECT * FROM ".$prefix."online WHERE username = 'Visitor'");
  82. $total = mysql_num_rows($result);
  83.  
  84. $article_content = $article_content."Total Visitors: ".$total;
  85.  
  86. function getadoptables()
  87. {
  88. global $prefix;
  89. global $userarray;
  90. global $row;
  91. $res = mysql_query("SELECT COUNT(*) AS cnt FROM ".$prefix."owned_adoptables WHERE owner = '".$row['username']."'");
  92. while($poke = mysql_fetch_array($res))
  93. {
  94. $cnt = $poke['cnt'];
  95. }
  96. return $cnt;
  97. }
  98.  
  99. // **********************************************************************
  100. // Begin Template Definition
  101. // **********************************************************************
  102.  
  103. //Define our current theme
  104. $file = $themeurl;
  105.  
  106. // Do the template changes and echo the ready template
  107. $template = file_get_contents($file);
  108. $article_date = getpmnotif();
  109. $template = replace(':ARTICLETITLE:',$article_title,$template);
  110. $template = replace(':ARTICLECONTENT:',$article_content,$template);
  111. $template = replace(':ARTICLEDATE:',$article_date,$template);
  112.  
  113. $template = replace(':BROWSERTITLE:',$browsertitle,$template);
  114. $template = replace(':SITENAME:',$sitename,$template);
  115.  
  116. //Define our links
  117. $template = replace(':LINKSBAR:',$links,$template);
  118.  
  119. //Get the content for the side bar...
  120.  
  121. $sidebar = getsidebar();
  122. $template = replace(':SIDEFEED:',$sidebar,$template);
  123.  
  124. //Get the ad content...
  125. $template = replace(':ADS:',$ads,$template);
  126.  
  127. //Get the slogan info
  128. $template = replace(':SLOGAN:',$slogan,$template);
  129.  
  130.  
  131. echo $template;
  132.  
  133. // **********************************************************************
  134. // End Template Definition
  135. // **********************************************************************
  136.  
  137.  
  138.  
  139. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement