Jump to content

Open Coterie  ·  19 members

SMF Staff People

Post As Character From Quick Reply


Jones
 Share

Recommended Posts

I promise I am almost done with the ACM relevant bits of my WiP site. 🤦‍♀️

 

As the title suggests, I am wondering if/how to add a dropdown so you can post from a character account using the quick reply box. Also, for some reason on the bio-form, the active tab does not change color. I haven't gotten into it to see what the deal is, yet. Just a thing to note, not sure if anyone else noticed similar or if I've accidentally done something funky to it. 

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

Tab colour is controlled by the CSS at the top of the character profile. If it's not changing colour, either the character doesn't have a colour or the bootstrap is messing up and not changing the tab classes rightly.

 

And I apparently did not do that on any of my sites, so you'll have to do it manually as I don't have a thinger to copy-pasta to you, but basically get into Post.template.php and copy-paste the select box constructors from there to the quick reply section of Display.template. I do believe the drop selector constructors are pretty much the only things I commented properly, lmao, so should be easy enough to find. And then just output the select box somewhere. It should figure itself out once the selector's there because it goes through the same post function.

  • Thank you 1

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

I think it's something with my css. I will have to comb through it. Maybe our tabbing codes are screwing with one another somewhere. 

 

Also I am The Dumb. Maaan I pulled the selectors from Post.Template.php and slapped it ub under the line of code for the spellchecker. Didn't work so assumed I was doing it wrong and posted here. After you replied I decided 'I would rather the drop box ontop of the quick reply text area' and moved the code block to right below the quickreply controls block and voila like magic.

	// Set up the character post selector.
	// This is the dumbest way to do this, but whatever.
	if(!empty($context['user']['characters']) && allowedTo('cmod_post'))
	{
		$select_box_string = '<select name="id_character">
			<option value="0">'.$txt['acm_post_as_user'].'</option>';
		foreach($context['user']['characters'] 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>';
		}
		// 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>';
		}
		$select_box_string .= '</select>';
	}
	    echo'
						<dt>
							<span id="caption_id_character">', $txt['acm_label_post_as'], ':</span>
						</dt>
						<dd>
							',!empty($select_box_string) ? $select_box_string : '<select name="id_character"><option value="0">'.$txt['acm_post_as_user'].'</option></select>','
						</dd>';

So anyone else that wants to slap it in there, just put it ontop of the line that says  if ($context['user']['is_guest'])

 

operation: bowtruckles & bombs

R6MmD.png

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.