News: Welcome to the TinyPortal Support site.

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

October 19, 2019, 09:47:13 AM

Login with username, password and session length

Recent

Members
  • Total Members: 3756
  • Latest: Ocean
Stats
  • Total Posts: 189092
  • Total Topics: 20765
  • Online Today: 61
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 2
Guests: 41
Total: 43

Author Topic: Add children to forum posts on front-page and/or multiple forums  (Read 4441 times)

0 Members and 1 Guest are viewing this topic.

xadio

  • Guest
Add children to forum posts on front-page and/or multiple forums
« on: February 08, 2006, 05:22:17 PM »
This is partially a suggestion and partially a request for assistance.  I am trying to have the children of the chosen forum also displayed on the frontpage, however I am having trouble with the sql.

What I am trying to do is:
1) Get all msgs where t.ID_BOARD == XX (where XX is the specified board)
2) OR where the b.ID_PARENT == t.ID_BOARD
3) AND where the m.ID_MSG = t.ID_FIRST_MSG

So my first idea was to just include it where the ID_PARENT == ID_BOARD then I realized that I need to get the ID_BORD of the children and add them.  So I am doing a nested Select statement to gather the children's ID's and then just include them in the or statement. But it is to no avail.


SELECT m
.iconm.subjectm.bodyIFNULLmem.realNamem.posterName ) AS posterNamem.posterTimet.numRepliest.ID_TOPICm.ID_MEMBERm.smileysEnabledb.name AS boardName
FROM smf_topics 
AS tsmf_messages AS msmf_boards AS b
LEFT JOIN smf_members 
AS mem ON mem.ID_MEMBER m.ID_MEMBER )
WHERE (t.ID_BOARD ='2' OR t.ID_BOARD = (
SELECT bb.ID_BOARD
FROM smf_boards 
AS bb
WHERE t
.ID_BOARD bb.ID_PARENT)
 ) AND 
m.ID_MSG t.ID_FIRST_MSG) AND
ORDER BY m.ID_MSG DESC
LIMIT 0
30


Some questions:

1) Should I just do multiple sql statements and code up the check in PHP or should I continue using SQL?
2) If I use php how would I go about resorting the $return array? (Lines 1361-1439)
3) Should I redesign the $return array to be a hash table where the key is the date/msg ID and thus they will be added chronologically?
4) OR should I redesign the output to check the post date/msg ID thus outputting it chronologically?



Thanks,
Ryan

Offline bloc

  • Founder
  • *
  • Posts: 5217
    • Bloc
Re: Add children to forum posts on front-page and/or multiple forums
« Reply #1 on: February 09, 2006, 11:30:41 AM »
Before going into details..you want to show childs information in full on boardindex - as opposed to current where it only displays the name/link?

xadio

  • Guest
Re: Add children to forum posts on front-page and/or multiple forums
« Reply #2 on: February 09, 2006, 02:11:55 PM »
No, I am refering to the frontpage using tinyportal.  As of now your portal only offers the ability to have one forum's threads displayed on the front page.  What I want for my site is to have a News Board and children of it such as:
-News
--Website
--Group
--Other

And then when you goto the homepage it will show the top XX threads from both the parent forum and children forums (of that particular parent):

.:[Example]:.
============================
 Website: [Subject]             child of News
------------------------------------
 [body]
============================
============================
 News: [Subject]                 child of Root
------------------------------------
 [body]
============================
.:[End]:.

Thanks for your quick reply.

Offline bloc

  • Founder
  • *
  • Posts: 5217
    • Bloc
Re: Add children to forum posts on front-page and/or multiple forums
« Reply #3 on: February 09, 2006, 04:59:31 PM »
I see. First thought would be to rather include the boards ID into the sql query, and then check in php later on the id, and apply it to different arrays, one for each board possibly. Still just one sql call, but no subselect and the parting/sorting is done only in php.

xadio

  • Guest
Re: Add children to forum posts on front-page and/or multiple forums
« Reply #4 on: February 09, 2006, 05:09:36 PM »
Ok, yea that makes sense, and it also sounds like a better move!  I will see what I can do.  Thanks again for your help!

Ryan

ynohtna

  • Guest
Re: Add children to forum posts on front-page and/or multiple forums
« Reply #5 on: March 02, 2006, 08:02:01 AM »
post the code when you figure it out!!! I would love this.  Many thanks.

xadio

  • Guest
Re: Add children to forum posts on front-page and/or multiple forums
« Reply #6 on: March 02, 2006, 09:25:50 AM »
post the code when you figure it out!!! I would love this.  Many thanks.

I have posted the directions here:
http://www.tinyportal.net/smf/index.php?topic=3149.msg26375#msg26375

dimkar

  • Guest
Re: Add children to forum posts on front-page and/or multiple forums
« Reply #7 on: January 16, 2008, 01:28:40 AM »
Hello I am wondering if  this has been implemented.
In my opinion it is a bit confusing if u have child boards not to show their recent posts also
on the front page.

Smoky

  • Guest
Re: Add children to forum posts on front-page and/or multiple forums
« Reply #8 on: January 16, 2008, 04:19:13 AM »
considering the server moves that tp has had, the code isn't showing up, after all this thread is almost, what?? over a year old.. but apparently it has been done, and presumably it was done thru block's advise.. perhaps if you tested this, and posted your results (successful or not) you can help or be helped with it..  ;)

dimkar

  • Guest
Re: Add children to forum posts on front-page and/or multiple forums
« Reply #9 on: January 16, 2008, 04:35:04 AM »
I have not not tried it nor tested it.
I think it is extremely useful.