Wedge

Public area => The Pub => Topic started by: live627 on October 6th, 2012, 03:13 AM

Title: topic_info
Post by: live627 on October 6th, 2012, 03:13 AM
Why is $topic_info populated in Post2(),  but not Post()?
Title: Re: topic_info
Post by: Arantor on October 6th, 2012, 03:32 AM
That's the way SMF always did it... IIRC, Post() populates $topicinfo with other stuff, just to be awkward.

Either way, this is not logic we've introduced at any point, if we had there would have been a reason for it that I'd be able to tell you :P
Title: Re: topic_info
Post by: live627 on October 6th, 2012, 05:22 AM
Could it be done,  for reuse in plugins and such?
Title: Re: topic_info
Post by: Arantor on October 6th, 2012, 03:17 PM
Given how volatile that is, you're almost better off just getting it yourself.

And isn't it global anyway meaning you're free to pull it whenever?
Title: Re: topic_info
Post by: live627 on October 7th, 2012, 12:49 AM
What I'm asking, is if the same global variable can be populated the same way in both functions.
Title: Re: topic_info
Post by: Arantor on October 7th, 2012, 01:00 AM
Aside from the fact that it would just be unnecessary database queries in most cases to do that?
Title: Re: topic_info
Post by: live627 on October 7th, 2012, 01:56 AM
Just need to convert this
Code: [Select]
list ($locked, $context['notify'], $pinned, $pollID, $context['topic_last_message'], $id_member_poster, $id_first_msg, $first_subject, $lastPostTime) = wesql::fetch_row($request);
to this
Code: [Select]
$topic_info = wesql::fetch_assoc($request);
changing every occurance of the affected variables. Or is there something deeper that I missed?
Title: Re: topic_info
Post by: Arantor on October 7th, 2012, 01:59 AM
I think it's a bit deeper than that, especially since remember that Post2() can and will call Post()...