Customizing SMF > SMF Coding Discussion
Need Coding Help
(1/1)
ninja111:
I need help Fixing this.
--- Code: ---Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/Who.template.php on line 74
65: echo '
66: <span class="contact_info floatright">
67: ', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="bottom" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
68: ', isset($context['disabled_fields']['icq']) ? '' : $member['icq']['link'] , ' ', isset($context['disabled_fields']['msn']) ? '' : $member['msn']['link'], ' ', isset($context['disabled_fields']['yim']) ? '' : $member['yim']['link'], ' ', isset($context['disabled_fields']['aim']) ? '' : $member['aim']['link'], ' ', $member['facebook']['link'], ' ', $member['myspace']['link'], ' ', $member['twitter']['link'], ' ', $member['googleplus']['link'], ' ', $member['linkedin']['link'], ' ', $member['youtube']['link'], ' ', $member['deviantart']['link'], '
69: </span>';
70: }
71:
72: echo '
73: <span class="member', $member['is_hidden'] ? ' hidden' : '', '">
74: →→→→→→→→→→', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt['profile_of'] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] .←←←←←←←←← '"') . '>' . ' . (!empty($member['group_image']) && empty($modSettings['disable_image_on_left']) && empty($modSettings['disable_on_online_list']) ? $member['group_image'] : '') . $member['name'] . (!empty($member['group_image']) && empty($modSettings['disable_image_on_right']) && empty($modSettings['disable_on_online_list']) ? $member['group_image'] : '') . '</a>', '
75: </span>';
76:
77: if (!empty($member['ip']))
78: echo '
--- End code ---
How do I edit that one little part correctly? In the middle of the →←'s, that pops up in bold with a error message. Is there a (,) needed in there or something?
ninja111:
Can someone tell me how to code this? I have absolutely no clue how to code. I'm learning at the very moment. So please explain it to me so i can learn. :)
The Craw:
Wow, that ternary is painfully long. Try replacing line 74 with this and let us know what happens.
--- Code: ---', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt['profile_of'] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] .'"') . '>' . (!empty($member['group_image']) && empty($modSettings['disable_image_on_left']) && empty($modSettings['disable_on_online_list']) ? $member['group_image'] : '') . $member['name'] . (!empty($member['group_image']) && empty($modSettings['disable_image_on_right']) && empty($modSettings['disable_on_online_list']) ? $member['group_image'] : '') . '</a>', '
--- End code ---
ninja111:
Thanks!
I just learned new coding thanks to you. I love generous people like you that are willing to take there time to help someone that needs it. There's only a few generous people these days and your one of them. ;D
The Craw:
--- Quote from: ninja111 on June 15, 2012, 12:15:31 AM ---Thanks!
I just learned new coding thanks to you. I love generous people like you that are willing to take there time to help someone that needs it. There's only a few generous people these days and your one of them. ;D
--- End quote ---
Well I'm glad to have been able to help. :) Here's a useful link on PHP ternary operators if you're interested in learning more about them.
http://www.tech-evangelist.com/2007/11/11/php-ternary-operator/
BTW, appreciative people like you are the reason I do this kinda stuff. Unfortunately, a lot of people on these types of forums have an attitude of entitlement, which doesn't make me want to help them much. It's a pleasure helping people who appreciate the work I do for them.
Navigation
[0] Message Index
Go to full version