Jump to content

Recommended Posts

Hello all!

 

I want to set my home page up to grab data from a thread in my vBulletin forum and have it immediately export the data onto the home page. Basically, when someone posts a new thread in a specified forum, all of the text they post in the thread will posted onto the home page.

 

In order to show what I mean, I can redirect you to this site:

 

http://www.hellandheavennet.com

See how there are tables that have news posts, with links to comments? I want to do something like this.

 

Now look at this link:

http://forums.hellandheavennet.com/forumdisplay.php?f=43

 

That second link is the sub-forum that the users post the threads in and the threads show up on the home page.

 

I don't want the thread title or anything, I want the actual post.

 

Does anyone know how to do this? Thanks. :)

I tried to follow that and copied the code, but I wound up getting this SQL error:

 

Database error in vBulletin 3.6.8:

Invalid SQL:

	SELECT IF(votenum >= 1, votenum, 0) AS numbvote, IF(votenum >= 1 AND votenum != 0, votetotal / votenum, 0) AS voteavg,
	editlog.dateline AS edit_dateline,
	thread.threadid, post.title, thread.replycount, postusername, postuserid, threadprefix, thread.dateline AS postdateline, thread.lastposter, thread.lastpost, IF(views<=thread.replycount, thread.replycount+1, views) AS views, thread.forumid, post.postid, pagetext, allowsmilie, thread.iconid AS threadiconid, iconpath AS threadiconpath, avatarpath, NOT ISNULL(filedata) AS hascustom, customavatar.dateline AS avatardateline, avatarrevision, NOT ISNULL(subscribethread.subscribethreadid) AS subscribed 
	FROM thread AS thread
	LEFT JOIN post AS post ON (post.postid = thread.firstpostid)
	LEFT JOIN postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = -1 AND postparsed.languageid = -1)
	LEFT JOIN editlog AS editlog ON(editlog.postid = post.postid)
	LEFT JOIN icon AS icon ON (icon.iconid = thread.iconid)
	LEFT JOIN user AS user ON (user.userid = post.userid)
	LEFT JOIN avatar as avatar ON (avatar.avatarid = user.avatarid)
	LEFT JOIN customavatar AS customavatar ON (customavatar.userid = user.userid)
	LEFT JOIN subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = '2')
	WHERE thread.forumid IN(4)
	GROUP BY post.postid
	ORDER BY thread.dateline DESC
	LIMIT 10;

MySQL Error  : Unknown column 'threadprefix' in 'field list'
Error number: 1054

 

I'm not sure, but I think I may have messed up the column threadprefix. Do you know what I'm doing wrong by any chance?

i would probably trim it down to something like this

SELECT 
thread.threadid, post.title, thread.replycount, threadprefix, thread.dateline AS postdateline, thread.forumid, post.postid, pagetext, allowsmilie, thread.iconid AS threadiconid,
FROM thread AS thread
LEFT JOIN post AS post ON (post.postid = thread.firstpostid)
LEFT JOIN postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = -1 AND postparsed.languageid = -1)
WHERE thread.forumid IN(4)
GROUP BY post.postid
ORDER BY thread.dateline DESC
LIMIT 10;

of course with out knowing the database setup this is more guess work!

 

you can probably trim this down to 1 table (maybe with 1 join)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.