live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
topic_info
« on October 6th, 2012, 03:13 AM »
Why is $topic_info populated in Post2(),  but not Post()?
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: topic_info
« Reply #1, 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
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: topic_info
« Reply #2, on October 6th, 2012, 05:22 AM »
Could it be done,  for reuse in plugins and such?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: topic_info
« Reply #3, 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?

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: topic_info
« Reply #4, 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.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: topic_info
« Reply #5, 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?

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: topic_info
« Reply #6, 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?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: topic_info
« Reply #7, 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()...