Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 12 Mar 2016, 23:54
gcombe74 gcombe74 is offline
 
Join Date: Feb 2016
php mysql query to pull last x number of posts

I migrated from phpbb3 to vbulletin.. and I used to pull the last 30 posts from my site by post id..

and oddly I can do that in vbulletin as well but only the posts that imported...

so the question is this..I was pulling by postid or lastpost... its easy to tell that vb5 has gone away from postid...

but is there query that I can run in vb5 to do this? can someone help me figure out how to reconstruct the url for pulling the last x number just php and mysql query?

Thanks
Reply With Quote
  #2  
Old 13 Mar 2016, 03:43
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
That won't be easy to do. All posts, threads, forums, categories, attachments, photos, galleries, private messages......you get the idea, are stored in the node table. Everything in vb5 is considered content. It is possible to do refining the query by contenttype, but may not be full proof. Might I ask what exactly you are trying to accomplish?

The reason you can still puul the last 30 by postid in vbulletin on imported posts is because your old post table still exists.
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
  #3  
Old 13 Mar 2016, 23:44
gcombe74 gcombe74 is offline
 
Join Date: Feb 2016
Originally Posted by Replicant View Post
That won't be easy to do. All posts, threads, forums, categories, attachments, photos, galleries, private messages......you get the idea, are stored in the node table. Everything in vb5 is considered content. It is possible to do refining the query by contenttype, but may not be full proof. Might I ask what exactly you are trying to accomplish?

The reason you can still puul the last 30 by postid in vbulletin on imported posts is because your old post table still exists.


just on my main site I like to list the last 30, but most of my forums are closed so RSS wont build them. so I was just wanting to pull the topic, date, person posting so people can see what is being taked about in a quick glance. in phpbb3 you can deterime what is built in RSS locked or not.
Reply With Quote
  #4  
Old 14 Mar 2016, 02:14
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
I use a search module with a custom search string in it that gives all the new threads, posts and comments in chronological order starting with the newest to the oldest. It works relatively bug free since version 5.1.5. Here is the basic version. I can help you tweak it for your needs. It also displays results based on permissions so if the user is logged in and has access to the closed forums, those new posts will be displayed for them to view.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

To use it, create a new page in site-builder and add the search module to the page. Edit the search properties in the advanced edit section and replace the search string with this one. Name the page and set the url to whatever you want such as /activity. Now when you navigate to /activity, you will see a page similar to the activity stream in vb4. You can adjust the "date"{"from":1 to however many days you wish to yield more or less results. This module can also be dropped onto a regular page or the front page if you want and will do the same thing. It will auto format for the size column you drop it in.
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
  #5  
Old 14 Mar 2016, 21:01
gcombe74 gcombe74 is offline
 
Join Date: Feb 2016
that code worked well. thank you.

So answer me this.. what would have have to embed in my main site (outside the forum) to make it display it on web page outside my forum? I realize session info is needed just not sure how in VB5 if that can be or how to.
Reply With Quote
  #6  
Old 14 Mar 2016, 21:19
shimei shimei is offline
 
Join Date: Feb 2015
Originally Posted by gcombe74 View Post
that code worked well. thank you.

So answer me this.. what would have have to embed in my main site (outside the forum) to make it display it on web page outside my forum? I realize session info is needed just not sure how in VB5 if that can be or how to.
Just curious, if I am understanding you right..... Wouldn't a RSS feeder on the other site work to list all the newest posts from RSS on your Vb 5 site?
Reply With Quote
  #7  
Old 15 Mar 2016, 01:53
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
Originally Posted by gcombe74 View Post
that code worked well. thank you.

So answer me this.. what would have have to embed in my main site (outside the forum) to make it display it on web page outside my forum? I realize session info is needed just not sure how in VB5 if that can be or how to.
This code can help you with that. For it to work, your cookie path has to be / in vb5. It will of course need other code, but this is the basis of viewing forum content outside the forums.

External Login Tutorial

Originally Posted by shimei View Post
Just curious, if I am understanding you right..... Wouldn't a RSS feeder on the other site work to list all the newest posts from RSS on your Vb 5 site?
Nope, he wants his users with private forum access to be able to view the activity stream. The RSS only works for public forums.
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status

Last edited by Replicant; 15 Mar 2016 at 02:00.
Reply With Quote
  #8  
Old 16 Mar 2016, 01:18
IggyP IggyP is offline
 
Join Date: May 2012
ive tried this fix and some other things but still cannot get a basic display of recent content in the order it was updated....theres always a couple in the middle thats out of order...

the search modules are pretty confusing to start with in vb5 but then to not work idk what i can do but wait and pray they fix it

really all i want is one "topic view" style module with a list of latest topics, posts, and comments, then one "default style" module that includes all activity but pms....shouldn't be too hard right?

--------------- Added 16 Mar 2016 at 07:50 ---------------

well...i kept messing with it....

this is the best string i found so far


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

i think my confusion may be a bug for if i add photo content, it basically breaks....takes out things that should be listed and dont have anything to do with photo content...could be other issues, but for my current content at least that seem to display it all in a proper chronology.

btw, another thing that bugs me and seems to come up about searches of recent activity is regarding confusion when members comments, or editing....wouldnt it be nice if above the members name on these results, is said last edited by, last commented by, or last posted by above names? yes...yes it would
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forum Home Enhancements Most active user Last X (last day/last week/last month/ever) Fully controlled Omranic vBulletin 3.6 Add-ons 70 03 Nov 2011 17:05



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 23:05.

Layout Options | Width: Wide Color: