";
+ // Echo the post content.
+ echo bbc(atname(nl2br($string)));
+ if($feed_is_poll == 'yes') {
+ echo "
";
+
+
+
+
+
+ // Added Feed polls. 2021
+ // Added Feed polls. 2021
+ // Added Feed polls. 2021
+ // Added Feed polls. 2021
+
+ # SELECT POLL DATA FOR THE POST
+ $fpoll_q = mysqli_query($conx, "SELECT * FROM feed_polls WHERE uqid='$feed_randomstr'");
+ while($fpoll_r = mysqli_fetch_assoc($fpoll_q)) {
+ // poll data
+ $fpoll_question = $fpoll_r['poll_question'];
+ $fpoll_opt1 = $fpoll_r['poll_opt1'];
+ $fpoll_opt2 = $fpoll_r['poll_opt2'];
+ $fpoll_opt3 = $fpoll_r['poll_opt3'];
+ $fpoll_opt4 = $fpoll_r['poll_opt4'];
+ $fpoll_opt5 = $fpoll_r['poll_opt5'];
+ $fpoll_istimed = $fpoll_r['is_timed'];
+ $fpoll_tstmpend = $fpoll_r['tstamp_end'];
+ if(strlen($fpoll_opt1) >= 30) {
+ $fpoll_optc1 = trim(substr($fpoll_opt1,0,30)) . "...";
+ }
+ else {
+ $fpoll_optc1 = $fpoll_opt1;
+ }
+ if(strlen($fpoll_opt2) >= 30) {
+ $fpoll_optc2 = trim(substr($fpoll_opt2,0,30)) . "...";
+ }
+ else {
+ $fpoll_optc2 = $fpoll_opt2;
+ }
+ if(strlen($fpoll_opt3) >= 30) {
+ $fpoll_optc3 = trim(substr($fpoll_opt3,0,30)) . "...";
+ }
+ else {
+ $fpoll_optc3 = $fpoll_opt3;
+ }
+ if(strlen($fpoll_opt4) >= 30) {
+ $fpoll_optc4 = trim(substr($fpoll_opt4,0,30)) . "...";
+ }
+ else {
+ $fpoll_optc4 = $fpoll_opt4;
+ }
+ if(strlen($fpoll_opt5) >= 30) {
+ $fpoll_optc5 = trim(substr($fpoll_opt5,0,30)) . "...";
+ }
+ else {
+ $fpoll_optc5 = $fpoll_opt5;
+ }
+ }
+ # SELECT RESPONSE DATA FOR THE POLL
+ $fpoll_response_q = mysqli_query($conx, "SELECT * FROM feed_poll_response WHERE poll_uqid='$feed_randomstr' && uid='$u_uid'");
+ while($fpoll_response_r = mysqli_fetch_assoc($fpoll_response_q)) {
+ // poll response data
+ $fpoll_option_picked = $fpoll_response_r['option_picked'];
+ }
+ echo "
";
+
+ if($fpoll_option_picked != '') {
+ $current_can_vote = "no";
+ }
+ else {
+ $current_can_vote = "yes";
+ }
+
+ // total vote count
+ $rest_c = mysqli_query($conx, "SELECT uid FROM feed_poll_response WHERE poll_uqid='$feed_randomstr'");
+ $optt_cnt = mysqli_num_rows($rest_c);
+
+ // count number of votes for each option
+ $res_c1 = mysqli_query($conx, "SELECT uid FROM feed_poll_response WHERE poll_uqid='$feed_randomstr' && option_picked='1'");
+ $opt1_cnt = mysqli_num_rows($res_c1);
+ if($opt1_cnt != '1') {
+ $count1_s = "s";
+ }
+ $res_c2 = mysqli_query($conx, "SELECT uid FROM feed_poll_response WHERE poll_uqid='$feed_randomstr' && option_picked='2'");
+ $opt2_cnt = mysqli_num_rows($res_c2);
+ if($opt2_cnt != '1') {
+ $count2_s = "s";
+ }
+ $res_c3 = mysqli_query($conx, "SELECT uid FROM feed_poll_response WHERE poll_uqid='$feed_randomstr' && option_picked='3'");
+ $opt3_cnt = mysqli_num_rows($res_c3);
+ if($opt3_cnt != '1') {
+ $count3_s = "s";
+ }
+ $res_c4 = mysqli_query($conx, "SELECT uid FROM feed_poll_response WHERE poll_uqid='$feed_randomstr' && option_picked='4'");
+ $opt4_cnt = mysqli_num_rows($res_c4);
+ if($opt4_cnt != '1') {
+ $count4_s = "s";
+ }
+ $res_c5 = mysqli_query($conx, "SELECT uid FROM feed_poll_response WHERE poll_uqid='$feed_randomstr' && option_picked='5'");
+ $opt5_cnt = mysqli_num_rows($res_c5);
+ if($opt5_cnt != '1') {
+ $count5_s = "s";
+ }
+ if($fpoll_option_picked == '1') {
+ $current_picked1 = "background-color: $username_color !important; color: $feed_tcolor !important";
+ }
+ if($fpoll_option_picked == '2') {
+ $current_picked2 = "background-color: $username_color !important; color: $feed_tcolor !important";
+ }
+ if($fpoll_option_picked == '3') {
+ $current_picked3 = "background-color: $username_color !important; color: $feed_tcolor !important";
+ }
+ if($fpoll_option_picked == '4') {
+ $current_picked4 = "background-color: $username_color !important; color: $feed_tcolor !important";
+ }
+ if($fpoll_option_picked == '5') {
+ $current_picked5 = "background-color: $username_color !important; color: $feed_tcolor !important";
+ }
+
+ echo "
A poll has been attached to this post.
";
+ if($fpoll_istimed == 'yes') {
+ echo "
There is a time limit- it will stop accepting responses in ";
+ echo polltime($fpoll_tstmpend);
+ echo ".";
+ }
+ else {
+ echo "
There is no time limit set- responses are always accepted.";
+ }
+ echo "
";
+ echo "";
+ echo "$feed_username $verif_check ";
+ echo " | ";
+ echo "
";
+ echo "
";
+ echo "
";
+ echo "| ";
+ echo "$fpoll_question";
+ echo " | ";
+ echo "
";
+ echo "
";
+ echo "
Select your response by tapping one of the options below.";
+ if($current_can_vote == 'no') {
+ echo "
You can change your response by tapping a new option.";
+ }
+
+ echo "
";
+ echo "| ";
+ echo "$fpoll_opt1";
+ echo " | ";
+ echo "";
+ echo "$fpoll_opt2";
+ echo " | ";
+ if($fpoll_opt3 != '') {
+ echo "";
+ echo "$fpoll_opt3";
+ echo " | ";
+ }
+ if($fpoll_opt4 != '') {
+ echo "";
+ echo "$fpoll_opt4";
+ echo " | ";
+ }
+ if($fpoll_opt5 != '') {
+ echo "";
+ echo "$fpoll_opt5";
+ echo " | ";
+ }
+ echo "
";
+
+
+ echo "
";
+ echo "
";
+ echo "$opt1_cnt voted \"$fpoll_optc1\"
";
+ echo "$opt2_cnt voted \"$fpoll_optc2\"
";
+ if($fpoll_opt3 != '') {
+ echo "$opt3_cnt voted \"$fpoll_optc3\"
";
+ }
+ if($fpoll_opt4 != '') {
+ echo "$opt4_cnt voted \"$fpoll_optc4\"
";
+ }
+ if($fpoll_opt5 != '') {
+ echo "$opt5_cnt voted \"$fpoll_optc5\"
";
+ }
+ echo "
Total Votes Received: $optt_cnt
";
+ echo "
";
+
+
+
+ // Added Feed polls. 2021
+ // Added Feed polls. 2021
+ // Added Feed polls. 2021
+ // Added Feed polls. 2021
+
+
+
+
+
+ echo "