Snickerdoodle 51 Author Share Posted January 29, 2019 A little too "simple", huh? xD It's still not showing NPCs in the dropdown, though. Here's the thing in Post.template, I think... // Create the optgroup loop. if(!empty($non_player) && (allowedTo('cmod_post_npc_own') || allowedTo('cmod_post_npc_any'))) { $select_box_string .= ' <optgroup label="'.$txt['acm_label_npcs'].'">'; foreach($non_player as $character) { $select_box_string .= ' <option value="'.$character['id'].'"'.(!empty($context['current_poster']) && $context['current_poster'] == $character['id'] ? ' selected' : '').'>'; if(!empty($modSettings['acmOrderCharsBy'])) { if($modSettings['acmOrderCharsBy'] == 1 && !empty($character['name']['last'])) $select_box_string .= $character['name']['last'].' '.$character['name']['first']; elseif($modSettings['acmOrderCharsBy'] == 2 && !empty($character['name']['last'])) $select_box_string .= $character['name']['last'].', '.$character['name']['first']; } else $select_box_string .= $character['name']['first']. (!empty($character['name']['last']) ? ' '.$character['name']['last'] : ''); $select_box_string .= ' </option>'; } $select_box_string .= ' </optgroup>'; } We're on Discord! Come say hello! Link to comment Share on other sites More sharing options...
Arceus 1,082 Share Posted January 29, 2019 Check in Post.php, see if you can find // Can we pull NPCs? in it. I am the darkness, always watching, always listening, ALWAYS THERE. (If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.) Link to comment Share on other sites More sharing options...
Snickerdoodle 51 Author Share Posted January 29, 2019 // Can we pull NPCs? $non_player = array(); if(allowedTo('cmod_post_npc_any')) { // This pulls all NPCs on the site. $request = $smcFunc['db_query']('',' SELECT id_character, name_first, name_last FROM {db_prefix}acm_characters WHERE is_npc = 1', array( ) ); $non_player = array(); while ($row = $smcFunc['db_fetch_assoc']($request)) { $non_player[] = array( 'id' => $row['id_character'], 'name' => array( 'first' => $row['name_first'], 'last' => $row['name_last'], ) ); } $smcFunc['db_free_result']($request); } elseif(allowedTo('cmod_post_npc_own')) { // Admin said only your own NPCs. $request = $smcFunc['db_query']('',' SELECT id_character, name_first, name_last FROM {db_prefix}acm_characters WHERE is_npc = 1 AND id_member = {int:id_member}', array( 'id_member' => $context['user']['id'], ) ); $non_player = array(); while ($row = $smcFunc['db_fetch_assoc']($request)) { $non_player[] = array( 'id' => $row['id_character'], 'name' => array( 'first' => $row['name_first'], 'last' => $row['name_last'], ) ); } $smcFunc['db_free_result']($request); } We're on Discord! Come say hello! Link to comment Share on other sites More sharing options...
Arceus 1,082 Share Posted January 29, 2019 Welp, code's correct... actually, every instance in both Post.php and Post.template.php where it uses $non_player, change it to $context['npcs']. I am the darkness, always watching, always listening, ALWAYS THERE. (If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.) Link to comment Share on other sites More sharing options...
Snickerdoodle 51 Author Share Posted January 29, 2019 Do I leave the [] that are already there after those two instances of non_player or take those out? We're on Discord! Come say hello! Link to comment Share on other sites More sharing options...
Arceus 1,082 Share Posted January 29, 2019 Yes, only replace $non_player itself, leave anything after it alone. I am the darkness, always watching, always listening, ALWAYS THERE. (If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.) Link to comment Share on other sites More sharing options...
Snickerdoodle 51 Author Share Posted January 29, 2019 That worked! YASSS... You are amazing 😄 1 We're on Discord! Come say hello! Link to comment Share on other sites More sharing options...
Snickerdoodle 51 Author Share Posted January 29, 2019 (edited) Can this be changed so that it shows the character avatar in the messageindex if they post IC? if(!empty($topic['first_post']['member']['id']) && $topic['first_post']['member']['id']!=0) { // Get The Avatar the easy Way $last_poster = $topic['first_post']['member']['id']; loadMemberData($last_poster); loadMemberContext($last_poster); echo' <td class="icon2 ', $color_class, ' avatared"> ', !empty($memberContext[$last_poster]['avatar']['image']) ? $memberContext[$last_poster]['avatar']['image'] : $settings['sr_default_avatar'], ' </td>'; } else { echo' <td class="icon2 ', $color_class, ' avatared"> ', $settings['sr_default_avatar'], ' </td>'; } Edit: I should probably mention that it's not curve. It's SunRise. And I know compatibility isn't guaranteed, so I totally understand if you can't help with this. Also, I'm trying to figure out how to make the correct names show in the SimplePortal sidebar Recent Topics... I don't know if it pulls the information from somewhere else on the board or if it has it's own little algorithm or whatever. I also understand if that's out of scope, since it's someone else's mod. Edited January 29, 2019 by Snickerdoodle added more info/inquiries We're on Discord! Come say hello! Link to comment Share on other sites More sharing options...
Arceus 1,082 Share Posted January 30, 2019 SP's recent posts blocks use SSI and basically it's a pain in the ass and I'm not touching it. I have done it before so it is doable. Anywhere a character name is pulled, it also pulls avatar under ['whateverthefuckthekeyis']['image'], should have name, href, and image. So if you just want the image to show up, ',$whatevervariable['whateverkey']['image']['image'],' should do it. And I mean everywhere, I made it do that in topics and board index and everything. I think it even does it on the member list and in user profiles. I am the darkness, always watching, always listening, ALWAYS THERE. (If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.) Link to comment Share on other sites More sharing options...
Snickerdoodle 51 Author Share Posted January 30, 2019 (edited) Okies.. I'll try that later on.... right now I'm dealing with the disappearance of the log in bit at the top of the page.... I haven't even changed anything since getting everything fixed, except adding a favicon *cries* OMG.... it was the 'show quick login on every page' being unchecked.... It's been unchecked for days, now.... and they just now noticed there was no quick login. >.< Anyway... yeah... I'm gonna give the avatar thing a shot tomorrow. xD Edited January 30, 2019 by Snickerdoodle We're on Discord! Come say hello! Link to comment Share on other sites More sharing options...
boydster 3 Share Posted November 30, 2019 Realized a few minutes ago that I was running into this exact same issue. Followed the instructions to add the extra LEFT JOINs and now things are working perfectly again. Thanks! Ask me about Werepenguin! Link to comment Share on other sites More sharing options...
Recommended Posts