function format_single($records, $loggedin_user) { $out = ''; foreach ($records as $rec) { // Display the title $out .= '<h2>' . get_basic_info($rec, $loggedin_user) . '</h2>'; $out .= run_plugins('detail_above', $rec, $loggedin_user); // Display the main bulk of the record $out .= get_detail($rec, $loggedin_user); $out .= run_plugins('detail_below', $rec, $loggedin_user); } $ret = array('data' => $out, 'content_type' => 'text/html'); return $ret; }
<?php if(!class_exists('pc')){ include(get_template_directory()."/assets/classes/character_class.php"); } include_once(get_template_directory()."/assets/functions/parse_character.php"); $pc = new pc(); get_basic_info($pc, get_the_ID()); function apply_save_bonus ($stat) { global $pc; $total = 0; $saves = $pc->get_saves(); foreach ($saves as $save) { if ($save == $stat) { $total += 1+ceil(($pc->get_level())*.25); } else { continue; } } if ($pc->get_save_bonus()) { $other_bonuses = $pc->get_save_bonus(); } else { $other_bonuses = array('null'); } foreach ($other_bonuses as $bonus) {
date_add($date, date_interval_create_from_date_string('-' . $min_age . ' years')); $bday_upbound = date_format($date, "Y-m-d"); $query_bday_upbound = $min_age == 0 ? '' : ' AND birthdate <="' . $bday_upbound . '"'; // expand part if (isset($_POST['advanced_search'])) { $min_height = $_POST['min_height']; $max_height = $_POST['max_height']; $education = $_POST['education']; } $query_min_height = $min_height == 0 ? '' : ' AND height>=' . $min_height; $query_max_height = $max_height == 0 ? '' : ' AND height<=' . $max_height; $query_education = $education == "Any" || $education == null ? '' : ' AND education="' . $education . '"'; $query = 'SELECT * FROM users_account WHERE userID <> ' . $_SESSION['valid_userID'] . $query_bday_lowbound . $query_bday_upbound . ' and gender="' . $gender . '" ' . $query_city . ' ' . $query_min_height . $query_max_height . $query_education; echo $query; } else { $row = get_basic_info($_SESSION["valid_userID"], $db); $gender = $row['gender'] == "Male" ? "Female" : "Male"; $query = 'SELECT * FROM users_account WHERE gender="' . $gender . '"'; } ?> <html> <head> <title>Search Results</title> <link rel="stylesheet" type="text/css" href="css/main.css"> <link rel="stylesheet" href="css/search_results.css"> <script src="JS/showHide.js"></script> </head> <body> <!-- top banner -->
echo "<a href='registration.php'>Register</a>"; } ?> </nav> </div> <!-- main body --> <div class="container"> <!-- profile summary and search --> <div class="sub_container"> <div class="section_container"> <!-- profile summary --> <div class="left homepage_profile"> <?php if (isset($_SESSION['valid_user'])) { $row = get_basic_info($_SESSION['valid_userID'], $db); echo ' <div class="image_container_190" style="background-image: url(users_profile_photo/' . ($row['profilePhoto'] != Null ? $row['profilePhoto'] : 'default_' . $row['gender'] . '.jpg') . ');"></div> <!-- profile photo --> <div class="profile_summary left" style="margin-left:20"> <!-- profile words --> <div id="profile_name" style="font-size:40;">' . $row['name'] . '</div> <div><grey>Age: </grey>' . cal_age($row['birthdate']) . '<br><grey>City: </grey>' . $row['city'] . '<br><grey>Education: </grey>' . $row['education'] . '<br><grey>Height: </grey>' . $row['height'] . 'cm</div> <div class="bottom"> <button onclick="location.href = \'profile.php\'">Enter my heydate</button> </div> </div> '; } else { // if the user hasn't logged in echo ' <form method="post" action="index.php">
echo ' <div class="image_container_190" style="margin-left:10px;margin-top:10px;background-image: url(users_profile_photo/' . ($row['profilePhoto'] != Null ? $row['profilePhoto'] : 'default_' . $row['gender'] . '.jpg') . ');"></div>'; } ?> </div> <div class="sub_container right" id="message_container"> <?php $query = 'select * from (select * from users_account right join(select receiverID, time from (SELECT receiverID, time FROM `users_message` WHERE senderID=' . $_SESSION['valid_userID'] . ' UNION SELECT senderID, time FROM `users_message` WHERE receiverID=' . $_SESSION['valid_userID'] . ') as X order by time DESC)as Y on userID=receiverID order by time DESC) as Z group by userID order by time DESC'; $Contacters = $db->query($query); $isfirst = true; while ($row1 = $Contacters->fetch_assoc()) { $contact = get_basic_info($row1['receiverID'], $db); echo "\t\t <div class=\"section_container\" id=" . $contact["userID"] . ">\n"; echo " <a href=\"profile.php?customerID=" . $contact['userID'] . "\"><div class=\"image_container_100\" style=\"background-image: url(users_profile_photo/" . ($contact['profilePhoto'] != Null ? $contact['profilePhoto'] : 'default_' . $row['gender'] . '.jpg') . ");\"></div></a>"; echo " <div class=\"profile_summary\">\n"; echo " <label id=\"profile_name\">" . $contact["name"] . "</label>\n"; echo " <div id=\"profile_brief\">" . cal_age($contact['birthdate']) . ", " . $contact['city'] . ", " . $contact['height'] . "cm, " . $contact['education'] . "</div>\n"; echo " </div>\n"; // read button echo " <button id=\"read\" onclick=\"showHide_inbox(" . $contact["userID"] . "); refreshMessage(" . $_SESSION['valid_userID'] . ", " . $contact['userID'] . ", 'message_area" . $contact['userID'] . "', 'textarea" . $contact['userID'] . "')\">Read Message</button>\n"; echo " <div class=\"hider clear\" id=\"hider" . $contact['userID'] . "\" style=\"display:none\">\n"; echo " <div class=\"message_area\" id=\"message_area" . $contact['userID'] . "\">\n"; echo " </div>\n"; echo " <div class=\"left clear\" id=\"reply_box\">\n"; echo " <textarea placeholder=\"Reply message here...\" class=\"left\" id=\"textarea" . $contact['userID'] . "\" value=''></textarea>\n"; echo " <button class=\"right\" onclick=\"refreshMessage(" . $_SESSION['valid_userID'] . ", " . $contact['userID'] . ", 'message_area" . $contact['userID'] . "', 'textarea" . $contact['userID'] . "')\">Send</button>\n"; echo " </div>\n";