vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Pull out text from post (https://vborg.vbsupport.ru/showthread.php?t=198522)

christmas 12-10-2008 12:08 PM

Pull out text from post
 
Hi guys

I like to pull out newest thread on non vbul index-page. I found this mod wich seems to work. But the mod do not include text from the posts. I like to include around 25 characters from each post. It must be relatively easy to pull out post-text, but is it? and what is the database-name of a post?

Here is the code:

Code:

bla bla bla

$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter,post FROM thread WHERE visible=1 AND open=1 $forumid ORDER BY lastpost DESC $limited");

while($thread_get=mysql_fetch_array($thread_sql))
{
$lastpost = $thread_get['lastpost'];
$poster = $thread_get['lastposter'];
$tid = $thread_get['threadid'];
$psql = mysql_query("SELECT postid FROM post WHERE threadid=$tid ORDER BY postid DESC");
$getp=mysql_fetch_array($psql);
$pid = $getp['postid'];
$date2 = date ("m/d/y h:i A" ,$lastpost);
$title = $thread_get['title'];
$title = substr($title,0,$txtlimit);
echo "<tr><td><font size=\"2\" face=\"arial,verdana,geneva\"><a href=\"$forum_url/showthread.php?p=$pid#post$pid\"><FONT SIZE=\"2\" COLOR=\"$titlecolor\" face=\"arial,verdana,geneva\">$title</FONT></a></font><br /><font color=\"$postedcolor\" face=\"arial,verdana,geneva\" size='1'>posted by $poster <i>$date2</i></FONT></td></tr>";
}
echo "</table>";


Lynne 12-10-2008 02:10 PM

You need to grab post.pagetext from the 'post' table. So, you'll have to do a join with the 'post' table on post.postid = thread.firstpostid

christmas 12-11-2008 07:31 AM

Hmm, I must admit I can't handle this alone. My PHP/Sql-skill are obviously to low. Can anyone help me. There are lots of mods that pulls latest posts out on nonVB index-page, but non of them pulls alsom some of the text from latest posts. It should be easy to make?! I am ready to pay for this.

Lynne 12-11-2008 02:52 PM

If you are wanting to pay for it, let me know and I'll move this thread to paid requests. Or you can just make a post in Paid Requests yourself about this.

christmas 12-11-2008 06:26 PM

Thanks, I will try making a request in paid section :)


All times are GMT. The time now is 11:38 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.01401 seconds
  • Memory Usage 1,715KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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