Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Show posts instead of threads... HELP!!!!! Details »»
Show posts instead of threads... HELP!!!!!
Version: , by ViPeR-GtS ViPeR-GtS is offline
Developer Last Online: Feb 2004 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 12-20-2002 Last Update: Never Installs: 0
 
No support by the author.

Code:
<?php
error_reporting(7);
require('./global.php');

  $news = $DB_site->query("SELECT thread.title, thread.threadid, thread.iconid, thread.postusername, thread.replycount FROM thread WHERE thread.forumid = XX ORDER BY thread.threadid DESC LIMIT 5");
  print("<table width='95%' align='center' cellspacing=0>");
  $lastdate="";
  while($new=$DB_site->fetch_array($news)) {
    $newstext=$DB_site->query_first("
    SELECT post.pagetext, post.dateline FROM post
    WHERE post.threadid='$new[threadid]'
    ORDER BY postid LIMIT 5
    ");
  
    print("<tr>");
//if(date("d.m.Y",$newstext[dateline])!=$lastdate) {
  //print(date("d.m.Y",$newstext[dateline])); }

$lastdate=date("d.m.Y",$newstext[dateline]);

    print("<th class='head' align='left' bgcolor='#FFFFFF".$headcolor."'><font size=1>".date("d.m.Y - H:i:",$newstext[dateline])."</font><br>".$new[title]."</th>");
    print("<th class='head' align='right' bgcolor='#FFFFFF".$headcolor."'>".$new[postusername]."<br><font size=1><a href='http://some forums/showthread.php?s=&threadid=".$new[threadid]."'>Comments(".$new[replycount].")</a></font></th></tr>");
    print("<tr></tr><tr><td class=news colspan='2' bgcolor='#FFFFFF".$newscolor."'>".bbcodeparse2($newstext[pagetext],1,1,1,1)."</td>");
    print("</tr><tr><td height=5></td></tr>");
  }
  print("</table>");
?>

how to change the above script to show posts in one of the threads instead of threads in the forums ??

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-21-2002, 12:05 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice script, it's one of mine, where did you get it from?

the answer:
PHP Code:
<?php
error_reporting
(7);
require(
'./global.php');

$news $DB_site->query("SELECT post.title, post.pagetext,post.postusername,post.dateline FROM post WHERE post.threadid = XX ORDER BY post.postid DESC LIMIT 5");
print(
"<table width='95%' align='center' cellspacing=0>");
$lastdate="";
while(
$newstext=$DB_site->fetch_array($news)) {
print(
"<tr>");
//if(date("d.m.Y",$newstext[dateline])!=$lastdate) {
//print(date("d.m.Y",$newstext[dateline])); }

$lastdate=date("d.m.Y",$newstext[dateline]);

print(
"<th class='head' align='left' bgcolor='#FFFFFF".$headcolor."'><font size=1>".date("d.m.Y - H:i:",$newstext[dateline])."</font><br>".$newstext[title]."</th>");
print(
"<th class='head' align='right' bgcolor='#FFFFFF".$headcolor."'>".$newstext[postusername]."<br><font size=1><a href='http://forums.khabal.com/showthread.php?s=&threadid=".$new[threadid]."'>Comments(".$new[replycount].")</a></font></th></tr>");
print(
"<tr></tr><tr><td class=news colspan='2' bgcolor='#FFFFFF".$newscolor."'>".bbcodeparse2($newstext[pagetext],1,1,1,1)."</td>");
print(
"</tr><tr><td height=5></td></tr>");
}
print(
"</table>");
?>
Reply With Quote
  #3  
Old 12-21-2002, 12:21 AM
ViPeR-GtS ViPeR-GtS is offline
 
Join Date: Mar 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in one of the post here... anyway you got any idea how to make it show posts instead of threads ???
Reply With Quote
  #4  
Old 12-21-2002, 12:24 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

never posted it here
just gave it away to one or two, but no problem, i was just faszinated to see it here

well, use the code i posted above, it should work for posts instead
Reply With Quote
  #5  
Old 12-23-2002, 03:34 AM
ViPeR-GtS ViPeR-GtS is offline
 
Join Date: Mar 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<form enctype="multipart/form-data" action="http://some forums/newreply.php" name="vbform" method="post"> 
<input type="hidden" name="s" value=""> 
<input type="hidden" name="action" value="postreply"> 
<input type="hidden" name="threadid" value="xxxxx"> 
<input type="hidden" name="title" value=""> 
<input type="hidden" name="iconid" value="0"> 
<input type="hidden" name="parseurl" value="yes"> 
<input type="hidden" name="email" value=""> 
<input type="hidden" name="disablesmilies" value=""> 
<input type="hidden" name="signature" value="yes"> 
<input type="hidden" name="closethread" value=""> 
<input type="hidden" name="hiddenreply" value=""> 
<input type="hidden" name="signature" value="yes"> 
<input type="hidden" name="rating" value="0"> 

<table cellpadding="0" cellspacing="0" border="0" bgcolor="#555576" width="100%" align="center"><tr><td> 
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr> 
<td bgcolor="#8080A6" colspan="2"><font face="verdana, arial, helvetica" size="2" color="#EEEEFF" class="thtcolor"><b>Post 
Reply</b></font></td>
</tr>
<tr valign="top">
<td bgcolor="#DFDFDF"><font face="verdana, arial, helvetica" size="2" ><b>Your User Name:</b></font></td>
<td bgcolor="#DFDFDF"><font face="verdana, arial, helvetica" size="2" ><input type="text" class="bginput" name="username" value="INPUT NAME" size="25">
  </font>
<font face="verdana,arial,helvetica" size="1" ><a href="register.php?action=signup">Want to register?</a>
</font></td>
</tr>
<tr valign="top">
<td bgcolor="#F1F1F1"><font face="verdana, arial, helvetica" size="2" ><b>Your Password:</b></font></td>
<td bgcolor="#F1F1F1"><font face="verdana, arial, helvetica" size="2" ><input type="password" class="bginput" name="password" value="" size="25">
  </font>
<font face="verdana,arial,helvetica" size="1" ><a href="member.php?action=lostpw">Forgotten your password?</a>
</font></td>
</tr>

<tr> 
<td bgcolor="#DFDFDF" valign="top" nowrap><font face="verdana, arial, helvetica" size="2" ><b>Your 
Reply:</b></font></td>
<td bgcolor="#DFDFDF"> 
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top"> 
<td> 
<textarea name="message" rows="7" cols="70" wrap="virtual" tabindex="1"></textarea>
<br>
<font face="verdana,arial,helvetica" size="1" ></font></td>
</tr>
</table>
</td>
</tr>
</table> 
</td></tr></table> 

<br> 

<table cellpadding="2" cellspacing="0" border="0" width="100%" align="center"> 
<tr> 
<td align="center"><font face="verdana, arial, helvetica" size="2" > 
<input type="submit" class="bginput" name="submit" value="Submit Reply" accesskey="s" tabindex="2"> 
</font></td> 
</tr> 
</table> 

</form>

if i use this on a non-vb page, how to i let it redirect back to this non vb page after someone has posted ???
Reply With Quote
  #6  
Old 12-23-2002, 01:24 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Xenon, what does this exactly do?
Reply With Quote
  #7  
Old 12-23-2002, 02:02 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@viper: please use code tags whenever you post code lines, it's so hard to read without....
well, you have to hack newreply.php and change the redirect-code whenever it's called by this non vb-script...

@Drk: It's the newsscript i use on my site, just a few lines i coded long time ago, because my mainpage is on a different server than the board, so i can't use a normal portal
Reply With Quote
  #8  
Old 12-23-2002, 10:59 PM
ViPeR-GtS ViPeR-GtS is offline
 
Join Date: Mar 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Xenon
@viper: please use code tags whenever you post code lines, it's so hard to read without....
well, you have to hack newreply.php and change the redirect-code whenever it's called by this non vb-script...

sorry will do tat next time

btw im not quite used to the vb codes, hope u can enlighten me regarding the changing of codes for redirect. Thanks
Reply With Quote
  #9  
Old 12-23-2002, 11:55 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, in your non vb-script after that:
Code:
<input type="hidden" name="s" value=""> 
<input type="hidden" name="action" value="postreply">
add this:
Code:
<input type="hidden" name="redirectnonvb" value="1">
then open newreply.php
find:
PHP Code:
      // redirect
      
if ($visible) {
        
$goto="showthread.php?s=$session[sessionhash]&postid=$postid#post$postid";
      } else {
        
$goto="forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]";
      }
      eval(
"standardredirect(\"".gettemplate("redirect_postthanks")."\",\"$goto\");"); 
and change to this:
PHP Code:
      // redirect
      
if ($visible) {
        
$goto="showthread.php?s=$session[sessionhash]&postid=$postid#post$postid";
      } else if(
$redirectnonvb!=1) {
        
$goto="forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]";
      } else {
       
$goto="url where to redirect :)";
      
}
      eval(
"standardredirect(\"".gettemplate("redirect_postthanks")."\",\"$goto\");"); 
Reply With Quote
  #10  
Old 12-24-2002, 12:20 AM
ViPeR-GtS ViPeR-GtS is offline
 
Join Date: Mar 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks... Xenon

another question...

the 1st code i post here... is to show the last 5 post rite...
if i want to make it to show all, how to make like show 5 or 10 per page ???
Reply With Quote
Reply


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 11:24 PM.


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.04646 seconds
  • Memory Usage 2,322KB
  • Queries Executed 23 (?)
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
  • (4)bbcode_code
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete