Start a new topic
Answered

Profile Data Master and line space

Hi, I have an area on our page for article content.  We have a user who recently created an article, but the line breaks were not automatically completed.  Also, <br> tags are not working either.  The widget is called the Profile Data Master and this is the code currently being used for the widget.


<div class="post_content" <? if ($dc[search_results_layout]=="right_sidebar") { ?>style="float:left;"<? } ?>>

<?


if ($page[seo_type]=="data_post" || $_ENV[seo_type]=="data_post") {


 $sidebar=$dc[profile_sidebar];


 $post=additionalFields($post,$w);

 if ($post[post_video]!="") {

  $post[post_video_link]=$post[post_video];

 $post[post_video]=str_replace("watch?v=","embed/",$post[post_video]);

 $post[post_video]=str_replace("youtu.be/","youtube.com/embed/",$post[post_video]);

 $post[post_video]=str_replace("vimeo.com/","player.vimeo.com/video/",$post[post_video]);

 $post[post_video]=explode("&",$post[post_video]); $post[post_video]=$post[post_video][0];


 $post[post_video]="<iframe width='640' height='380' src='".str_replace("http://","//",$post[post_video])."' frameborder='0' allowfullscreen></iframe>";

 }

 //$post[post_content]=str_replace("n","<br>",$post[post_content]);

 if ($post[post_tags]!="") {

 $post[post_tags]=explode(",",rtrim($post[post_tags],", "));

 foreach ($post[post_tags] as $tag) {

  if ($tag!="") {

 $tag=str_replace('"',"",$tag);

 $tags[]= "<A HREF='/$dc[data_filename]?q=".trim($tag)."' title='$tag ".ucwords($dc[data_name])."'>".ucwords(strtolower(trim($tag)))."</a>";

  }

 } if (is_array($tags)) { $post[post_tags]=implode(", ",$tags); $tags=$post[post_tags]; }

 }


 echo eval("?>".$dc[search_results_layout]."<?");


?>



 <div class="clear"></div>


 <? if (strstr($post[additional_fields],"==")) {


 $fresults=mysql($w[database],"SELECT * FROM `form_fields` WHERE `form_name`='$dc[form_name]' AND `field_display_view`='1' ORDER BY `field_order` ASC");

 if (mysql_num_rows($fresults)>0) {

 ?>

 <table class="profile-table">


 <?

 while ($f=mysql_fetch_array($fresults)) {

 if ($f[field_type]=="HTML") { ?><tr><th colspan=2><h2><?=$f[field_text]?></h2></th></tr>

 <? } else if ($pre[$f[field_name]]!="") { ?>

 <tr>

 <td class="one"><?=$f[field_text]?></td>

 <td><?=ucfirst($post[$f[field_name]])?></td>

 </tr>

 <? }

 }

 

 } ?></table>

 

 <? } ?>




 <? if ($dc[comments_header]!="") { ?><h4><?=eval("?>".$dc[comments_header]."<?")?></h4><? } ?>


 <? if ($dc[comments_code]!="") { ?><?=eval("?>".$dc[comments_code]."<?")?><? } ?>




<? } else { ?>



 <?=$page[header]?>

 <h1 class="hero"><?php echo stripslashes(stripslashes($page[h1]));?> <? if ($_GET[page]>0) { ?>- Page <?php echo stripslashes($_GET[page]);?><? } ?></h1>


 <? if ($page[h2]!="") { ?><h2 style="border-top:0px;" class="news-topic"><?=$page[h2]?></em></h2><? } ?>

<? if ($w[software_version] < 3) { ?>

 <? if ($_GET[advanced]!="") { ?><?=widget("Advanced Search Results Filter","",$w[website_id],$w)?><? } ?>

<? } ?>

 <? if (is_array($data_results) && count($data_results)>1) { ?>


 <div style="padding-top:0px;float:left;overflow:hidden;width:100%;" id="location-tabs" class="location-tabs">

 <? if(is_array($tabs) && $notabs!=1) { ?>

 <ul class="main-tabs">


 <? foreach ($tabs as $key=>$tab) { $tabsnum++; ?><li <? $tb++; if ($tb==1) { ?>class="active"<? } ?>><a href="#t<?=$key?>" rel="nofollow"><? echo eval("?>".$tab."<?"); ?><?=$dc[data_type]?><? if ($data_results[$key][total]>0) { ?> (<font><?=$data_results[$key][total]?></font>)<? } ?></a></li><? } ?>

 </ul>

 <? } ?>

 <?

 foreach ($data_results as $key=>$value) { ?>

 <? $totaltabs++; ?>

 <div id="tab-t<?=$key?>" class="location-content"><? echo $value[results]; ?><div class="clear"></div>

 <div id="sort"><div class="sort"><?=str_replace("?","$value[data_filename]?",$value[pagination])?></div></div></div>

<? } } else { ?>

 <? $totaltabs++; ?>

 <div>


 <?=$data_results[$dc[data_id]][results]?>

 <div class="clear"></div>

<?

$app_uri='http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";

 if ($pos_get = strpos($app_uri, '?')) { $app_uri = substr($app_uri, 0, $pos_get); }

if (($slash_get = strrpos($app_uri, '/')) == strlen($app_uri)-1) {

$app_uri = substr($app_uri,0,$slash_get);

}

?>

 <div id="sort"><div class="sort"><?=str_replace("?",$app_uri."?",$data_results[$dc[data_id]][pagination])?></div></div>

<div class="clear"></div>

 <? } ?>

 </div>

 <? if ($totaltabs<1) { echo showMessage("Sorry, we did not find any results for your search.","alert",1); }


 $sidebar=$page[sidebar];

if ($dc[category_sidebar]!="") { $sidebar=$dc[category_sidebar]; }

?>



<? } ?>



</div>


 <!--- Sidebar --->

 

<div class="post_sidebar">


<? if ($sidebar!="") { echo sidebar($sidebar,"",$w[website_id],$w); } ?>


</div>



Thanks.


Best Answer
Hi Amol, the issue was that your site is HTTPS but the script that was needed for the posts to work was being called through HTTP. This is now fixed, but any existing article that has the issue will need fixing and then be  saved to be updated. Any new articles does not need anything, just paste it and done.

 


Hi Amol, thank you for the code. Could you please provide an image or a link to where the problem is so we can assist you quicker to solve the issue. I tried looking at the articles but could not find an issue like this.

PS: I loved your article about customer service.

 

Thanks.  Here's what it should look like, and how its posting.

Answer
Hi Amol, the issue was that your site is HTTPS but the script that was needed for the posts to work was being called through HTTP. This is now fixed, but any existing article that has the issue will need fixing and then be  saved to be updated. Any new articles does not need anything, just paste it and done.

 

thank you very much.