Customizing SMF > SMF Coding Discussion
Help me write this code...
Labradoodle-360:
Forgot something that's supposed to be at the end of 1.1x queries.
--- Code: ---, __FILE__, __LINE__
--- End code ---
Usage:
--- Code: ---$myquery = db_query("
SELECT id_group
FROM {$db_prefix}members
WHERE id_member = ". $row['first_id_member'], __FILE__, __LINE__
);
--- End code ---
IchBin™:
Thanks, forgot about that. UPdated the post.
Labradoodle-360:
No problem...I don't even think it really matters, I think it's more for recording the queries.
Liam_michael:
Thanks guys, this next question stems from my poor php understanding... Where exactly do I place this code in messageindex.php?:
--- Code: ---$myquery = db_query("
SELECT id_group
FROM {$db_prefix}members
WHERE id_member = ". $row['firstID_MEMBER'], __FILE__, __LINE__);
$style = '';
$mygroups = array(1,3);
$groups = array();
while($row2 = mysql_fetch_row($myquery))
$groups[] = $row2[0];
if(array_intersect($groups, $mygroups))
$style = 'style="color: red;"';
--- End code ---
I've attached my messageindex.php file for reference.
Labradoodle-360:
You have to add it above the other code you need to modify.
--- Code: ---// 'Print' the topic info.
$context['topics'][$row['ID_TOPIC']] = array(
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version