Jump to content

Open Coterie  ·  19 members

SMF Staff People

Error with Unread Posts


Snickerdoodle
 Share

Recommended Posts

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>';
		}

 

Link to comment
Share on other sites

Check in Post.php, see if you can find // Can we pull NPCs? in it.

nusignature.png nusignature.png

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

	// 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);
	}

 

Link to comment
Share on other sites

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'].

nusignature.png nusignature.png

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

Yes, only replace $non_player itself, leave anything after it alone.

nusignature.png nusignature.png

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

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 by Snickerdoodle
added more info/inquiries
Link to comment
Share on other sites

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.

nusignature.png nusignature.png

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

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 by Snickerdoodle
Link to comment
Share on other sites

  • 10 months later...

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.