vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Formatting carried over to non vb page? (https://vborg.vbsupport.ru/showthread.php?t=82564)

GSX-Racing 06-06-2005 05:35 AM

Formatting carried over to non vb page?
 
Not sure if that is the wording but here goes.

I have a script that grabs the first post from the latest 3 threads and displays on a non vb page.

http://www.groundpilots.com/vb/print_news.phtml is what I'm talking about.

However, if you notice, it doesn't bring any of the formatting (like line breaks, colors, bold text, center) with it.

Does anyone know how I could achieve this? Also, it is only grabbing part of the post, how can I get it to grab all the text.

Here is most of the file is anyone can see where I need to change some of it.

Code:

require_once("./includes/functions_bbcodeparse.phtml");
$outxt=parse_bbcode2($ptext,"1","1","1","1","1");
$outxt=substr($outxt,0,350);

// This is optional. It strips out unecessary tags if you wish and leaves those specified behind
 $outxt = strip_tags($outxt, '<p>');
// This sql gets the title of the forum
$sql3 = "SELECT title FROM ".$dbprefix."forum WHERE forumid = \"$forumid\" LIMIT 1";
$sql_result3 = mysql_query($sql3, $connection) or die ("Could not execute query in second sql statement.");
$row3 = mysql_fetch_array($sql_result3);
$forumname = $row3["title"];
//EDIT the HTML OUTPUT HERE
$towrite .= '
<table class="newstext" width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td bgcolor="#2F3E49"><a href="'.$forumspath.'/showthread.phtml?s=&amp;threadid='.$threadid.'"><font color=#FFFFFF>'.$title.'</font></a></td>
    <td align="right" bgcolor="#2F3E49"><font color=#CCCCCC>Posted by</font> <a href="'.$forumspath.'/member.phtml?s=&amp;action=getinfo&amp;userid='.$postuserid.'"><b><font color=#FFFFFF>'.$postusername.'</font></b></a><font color=#CCCCCC> on <i>'.$dateposted.'</i></font></td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#232D35"><font color=#CCCCCC>'.$outxt.'</font></td>
  </tr>
  <tr bgcolor="#2F3E49">
    <td><a class=newsout href="'.$forumspath.'/showthread.phtml?s=&amp;threadid='.$threadid.'"><font color=#FFFFFF>'.$replycount.' '.$commenttext.'</font></a></td>
    <td align="right" bgcolor="#2F3E49"><a href="'.$forumspath.'/showthread.phtml?s=&amp;threadid='.$threadid.'"><font color=#FFFFFF>Read Complete Article</font></a>&nbsp;&nbsp;<a href="'.$forumspath.'/newreply.phtml?do=newreply&t='.$threadid.'"><img src="'.$forumspath.'/tren_z/buttons/reply.gif" title="Post a reply to this article" border="0"></a></td>
  </tr>
</table><br>
';
// END HTML EDIT
}
}

echo $towrite;

echo '</body></html>';
}

writenews("27", "","3");
?>


Andreas 06-06-2005 10:24 AM

PHP Code:

// This is optional. It strips out unecessary tags if you wish and leaves those specified behind
$outxt strip_tags($outxt'<p>'); 

Well, this removes all formatting except <p>-Tags :)

GSX-Racing 06-06-2005 09:44 PM

Quote:

Originally Posted by KirbyDE
PHP Code:

// This is optional. It strips out unecessary tags if you wish and leaves those specified behind
$outxt strip_tags($outxt'<p>'); 

Well, this removes all formatting except <p>-Tags :)

Ok thanks.

I thought it had something to do with that but didn't know for sure.


All times are GMT. The time now is 08:15 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01222 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete