Customizing SMF > SMF Coding Discussion
Display topic starter name (SMF 1.1.x)
Derp:
Still no lucky with this.
I've just found a mod for SMF 2.x that does exactly what I need, can someone look at this code for Display.php and tell me what changes should I do to make it 1.1.x compatible?
--- Code: ---
$request = $smcFunc['db_query']
('', "
SELECT id_member, real_name
FROM {db_prefix}members
WHERE id_member = {int:user_id}
LIMIT 1
",
array( 'user_id' => $context['topic_starter_id'])
);
list($member_id, $name_started) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
$context['name_started'] = !empty($name_started) ? $name_started : $txt['guest'] ;
--- End code ---
Thank you all!
Derp:
Any ideas? :)
cicka:
--- Quote from: Derp on August 19, 2012, 10:44:55 AM ---Any ideas? :)
--- End quote ---
Did you try my suggestion above?
Derp:
--- Quote from: cicka on August 19, 2012, 11:17:38 AM ---Did you try my suggestion above?
--- End quote ---
Yes, but it didn't work - or I did something wrong, kinda newbie on this :)
The closest I came was with the following code:
--- Code: ---<span class="thread-title">', $context['subject'], '</span><br /><span class="thread-desc">Thread by: ', $context['topic_starter_id'], '</span>
--- End code ---
The output give me the correct member ID, but I need the name, not the number...
Thanks for your time!
Navigation
[0] Message Index
[*] Previous page
Go to full version