Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 22 Jan 2013, 14:33
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
Help me show

I use the following code inserted hook forumbit_display and it has taken time of the last post, now I need to get the time of the first post (time when create topic), anyone can help me, thanks a lot.


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


Last edited by Easy5s.net; 23 Jan 2013 at 00:00.
Reply With Quote
  #2  
Old 22 Jan 2013, 14:55
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
The information on the last post is saved in the forum table, but what you want isn't there so you'd have to add a query to get it.
Reply With Quote
  #3  
Old 22 Jan 2013, 15:01
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
You can guide me to select the table and should have what conditions? Please give me an example.

SELECT * what ?
WHERE ?
Reply With Quote
  #4  
Old 22 Jan 2013, 15:18
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Actually now that I've looked at some more code, I think you can piggy back it on another query so you don't have to add one. To try that, create a new plugin using hook cache_ordered_forums and code like this:

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


and then you should be able to use $forum['lastthreaddateline'] in your plugin (but I haven't tried it at all).


Edit: ...but I'm not sure if that's right now that I think about it. I don't know if the lastthreadid is the last thread created or the last thread that someone posted in.

Last edited by kh99; 22 Jan 2013 at 15:34.
Reply With Quote
  #5  
Old 22 Jan 2013, 15:33
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
Originally Posted by kh99 View Post
Actually now that I've looked at some more code, I think you can piggy back it on another query so you don't have to add one. To try that, create a new plugin using hook cache_ordered_forums and code like this:

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


and then you should be able to use $forum['lastthreaddateline'] in your plugin (but I haven't tried it at all).

I have to try and error

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


and use code

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


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


Last edited by Easy5s.net; 22 Jan 2013 at 15:39.
Reply With Quote
  #6  
Old 22 Jan 2013, 15:38
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
oops, it looks like you already have another plugin doing something similar? Try commenting out the $tachyjoin line in the code I posted and see if that works (although it seems like it's not quite correct since forum.lastthreadid could be different from lastthreadid if it's for a user in global ignore).
Reply With Quote
  #7  
Old 22 Jan 2013, 15:40
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by Easy5s.net View Post
and use code

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

Unknown column 'lastthreaddateline' in 'field list'

Yeah, sorry, I deleted that because I'm now confused as to whether or not lastthreadid is the thread you want. In any case it should have been "SELECT dateline AS lastthreaddateline" (or just "SELECT dateline", but I was trying to make it consistent with the other pluigin code I posted).

Edit nvm, it looks like the lastthread information *is* the info for the last thread posted in, so (if I understood you correctly) it is what you want.

Last edited by kh99; 22 Jan 2013 at 15:47.
Reply With Quote
  #8  
Old 22 Jan 2013, 15:45
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
I have not seen any code works
Reply With Quote
  #9  
Old 22 Jan 2013, 15:49
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Did you try the cache_ordered_forums plugin with just this one line of code:

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


or try the query in your plugin using this:

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


or are you saying you've tried those (without errors) but it's still not working?
Reply With Quote
  #10  
Old 22 Jan 2013, 16:03
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
edit....

Last edited by Easy5s.net; 22 Jan 2013 at 23:08.
Reply With Quote
  #11  
Old 22 Jan 2013, 16:08
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Assuming you have the new plugin working, you'd also have to change your code to use the new field. I think you just have to change the $thread['dateline'] line like this:


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

Reply With Quote
  #12  
Old 22 Jan 2013, 16:18
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
Wrong place?

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

Reply With Quote
  #13  
Old 22 Jan 2013, 16:25
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You'd want to use query_first() instead of query_read() (or else you'd have to call fetch_array()).
Reply With Quote
  #14  
Old 22 Jan 2013, 16:37
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
you can edit help me

Last edited by Easy5s.net; 22 Jan 2013 at 23:08.
Reply With Quote
  #15  
Old 22 Jan 2013, 16:41
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
What you had above looked OK, just change the first line to:


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

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Admin Edit of Post Username & Dateline phlogiston vBulletin 3.5 Add-ons 38 25 Jan 2014 00:18



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:35.

Layout Options | Width: Wide Color: