Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 11-30-2002, 03:52 PM
amsch amsch is offline
 
Join Date: Dec 2001
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default simple one..

I have this hack that calls threads from my fourms. The problem I have is it will mess up my tables when people put in the vb code or urls. How can I tell it to ignore those?

Here is the hack... I have had it for almost 2 years... I have no idea where it came from.
<?
require("/config.php");

$num_active = 4;
$num_chars = 40;

$db=mysql_connect($servername,$dbusername,$dbpassw ord);
mysql_select_db($dbname);

$querylatest="select * from thread where forumid='1' or forumid='78' or forumid='45' or forumid='11' or forumid='15' or forumid='43' or forumid='2' or forumid='35' or forumid='65' or forumid='7' or forumid='86' or forumid='85' or forumid='87' or forumid='12' or forumid='46' or forumid='3' or forumid='80' or forumid='4' or forumid='5' or forumid='36' or forumid='37' or forumid='44' or forumid='17' or forumid='81' or forumid='38' or forumid='69' or forumid='13' or forumid='14' or forumid='96' or forumid='97' or forumid='95' order by lastpost desc limit $num_active";

$resultlatest = mysql_query($querylatest,$db);

print("<table width=\"75%%\" cellspacing=\"0\" cellpadding=\"1\">");

while ($latest_array = mysql_fetch_array($resultlatest)) {

$querythread="select * from post where threadid='$latest_array[threadid]' order by dateline asc limit 1";

$result_thread_text= mysql_query($querythread,$db);

$result_thread_array = mysql_fetch_array($result_thread_text);
printf ("<td align=\"left\" width=\"75%%\" bgcolor=\"#ffffff\"><font face=\"arial,Verdana, ArialHelveticasans-serif\" size=\"2\">%s... </font><a href=\"/boards/showthread.php?threadid=%s\"><font face=\"arial,Verdana, ArialHelveticasans-serif\" size=\"2\">Rant Here </font></a></td></tr>",substr(strip_tags($result_thread_array["pagetext"]),0,$num_chars),$latest_array["threadid"]);
printf ("<tr><td colspan=\"2\" width=\"75%%\"> </td></tr>");
}

printf ("</table>");
?>
Reply With Quote
  #2  
Old 12-03-2002, 12:11 PM
amsch amsch is offline
 
Join Date: Dec 2001
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?? please!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03665 seconds
  • Memory Usage 2,156KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete