public function cc_to_html($data = array()) { // set return result $result = array("status" => false, "message" => "", "data" => ""); // check data must be an array if (is_array($data)) { // check data is not empty if (count($data) > 0) { // set blank html $html = ""; $data = array_reverse($data); foreach ($data as $comment) { $detail = strip_tags($comment["comment"]); $detail = make_url_to_link($detail); $detail = str_replace('\\n\\r', '<br />', $detail); $detail = preg_replace('/^(?:<br\\s*\\/?>\\s*)+/', '', $detail); $since = c_get_time_elapsed(strtotime($comment['added_on'])); $user = $this->is_valid_user($comment['posted_by']); $name = $user ? $user['name'] : 'Unknow user'; $image = get_profile_pic($user['id'], $user['profile_pic']); $html .= "\n <div class='leftine'>\n <div class='comm'> </div>\n <div class='commhead'> </div>\n <div class='smalluserimg'><img alt='' src='{$image}' /></div>\n <div class='smallusertxt'> <span class='star_headdrop'>{$name}</span>\n <p>{$detail}</p>\n <span style='color: #646464; float: left; font-size: 13px'>{$since}</span>\n </div>\n </div>"; } $result["status"] = true; $result["message"] = "Data successfully converted array to html."; $result["data"] = $html; } else { $result["message"] = "Data is empty."; } } else { $result["message"] = "Data is not array kindly pass an array."; } // return result return $result; }
<li class="mrgntoptn"> <div class="usrimgmsg"><?php echo $image; ?> </div> <div class="usritxtmsg"> <strong><?php #echo $notif_data['notif_data']['user']['data']['name']; ?> </strong><br /> <?php echo $detail; ?> <br /> <strong><?php echo c_get_time_elapsed(strtotime($notif_data['notif_data']['created_on'])); ?> </strong> <!-- <p> <a href="javascript:void(0);" class="mainsave floatlft marginrighrspc <?php echo $a_link; ?> " data-csid="<?php echo $notif_data['notif_data']['caller_stream']['data']['id']; ?> " data-rsid="<?php echo $notif_data['notif_data']['receiver_stream']['data']['id']; ?> ">Accept</a> <a href="javascript:void(0);" class="mainsave floatlft <?php
public function feeds_to_html($data = array()) { // set return result $result = array("status" => false, "message" => "", "data" => ""); // check data must be an array if (is_array($data)) { // check data is not empty if (count($data) > 0) { // set blank html $group = ""; $html = ""; $control = 0; $serial = 0; foreach ($data as $feed) { $feed_id = $feed['id']; $title = strip_tags($feed['title']); $title = word_limiter($title, 7); $eco_pic_dir = ($feed['data_type'] == 'voice' or $feed['data_type'] == 'stream') ? "voices" : "ecosystem"; $image = "/user_files/prof/" . $feed['user_id'] . "/{$eco_pic_dir}/" . $feed['eco_pic']; $since = c_get_time_elapsed(strtotime($feed['created_on'])); $detail = strip_tags($feed["details"]); $detail = make_url_to_link($detail); $detail = str_replace('\\n\\r', '<br />', $detail); $detail = preg_replace('/^(?:<br\\s*\\/?>\\s*)+/', '', $detail); $detail = word_limiter($detail, 10); $userdata = $this->session->userdata('user_data'); $uid = $feed['user_id']; $user = $this->Mod_User->get_user($uid); $user_image = "/user_files/prof/{$uid}/" . $user['data']['profile_pic']; if (!file_exists($_SERVER['DOCUMENT_ROOT'] . $user_image)) { $user_image = "/assets/images/ep.png"; } $single_feed_url = base_url() . $feed['data_type'] . '/' . $feed_id; $data_type = ucwords($feed['data_type']); ++$serial; if ($control == 0) { $group = "<div class='container_705'><ul class='dropcontainer'>"; ++$control; } else { $group = ""; ++$control; } $text = $feed['data_type'] == 'voice' ? 'Vote' : 'View'; $list = "\n <li>\n <div class='wwf_the_outer' style='background: url({$image}) no-repeat scroll 0 0 / 100% 100px rgba(0, 0, 0, 0)'>\n <div class='image_wwf'>\n <img src='{$user_image}' alt='' style='width: 56px; height: 56px;' />\n </div>\n <h4>{$title}</h4>\n <p>{$detail}</p>\n <a href='{$single_feed_url}' class='yellow_btn'>{$text}</a>\n <p>{$since}</p>\n <div class='srachbar'>{$data_type}</div>\n </div>\n </li>\n "; $html .= $group . $list; if ($control == 3) { $group = "</ul></div><div class='brdrall'></div>"; $control = 0; } else { $group = ""; } if ($serial == count($data)) { $group = "</ul></div><div class='brdrall'></div>"; } $html .= $group; } $result["status"] = true; $result["message"] = "Data successfully converted array to html."; $result["data"] = $html; } else { $result["message"] = "Data is empty."; } } else { $result["message"] = "Data is not array kindly pass an array."; } // return result return $result; }
public function mv_to_html($data = array()) { // set return result $result = array("status" => false, "message" => "", "data" => ""); // check data must be an array if (is_array($data)) { // check data is not empty if (count($data) > 0) { // set blank html $group = ""; $html = ""; $control = 0; $serial = 0; foreach ($data as $voice) { $voice_id = $voice['id']; $title = strip_tags($voice['question_text']); $title = word_limiter($title, 7); $image = "../user_files/prof/" . $this->get_logged_uid() . "/voices/" . $voice['voice_pic']; $since = c_get_time_elapsed(strtotime($voice['added_on'])); $detail = strip_tags($voice["voice_details"]); $detail = make_url_to_link($detail); $detail = str_replace('\\n\\r', '<br />', $detail); $detail = preg_replace('/^(?:<br\\s*\\/?>\\s*)+/', '', $detail); $detail = word_limiter($detail, 10); $userdata = $this->session->userdata('user_data'); $uid = $userdata['uid']; $user = $this->Mod_User->get_user($uid); $user_image = get_profile_pic($uid, $user['data']['profile_pic']); $single_voice_url = base_url() . $this->_config['single_voice_url'] . '/' . $voice_id; ++$serial; if ($control == 0) { $group = "<div class='container_705'><ul class='dropcontainer'>"; ++$control; } else { $group = ""; ++$control; } $list = "\n <li>\n <div class='wwf_the_outer' style='background: url({$image}) no-repeat scroll 0 0 / 100% 100px rgba(0, 0, 0, 0)'>\n <div class='image_wwf'>\n <img src='{$user_image}' alt='' style='width: 56px; height: 56px;' />\n </div>\n <h4>{$title}</h4>\n <p>{$detail}</p>\n <a href='{$single_voice_url}' class='yellow_btn'>Vote</a>\n <p>{$since}</p>\n </div>\n </li>\n "; $html .= $group . $list; if ($control == 3) { $group = "</ul></div><div class='brdrall'></div>"; $control = 0; } else { $group = ""; } if ($serial == count($data)) { $group = "</ul></div><div class='brdrall'></div>"; } $html .= $group; } $result["status"] = true; $result["message"] = "Data successfully converted array to html."; $result["data"] = $html; } else { $result["message"] = "Data is empty."; } } else { $result["message"] = "Data is not array kindly pass an array."; } // return result return $result; }
<p><?php echo $os_since; ?> </p> </div> <div class="brdrall"></div> <?php } ?> <?php if ($is_or_river) { $or_title = strip_tags($or_river['title']); $or_title = word_limiter($or_title, 7); $or_str_bg_image = "/user_files/prof/" . $or_river['moderator_id'] . "/ecosystem/" . $or_river['eco_pic']; $or_since = c_get_time_elapsed(strtotime($or_river['created_on'])); $or_detail = strip_tags($or_river["description"]); $or_detail = word_limiter($or_detail, 10); $user = $this->Mod_User->get_user($or_river['moderator_id']); $or_single_river_url = base_url() . $config['single_river_url'] . '/' . $or_river['id']; $or_user_image = get_profile_pic($user['data']['id'], $user['data']['profile_pic']); ?> <div class="headblack mrgntopnone">Rivers you might want<br /> to Follow</div> <div class="wwf_the_outer rightpan" title="" style="background: url(<?php echo $or_str_bg_image; ?> ) no-repeat scroll 0 0 / 100% 100px rgba(0, 0, 0, 0)"> <div class="image_wwf"><img src="<?php echo $or_user_image; ?> " alt="" style="width: 65px; height: 65px;" /></div>
<h2><span class="star_head">Moderator |</span> <a href="<?php echo DOC_ROOT . 'member/' . $river['moderator_id']; ?> "><?php echo $moderator_name; ?> </a></h2> <br /><br /><br /> </div> <ul class="dropcontainer"> <?php foreach ($child_streams as $stream) { $title = strip_tags($stream['question_text']); $title = word_limiter($title, 7); $str_bg_image = "/user_files/prof/" . $stream['user_id'] . "/voices/" . $stream['voice_pic']; $since = c_get_time_elapsed(strtotime($stream['added_on'])); $detail = strip_tags($stream["voice_details"]); $detail = word_limiter($detail, 10); $user = $this->Mod_User->get_user($stream['user_id']); $uid = $stream['user_id']; $single_stream_url = base_url() . $config['single_stream_url'] . '/' . $stream['id']; $user_image = get_profile_pic($uid, $user['data']['profile_pic']); ?> <li> <div class="wwf_the_outer" style="background: url(<?php echo $str_bg_image; ?> ) no-repeat scroll 0 0 / 100% 100px rgba(0, 0, 0, 0)"> <div class="image_wwf"><img src="<?php echo $user_image; ?>